/* ==========================================================================
   Fleet Management — Admin design system
   Industrial / logistics: dark navy chrome, calm neutral canvas, a single
   safety-amber accent, semantic status colours.
   ========================================================================== */

:root {
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  /* chrome */
  --side-bg: #0c1422;
  --side-bg-2: #111b2d;
  --side-fg: #93a1b8;
  --side-fg-strong: #e8edf5;
  --side-line: rgba(255, 255, 255, 0.06);

  /* canvas */
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3e8ef;
  --line-strong: #cfd7e2;
  --fg: #0f1a2b;
  --fg-2: #475467;
  --fg-3: #7a8699;

  /* accent — safety amber */
  --accent: #f5a623;
  --accent-strong: #e08e0b;
  --accent-soft: #fff4de;
  --accent-fg: #1a1204;

  /* status */
  --ok: #12a150;      --ok-soft: #e4f6ec;
  --info: #2466e0;    --info-soft: #e5eefd;
  --warn: #e0700e;    --warn-soft: #fdf0e3;
  --danger: #d92d20;  --danger-soft: #fdecea;
  --muted: #667085;   --muted-soft: #eef1f5;
  --dark: #344054;    --dark-soft: #e4e7ec;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, 0.25);
  --focus: 0 0 0 3px rgba(245, 166, 35, 0.35);
  --sidebar-w: 256px;
  --topbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111c; --surface: #111a28; --surface-2: #0e1623; --line: #1f2a3b; --line-strong: #2b384c;
    --fg: #e6ebf2; --fg-2: #a6b1c2; --fg-3: #75829a;
    --side-bg: #070d17; --side-bg-2: #0c1422;
    --accent-soft: #3a2a0c;
    --ok-soft: #0f2e1d; --info-soft: #102546; --warn-soft: #3a220c; --danger-soft: #3b1512; --muted-soft: #1a2433; --dark-soft: #1f2937;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0a111c; --surface: #111a28; --surface-2: #0e1623; --line: #1f2a3b; --line-strong: #2b384c;
  --fg: #e6ebf2; --fg-2: #a6b1c2; --fg-3: #75829a;
  --side-bg: #070d17; --side-bg-2: #0c1422;
  --accent-soft: #3a2a0c;
  --ok-soft: #0f2e1d; --info-soft: #102546; --warn-soft: #3a220c; --danger-soft: #3b1512; --muted-soft: #1a2433; --dark-soft: #1f2937;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
.num, td.num, .kpi-value { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--fg-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ boot */
.boot { display: grid; place-items: center; height: 100vh; color: var(--fg-3); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-fg); display: flex; flex-direction: column; border-right: 1px solid var(--side-line); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid var(--side-line); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--accent-fg);
  background: linear-gradient(135deg, #ffc15a, var(--accent) 55%, var(--accent-strong)); box-shadow: 0 6px 16px -6px rgba(245, 166, 35, .6);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { color: var(--side-fg-strong); font-weight: 650; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-fg); }
.nav { padding: 14px 12px 24px; flex: 1; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { padding: 0 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5b6a82; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; text-decoration: none;
  color: var(--side-fg); font-weight: 500; position: relative; transition: background .12s, color .12s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: var(--side-fg-strong); }
.nav a.active { background: rgba(245, 166, 35, .12); color: #ffd28a; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .soon { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: #6f7d95; }
.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--side-line); font-size: 11.5px; color: #56657d; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 650; }
.topbar .crumb { color: var(--fg-3); font-size: 12.5px; }
.topbar-spacer { flex: 1; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 48px; max-width: 1480px; width: 100%; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #334155, #0f172a); }
.user-chip .who { line-height: 1.15; text-align: left; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who span { font-size: 11px; color: var(--fg-3); }

/* ------------------------------------------------------------ dropdowns */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.dropdown-panel button, .dropdown-panel a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; text-decoration: none; color: var(--fg); }
.dropdown-panel button:hover, .dropdown-panel a:hover { background: var(--surface-2); }
.dropdown-panel svg { width: 16px; height: 16px; color: var(--fg-3); }
.dropdown-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.notif-panel { width: 360px; padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--info); }
.notif-item .sev.warning { background: var(--warn); } .notif-item .sev.critical { background: var(--danger); }
.notif-item.read { opacity: .6; }
.notif-item b { font-size: 13px; font-weight: 600; display: block; }
.notif-item p { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-2); }
.notif-item time { font-size: 11.5px; color: var(--fg-3); }

/* ---------------------------------------------------------------- page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--fg-2); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12.5px; color: var(--fg-3); }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1.6fr 1fr; }
.grid-halves { grid-template-columns: 1fr 1fr; }

/* ------------------------------------------------------------------ KPI */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 16px 14px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--muted-soft); color: var(--muted); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1.1; }
.kpi-foot { font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.kpi.ok .kpi-icon { background: var(--ok-soft); color: var(--ok); }
.kpi.info .kpi-icon { background: var(--info-soft); color: var(--info); }
.kpi.warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.kpi.danger .kpi-icon { background: var(--danger-soft); color: var(--danger); }
.kpi.danger.hot { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.kpi.danger.hot::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--danger); }

/* segmented status bar */
.segbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--muted-soft); gap: 2px; }
.segbar span { display: block; height: 100%; min-width: 0; transition: flex-grow .4s; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-item b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* map placeholder */
.map-placeholder {
  position: relative; min-height: 300px; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
  background:
    radial-gradient(circle at 30% 40%, rgba(245, 166, 35, .10), transparent 40%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface-2);
  display: grid; place-items: center; text-align: center; padding: 24px;
}
.map-placeholder .inner { max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.map-placeholder h4 { font-size: 14px; margin-bottom: 4px; }
.map-placeholder p { margin: 0; color: var(--fg-2); font-size: 13px; }

/* activity */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity .a-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--muted-soft); color: var(--fg-2); }
.activity .a-icon svg { width: 14px; height: 14px; }
.activity b { font-weight: 600; }
.activity time { font-size: 12px; color: var(--fg-3); white-space: nowrap; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; font-size: 13.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-dark { background: #0f1a2b; border-color: #0f1a2b; color: #fff; }
.btn-dark:hover { background: #1c2a40; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-lg { height: 46px; font-size: 15px; padding: 0 20px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: 12px; color: var(--fg-3); }
.field .err { font-size: 12px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input::placeholder { color: var(--fg-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--focus); }
.field.invalid .input, .field.invalid .select { border-color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--fg-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: 9px; font-size: 13px; border: 1px solid; margin-bottom: 14px; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }

/* ---------------------------------------------------------------- table */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .input-icon { flex: 1; min-width: 220px; max-width: 380px; }
.toolbar .select { width: auto; min-width: 150px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: 0; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg-3); background: var(--surface-2); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user b { display: block; font-weight: 600; }
.cell-user span { font-size: 12.5px; color: var(--fg-3); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-2); }
.pager .btns { display: flex; gap: 6px; }
.expand td { background: var(--surface-2); }
.json-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.json-diff pre { margin: 4px 0 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 12px; max-height: 260px; }

/* --------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-soft); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.dark { background: var(--dark-soft); color: var(--dark); }
.badge.accent { background: var(--accent-soft); color: #9a5b00; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--muted-soft); color: var(--fg-2); font-size: 12px; font-family: var(--mono); }

/* ----------------------------------------------------------- empty state */
.empty { padding: 44px 24px; text-align: center; color: var(--fg-2); }
.empty .e-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--muted-soft); color: var(--fg-3); }
.empty .e-icon svg { width: 22px; height: 22px; }
.empty h4 { font-size: 15px; color: var(--fg); margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 440px; }

/* upcoming module */
.upcoming { max-width: 760px; }
.upcoming .phase { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9a5b00; background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; margin-bottom: 14px; }
.upcoming ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.upcoming li { display: flex; gap: 9px; align-items: flex-start; color: var(--fg-2); }
.upcoming li svg { width: 16px; height: 16px; color: var(--fg-3); flex: none; margin-top: 2px; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 14, 25, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px; z-index: 100; animation: fade .12s ease-out; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: rise .16s ease-out; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-sm { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head p { margin: 4px 0 0; color: var(--fg-2); font-size: 13px; }
.modal-body { padding: 14px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------------------------------------------------------------- toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 10px; background: #0f1a2b; color: #e8edf5; box-shadow: var(--shadow-lg); animation: rise .16s ease-out; font-size: 13.5px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #4ade80; } .toast.error svg { color: #f87171; } .toast.info svg { color: #93c5fd; }

/* ------------------------------------------------------------ settings */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--fg-2); font-weight: 500; }
.settings-nav a:hover { background: var(--surface); }
.settings-nav a.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.setting-row { display: grid; grid-template-columns: 1fr 260px; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { font-weight: 600; }
.setting-row p { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-3); }
.setting-row .mobile-flag { margin-left: 8px; }
.setting-row.field { margin-bottom: 0; }
.setting-row .err { grid-column: 1 / -1; }

/* ------------------------------------------------------------- auth page */
/* Full-bleed night scene: truck photo bottom-left, amber accents, white sign-in card on the right. */
.auth {
  position: relative; overflow: hidden; min-height: 100vh; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 48px; align-items: center;
  padding: 56px clamp(24px, 6vw, 96px);
  background:
    radial-gradient(700px 420px at 62% 30%, rgba(245, 166, 35, .07), transparent 70%),
    radial-gradient(900px 600px at 100% 0%, rgba(36, 102, 224, .10), transparent 65%),
    linear-gradient(165deg, #0d1626 0%, #0b1220 55%, #090f1a 100%);
  color: #dfe6f1;
}
.auth-photo {
  position: absolute; z-index: -1; left: 0; bottom: 0; width: min(72vw, 1180px); aspect-ratio: 960 / 334;
  background: url("../img/login-trucks.jpg") left bottom / cover no-repeat;
  /* Fade top and right edges into the page (whatever its background) — no visible seams. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%), linear-gradient(90deg, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0%, #000 42%), linear-gradient(90deg, #000 55%, transparent 100%);
  mask-composite: intersect;
}
.auth-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(9, 15, 26, .85) 100%);
}
.auth-line { position: absolute; z-index: -1; height: 1px; width: 520px; background: linear-gradient(90deg, transparent, rgba(245, 166, 35, .7), transparent); pointer-events: none; }
.auth-line-a { left: -140px; top: 70px; transform: rotate(-38deg); }
.auth-line-b { right: -160px; bottom: 120px; transform: rotate(-38deg); }

.auth-hero { position: relative; align-self: stretch; display: flex; flex-direction: column; min-height: calc(100vh - 112px); }
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-brand-mark { width: 62px; height: 62px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #ffb83d, var(--accent) 55%, var(--accent-strong)); box-shadow: 0 10px 30px -10px rgba(245, 166, 35, .6); color: #1a1204; }
.auth-brand-mark .brand-f { width: 38px; height: 38px; }
.auth-brand-name { font-size: 34px; line-height: 1; color: #fff; letter-spacing: -0.02em; font-weight: 500; }
.auth-brand-name b { font-weight: 800; }
.auth-brand-sub { margin-top: 8px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: #a4b1c5; word-spacing: .3em; }
.auth-route { position: absolute; top: 40px; right: -8%; width: min(36vw, 340px); color: var(--accent); pointer-events: none; }
.auth-route .route-ring circle { fill: none; stroke: rgba(245, 166, 35, .28); stroke-width: 1; }
.auth-hero-body { margin-top: clamp(48px, 9vh, 96px); max-width: 640px; }
.auth-hero h2 { font-size: clamp(38px, 4.2vw, 58px); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; color: #fff; margin: 0; }
.auth-hero h2 em { display: block; font-style: normal; color: var(--accent); }
.auth-hero p { color: #b6c1d2; font-size: 17px; line-height: 1.5; margin: 20px 0 0; max-width: 470px; }
.auth-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; max-width: 620px; }
.auth-feature { padding: 0 22px; border-left: 1px solid rgba(255, 255, 255, .14); display: flex; flex-direction: column; }
.auth-feature:first-child { padding-left: 0; border-left: 0; }
.auth-feature-icon { width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; color: var(--accent); margin-bottom: 14px; }
.auth-feature-icon svg { width: 22px; height: 22px; }
.auth-feature b { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; }
.auth-feature span { color: #a4b1c5; font-size: 13.5px; margin-top: 6px; line-height: 1.45; }
.auth-tagline { margin-top: auto; padding-top: 40px; display: flex; align-items: center; gap: 14px; font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: #c5cfdd; }
.auth-tagline i { width: 36px; height: 3px; border-radius: 2px; background: var(--accent); }
.auth-tagline span { color: #6c7a90; }

.auth-panel { display: flex; justify-content: center; }
.auth-card {
  position: relative; width: 100%; max-width: 440px; padding: 40px 38px 30px; border-radius: 16px;
  background: var(--surface); color: var(--fg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .06);
}
.auth-card-bar { display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--accent); margin-bottom: 22px; }
.auth-card h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.auth-card .lead { margin: 10px 0 28px; color: var(--fg-2); font-size: 15px; line-height: 1.5; }
.auth-card .field label { font-weight: 600; color: var(--fg); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fg-3); pointer-events: none; }
.input-icon .input { height: 50px; font-size: 15px; padding-left: 46px; background: var(--surface-2); }
.input-icon:has(.input-reveal) .input { padding-right: 46px; }
.input-reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--fg-3); cursor: pointer; }
.input-reveal:hover { color: var(--fg); background: var(--muted-soft); }
.input-reveal:focus-visible { outline: none; box-shadow: var(--focus); }
.input-reveal svg { width: 18px; height: 18px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 22px; font-size: 13.5px; }
.auth-card .auth-links .link { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.auth-submit { height: 54px; font-size: 16px; font-weight: 700; gap: 10px; }
.auth-submit svg { width: 18px; height: 18px; }
.link { color: var(--info); text-decoration: none; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }
.auth-note { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--fg-3); display: flex; gap: 12px; align-items: flex-start; }
.auth-note svg { width: 22px; height: 22px; flex: none; color: var(--fg-3); }

/* ----------------------------------------------------------- responsive */
.scrim { display: none; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) {
  .grid-2, .grid-halves { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; align-content: start; justify-items: center; }
  .auth-hero { min-height: 0; align-self: auto; width: 100%; max-width: 440px; }
  .auth-hero-body, .auth-route, .auth-tagline { display: none; }
  .auth-photo { width: 100%; }
}
@media (max-width: 560px) {
  .auth { padding: 24px 16px; }
  .auth-card { padding: 30px 22px 24px; }
  .auth-brand-name { font-size: 26px; }
  .auth-brand-mark { width: 50px; height: 50px; }
  .auth-brand-sub { font-size: 10px; letter-spacing: .18em; word-spacing: 0; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 14, 25, .5); z-index: 25; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .setting-row { grid-template-columns: 1fr; gap: 10px; }
  .user-chip .who { display: none; }
  .upcoming ul { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .json-diff { grid-template-columns: 1fr; }
  .notif-panel { width: calc(100vw - 32px); }
}

/* ======================================================= Phase 2 components */
.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--accent-soft); }
.cell-main b { display: block; font-weight: 650; }
.cell-main span { font-size: 12.5px; color: var(--fg-3); }
.fleet-no { font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.plate { display: inline-block; padding: 1px 7px; border: 1.5px solid var(--fg); border-radius: 5px; font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .06em; background: #fffbea; color: #111; white-space: nowrap; }

/* profile header */
.profile-head { display: flex; align-items: center; gap: 18px; padding: 20px; flex-wrap: wrap; }
.profile-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: #0f1a2b; color: var(--accent); flex: none; }
.profile-icon svg { width: 28px; height: 28px; }
.profile-title h2 { font-size: 22px; font-weight: 750; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-title p { margin: 4px 0 0; color: var(--fg-2); }
.profile-stats { display: flex; gap: 26px; margin-left: auto; flex-wrap: wrap; }
.profile-stats div { text-align: right; }
.profile-stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.profile-stats span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); text-decoration: none; font-weight: 600; margin-bottom: 12px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--fg); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px; border: 0; background: none; color: var(--fg-2); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab[disabled] { color: var(--fg-3); cursor: not-allowed; }
.tab .soon { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--muted-soft); color: var(--fg-3); }

/* definition grid */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0; }
.dl-grid > div { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.dl-grid dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.dl-grid dd { margin: 3px 0 0; font-weight: 550; }

/* compliance tiles */
.comp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comp-tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface); }
.comp-tile .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.comp-tile b { display: block; font-size: 16px; margin: 4px 0 8px; }
.comp-tile.expired { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }
.comp-tile.expiring { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 4px 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--info); }
.timeline li::after { content: ""; position: absolute; left: 10.5px; top: 18px; bottom: 0; width: 1.5px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.warn::before { border-color: var(--warn); }
.timeline li.ok::before { border-color: var(--ok); }
.timeline li.danger::before { border-color: var(--danger); }
.timeline time { font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.timeline b { display: block; font-weight: 600; }
.timeline p { margin: 2px 0 0; font-size: 12.5px; color: var(--fg-2); }

/* checkbox chips */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.check-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; user-select: none; background: var(--surface); }
.check-chip input { width: 17px; height: 17px; accent-color: var(--accent-strong); margin: 0; }
.check-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-chip span small { display: block; font-size: 11.5px; color: var(--fg-3); }
.segmented { display: inline-flex; background: var(--muted-soft); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--fg-2); cursor: pointer; font-size: 13px; }
.segmented button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.segmented button .n { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; }
.modal-lg { max-width: 760px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 700; margin: 18px 0 10px; }
.section-title:first-child { margin-top: 0; }
@media (max-width: 900px) { .comp-tiles { grid-template-columns: 1fr; } .profile-stats { margin-left: 0; } .profile-stats div { text-align: left; } }

/* ======================================================= Phase 3 components */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #0f1a2b; aspect-ratio: 4 / 3; cursor: zoom-in; border: 1px solid var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; font-size: 11.5px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-group { margin-bottom: 18px; }
.gallery-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.chip-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.chip.active { background: #0f1a2b; border-color: #0f1a2b; color: #fff; }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(5, 9, 16, .94); display: grid; grid-template-rows: auto 1fr auto; color: #e8edf5; animation: fade .12s; }
.lightbox-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.lightbox-top .title { flex: 1; min-width: 0; }
.lightbox-top b { display: block; }
.lightbox-top span { font-size: 12.5px; color: #93a1b8; }
.lightbox .lb-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; text-decoration: none; }
.lightbox .lb-btn:hover { background: rgba(255,255,255,.14); }
.lightbox .lb-btn svg { width: 18px; height: 18px; }
.lightbox-stage { position: relative; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; user-select: none; }
.lightbox-stage.zoomed { cursor: grab; }
.lightbox-stage img { max-width: 96vw; max-height: 100%; transform-origin: center; transition: transform .15s; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: 14px; } .lightbox-nav.next { right: 14px; }
.lightbox-bottom { padding: 10px 16px; font-size: 12px; color: #7d8aa0; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare figure { margin: 0; }
.compare img { width: 100%; border-radius: 10px; display: block; background: #0f1a2b; aspect-ratio: 4/3; object-fit: cover; cursor: zoom-in; }
.compare figcaption { font-size: 12px; color: var(--fg-3); margin-top: 4px; }
.compare-row { margin-bottom: 18px; }
.compare-row h4 { margin: 0 0 8px; font-size: 13px; }
.compare .missing-photo { aspect-ratio: 4/3; border-radius: 10px; border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--fg-3); font-size: 12.5px; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.result-list li:last-child { border-bottom: 0; }
.result-list .cmt { grid-column: 1 / -1; font-size: 12.5px; color: var(--fg-2); }
.rs { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; text-transform: uppercase; }
.rs.ok { background: var(--ok-soft); color: var(--ok); } .rs.concern { background: var(--danger-soft); color: var(--danger); }
.rs.not_applicable { background: var(--muted-soft); color: var(--muted); } .rs.not_checked { background: var(--warn-soft); color: var(--warn); }

.defect-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); }
.defect-card.critical { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); box-shadow: inset 4px 0 0 var(--danger); }
.defect-card .gallery { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.defect-card h4 { margin: 0; font-size: 14.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.defect-card p { margin: 6px 0 0; color: var(--fg-2); }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); }
.stat-strip div { padding: 12px 18px; border-right: 1px solid var(--line); }
.stat-strip div:last-child { border-right: 0; }
.stat-strip b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.tpl-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 11px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.tpl-item:last-child { border-bottom: 0; }
.tpl-item.inactive { opacity: .5; }
.tpl-item .rules { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } }

/* ==========================================================================
   Phase 5 — maps: live fleet, trip history, geofences
   ========================================================================== */
/* Leaflet uses z-index 200–1000 for its panes and controls. isolation: isolate keeps
   those numbers inside each map, so dialogs (100), the lightbox, the top bar and the mobile
   menu always stay above maps. Our own overlays (.live-map-bar, .live-detail) are isolated
   with their map card for the same reason. */
.leaflet-container { font-family: var(--font); background: var(--surface-2); isolation: isolate; z-index: 0; }
.live-map, .trip-map-wrap, .geo-map-card, .dash-map, .geo-pick { isolation: isolate; }
.map-notice { position: absolute; z-index: 800; left: 50%; top: 10px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center;
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); padding: 6px 12px; border-radius: 8px; font-size: 12.5px; }
.map-notice svg { width: 15px; height: 15px; }
.map-empty { position: absolute; inset: 0; z-index: 700; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--fg-2); }
.map-empty svg { width: 28px; height: 28px; color: var(--fg-3); }
.map-pop { font-size: 12.5px; line-height: 1.5; }

/* vehicle marker: pin in the state colour with a vehicle silhouette,
   heading arrow orbiting it while moving, fleet-number chip below */
.vm-icon { background: none; border: 0; }
.vpin { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--vm); color: #fff; flex: none;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(15, 26, 43, .3); }
.vpin .vglyph { width: 25px; height: 25px; }
.vpin-available, .vpin-waiting, .vpin-inactive { color: #344054; }
.vm { position: relative; width: 40px; height: 40px; }
.vm-pin { position: absolute; inset: 0; border-radius: 50%; background: var(--vm); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 26, 43, .4);
  display: grid; place-items: center; color: #fff; transition: transform .15s; }
.vm-pin .vglyph { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.vm-available .vm-pin, .vm-waiting .vm-pin, .vm-inactive .vm-pin { color: #344054; }
.vm-available .vm-pin .vglyph, .vm-waiting .vm-pin .vglyph, .vm-inactive .vm-pin .vglyph { filter: none; }
.vm-arrow { position: absolute; inset: -11px; pointer-events: none; }
.vm-arrow::before { content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 10px solid var(--vm); border-top: 0;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.vm-label { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); white-space: nowrap; background: rgba(11, 18, 32, .92); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 8px; border: 1px solid var(--vm); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); letter-spacing: .02em; }
.vm-label small { font-weight: 600; color: var(--vm); }
.vm.selected .vm-pin { transform: scale(1.15); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent), 0 2px 10px rgba(15, 26, 43, .45); }
.vm.selected .vm-label { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.vm.selected .vm-label small { color: inherit; }
.vm-offline .vm-pin, .vm-gps_unavailable .vm-pin { opacity: .9; }
.route-dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }

/* LIVE FLEET: list left, map right */
.content:has(.live) { max-width: none; padding: 16px; }
.live { display: grid; grid-template-columns: 340px 1fr; gap: 14px; height: calc(100vh - var(--topbar-h) - 32px); min-height: 520px; }
.live-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.live-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.live-stat { background: none; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 6px; text-align: center; cursor: pointer; color: inherit; font: inherit; }
.live-stat:nth-child(4n) { border-right: 0; }
.live-stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.live-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); font-weight: 650; }
.live-stat:hover { background: var(--surface-2); }
.live-stat.active { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.live-filters { padding: 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.live-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-filter-row .select { min-width: 0; height: 34px; font-size: 12.5px; }
.live-list { overflow-y: auto; flex: 1; }
.live-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; }
.live-item:hover { background: var(--surface-2); }
.live-item.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.live-item-main, .live-item-side { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; }
.live-item-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item-side { align-items: flex-end; }
.live-state { font-weight: 700; font-size: 12px; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.badge .live-dot { width: 8px; height: 8px; margin-right: 5px; }
.live-map { position: relative; overflow: hidden; min-height: 0; }
/* Sized by height, not position: Leaflet forces position:relative on a container it
   initialises before it is attached to the page, which would cancel inset:0. */
.live-map-canvas { width: 100%; height: 100%; }
.live-map-bar { position: absolute; z-index: 800; top: 10px; left: 56px; right: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.live-map-bar > * { pointer-events: auto; }
.live-conn, .live-toggle { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: 12.5px; box-shadow: var(--shadow-sm); }
.live-conn.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.live-conn svg { width: 15px; height: 15px; }
.live-toggle { cursor: pointer; user-select: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.live-detail { position: absolute; z-index: 850; right: 12px; bottom: 24px; width: 340px; max-height: calc(100% - 70px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px; }
.live-detail .alert { margin-bottom: 10px; }
.live-detail-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.live-detail-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.live-rows { display: grid; border-top: 1px solid var(--line); margin-bottom: 12px; }
.live-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.live-row span { color: var(--fg-3); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; font-weight: 650; padding-top: 2px; }
.live-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-hint { font-size: 11.5px; color: var(--fg-3); padding-top: 6px; }
.live-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.live-actions .btn { justify-content: center; }
.live-actions .btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
@media (max-width: 1080px) {
  .live { grid-template-columns: 1fr; height: auto; }
  .live-side { max-height: 420px; }
  .live-map { height: 70vh; }
  .live-detail { position: static; width: auto; max-height: none; border-radius: 0; box-shadow: none; border-width: 1px 0 0; }
  .live-map:has(.live-detail:not(.hidden)) { height: auto; }
  .live-map:has(.live-detail:not(.hidden)) .live-map-canvas { position: relative; height: 60vh; }
}

/* TRIP HISTORY */
.table tbody tr.selected td { background: var(--accent-soft); }
.trip-detail { margin-top: 16px; }
.trip-body { display: grid; grid-template-columns: 1fr 320px; min-height: 480px; }
.trip-map-wrap { position: relative; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.trip-map { position: relative; flex: 1; min-height: 460px; }
.trip-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; border-top: 1px solid var(--line); color: var(--fg-2); }
.trip-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trip-legend i { display: inline-block; width: 26px; height: 0; border-top: 4px solid var(--accent); }
.trip-legend i.dashed { border-top-style: dashed; }
.trip-timeline { padding: 14px 16px; max-height: 560px; overflow-y: auto; }
.trip-timeline li.clickable:hover b { color: var(--accent-strong); }
@media (max-width: 1080px) { .trip-body { grid-template-columns: 1fr; } .trip-map-wrap { border-right: 0; } }

/* GEOFENCES */
.geo-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
.geo-map-card { position: relative; overflow: hidden; }
.geo-map { height: 560px; }
.geo-pick { position: relative; height: 320px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.geo-type { display: inline-flex; align-items: center; gap: 7px; }
.geo-type i { width: 10px; height: 10px; border-radius: 50%; }
@media (max-width: 1080px) { .geo-grid { grid-template-columns: 1fr; } .geo-map { height: 380px; } }

/* DASHBOARD mini map */
.dash-map { position: relative; height: 300px; border-top: 1px solid var(--line); }

/* SYNC ISSUES (Phase 6) */
.sync-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-2); margin: 4px 0 12px; }
.sync-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sync-meta svg { width: 14px; height: 14px; }
.sync-photo img { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 10px; }
.sync-payload summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.sync-payload pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 12px;
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ==========================================================================
   Phase 7 — documents, maintenance, fuel, reports
   ========================================================================== */
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn + .btn, .row-actions .btn + a, .row-actions a + .btn { margin-left: 6px; }
.table tbody tr.muted-row td { color: var(--fg-3); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent-strong); }
.text-warn { color: var(--warn); }
.pager-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: 16px; }
.pager-row .pager { flex: 1; border-top: 0; }

.doc-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.doc-stat { background: none; border: 0; border-right: 1px solid var(--line); padding: 12px 18px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.doc-stat:last-child { border-right: 0; }
.doc-stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.doc-stat span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; }
.doc-stat.danger b { color: var(--danger); }
.doc-stat.warn b { color: var(--warn); }
.doc-stat:hover { background: var(--surface-2); }
.doc-stat.active { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }

.parts-table { margin-bottom: 8px; }
.parts-table td { padding: 4px 6px; }
.parts-table .input { height: 34px; }

.reports-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.report-list { display: flex; flex-direction: column; }
.report-item { background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 11px 14px; cursor: pointer; font: inherit; color: inherit; }
.report-item b { display: block; font-size: 13.5px; }
.report-item span { font-size: 12px; color: var(--fg-3); }
.report-item:hover { background: var(--surface-2); }
.report-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.toolbar-field { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--fg-3); font-weight: 600; }
.toolbar-field .input, .toolbar-field .select { height: 34px; min-width: 0; }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 16px 10px; flex-wrap: wrap; }
.report-head h3 { font-size: 16px; }
.report-table tfoot td { border-top: 2px solid var(--line-strong); background: var(--surface-2); }
@media (max-width: 1080px) { .reports-layout { grid-template-columns: 1fr; } }

.doc-file { display: inline-flex; align-items: center; gap: 5px; }
.doc-file svg, .row-actions svg, .btn-sm svg { width: 15px; height: 15px; flex: none; }
.toolbar .input[type="date"], .toolbar .input[type="datetime-local"] { width: auto; }
.table td.num { white-space: nowrap; }
.table td .badge { white-space: normal; }
.reports-layout > .card { min-width: 0; }
.report-table td { white-space: nowrap; }
.table td .badge { height: auto; min-height: 22px; line-height: 1.35; padding-top: 2px; padding-bottom: 2px; }
.table td > div + div .badge, .table td > div > .badge { margin-top: 2px; }
.fuel-checks { min-width: 240px; }

/* ===================================================== v8 redesign: shell
   Dark "control room" look by default (theme.js); light mode stays available. */
:root[data-theme="dark"] {
  --bg: #0a1120; --surface: #0f1a2c; --surface-2: #0c1626; --line: #1c2a40; --line-strong: #283a56;
  --fg: #e7edf6; --fg-2: #a9b5c8; --fg-3: #7686a0;
  --side-bg: #0a1220; --side-bg-2: #0a1220; --side-line: rgba(255, 255, 255, .06);
  --info: #3b82f6; --info-soft: #11264a; --ok: #22c55e; --ok-soft: #0d2c1c; --warn: #f59e0b; --warn-soft: #36260a;
  --danger: #ef4444; --danger-soft: #3a1518; --muted-soft: #172235; --dark-soft: #1d2738;
  --shadow-sm: none; --shadow: 0 1px 3px rgba(0, 0, 0, .45); --shadow-lg: 0 24px 50px -14px rgba(0, 0, 0, .7);
}
:root { --violet: #8b5cf6; --violet-soft: #ede9fe; }
:root[data-theme="dark"] { --violet: #a78bfa; --violet-soft: #241c45; }

.sidebar { min-width: 0; }
.brand { height: 78px; padding: 0 18px; border-bottom: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.brand-mark .brand-f { width: 26px; height: 26px; }
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 9.5px; letter-spacing: .14em; margin-top: 3px; color: #8a97ad; }
.nav { padding-top: 6px; }
.nav a { padding: 10px 12px; font-size: 14.5px; }
.nav a.active { background: #2563eb; color: #fff; box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .9); }
.nav a.active::before { display: none; }
.nav a.active svg { opacity: 1; }
.app.nav-collapsed { grid-template-columns: 0 1fr; }
.app.nav-collapsed .sidebar { visibility: hidden; border: 0; }
.menu-toggle { display: inline-grid; flex: none; }

.topbar { gap: 14px; }
:root[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--bg) 86%, transparent); }
.search { position: relative; flex: 0 1 560px; min-width: 0; }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--fg-3); pointer-events: none; }
.search-input {
  width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
  padding: 0 14px 0 42px; font: inherit; font-size: 14px;
}
.search-input::placeholder { color: var(--fg-3); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; max-height: 420px; overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.search-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.search-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--fg); }
.search-item:hover, .search-item:focus { background: var(--surface-2); outline: none; }
.search-item-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.search-item-icon svg { width: 16px; height: 16px; }
.search-item b { display: block; font-size: 13.5px; font-weight: 600; }
.search-item span span { font-size: 12px; color: var(--fg-3); }
.search-empty { padding: 12px; font-size: 13px; color: var(--fg-3); }
.card { border-radius: 14px; }
.page-head h2 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }

/* Maps follow the theme: dark tiles in dark mode (same free OpenStreetMap tiles, recoloured). */
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.88) saturate(.55); }
:root[data-theme="dark"] .leaflet-container { background: #0c1424; }

/* The sign-in card stays light in both themes (as designed). */
.auth-card {
  color-scheme: light;
  --surface: #ffffff; --surface-2: #f8fafc; --line: #e3e8ef; --line-strong: #cfd7e2; --fg: #0f1a2b; --fg-2: #475467; --fg-3: #7a8699;
  --muted-soft: #eef1f5; --info: #2466e0; --info-soft: #e5eefd; --danger: #d92d20; --danger-soft: #fdecea;
}
@media (max-width: 900px) {
  .app.nav-collapsed { grid-template-columns: 1fr; }
  .app.nav-collapsed .sidebar { visibility: visible; }
  .search { flex: 1; }
}

/* ===================================================== v8 redesign: dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-head h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; }
.dash-head p { margin: 4px 0 0; color: var(--fg-2); font-size: 15px; }
.dash-head .wave { font-size: 26px; }
.dash-clock { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.dash-clock > svg { width: 22px; height: 22px; color: var(--fg-2); }
.dash-clock b { display: block; font-size: 13.5px; font-weight: 600; }
.dash-clock span { font-size: 13px; color: var(--fg-2); }

.kpis2 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi2 {
  --tone: var(--info);
  position: relative; display: block; padding: 16px 16px 14px; border-radius: 14px; text-decoration: none; color: inherit; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 7%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--tone) 45%, var(--line));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--tone) 70%, transparent);
  transition: transform .12s, box-shadow .12s;
}
a.kpi2:hover { transform: translateY(-2px); box-shadow: inset 0 -2px 0 var(--tone), 0 10px 24px -14px color-mix(in srgb, var(--tone) 70%, transparent); }
.kpi2.blue { --tone: #3b82f6; } .kpi2.green { --tone: #22c55e; } .kpi2.teal { --tone: #14b8a6; }
.kpi2.orange { --tone: #f59e0b; } .kpi2.red { --tone: #ef4444; } .kpi2.violet { --tone: #8b5cf6; }
.kpi2-top { display: flex; align-items: center; gap: 12px; }
.kpi2-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.kpi2-icon svg { width: 20px; height: 20px; }
.kpi2-label { font-size: 14px; font-weight: 600; color: var(--fg); }
.kpi2-value { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-top: 14px; }
.kpi2-foot { font-size: 12.5px; color: var(--fg-2); margin-top: 8px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(330px, 1fr); gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; min-width: 0; }
.dash-card { overflow: hidden; }
.dash-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dash-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.dash-card-head h3 { font-size: 16px; font-weight: 700; }
.dash-card-head .sub { font-size: 12.5px; color: var(--fg-3); }
.dash-card-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--info); flex: none; }
.dash-card-icon.orange { color: var(--warn); }
.dash-card-icon svg { width: 22px; height: 22px; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--info); text-decoration: none; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.link-more svg { width: 14px; height: 14px; }
.live-dot2 { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); flex: none; }

.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--fg-2); flex-wrap: wrap; }
.chart-legend i, .donut-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.overview-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; }
.hour-chart-wrap { position: relative; padding: 14px 14px 8px; min-width: 0; }
.hour-chart { width: 100%; height: auto; display: block; }
.hour-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.hour-chart .axis { fill: var(--fg-3); font-size: 11px; font-family: var(--font); }
.hour-chart .hit { fill: transparent; }
.hour-chart .hit:hover { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-3); font-size: 13px; pointer-events: none; }
.donut-wrap { border-left: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.donut { width: 140px; height: 140px; }
.donut-track { fill: none; stroke: var(--surface-2); stroke-width: 14; }
.donut-value { fill: var(--fg); font-size: 26px; font-weight: 800; font-family: var(--font); }
.donut-label { fill: var(--fg-3); font-size: 10px; font-family: var(--font); }
.donut-legend { width: 100%; display: grid; gap: 6px; font-size: 12.5px; }
.donut-legend > div { display: grid; grid-template-columns: auto 1fr auto 38px; align-items: center; gap: 4px; }
.donut-legend span { color: var(--fg-2); }
.donut-legend b { font-weight: 700; }
.donut-legend em { font-style: normal; color: var(--fg-3); text-align: right; }

.dash-map-lg { height: 340px; border-top: 0; }
.live-rows2 { display: grid; }
.live-row2 { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.25fr) auto; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.live-row2:last-child { border-bottom: 0; }
.live-row2:hover { background: var(--surface-2); }
.veh-tile { --tone: var(--info); width: 44px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone); }
.veh-tile.ok { --tone: var(--ok); } .veh-tile.info { --tone: var(--info); } .veh-tile.danger { --tone: var(--danger); } .veh-tile.warn { --tone: var(--warn); }
.veh-tile svg { width: 22px; height: 22px; }
.live-row2-main b { display: block; font-size: 14px; }
.live-row2-main span { font-size: 12.5px; color: var(--fg-3); }
.live-row2-who { display: grid; gap: 3px; font-size: 12.5px; color: var(--fg-2); min-width: 0; }
.live-row2-who span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-row2-who svg { width: 13px; height: 13px; flex: none; color: var(--fg-3); }
.live-row2-state { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--fg-2); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.danger { background: var(--danger-soft); color: var(--danger); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.muted { background: var(--muted-soft); color: var(--fg-2); }

.timeline { list-style: none; margin: 0; padding: 12px 18px 14px; }
.timeline li { --tone: var(--fg-3); position: relative; display: grid; grid-template-columns: 14px 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 0; }
.timeline li.ok { --tone: var(--ok); } .timeline li.info { --tone: var(--info); } .timeline li.danger { --tone: var(--danger); }
.timeline li.warn { --tone: var(--warn); } .timeline li.violet { --tone: var(--violet); }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline li:first-child::before { top: 50%; }
.timeline li:last-child::before { bottom: 50%; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--tone); border: 3px solid var(--surface); position: relative; }
.tl-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone) 15%, transparent); color: var(--tone); }
.tl-icon svg { width: 17px; height: 17px; }
.timeline b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline span { font-size: 12px; color: var(--fg-3); }

.attention { display: grid; padding: 8px; }
.attention-item { --tone: var(--fg-3); display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; text-decoration: none; color: var(--fg); font-size: 13.5px; }
.attention-item:hover { background: var(--surface-2); }
.attention-item svg { width: 17px; height: 17px; flex: none; }
.attention-item span { flex: 1; }
.attention-item svg:first-child { color: var(--tone); }
.attention-item svg:last-child { color: var(--fg-3); }
.attention-item.red { --tone: var(--danger); }
.attention-item.orange { --tone: var(--warn); }
.attention-ok { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--fg-2); font-size: 13.5px; }
.attention-ok svg { width: 18px; height: 18px; color: var(--ok); }

@media (max-width: 1440px) { .kpis2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .kpis2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-body { grid-template-columns: 1fr; }
  .donut-wrap { border-left: 0; border-top: 1px solid var(--line); }
  .live-row2 { grid-template-columns: auto minmax(0, 1fr) auto; }
  .live-row2-who { display: none; }
}

/* v8 shell fixes */
.user-chip { flex: none; }
.user-chip > svg { width: 16px; height: 16px; flex: none; color: var(--fg-3); }
.user-chip .who b, .user-chip .who span { white-space: nowrap; }
.brand-sub { white-space: nowrap; letter-spacing: .05em; font-size: 9px; }

/* ===================================================== v8 redesign: live fleet */
.content:has(.live2) { max-width: none; }
.kpis5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
button.kpi2 { font: inherit; text-align: left; cursor: pointer; width: 100%; }
button.kpi2:hover { transform: translateY(-2px); }
.kpi2.active { box-shadow: inset 0 0 0 2px var(--tone), 0 10px 24px -14px var(--tone); }

.live2-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 18px; margin-bottom: 18px; }
.live2-mapcard { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.live2-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.live2-filters .select { width: auto; min-width: 150px; height: 38px; }
.live2-filter-label { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.live2-filter-label svg { width: 16px; height: 16px; }
.live2-search { flex: 1; min-width: 180px; }
.live2-search .input { height: 38px; font-size: 13.5px; padding-left: 40px; }
.live2-map { position: relative; height: clamp(420px, calc(100vh - 440px), 720px); isolation: isolate; }
.live2-map .live-map-canvas { position: absolute; inset: 0; }
.map-overlay { position: absolute; z-index: 500; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.map-overlay > * { pointer-events: auto; }
.map-overlay.top-right { top: 12px; right: 12px; justify-content: flex-end; max-width: calc(100% - 80px); }
.map-overlay.bottom-left { left: 12px; bottom: 12px; }
.map-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--fg); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
  backdrop-filter: blur(6px);
}
.map-chip input { accent-color: var(--info); margin: 0; }
.map-chip svg { width: 15px; height: 15px; }
.map-chip.error { color: var(--danger); }
.map-legend { gap: 14px; padding: 8px 12px; border-radius: 9px; font-size: 12.5px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; }

.live2-side { display: flex; flex-direction: column; overflow: hidden; max-height: calc(clamp(420px, calc(100vh - 440px), 720px) + 63px); }
.live2-side .dash-card-head .muted { font-size: 12.5px; }
.live2-list { overflow-y: auto; flex: 1; }
.live2-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; padding: 12px 16px;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.live2-row:hover { background: var(--surface-2); }
.live2-row.selected { background: color-mix(in srgb, var(--info) 12%, transparent); box-shadow: inset 3px 0 0 var(--info); }
.live2-row > svg { width: 16px; height: 16px; color: var(--fg-3); }
.live2-row-main { display: grid; gap: 2px; min-width: 0; font-size: 12.5px; }
.live2-row-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live2-row-main > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.live2-row-main svg { width: 12px; height: 12px; flex: none; }
.live2-row-side { display: grid; justify-items: end; gap: 3px; font-size: 12px; }
.veh-tile .vglyph { width: 26px; height: 26px; }
.veh-tile.lg { width: 54px; height: 48px; border-radius: 12px; }
.veh-tile.lg .vglyph { width: 32px; height: 32px; }

.live2-bottom { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) minmax(260px, 1.1fr); gap: 18px; align-items: stretch; }
.live2-detail { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; align-content: start; }
.live2-detail-empty { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 20px; color: var(--fg-2); }
.live2-detail-empty > svg { width: 28px; height: 28px; color: var(--info); flex: none; }
.live2-detail-empty b { display: block; color: var(--fg); }
.live2-detail-empty span { font-size: 13px; }
.live2-detail-main { padding: 16px 18px; min-width: 0; display: grid; gap: 10px; }
.live2-detail-head { display: flex; align-items: center; gap: 12px; }
.live2-detail-title { flex: 1; min-width: 0; }
.live2-detail-title > div { display: flex; align-items: center; gap: 10px; }
.live2-detail-title b { font-size: 18px; }
.live2-detail-title > span { font-size: 13px; color: var(--fg-2); }
.live2-speed { text-align: right; }
.live2-speed b { font-size: 24px; font-weight: 800; }
.live2-speed span { font-size: 12px; color: var(--fg-3); margin-left: 4px; }
.live2-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--fg-2); }
.live2-detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.live2-detail-meta svg { width: 14px; height: 14px; color: var(--fg-3); }
.live2-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.live2-facts span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); }
.live2-facts b { font-size: 13.5px; font-weight: 600; }
.live2-actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.live2-action {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--fg); text-decoration: none; font: inherit; font-size: 11.5px; font-weight: 600; text-align: center; cursor: pointer;
}
.live2-action svg { width: 22px; height: 22px; color: var(--fg-2); }
.live2-action:hover:not(:disabled) { border-color: var(--info); }
.live2-action.active { background: color-mix(in srgb, var(--info) 18%, var(--surface)); border-color: var(--info); color: var(--info); }
.live2-action.active svg { color: var(--info); }
.live2-action:disabled { opacity: .45; cursor: not-allowed; }

.quick-stats { display: grid; gap: 4px; padding: 10px 18px 16px; }
.quick-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.quick-stat:last-child { border-bottom: 0; }
.quick-stat span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); }
.quick-stat span svg { width: 16px; height: 16px; color: var(--info); }
.quick-stat b { font-size: 22px; font-weight: 800; }
.quick-stat small { font-size: 12px; color: var(--fg-3); font-weight: 600; }

.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; vertical-align: 2px; }
.alert-list { display: grid; padding: 6px 8px 10px; max-height: 260px; overflow-y: auto; }
.alert-row {
  --tone: var(--danger); display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  border: 0; background: none; color: var(--fg); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer;
}
.alert-row.warn { --tone: var(--warn); }
.alert-row:hover { background: var(--surface-2); }
.alert-row svg { width: 16px; height: 16px; color: var(--tone); }
.alert-row span { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


@media (max-width: 1440px) {
  .live2-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .live2-detail { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .live2-grid { grid-template-columns: 1fr; }
  .live2-side { max-height: 460px; }
  .kpis5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .live2-bottom { grid-template-columns: 1fr; }
  .live2-detail { grid-template-columns: 1fr; }
  .kpis5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live2-filters .select { flex: 1 1 140px; min-width: 0; }
}

/* Live Fleet: full-screen map (filters + map fill the screen; Esc exits). */
.live2-mapcard:fullscreen { border-radius: 0; border: 0; background: var(--bg); }
.live2-mapcard:fullscreen .live2-map { height: auto; flex: 1; }
.live2-mapcard::backdrop { background: var(--bg); }

/* Map: count bubble for vehicles that overlap when zoomed out (ring = share of moving / idle / offline). */
.vcluster-icon { background: none; border: 0; }
.vcluster {
  position: relative; border-radius: 50%; display: grid; place-content: center; text-align: center; cursor: pointer;
  background: var(--ring); padding: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); transition: transform .12s;
}
.vcluster::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0f1a2b; }
.vcluster:hover { transform: scale(1.08); }
.vcluster b, .vcluster span { position: relative; color: #fff; line-height: 1; }
.vcluster b { font-size: 17px; font-weight: 800; }
.vcluster span { font-size: 7px; text-transform: uppercase; letter-spacing: .04em; color: #c5cfdd; margin-top: 2px; }

/* Direction arrow always visible: drawn above the label; label flips above the pin when heading south. */
.vm-arrow { z-index: 2; }
.vm-label { z-index: 1; }
.vm.label-top .vm-label { top: auto; bottom: 44px; }

/* Sign-up (multi-company) */
.field .hint.hint-ok { color: var(--ok); font-weight: 600; }
.field .hint.hint-bad { color: var(--danger); font-weight: 600; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--fg-2); line-height: 1.45; cursor: pointer; }
.auth-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent-strong); flex: none; }
.auth-card .form-row { gap: 0 12px; }

/* ===================================================== owner console (multi-company) */
.text-danger { color: var(--danger); }
.owner-auth { grid-template-columns: 1fr; justify-items: center; }
.owner-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.owner-brand .brand-mark { width: 36px; height: 36px; }
.owner-brand .brand-mark .brand-f { width: 22px; height: 22px; }
.owner-brand b { font-size: 16px; }
.owner-brand span:last-child { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); padding: 3px 8px; border-radius: 999px; background: var(--muted-soft); }
.owner-top .owner-brand { margin: 0; }
.owner { min-height: 100vh; background: var(--bg); }
.owner-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.owner-main { max-width: 1280px; margin: 0 auto; padding: 26px 28px 48px; }
.owner-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.owner-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 0; background: none; color: var(--fg-2); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.owner-tab:hover { background: var(--surface-2); color: var(--fg); }
.owner-tab.active { background: var(--info-soft); color: var(--info); }
.owner-tab .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--muted-soft); color: var(--fg-2); font-size: 12px; text-align: center; }
.owner-tab .count.hot { background: var(--warn); color: #fff; }
.owner-detail { display: grid; gap: 16px; }
.owner-detail h4 { margin: 4px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); }
.owner-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.owner-usage div { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.owner-usage b { display: block; font-size: 20px; font-weight: 800; }
.owner-usage span { font-size: 12px; color: var(--fg-3); }
.owner-form { display: grid; gap: 4px; }
.owner-form > .btn { justify-self: start; }
.owner-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.owner-history li { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.owner-history time { margin-left: auto; color: var(--fg-3); font-size: 12px; }
@media (max-width: 700px) { .owner-usage { grid-template-columns: repeat(2, minmax(0, 1fr)); } .owner-top, .owner-main { padding-left: 16px; padding-right: 16px; } }

/* ==========================================================================
   Phase 10 — platform notices inside the company dashboard
   ========================================================================== */
.platform-banners:empty { display: none; }
.app.in-support .platform-banners { position: sticky; top: 0; z-index: 30; }
.app.in-support .topbar { position: relative; }
.support-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 22px; color: #fff; font-size: 13px;
  background: repeating-linear-gradient(135deg, #5b21b6 0 18px, #6d28d9 18px 36px); border-bottom: 2px solid #f5a623; }
.support-banner.level-view { background: repeating-linear-gradient(135deg, #1e40af 0 18px, #1d4ed8 18px 36px); }
.support-banner.level-emergency { background: repeating-linear-gradient(135deg, #991b1b 0 18px, #b91c1c 18px 36px); }
.support-banner.customer { background: #2e1065; border-bottom-color: #8b5cf6; }
.support-banner .sb-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .06em; font-size: 12px; padding: 4px 10px; border-radius: 6px; background: #f5a623; color: #1a1204; }
.support-banner .sb-badge svg { width: 14px; height: 14px; }
.support-banner .sb-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; line-height: 1.35; }
.support-banner .sb-text span { opacity: .85; font-size: 12.5px; }
.support-banner .sb-left { white-space: nowrap; opacity: .9; }
.support-banner .sb-timer { font-variant-numeric: tabular-nums; font-size: 15px; }
.support-banner .sb-exit { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .12); color: #fff; font-weight: 750; font-size: 12.5px; cursor: pointer; letter-spacing: .02em; }
.support-banner .sb-exit:hover { background: rgba(255, 255, 255, .24); }
.support-banner .sb-exit svg { width: 15px; height: 15px; }
.platform-announcement { display: flex; gap: 12px; align-items: flex-start; padding: 10px 22px; font-size: 13px; border-bottom: 1px solid var(--line);
  background: var(--info-soft); color: var(--fg); }
.platform-announcement > svg { width: 18px; height: 18px; color: var(--info); flex: none; margin-top: 1px; }
.platform-announcement > div { flex: 1; display: flex; flex-direction: column; }
.platform-announcement span { color: var(--fg-2); }
.platform-announcement .icon-btn { width: 28px; height: 28px; }
.platform-announcement.maintenance { background: var(--warn-soft); } .platform-announcement.maintenance > svg { color: var(--warn); }
.platform-announcement.emergency { background: var(--danger-soft); } .platform-announcement.emergency > svg { color: var(--danger); }
@media (max-width: 700px) { .support-banner { padding: 10px 14px; gap: 10px; } .support-banner .sb-left { order: 3; } }

/* ==========================================================================
   FLEVARO brand layer (8 Oct 2026) — visual identity only; see docs/design/FLEVARO-brand.md.
   Navy chrome, brand blue #126BFF, electric accent #19A7FF, Plus Jakarta Sans.
   Status colours (green / blue / amber / red / grey) keep their meaning.
   ========================================================================== */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --font: "Plus Jakarta Sans", "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --side-bg: #071A2B; --side-bg-2: #0B2545; --side-fg: #93A4BC; --side-fg-strong: #EEF3FA;
  --bg: #F5F7FA; --line: #DCE3EA; --fg: #111827; --fg-3: #64748B;
  --accent: #126BFF; --accent-strong: #0B57E0; --accent-soft: #E8F0FF; --accent-fg: #FFFFFF;
  --brand-electric: #19A7FF; --brand-navy: #071A2B; --brand-deep: #0B2545;
  --focus: 0 0 0 3px rgba(18, 107, 255, 0.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #06121F; --surface: #0B1828; --surface-2: #091523; --line: #16263A; --line-strong: #22354D; --side-bg: #050F1C; --side-bg-2: #071A2B; --accent-soft: #0F2A55; }
}
:root[data-theme="dark"] { --bg: #06121F; --surface: #0B1828; --surface-2: #091523; --line: #16263A; --line-strong: #22354D; --side-bg: #050F1C; --side-bg-2: #071A2B; --accent-soft: #0F2A55; }

.btn-primary { color: #fff; }
.brand-mark, .auth-brand-mark { background: linear-gradient(150deg, #0B2545, #071A2B); border: 1px solid rgba(25, 167, 255, .25); box-shadow: 0 6px 18px -8px rgba(18, 107, 255, .65); }
.brand-mark svg { width: 24px; height: 24px; }
.auth-brand-mark .brand-f { width: 40px; height: 40px; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.nav a.active { background: rgba(18, 107, 255, .16); color: #CFE2FF; }
.badge.accent, .upcoming .phase { color: #0B57E0; }
:root[data-theme="dark"] .badge.accent { color: #8DB8FF; }
.auth { background:
    radial-gradient(700px 420px at 62% 30%, rgba(25, 167, 255, .08), transparent 70%),
    radial-gradient(900px 600px at 100% 0%, rgba(18, 107, 255, .12), transparent 65%),
    linear-gradient(165deg, #0B2545 0%, #071A2B 55%, #050F1C 100%); }
.auth-line { background: linear-gradient(90deg, transparent, rgba(25, 167, 255, .7), transparent); }
.auth-route .route-ring circle { stroke: rgba(25, 167, 255, .28); }
.auth-brand-name { font-weight: 800; letter-spacing: .06em; }
.map-placeholder { background:
    radial-gradient(circle at 30% 40%, rgba(18, 107, 255, .10), transparent 40%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--surface-2); }
/* Plus Jakarta Sans is wider than the old font: ease the tight display tracking. */
.auth h1, .auth h2, .auth-hero h2, .dash-head h2, .kpi2-value, .kpi-value { letter-spacing: -0.015em; }
/* Inter-only stylistic sets (cv11, ss01) switch Plus Jakarta Sans letters to alternates — use the font's normal shapes. */
body { font-feature-settings: normal; }
