/* Shared design tokens + top bar / bottom tab bar for dashboard.html, map.html and login.html. */
:root {
  --bg: #f6f6f3; --page: var(--bg); --surface: #ffffff; --surface-2: #efeeea; --ink: #121212; --ink-2: #3d3c39;
  --muted: #6f6d68; --border: rgba(0,0,0,.12); --accent: #2a6df4; --good: #1f9d55; --bad: #d64545; --critical: var(--bad);
  --warn: #d9941e; --series-1: #2a78d6; --series-2: #eb6834; --series-3: #7a5cc7;
  --shadow: 0 6px 24px rgba(0,0,0,.14); --radius: 12px; --nav-h: 48px; --tab-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --surface: #1a1b1e; --surface-2: #232428; --ink: #f2f1ee; --ink-2: #c8c6c1; --muted: #8f8d87;
    --border: rgba(255,255,255,.11); --accent: #6a9bff; --good: #3ecf7a; --bad: #ff6b6b; --warn: #f0b24a;
    --series-1: #5a9bea; --series-2: #f0875a; --series-3: #a58ce6; --shadow: 0 6px 24px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --surface: #1a1b1e; --surface-2: #232428; --ink: #f2f1ee; --ink-2: #c8c6c1; --muted: #8f8d87;
  --border: rgba(255,255,255,.11); --accent: #6a9bff; --good: #3ecf7a; --bad: #ff6b6b; --warn: #f0b24a;
  --series-1: #5a9bea; --series-2: #f0875a; --series-3: #a58ce6; --shadow: 0 6px 24px rgba(0,0,0,.5); color-scheme: dark;
}
.topnav { display: flex; align-items: center; gap: 4px; height: var(--nav-h); padding: 0 12px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.topnav .brand { font-weight: 700; margin-right: 12px; color: var(--ink); }
.topnav a.tab { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; min-height: 32px; display: inline-flex; align-items: center; text-decoration: none; }
.topnav a.tab:hover { background: var(--surface-2); }
.topnav a.tab[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.topnav .spacer { margin-left: auto; }
.topnav form { margin: 0; } .topnav .linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; min-height: 32px; }
@media (max-width: 720px) {
  .topnav { justify-content: space-between; }
  .topnav .tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: flex; background: var(--surface); border-top: 1px solid var(--border); z-index: 1100; }
  .topnav .tabs a.tab { flex: 1; justify-content: center; border-radius: 0; font-size: 12px; min-height: 44px; padding: 0 2px; box-shadow: none !important; }
  .topnav .tabs a.tab[aria-current="page"] { color: var(--accent); background: none; }
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
