/* ============================================================
   DriveWise — design system
   ============================================================ */
:root {
  /* surfaces */
  --bg:          #060A14;
  --bg-2:        #08101E;
  --sidebar:     rgba(6, 12, 24, 0.58);
  --card:        rgba(9, 17, 31, 0.5);
  --card-2:      rgba(13, 24, 42, 0.36);
  --card-hi:     rgba(23, 37, 60, 0.46);
  --line:        rgba(210, 232, 255, 0.13);
  --line-strong: rgba(210, 232, 255, 0.24);
  --line-soft:   rgba(210, 232, 255, 0.08);
  --app-bg-image-opacity: 1;
  --app-bg-image-filter: saturate(1.2) contrast(1.08) brightness(1.03);
  --app-bg-scrim:
    linear-gradient(90deg, rgba(3,7,15,0.36) 0%, rgba(3,7,15,0.08) 44%, rgba(3,7,15,0.3) 100%),
    linear-gradient(180deg, rgba(3,7,15,0.18) 0%, rgba(3,7,15,0.42) 100%),
    radial-gradient(900px 500px at 90% -10%, rgba(59,130,246,0.14), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(168,85,247,0.08), transparent 60%);
  --glass-blur: blur(30px) saturate(1.55);
  --glass-blur-strong: blur(44px) saturate(1.65);

  /* text */
  --text:    #F1F5F9;
  --text-2:  #94A3B8;
  --text-3:  #64748B;
  --text-4:  #475569;

  /* accents */
  --c-blue:   #3B82F6;
  --c-blue-2: #60A5FA;
  --c-cyan:   #06B6D4;
  --c-teal:   #14B8A6;
  --c-green:  #10B981;
  --c-lime:   #84CC16;
  --c-yellow: #EAB308;
  --c-amber:  #F59E0B;
  --c-orange: #F97316;
  --c-red:    #EF4444;
  --c-pink:   #EC4899;
  --c-violet: #A855F7;
  --c-indigo: #6366F1;

  /* shadows / glows */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.09) inset, 0 0 0 1px var(--line), 0 16px 42px -18px rgba(0,0,0,0.78);
  --shadow-pop:  0 30px 80px -20px rgba(0,0,0,0.85), 0 0 0 1px var(--line-strong);

  /* radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;

  /* layout */
  --sidebar-w: 256px;
  --topbar-h: 56px;
  --maxw: 1480px;

  /* fonts */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* light theme overrides */
:root[data-theme="light"] {
  --bg:          #F4F6FB;
  --bg-2:        #EDF1F8;
  --sidebar:     rgba(255, 255, 255, 0.54);
  --card:        rgba(255, 255, 255, 0.5);
  --card-2:      rgba(255, 255, 255, 0.36);
  --card-hi:     rgba(255, 255, 255, 0.46);
  --line:        rgba(15, 23, 42, 0.13);
  --line-strong: rgba(15, 23, 42, 0.22);
  --line-soft:   rgba(15, 23, 42, 0.08);
  --text:        #0F172A;
  --text-2:      #475569;
  --text-3:      #64748B;
  --text-4:      #94A3B8;
  --app-bg-image-opacity: 0.86;
  --app-bg-image-filter: saturate(0.95) contrast(1.03) brightness(1.08);
  --app-bg-scrim:
    linear-gradient(90deg, rgba(244,246,251,0.48) 0%, rgba(244,246,251,0.18) 42%, rgba(244,246,251,0.48) 100%),
    linear-gradient(180deg, rgba(244,246,251,0.28) 0%, rgba(244,246,251,0.68) 100%),
    radial-gradient(900px 500px at 90% -10%, rgba(59,130,246,0.08), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(168,85,247,0.05), transparent 60%);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.72) inset, 0 0 0 1px var(--line), 0 16px 42px -20px rgba(15,23,42,0.3);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01", "cv09", "cv11";
  letter-spacing: -0.01em;
  min-height: 100vh;
  overflow-x: hidden;
}

/* subtle automotive background, dimmed behind the app for contrast */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("assets/drivewise-road-bg.jpg");
  background-size: cover;
  background-position: 56% center;
  background-repeat: no-repeat;
  filter: var(--app-bg-image-filter);
  opacity: var(--app-bg-image-opacity);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed; inset: 0;
  background: var(--app-bg-scrim);
  pointer-events: none;
  z-index: 0;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(59,130,246,0.35); color: #fff; }

.mobile-topbar,
.sidebar,
.desktop-topbar,
.bottom-nav,
.card,
.stat,
.report-tile,
.timeline-item,
.insight,
.reminder,
.qa-btn,
.vehicle-card,
.search,
.vehicle-pill,
.car-pill,
.tab,
.modal-card {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.18); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.32); border: 2px solid transparent; background-clip: padding-box; }

/* ============================================================
   Icons
   ============================================================ */
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 36px; height: 36px; }

.iconbtn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  position: relative;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.iconbtn:hover { background: var(--card-hi); color: var(--text); border-color: var(--line); }
.iconbtn .badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--c-blue);
  font-size: 10px; font-weight: 700; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--card);
}
.iconbtn .badge:empty { display: none; }
.iconbtn .dot {
  position: absolute; top: 9px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-blue);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ============================================================
   App grid
   ============================================================ */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============================================================
   Mobile topbar (hidden on desktop)
   ============================================================ */
.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  height: 56px;
  padding: 0 16px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
}

.vehicle-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 20;
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 22px;
}
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; filter: drop-shadow(0 4px 12px rgba(56,189,248,0.4)); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #38BDF8, #2563EB);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Nav */
.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  position: relative;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.04));
  color: var(--text);
  border: 1px solid rgba(59,130,246,0.28);
  box-shadow: 0 0 24px -8px rgba(59,130,246,0.4) inset;
}
.nav-item.is-active::before {
  content: "";
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #38BDF8, #2563EB);
  box-shadow: 0 0 12px rgba(56,189,248,0.6);
}
.nav-item .ic { width: 18px; height: 18px; }

/* Vehicle card */
.vehicle-card {
  margin-top: auto;
  margin-bottom: 12px;
  padding: 14px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.vehicle-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(56,189,248,0.08), transparent 60%);
  pointer-events: none;
}
.vehicle-card-head { position: relative; z-index: 1; }
.vehicle-plate {
  font-weight: 800; font-size: 14px; letter-spacing: -0.01em;
}
.vehicle-name {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.vehicle-illust {
  height: 92px;
  margin: 8px -4px 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vehicle-image {
  width: 100%;
  max-height: 92px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 16px rgba(0,0,0,0.38));
}

/* Sidebar footer */
.sidebar-footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 0 0;
}
.divider-v {
  width: 1px; height: 18px; background: var(--line-strong);
}

/* ============================================================
   Main area
   ============================================================ */
.main {
  min-width: 0;
  display: flex; flex-direction: column;
  position: relative;
}

.desktop-topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
}
.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  height: 36px;
  width: 280px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-3);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.search:focus-within { border-color: rgba(59,130,246,0.4); background: var(--card-hi); }
.search input {
  border: 0; outline: 0; background: transparent;
  width: 100%; font-size: 13px;
}
.search input::placeholder { color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.window-controls { display: flex; align-items: center; gap: 8px; }
.wc {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--card);
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.wc:hover { background: var(--card-hi); color: var(--text); }
.wc-close:hover { background: var(--c-red); color: #fff; }

.view-host {
  flex: 1;
  padding: 24px 28px 96px;
  max-width: var(--maxw);
  width: 100%;
}

/* ============================================================
   Page header
   ============================================================ */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head-left { min-width: 0; }
.car-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s var(--ease);
}
.car-pill:hover { background: var(--card-hi); }

.page-title {
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.page-subtitle {
  font-size: 15px; color: var(--text-2); font-weight: 500;
}

/* ============================================================
   Cards & general
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title {
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
}
.card-link {
  font-size: 12px; font-weight: 600; color: var(--c-blue-2);
  cursor: pointer;
}
.card-link:hover { text-decoration: underline; }

.select {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.select:hover { background: var(--card-hi); color: var(--text); }
.select select {
  border: 0; outline: 0; background: transparent;
  font-weight: 600; font-size: 12px;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  padding-right: 4px;
}

/* ============================================================
   Stat cards (top KPI row)
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 0% 0%, var(--stat-glow, transparent), transparent 60%);
  opacity: 0.5; pointer-events: none;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--stat-bg, rgba(59,130,246,0.12));
  color: var(--stat-fg, var(--c-blue));
  border: 1px solid var(--stat-bd, rgba(59,130,246,0.25));
  flex-shrink: 0;
}
.stat-icon .ic { width: 22px; height: 22px; }
.stat-body { min-width: 0; flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.stat-value .unit {
  font-size: 13px; color: var(--text-3); font-weight: 600; margin-left: 3px;
}
.stat-label {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  margin-top: 4px;
}
.stat-delta {
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px;
}
.stat-delta.up { color: var(--c-green); }
.stat-delta.down { color: var(--c-red); }
.stat-delta.neutral { color: var(--text-3); }
.stat-delta .ic { width: 11px; height: 11px; }

/* color variants */
.stat[data-c="blue"]   { --stat-bg: rgba(59,130,246,0.12);  --stat-fg: var(--c-blue);   --stat-bd: rgba(59,130,246,0.25);  --stat-glow: rgba(59,130,246,0.10); }
.stat[data-c="cyan"]   { --stat-bg: rgba(6,182,212,0.12);   --stat-fg: var(--c-cyan);   --stat-bd: rgba(6,182,212,0.25);   --stat-glow: rgba(6,182,212,0.10); }
.stat[data-c="green"]  { --stat-bg: rgba(16,185,129,0.12);  --stat-fg: var(--c-green);  --stat-bd: rgba(16,185,129,0.25);  --stat-glow: rgba(16,185,129,0.10); }
.stat[data-c="lime"]   { --stat-bg: rgba(132,204,22,0.12);  --stat-fg: var(--c-lime);   --stat-bd: rgba(132,204,22,0.25);  --stat-glow: rgba(132,204,22,0.10); }
.stat[data-c="orange"] { --stat-bg: rgba(249,115,22,0.12);  --stat-fg: var(--c-orange); --stat-bd: rgba(249,115,22,0.25);  --stat-glow: rgba(249,115,22,0.10); }
.stat[data-c="violet"] { --stat-bg: rgba(168,85,247,0.12);  --stat-fg: var(--c-violet); --stat-bd: rgba(168,85,247,0.25);  --stat-glow: rgba(168,85,247,0.10); }
.stat[data-c="pink"]   { --stat-bg: rgba(236,72,153,0.12);  --stat-fg: var(--c-pink);   --stat-bd: rgba(236,72,153,0.25);  --stat-glow: rgba(236,72,153,0.10); }
.stat[data-c="amber"]  { --stat-bg: rgba(245,158,11,0.12);  --stat-fg: var(--c-amber);  --stat-bd: rgba(245,158,11,0.25);  --stat-glow: rgba(245,158,11,0.10); }

/* "next service" stat — special accent badge */
.stat-pill {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(249,115,22,0.12);
  color: var(--c-orange);
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(249,115,22,0.25);
  margin-top: 6px;
}

/* ============================================================
   Dashboard middle row: chart + gauge + activity
   ============================================================ */
.row-main {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1.2fr;
  gap: 16px;
  margin-bottom: 18px;
}

/* Big chart */
.chart-card { padding: 22px; }
.chart-bigvalue {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.025em;
  margin: 6px 0 14px;
}
.chart-bigvalue .unit { font-size: 14px; color: var(--text-3); font-weight: 600; }
.chart-area { height: 220px; }
.chart-area svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-axis text { fill: var(--text-3); font-size: 10.5px; font-weight: 600; }
.chart-line { fill: none; stroke: var(--c-blue); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 4px 10px rgba(59,130,246,0.4)); }
.chart-fill { fill: url(#blueArea); opacity: 0.45; }
.chart-dot { fill: var(--bg); stroke: var(--c-blue); stroke-width: 2; }
.chart-dot-active { fill: var(--c-blue); stroke: #fff; stroke-width: 2; r: 5; }
.chart-tooltip {
  position: absolute;
  padding: 6px 10px;
  background: var(--card-hi);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chart-wrap { position: relative; }

.chart-peak {
  position: absolute;
  padding: 4px 10px;
  background: var(--c-blue);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  border-radius: 6px;
  transform: translate(-50%, -135%);
  box-shadow: 0 4px 14px rgba(59,130,246,0.5);
  pointer-events: none;
}
.chart-peak::after {
  content: "";
  position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid var(--c-blue);
}

/* Gauge */
.gauge-card { padding: 22px; display: flex; flex-direction: column; }
.gauge-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.gauge {
  position: relative;
  width: 180px; height: 180px;
}
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--card-hi); stroke-width: 14; }
.gauge-fill { fill: none; stroke: url(#gaugeGrad); stroke-width: 14; stroke-linecap: round; transition: stroke-dasharray 0.6s var(--ease); }
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.03em;
}
.gauge-unit { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: -2px; }
.gauge-status {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: rgba(16,185,129,0.12);
  color: var(--c-green);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 999px;
  font-weight: 700; font-size: 12px;
  align-self: center;
}
.gauge-status .ic { width: 12px; height: 12px; }

/* Activity */
.activity-card { padding: 20px 8px 12px 20px; }
.activity-card .card-head { padding-right: 12px; }
.activity-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex; flex-direction: column;
}
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s var(--ease);
}
.activity-item:hover { background: var(--card-hi); }
.activity-item::before {
  content: "";
  position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ai-color, var(--c-blue));
  box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--ai-color, var(--c-blue));
}
.activity-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ai-bg, rgba(59,130,246,0.12));
  color: var(--ai-color, var(--c-blue));
  flex-shrink: 0;
  margin-left: 12px;
}
.activity-icon .ic { width: 18px; height: 18px; }
.activity-text { flex: 1; min-width: 0; }
.activity-title { font-weight: 700; font-size: 13px; }
.activity-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.activity-meta { text-align: right; font-size: 11px; color: var(--text-3); font-weight: 600; flex-shrink: 0; padding-right: 6px; }
.activity-meta .date { color: var(--text-2); }
.activity-chev { color: var(--text-4); }

/* color variants for activity */
.activity-item[data-c="blue"]   { --ai-color: var(--c-blue);   --ai-bg: rgba(59,130,246,0.14); }
.activity-item[data-c="green"]  { --ai-color: var(--c-green);  --ai-bg: rgba(16,185,129,0.14); }
.activity-item[data-c="amber"]  { --ai-color: var(--c-amber);  --ai-bg: rgba(245,158,11,0.14); }
.activity-item[data-c="violet"] { --ai-color: var(--c-violet); --ai-bg: rgba(168,85,247,0.14); }
.activity-item[data-c="pink"]   { --ai-color: var(--c-pink);   --ai-bg: rgba(236,72,153,0.14); }
.activity-item[data-c="cyan"]   { --ai-color: var(--c-cyan);   --ai-bg: rgba(6,182,212,0.14); }
.activity-item[data-c="orange"] { --ai-color: var(--c-orange); --ai-bg: rgba(249,115,22,0.14); }
.activity-item[data-c="lime"]   { --ai-color: var(--c-lime);   --ai-bg: rgba(132,204,22,0.14); }
.activity-item[data-c="red"]    { --ai-color: var(--c-red);    --ai-bg: rgba(239,68,68,0.14); }

/* Empty state */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty-title { font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.empty-sub { font-size: 13px; }

/* ============================================================
   Reports / Insights — six mini cards
   ============================================================ */
.insights-card { padding: 20px; margin-bottom: 18px; }
.insights-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.insight {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.insight:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.insight-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.insight-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 4px 0 6px;
}
.insight-spark { height: 36px; }
.insight-spark svg { width: 100%; height: 100%; overflow: visible; }
.insight-delta {
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
  margin-bottom: 6px;
}
.insight-delta .ic { width: 10px; height: 10px; }
.insight-delta.up { color: var(--c-green); }
.insight-delta.down { color: var(--c-red); }
.insight-delta.neutral { color: var(--text-3); }

/* ============================================================
   Quick Actions + Reminders row
   ============================================================ */
.row-bottom {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.qa-btn {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 8px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.qa-btn:hover { transform: translateY(-2px); background: var(--card-hi); border-color: var(--line-strong); }
.qa-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--qa-bg, rgba(59,130,246,0.12));
  color: var(--qa-fg, var(--c-blue));
  border: 1px solid var(--qa-bd, rgba(59,130,246,0.25));
}
.qa-icon .ic { width: 20px; height: 20px; }
.qa-label { font-size: 12px; font-weight: 600; }
.qa-btn[data-c="blue"]   { --qa-bg: rgba(59,130,246,0.12);  --qa-fg: var(--c-blue);   --qa-bd: rgba(59,130,246,0.25); }
.qa-btn[data-c="green"]  { --qa-bg: rgba(16,185,129,0.12);  --qa-fg: var(--c-green);  --qa-bd: rgba(16,185,129,0.25); }
.qa-btn[data-c="orange"] { --qa-bg: rgba(249,115,22,0.12);  --qa-fg: var(--c-orange); --qa-bd: rgba(249,115,22,0.25); }
.qa-btn[data-c="amber"]  { --qa-bg: rgba(245,158,11,0.12);  --qa-fg: var(--c-amber);  --qa-bd: rgba(245,158,11,0.25); }

/* Reminder cards */
.reminders-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.reminder {
  padding: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.reminder:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.reminder-head { display: flex; align-items: center; gap: 10px; }
.reminder-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rm-bg, rgba(59,130,246,0.12));
  color: var(--rm-fg, var(--c-blue));
}
.reminder-icon .ic { width: 16px; height: 16px; }
.reminder-title { font-weight: 700; font-size: 12.5px; }
.reminder-sub { font-size: 11.5px; color: var(--text-3); }
.reminder-badge {
  align-self: flex-start;
  padding: 3px 8px;
  font-size: 10.5px; font-weight: 800;
  border-radius: 999px;
  background: var(--rm-bg, rgba(59,130,246,0.12));
  color: var(--rm-fg, var(--c-blue));
  border: 1px solid var(--rm-bd, rgba(59,130,246,0.22));
}
.reminder[data-c="orange"] { --rm-bg: rgba(249,115,22,0.12);  --rm-fg: var(--c-orange); --rm-bd: rgba(249,115,22,0.25); }
.reminder[data-c="cyan"]   { --rm-bg: rgba(6,182,212,0.12);   --rm-fg: var(--c-cyan);   --rm-bd: rgba(6,182,212,0.25); }
.reminder[data-c="violet"] { --rm-bg: rgba(168,85,247,0.12);  --rm-fg: var(--c-violet); --rm-bd: rgba(168,85,247,0.25); }
.reminder[data-c="pink"]   { --rm-bg: rgba(236,72,153,0.12);  --rm-fg: var(--c-pink);   --rm-bd: rgba(236,72,153,0.25); }
.reminder[data-c="green"]  { --rm-bg: rgba(16,185,129,0.12);  --rm-fg: var(--c-green);  --rm-bd: rgba(16,185,129,0.25); }
.reminder[data-c="red"]    { --rm-bg: rgba(239,68,68,0.12);   --rm-fg: var(--c-red);    --rm-bd: rgba(239,68,68,0.25); }

.notification-summary {
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.notification-list {
  display: grid;
  gap: 10px;
}
.reminder.is-compact {
  cursor: default;
}

.vehicle-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vehicle-switcher-row {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.vehicle-switcher-row:hover {
  background: var(--card-hi);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.vehicle-switcher-row.is-active {
  border-color: rgba(59,130,246,0.48);
  box-shadow: 0 0 24px -10px rgba(59,130,246,0.6) inset;
}
.vehicle-switcher-thumb {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vehicle-switcher-thumb img {
  width: 100%;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0,0,0,0.32));
}
.vehicle-switcher-title {
  font-size: 14px;
  font-weight: 800;
}
.vehicle-switcher-sub {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700; font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 14px; }

.btn-primary {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 6px 18px -6px rgba(59,130,246,0.5);
}
.btn-primary:hover { background: linear-gradient(135deg, #4F8FFB, #2D6FE8); }
.btn-ghost {
  background: var(--card-hi);
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--card-2); border-color: rgba(59,130,246,0.4); color: var(--c-blue-2); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--c-red);
  border-color: rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

/* ============================================================
   Timeline view
   ============================================================ */
.tabs {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.tab:hover { background: var(--card-hi); color: var(--text); }
.tab.is-active {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 4px 14px -4px rgba(59,130,246,0.5);
}

.timeline-list { display: flex; flex-direction: column; gap: 8px; }
.timeline-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
  position: relative;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.timeline-item:hover { background: var(--card-hi); border-color: var(--line-strong); transform: translateX(2px); }
.timeline-item::before {
  content: "";
  position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ai-color, var(--c-blue));
  box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--ai-color, var(--c-blue));
}
.timeline-item[data-c="blue"]   { --ai-color: var(--c-blue);   --ai-bg: rgba(59,130,246,0.14); }
.timeline-item[data-c="green"]  { --ai-color: var(--c-green);  --ai-bg: rgba(16,185,129,0.14); }
.timeline-item[data-c="amber"]  { --ai-color: var(--c-amber);  --ai-bg: rgba(245,158,11,0.14); }
.timeline-item[data-c="violet"] { --ai-color: var(--c-violet); --ai-bg: rgba(168,85,247,0.14); }
.timeline-item[data-c="cyan"]   { --ai-color: var(--c-cyan);   --ai-bg: rgba(6,182,212,0.14); }
.timeline-item[data-c="orange"] { --ai-color: var(--c-orange); --ai-bg: rgba(249,115,22,0.14); }
.timeline-item[data-c="pink"]   { --ai-color: var(--c-pink);   --ai-bg: rgba(236,72,153,0.14); }
.timeline-item[data-c="lime"]   { --ai-color: var(--c-lime);   --ai-bg: rgba(132,204,22,0.14); }

.tl-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ai-bg);
  color: var(--ai-color);
  flex-shrink: 0;
}

/* ============================================================
   Reports page
   ============================================================ */
.reports-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.report-tile {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.report-tile-label {
  font-size: 12px; font-weight: 600; color: var(--text-3);
}
.report-tile-value {
  font-family: var(--font-display);
  font-weight: 800; font-size: 26px;
  letter-spacing: -0.025em;
  margin: 4px 0 6px;
}
.report-tile-value .unit { font-size: 13px; color: var(--text-3); font-weight: 600; }
.report-tile-spark { height: 50px; margin-top: 8px; }

.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

/* Insights list (reports page) */
.insight-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.insight-row + .insight-row { margin-top: 8px; }
.insight-row-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ai-bg, rgba(245,158,11,0.14));
  color: var(--ai-color, var(--c-amber));
}
.insight-row-text { flex: 1; }
.insight-row-title { font-weight: 700; font-size: 13.5px; }
.insight-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.insight-row[data-c="amber"]  { --ai-color: var(--c-amber);  --ai-bg: rgba(245,158,11,0.14); }
.insight-row[data-c="cyan"]   { --ai-color: var(--c-cyan);   --ai-bg: rgba(6,182,212,0.14); }
.insight-row[data-c="violet"] { --ai-color: var(--c-violet); --ai-bg: rgba(168,85,247,0.14); }
.insight-row[data-c="green"]  { --ai-color: var(--c-green);  --ai-bg: rgba(16,185,129,0.14); }
.insight-row[data-c="orange"] { --ai-color: var(--c-orange); --ai-bg: rgba(249,115,22,0.14); }

/* Donut */
.donut-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; }
.donut { width: 180px; height: 180px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--card-hi); stroke-width: 18; }
.donut-seg { fill: none; stroke-width: 18; stroke-linecap: butt; transition: stroke-dasharray 0.6s var(--ease); }
.donut-center { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.025em; }

.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-key { color: var(--text-2); flex: 1; font-weight: 600; }
.legend-val { font-weight: 700; }

/* Bar list */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 70px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row-label { color: var(--text-2); font-weight: 600; }
.bar-row-track {
  height: 8px; background: var(--card-hi); border-radius: 4px; overflow: hidden;
}
.bar-row-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--c-blue), var(--c-cyan));
  transition: width 0.6s var(--ease);
}
.bar-row-val { text-align: right; font-weight: 700; font-family: var(--font-mono); font-size: 11.5px; }

/* ============================================================
   Settings, etc.
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-text { min-width: 0; }
.settings-row-title { font-weight: 700; font-size: 13.5px; }
.settings-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-blue); background: var(--card-hi); }
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 11px; color: var(--text-3); }

.entry-type-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.etype {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  font-size: 12px; font-weight: 600;
}
.etype:hover { background: var(--card-hi); }
.etype.is-active {
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 16px -4px rgba(59,130,246,0.4) inset;
}
.etype-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--et-bg, rgba(59,130,246,0.12));
  color: var(--et-fg, var(--c-blue));
}
.etype[data-c="blue"]   { --et-bg: rgba(59,130,246,0.14);  --et-fg: var(--c-blue); }
.etype[data-c="green"]  { --et-bg: rgba(16,185,129,0.14);  --et-fg: var(--c-green); }
.etype[data-c="amber"]  { --et-bg: rgba(245,158,11,0.14);  --et-fg: var(--c-amber); }
.etype[data-c="violet"] { --et-bg: rgba(168,85,247,0.14);  --et-fg: var(--c-violet); }
.etype[data-c="cyan"]   { --et-bg: rgba(6,182,212,0.14);   --et-fg: var(--c-cyan); }
.etype[data-c="orange"] { --et-bg: rgba(249,115,22,0.14);  --et-fg: var(--c-orange); }
.etype[data-c="pink"]   { --et-bg: rgba(236,72,153,0.14);  --et-fg: var(--c-pink); }
.etype[data-c="lime"]   { --et-bg: rgba(132,204,22,0.14);  --et-fg: var(--c-lime); }

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  display: none;
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; animation: modalIn 0.2s var(--ease); }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,10,20,0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-pop);
  animation: modalCardIn 0.25s var(--ease);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  letter-spacing: -0.02em;
}
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 16px;
}

@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalCardIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-hi);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(16,185,129,0.4); color: var(--c-green); }
.toast.error { border-color: rgba(239,68,68,0.4); color: var(--c-red); }

/* ============================================================
   Bottom Nav (mobile)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 10.5px; font-weight: 600;
  border-radius: 10px;
  transition: color 0.15s var(--ease);
}
.bn-item.is-active { color: var(--c-blue-2); }
.bn-item .ic { width: 22px; height: 22px; }
.bn-fab {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  border: 0;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px;
  box-shadow: 0 10px 24px -4px rgba(59,130,246,0.6);
  transition: transform 0.18s var(--ease);
}
.bn-fab:active { transform: scale(0.95); }
.bn-fab .ic { width: 24px; height: 24px; }

/* Backdrop */
.backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 19;
  backdrop-filter: blur(4px);
}
.backdrop.is-open { display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1280px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .insights-grid { grid-template-columns: repeat(3, 1fr); }
  .row-main { grid-template-columns: 1fr 1fr; }
  .row-main .activity-card { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  :root { --sidebar-w: 0; }
  .app { grid-template-columns: 1fr; }

  /* sidebar becomes drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    border-right: 1px solid var(--line-strong);
    box-shadow: 24px 0 60px rgba(0,0,0,0.5);
  }
  .sidebar.is-open { transform: translateX(0); }

  .desktop-topbar { display: none; }
  .mobile-topbar { display: flex; }

  .view-host { padding: 16px 14px 96px; }
  body::before {
    background-position: 48% center;
  }

  .page-title { font-size: 26px; }
  .page-head { flex-direction: column; gap: 12px; align-items: stretch; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon .ic { width: 18px; height: 18px; }
  .stat-value { font-size: 19px; }

  .row-main {
    grid-template-columns: 1fr;
  }
  .row-bottom { grid-template-columns: 1fr; }
  .reminders-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .insights-grid { grid-template-columns: 1fr 1fr; }
  .insights-card .card-head .select { display: none; }
  .reports-overview { grid-template-columns: repeat(3, 1fr); }
  .reports-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .entry-type-grid { grid-template-columns: repeat(4, 1fr); }

  .bottom-nav { display: flex; }
}

@media (max-width: 480px) {
  .reports-overview { grid-template-columns: 1fr 1fr; }
  .reports-overview .report-tile:nth-child(3) { grid-column: span 2; }
  .stat-value { font-size: 18px; }
  .insight-value { font-size: 17px; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .qa-btn { padding: 14px 4px 10px; }
  .qa-icon { width: 38px; height: 38px; }
}

/* ============================================================
   Misc utility
   ============================================================ */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.flex-spacer { flex: 1; }
.hidden { display: none !important; }
.section-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  margin: 0 0 12px;
}

/* range filter */
.range-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.range-row .field { gap: 4px; }
.range-row .field input { padding: 8px 10px; font-size: 13px; }

/* desktop topbar hidden on mobile, shown on desktop */
@media (min-width: 881px) {
  .mobile-topbar { display: none; }
}
