/* ===========================
   Dashboard layout
   =========================== */
.dash {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(94,234,212,0.05) 0%, transparent 60%),
    var(--bg);
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 6px 10px 18px; }
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.side-nav a:hover { color: var(--text); background: var(--surface); }
.side-nav a.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.side-nav .ico {
  width: 24px;
  display: inline-flex;
  justify-content: center;
  font-size: 15px;
}
.side-nav .badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
}

.side-bottom { margin-top: auto; padding-top: 14px; }
.demo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.demo-card strong { font-size: 13px; }
.demo-card p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.demo-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(94,234,212,0.18);
  flex-shrink: 0;
}

/* Main */
.main {
  padding: 28px 32px 60px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
  justify-content: center;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stat-value {
  font-size: 20px;
  letter-spacing: -0.01em;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.panel-head .muted { color: var(--muted); font-size: 12px; }

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within {
  border-color: rgba(94,234,212,0.45);
  box-shadow: 0 0 0 3px rgba(94,234,212,0.10);
}
.search-ico { padding: 0 6px 0 10px; opacity: 0.7; }
.search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 10px 4px;
  font-family: inherit;
}
.search input::placeholder { color: var(--muted-2); }
.search .btn-primary { padding: 10px 16px; }

/* Status */
.status {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.status.error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

/* Result */
.result { margin-top: 16px; }
.weather-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
}
.weather-emoji { font-size: 32px; line-height: 1; }
.weather-text { display: flex; flex-direction: column; gap: 2px; }
.weather-text strong { font-size: 20px; }
.weather-text span { color: var(--muted); font-size: 13px; }
.category-pill {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
  text-transform: lowercase;
}

.places {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.place-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.06s ease;
}
.place-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.place-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.place-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rating { color: var(--warn); font-weight: 600; }
.place-address { color: var(--muted); font-size: 13px; line-height: 1.4; }

/* History */
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
}
.history-item .h-location { font-weight: 600; font-size: 14px; }
.history-item .h-meta { color: var(--muted); font-size: 12px; }
.history-item .spacer { flex: 1; }
.history-item button {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.history-item button:hover { color: var(--text); border-color: #3a4654; }
.history-item button.danger:hover { color: var(--danger); border-color: rgba(248,113,113,0.45); }
.history-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* About */
.about p { margin: 0 0 14px; color: var(--muted); }
.kv {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.kv li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.kv span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.kv code {
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--text);
}

/* Responsive */
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    align-items: center;
    gap: 8px;
  }
  .sidebar .brand { padding: 0 6px; flex-shrink: 0; }
  .side-nav { flex-direction: row; margin-top: 0; }
  .side-nav .badge { display: none; }
  .side-bottom { display: none; }
  .main { padding: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
