/* =========================================================
   MCA ISWM — Modern Design System
   Light + Dark theme · CSS variables · soft shadows
   ========================================================= */
:root {
  --bg: #f2f5fa;
  --bg-grad: radial-gradient(1200px 700px at 100% -12%, #e9f1ff 0%, rgba(242,245,250,0) 46%), linear-gradient(180deg, #f6f8fc 0%, #eef1f7 100%);
  --ink: #0b1220;
  --ink-soft: #3a4a63;
  --muted: #6b7a93;
  --line: #e6eaf2;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --bg-soft: #eef2f8;
  --side: #0c1626;
  --side-2: #102038;
  --side-ink: #d6e0ee;
  --side-mut: #8295ad;
  --accent: #10b981;
  --accent-600: #059669;
  --accent-2: #3b82f6;
  --accent-soft: #e6f7f1;
  --warn: #f59e0b;
  --warn-soft: #fef3e2;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --info: #3b82f6;
  --info-soft: #e8f0fe;
  --ok: #16a34a;
  --ok-soft: #e7f6ec;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow: 0 8px 24px rgba(16,24,40,.08);
  --shadow-lg: 0 26px 64px rgba(16,24,40,.14);
  --radius: 14px;
  --radius-sm: 9px;
  --w: 272px;
  --top-h: 62px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t: 170ms cubic-bezier(.4,0,.2,1);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
  --grad-brand: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --grad-side: linear-gradient(180deg, #10243f 0%, #0c1626 55%, #081120 100%);
}
[data-theme="dark"] {
  --bg: #0a0f1a;
  --bg-grad: radial-gradient(1200px 700px at 100% -12%, #103427 0%, rgba(10,15,26,0) 48%), linear-gradient(180deg, #0b111d 0%, #080d16 100%);
  --ink: #e9eef6;
  --ink-soft: #b3c1d4;
  --muted: #8499b0;
  --line: #1b2738;
  --panel: #101827;
  --panel-2: #0c1421;
  --bg-soft: #0c1421;
  --side: #060c16;
  --side-2: #0a1524;
  --side-ink: #d6e0ee;
  --side-mut: #7388a0;
  --accent: #2dd4a7;
  --accent-600: #14b88a;
  --accent-2: #60a5fa;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 8px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 26px 64px rgba(0,0,0,.62);
  --accent-soft: #0c2c23;
  --warn-soft: #2a2110;
  --danger-soft: #2a1414;
  --info-soft: #122036;
  --ok-soft: #0c2418;
  --grad-side: linear-gradient(180deg, #0a1524 0%, #070e1a 55%, #05090f 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
h1, h2, h3 { letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, #0d2336 0%, #0a1a2b 60%, #081523 100%);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px; text-decoration: none; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand .logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 20px rgba(14,163,113,.45);
}
.brand strong { display: block; font-size: 15px; line-height: 1.15; color: #fff; letter-spacing: .01em; }
.brand span { font-size: 10.5px; color: var(--side-mut); letter-spacing: .04em; }

.nav-search {
  margin: 14px 14px 6px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px; width: calc(100% - 28px); background: rgba(255,255,255,.035);
  color: #fff; font-size: 13px; transition: border-color .15s, background .15s;
}
.nav-search::placeholder { color: var(--side-mut); }
.nav-search:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.06); }

.sidebar nav { overflow: auto; flex: 1; padding: 6px 10px 14px; }
.sidebar nav::-webkit-scrollbar { width: 7px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
.sidebar nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

.nav-g { margin: 2px 0; }
.nav-g > summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; list-style: none; user-select: none;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: #6f8aa3; padding: 15px 12px 7px;
}
.nav-g > summary::-webkit-details-marker { display: none; }
.ng-head { display: flex; align-items: center; gap: 9px; }
.ng-head svg { width: 14px; height: 14px; opacity: .8; }
.ng-caret { width: 14px; height: 14px; opacity: .55; transition: transform .2s ease; }
.nav-g[open] > summary .ng-caret { transform: rotate(90deg); }
.nav-g-body { padding: 2px 0 4px; }

.nav-i {
  display: flex; align-items: center; gap: 12px; color: #b9c8d8;
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 9px 12px; margin: 2px 6px; border-radius: 10px;
  position: relative; transition: background .15s, color .15s;
}
.nav-i svg { width: 18px; height: 18px; flex: none; opacity: .75; transition: opacity .15s; }
.nav-i span { flex: 1; min-width: 0; }
.nav-i:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-i.on {
  background: linear-gradient(90deg, rgba(30,199,138,.22), rgba(37,99,235,.06));
  color: #fff;
}
.nav-i.on::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.nav-i.on svg { opacity: 1; color: var(--accent); }

.side-foot {
  border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.15);
}
.side-foot .av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; flex: none; box-shadow: 0 4px 10px rgba(14,163,113,.4); }
.side-foot .who { flex:1; min-width:0; line-height:1.25; }
.side-foot .who b { color:#fff; font-size:13px; display:block; }
.side-foot .who small { color: var(--side-mut); font-size:11px; }
.side-foot .logout { color: var(--side-mut); text-decoration:none; padding:8px; border-radius:9px; transition:.15s; display:grid; place-items:center; }
.side-foot .logout:hover { color:#fff; background: rgba(255,255,255,.1); }
.side-foot .logout svg { width:18px; height:18px; display:block; }

/* ---------- Main / topbar ---------- */
main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 0 18px; height: var(--top-h);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  min-width: 0;
}
.top h1 {
  flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top .crumbs { font-size: 12px; color: var(--muted); }
.menu-btn { display: none; background: var(--accent); color: #fff; border: 0; padding: 9px 13px; border-radius: 10px; cursor: pointer; }
.top-search {
  display: flex; align-items: center; gap: 8px;
  flex: 0 1 240px; width: 240px; max-width: min(240px, 28vw); min-width: 0;
  height: 38px; padding: 0 12px; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.top-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--ring);
}
.top-search svg {
  flex: 0 0 16px; width: 16px; height: 16px; color: var(--muted); display: block;
}
.top-search input {
  flex: 1 1 auto; min-width: 0; width: 100%; height: 100%;
  border: 0; outline: 0; background: transparent; box-shadow: none;
  font-size: 13px; color: var(--ink); padding: 0; margin: 0;
  appearance: none; -webkit-appearance: none;
}
.top-search input::placeholder { color: var(--muted); }
.top-search input::-webkit-search-decoration,
.top-search input::-webkit-search-cancel-button { display: none; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
@media (max-width: 900px) {
  .top-search { flex-basis: 160px; width: 160px; max-width: 160px; }
}
@media (max-width: 640px) {
  .top-search { display: none; }
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; transition: .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--line);
  border-radius: 99px; background: var(--panel); text-decoration: none; color: var(--ink);
}
.user-chip .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; display:grid; place-items:center; font-weight:700; font-size:12px; }
.user-chip .nm { line-height: 1.1; }
.user-chip .nm b { font-size: 13px; display: block; }
.user-chip .nm small { color: var(--muted); font-size: 11px; }

.content { padding: 22px; overflow: auto; flex: 1; }
.content.map-page { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h)); }
.content.map-page > .ops-map-shell,
.content.live-map-page > .ops-map-shell {
  flex: 1; width: 100%; min-width: 0; min-height: 640px;
  height: calc(100vh - var(--top-h));
}

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  position: relative; background: var(--panel); padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--accent), var(--accent-2)); }
.kpi em { display: block; font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi b { font-size: 26px; color: var(--ink); font-weight: 750; line-height: 1.2; }
.kpi .spark { font-size: 11px; color: var(--ok); margin-top: 2px; }

/* ---------- Cards ---------- */
.card { background: var(--panel); padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card > .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; line-height: 1.6; white-space: nowrap;
}
.pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.pill.green, .pill.ok, .pill.present, .pill.resolved, .pill.on, .pill.gpsok, .pill.moving, .pill.yes { color: var(--ok); background: var(--ok-soft); }
.pill.blue, .pill.info, .pill.open, .pill.inprogress, .pill.in-progress { color: var(--info); background: var(--info-soft); }
.pill.amber, .pill.warn, .pill.warning, .pill.idle, .pill.leave, .pill.no { color: var(--warn); background: var(--warn-soft); }
.pill.red, .pill.danger, .pill.critical, .pill.breakdown, .pill.maintenance, .pill.nogps, .pill.absent { color: var(--danger); background: var(--danger-soft); }
.pill.gray, .pill.stopped, .pill.no-gps { color: var(--muted); background: var(--panel-2); }
.pill.accent { color: var(--accent); background: var(--accent-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: #fff;
  text-decoration: none; border: 0; padding: 9px 15px; margin: 4px 6px 0 0; cursor: pointer;
  font-size: 13px; font-weight: 600; border-radius: 10px; transition: transform .12s, box-shadow .12s, background .15s;
  box-shadow: 0 2px 6px rgba(14,163,113,.3);
}
.btn:hover { background: var(--accent-600); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(14,163,113,.35); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--panel); color: var(--accent-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent-2); color: var(--accent-2); transform: none; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.danger { background: var(--danger); box-shadow: 0 2px 6px rgba(225,29,72,.3); }
.btn.danger:hover { background: #c01840; }

/* ---------- Forms ---------- */
.login, .stack-form, .inline { font-size: 13px; }
.login label, .stack-form label { display: block; margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
.login input, .login textarea, .login select,
.stack-form input, .stack-form select, .stack-form textarea,
.inline input, .inline select, .inline textarea {
  width: 100%; margin-top: 6px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.login input:focus, .stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus,
.inline input:focus, .inline select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.inline input, .inline select { width: auto; min-width: 150px; }
.inline label { margin: 0; }
.err { color: var(--danger); font-weight: 600; }

/* ---------- Map / fleet ---------- */
.map-layout { display: grid; grid-template-columns: 280px 1fr; width: 100%; height: calc(100vh - var(--top-h)); }
.fleet-list { overflow: auto; background: var(--panel); border-right: 1px solid var(--line); }
.sec { padding: 13px 16px; font-size: 11px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); letter-spacing: .05em; display:flex; justify-content:space-between; }
.veh-item {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--panel); border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; cursor: pointer; text-align: left; transition: background .12s;
}
.veh-item:hover { background: var(--panel-2); }
.veh-item .pill { font-size: 10px; }
.map-frame { position: relative; min-height: 0; background: #cfe3d8; }
.map { height: 100%; min-height: 480px; }
.side-card {
  position: absolute; right: 16px; top: 16px; width: 290px; background: var(--panel); padding: 16px;
  font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius); max-height: 72vh; overflow: auto; z-index: 500; box-shadow: var(--shadow-lg);
}
.side-card h3 { margin: 0 0 8px; font-size: 15px; }
.side-card button { margin: 4px 4px 0 0; }
.veh-item.gps-on { border-left: 3px solid var(--accent); }
.veh-item.gps-off { opacity: .72; }
.fleet-pin { width: 48px; text-align: center; line-height: 0; pointer-events: none; }
/* Vehicle master editor */
.vm-table select, .vm-table input { width: 130px; padding: 6px 8px; }
.vm-table .vm-ward { width: 110px; }
.vm-table .vm-driver, .vm-table .vm-phone { width: 120px; }
.vm-table td { vertical-align: middle; }
.vm-save { min-width: 64px; }
.fleet-pin-svg { display: block; margin: 0 auto; overflow: visible; transition: filter .2s; }
.fleet-tag {
  display: inline-block; margin-top: 2px; max-width: 72px; padding: 2px 6px;
  font-size: 9px; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 99px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 1px 3px rgba(15,23,42,.18);
}
.fleet-pin.is-moving .fleet-pin-svg { filter: drop-shadow(0 0 4px rgba(14,163,113,.55)); }
.leaflet-div-icon.tipper-marker { background: transparent; border: 0; }

/* map pages variants */
.content.dash-with-map .map-layout { height: 460px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.content.dash-with-map .map { min-height: 460px; }
.content.cc-with-map .cc-strip .kpis { margin-bottom: 14px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.content.cc-with-map .cc-strip .kpi { padding: 11px 13px; }
.content.cc-with-map .cc-strip .kpi b { font-size: 19px; }
.content.cc-with-map .map-layout { height: 320px; min-height: 320px; max-height: 320px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.content.cc-with-map .map, .content.cc-with-map .map-frame { height: 320px; min-height: 0; }
.content.cc-with-map .fleet-list { background: var(--panel); }
.content.cc-with-map .side-card { top: 10px; right: 10px; width: 240px; max-height: 280px; padding: 12px; }
.content.cc-with-map .cc-foot { margin-top: 16px; }
.content.cc-with-map .cc-foot .card { margin-bottom: 0; }

/* Command centre with embedded live map */
.cc-map-block { margin-bottom: 16px; }
.cc-map-block .map-layout { height: min(640px, 72vh); min-height: 420px; border: 1px solid var(--line, #e2e8f0); border-radius: var(--radius, 14px); overflow: hidden; background: var(--panel, #fff); }
.cc-map-block .map, .cc-map-block .map-frame { height: 100%; min-height: 0; }
.cc-map-block .fleet-list { background: var(--panel, #fff); }
.cc-map-block .map-counters { top: 10px; left: 10px; }

.content.rpt-with-map .rpt-split { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.15fr); gap: 16px; align-items: stretch; }
.content.rpt-with-map .rpt-map-col { display: flex; flex-direction: column; min-height: 0; }
.content.rpt-with-map .map-layout { display: grid; flex: 1; grid-template-columns: 1fr; height: auto; min-height: 460px; max-height: none; margin-bottom: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.content.rpt-with-map .map, .content.rpt-with-map .map-frame { height: 100%; min-height: 460px; }
.content.rpt-with-map .side-card { top: 10px; right: 10px; width: 220px; max-height: 240px; padding: 12px; }
.content.rpt-with-map .side-card.rpt-side-card.open,
.content.rpt-with-map .rpt-side-card.open { width: 260px; max-height: 360px; overflow: auto; }
.content.rpt-with-map .rpt-table { overflow: auto; max-height: calc(100vh - 180px); }

.rpt-map-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius, 12px);
  border: 1px solid var(--line, #e2e8f0); background: var(--panel, #fff);
}
.rpt-map-toolbar .rmt-label { font-size: 12px; font-weight: 700; color: var(--muted, #64748b); margin-right: 4px; }
.rpt-map-toolbar .rmt-chk { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.rpt-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.rpt-kpis .rk { background: var(--bg-soft, #f8fafc); border: 1px solid var(--line, #e2e8f0); border-radius: 8px; padding: 8px 10px; }
.rpt-kpis .rk span { display: block; font-size: 10px; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
.rpt-kpis .rk b { font-size: 14px; font-weight: 700; }
.rpt-cov-bar { height: 6px; border-radius: 99px; background: var(--line, #e2e8f0); overflow: hidden; margin: 6px 0 4px; }
.rpt-cov-fill { height: 100%; background: linear-gradient(90deg, #16a34a, #0ea5e9); border-radius: 99px; transition: width .25s ease; }
.rpt-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 6px; font-size: 10.5px; color: var(--muted, #64748b); }
.rpt-legend span { display: inline-flex; align-items: center; gap: 4px; }
.rpt-legend .lg { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.rpt-legend .lg.stopped { background: #64748b; }
.rpt-legend .lg.slow { background: #0ea5e9; }
.rpt-legend .lg.cruise { background: #16a34a; }
.rpt-legend .lg.fast { background: #dc2626; }
.rpt-pin-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 10px; font-size: 10px; color: var(--muted, #64748b); }
.rpt-pin-legend .pin-leg { display: inline-flex; align-items: center; gap: 4px; }
.rpt-pin-legend .pin-leg.covered::before { content: ''; width: 10px; height: 12px; background: #16a34a; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: inline-block; }
.rpt-pin-legend .pin-leg.uncovered::before { content: ''; width: 10px; height: 12px; background: #cbd5e1; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: inline-block; }
.rpt-pin-legend .pin-leg.scan::before { content: ''; width: 10px; height: 12px; background: #ea580c; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: inline-block; }
.rpt-pin-legend .pin-leg.route::before { content: ''; width: 16px; height: 0; border-top: 3px dashed #7c3aed; display: inline-block; }
.cov-pin-wrap { background: transparent; border: none; }
.content.rpt-with-map .map-frame { position: relative; }
.content.rpt-with-map .replay-bar { z-index: 700; }
.content.vh-page.dash-with-map .map-layout { height: auto; }
.content.vh-page.map-page .map-layout.history-map-layout {
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  height: min(68vh, 780px) !important;
  min-height: min(62vh, 720px) !important;
  max-height: none !important;
}
.content.vh-page.map-page .map-frame { position: relative; min-height: inherit; height: 100%; }
.content.vh-page.map-page .map-frame .map { position: absolute; inset: 0; min-height: 0; }
.content.vh-page.map-page .map-layout {
  grid-template-columns: 1fr;
}
.content.vh-page.map-page { padding: 12px 16px 18px; overflow: auto; min-height: calc(100vh - var(--top-h)); }
.vh-shell.vh-fullmap { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.vh-hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line, #e2e8f0);
  background: linear-gradient(135deg, rgba(15,118,110,.08), rgba(37,99,235,.06));
}
.vh-hero h2 { margin: 0 0 4px; font-size: 1.2rem; }
.vh-hero p { margin: 0; color: var(--muted, #64748b); font-size: 13px; }
.vh-kpis-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.vh-kpis-inline .vh-kpi { padding: 8px 14px; min-width: 88px; }
.vh-kpis-inline .vh-kpi b { font-size: 18px; }
.vh-filters { padding: 12px 14px; }
.vh-filter-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px;
}
.vh-filter-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted, #64748b); }
.vh-filter-grid select,
.vh-filter-grid input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #e2e8f0); font-size: 13px; width: 100%; }
.vh-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vh-filter-count { margin-left: auto; font-size: 12px; color: var(--muted, #64748b); }
.vh-map-full { width: 100%; }
.vh-map-full .vh-map-wrap { width: 100%; }
.content.vh-page .vh-map-full .map-layout.history-map-layout {
  width: 100%; min-height: min(62vh, 720px); height: min(68vh, 780px);
  border: 1px solid var(--line, #e2e8f0); border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 28px rgba(15,23,42,.08);
}
.content.vh-page .vh-map-full .map-frame {
  position: relative;
  min-height: inherit;
  height: 100%;
}
.content.vh-page .vh-map-full .map-frame .map {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: auto !important;
  width: 100%;
}
.vh-dock { padding: 0; overflow: hidden; }
.vh-dock.collapsed .vh-dock-body,
.vh-dock.collapsed .vh-dock-foot { display: none; }
.vh-dock-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e2e8f0); background: var(--bg-soft, #f8fafc);
}
.vh-dock-head h3 { margin: 0; font-size: 14px; flex: 1; }
.vh-dock-body {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
  padding: 12px; max-height: 280px; overflow: auto;
}
.vh-dock-foot { padding: 10px 14px; border-top: 1px solid var(--line, #e2e8f0); }
.vh-kpi {
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line, #e2e8f0);
  background: var(--panel, #fff); box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.vh-kpi span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #64748b); }
.vh-kpi b { font-size: 22px; line-height: 1.1; }
.vh-search { max-width: 200px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line, #e2e8f0); font-size: 12px; }
.vh-card {
  border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 10px 12px;
  background: var(--panel, #fff); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.vh-card:hover { border-color: #0f766e; box-shadow: 0 4px 14px rgba(15,118,110,.12); }
.vh-card.active { border-color: #0f766e; background: rgba(15,118,110,.06); box-shadow: 0 0 0 2px rgba(15,118,110,.15); }
.vh-card.is-offline { opacity: .72; }
.vh-card-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 8px; }
.vh-plate { font-size: 13px; display: block; }
.vh-type { font-size: 11px; color: var(--muted, #64748b); }
.vh-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.vh-status.live { background: #dcfce7; color: #166534; }
.vh-status.off { background: #f1f5f9; color: #64748b; }
.vh-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 11px; margin-bottom: 8px; }
.vh-metrics span { display: block; color: var(--muted, #64748b); font-size: 10px; }
.vh-metrics b { font-size: 12px; }
.vh-metrics .cov-good { color: #16a34a; }
.vh-metrics .cov-mid { color: #d97706; }
.vh-metrics .cov-low { color: #dc2626; }
.vh-cov-bar { height: 4px; border-radius: 99px; background: var(--line, #e2e8f0); overflow: hidden; margin-bottom: 8px; }
.vh-cov-fill { height: 100%; border-radius: 99px; background: #94a3b8; }
.vh-cov-fill.cov-good { background: linear-gradient(90deg, #16a34a, #0ea5e9); }
.vh-cov-fill.cov-mid { background: linear-gradient(90deg, #d97706, #f59e0b); }
.vh-cov-fill.cov-low { background: #dc2626; }
.vh-actions { display: flex; gap: 6px; }
.vh-map-wrap { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.vh-map-status {
  font-size: 12px; font-weight: 600; color: #0f766e; padding: 8px 12px; border-radius: 10px;
  background: rgba(15,118,110,.08); border: 1px solid rgba(15,118,110,.15);
}
.vh-map-status.err { color: #b45309; background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.vh-layerbar { margin-bottom: 0; }
.content.vh-page .vh-map-side.open { width: 300px; max-height: 460px; }
@media (max-width: 1100px) {
  .vh-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content.vh-page .vh-map-full .map-layout.history-map-layout,
  .content.vh-page .vh-map-full .map { min-height: 50vh; height: 55vh; }
}
@media (max-width: 640px) {
  .vh-filter-grid { grid-template-columns: 1fr 1fr; }
  .vh-dock-body { grid-template-columns: 1fr; }
}
.geo-preview-map { height: 420px; border-radius: 12px; border: 1px solid var(--line, #e2e8f0); }
.geo-boundary-page .rpt-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .geo-boundary-page .rpt-split { grid-template-columns: 1fr; } }
.pill.ok { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.pill.muted { background: #f1f5f9; color: #64748b; padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.side-empty { font-size: 12.5px; color: var(--muted, #64748b); line-height: 1.45; margin: 8px 0; }

/* ---------- Live map (map-page) professional redesign ---------- */
.content.map-page .map-layout {
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--top-h));
  border: 0; border-radius: 0; overflow: hidden; gap: 0;
}
.content.map-page .fleet-list {
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
  height: 100%; overflow: hidden;
}
.content.map-page .fl-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}
.content.map-page .fl-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.content.map-page .fl-head .fl-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.content.map-page .fl-tools { flex: none; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.content.map-page .map-filters { border: 0; border-radius: 0; margin: 0; background: transparent; padding: 11px 14px; }
.content.map-page .map-layerbar { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; padding: 9px 14px; background: var(--panel); }
.content.map-page .fl-scroll { flex: 1; min-height: 0; overflow: auto; }
.content.map-page .sec {
  position: sticky; top: 0; z-index: 3; background: var(--panel);
  padding: 10px 16px; font-size: 10.5px; letter-spacing: .06em;
}
.content.map-page .map-frame { background: var(--bg-soft); border-left: 0; }
.content.map-page .map-counters { top: 14px; left: 14px; border-radius: 12px; }
.content.map-page .map-legend { bottom: 14px; left: 14px; border-radius: 12px; }
.content.map-page .geo-feed { bottom: 14px; right: 14px; border-radius: 14px; }
.content.map-page .side-card { top: 14px; right: 14px; border-radius: 16px; }
@media (max-width: 900px) {
  .content.map-page .map-layout { grid-template-columns: 1fr; grid-template-rows: 42vh 1fr; }
  .content.map-page .fleet-list { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Charts ---------- */
.chart-toolbar { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chart-card canvas { height: 280px !important; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.chart-head h2 { margin: 0; font-size: 15px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.chart-canvas { position: relative; flex: 1; min-height: 280px; }
.chart-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; padding: 8px 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; }
.chart-filters .cf { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 12px; color: var(--ink); }
.chart-filters .cf.zone { min-width: 130px; }
.chart-filters .cf.ward { min-width: 120px; }
.chart-filters .cf.grp { min-width: 110px; }
.chart-tools { display: flex; gap: 6px; flex-shrink: 0; }
.chart-card .chart-tools .btn { font-size: 11px; padding: 4px 8px; }

/* ---------- Utility text ---------- */
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.tiny { color: var(--muted); font-size: 12px; padding: 0 12px 8px; }
.note { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); padding: 11px 14px; border-radius: 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.note.blue { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, var(--line)); }

/* ---------- Dashboard (advanced) ---------- */
.dash-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--ok); background: var(--ok-soft); padding: 5px 11px; border-radius: 99px; }
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.dash-updated { font-size: 12px; color: var(--muted); }
.dash-updated b { color: var(--ink-soft); font-weight: 600; }
.dash-head .btn.sm { margin-left: auto; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.qa { display: flex; align-items: center; gap: 11px; padding: 13px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px; transition: transform .15s, box-shadow .15s, border-color .15s; box-shadow: var(--shadow-sm); }
.qa svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.qa:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-main { min-width: 0; }
.dash-main .card, .dash-main .chart-card { min-width: 0; overflow: hidden; }
.dash-rail { align-self: start; min-width: 0; }
.rail-scroll { display: flex; flex-direction: column; gap: 16px; }
.rail-card { margin: 0; padding: 0 14px 8px; min-width: 0; display: flex; flex-direction: column; max-height: 300px; overflow: hidden; }
.rail-card .chart-head { padding: 12px 0 8px; }
.dash-rail .fleet-feed, .dash-rail .feed { max-height: none; flex: 1; overflow: auto; margin: 0; padding: 0; }
.fleet-feed, .feed { max-height: 320px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-row .fr-main { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.feed-row .fr-main b { font-size: 13px; display: block; }
.feed-row .fr-main small { color: var(--muted); font-size: 11px; }
.feed-row .fr-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fr-ticket { font-size: 11px; font-weight: 700; color: var(--accent-2); background: var(--info-soft); padding: 3px 7px; border-radius: 7px; white-space: nowrap; }
.fleet-row .fdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fdot.g { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.fdot.r { background: var(--danger); }
.fleet-row.on { background: color-mix(in srgb, var(--ok) 6%, transparent); border-radius: 8px; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-rail { position: static; }
  .rail-card { max-height: none; }
}
@media (max-width: 720px) {
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- Public / guest / login ---------- */
body.guest { background: linear-gradient(135deg, #07121d 0%, #0e2742 55%, #0b8a60 140%); min-height: 100vh; }
.public-nav { display: flex; gap: 18px; justify-content: center; padding: 18px; }
.public-nav a { color: #cfe3d8; text-decoration: none; font-weight: 600; }
.public-nav a:hover { color: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { display: none; padding: 56px 48px; color: #fff; background: radial-gradient(700px 500px at 20% 10%, rgba(30,199,138,.35), transparent), linear-gradient(160deg, #0e2742, #07121d); flex-direction: column; justify-content: space-between; }
.auth-hero .brand .logo { width: 48px; height: 48px; border-radius: 13px; font-size: 22px; }
.auth-hero h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
.auth-hero p { color: #b9c9d8; max-width: 380px; }
.auth-hero .feat { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.auth-hero .feat .d { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.auth-hero .feat .d svg { width: 20px; height: 20px; color: var(--accent); }
.auth-card { display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; margin: 0; background: var(--panel); padding: 34px 32px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login .sub { color: var(--muted); margin: 0 0 22px; }
.login label { color: var(--ink-soft); font-weight: 600; }
.login input, .login textarea, .login select { padding: 11px 13px; }
.login button { width: 100%; background: var(--accent); color: #fff; border: 0; padding: 13px; border-radius: 11px; margin-top: 10px; cursor: pointer; font-size: 15px; font-weight: 700; box-shadow: 0 6px 16px rgba(14,163,113,.35); transition: .15s; }
.login button:hover { background: var(--accent-600); transform: translateY(-1px); }
.login .hint { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }

.public { max-width: 720px; margin: 40px auto; padding: 28px; background: var(--panel); border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.public h1 { margin-top: 0; }

/* ---------- PWA ---------- */
.pwa { max-width: 480px; margin: 0 auto; padding: 24px; min-height: 100vh; background: var(--panel); }
.pwa h1 { font-size: 22px; }
.pwa input, .pwa select, .pwa textarea { width: 100%; margin: 8px 0; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); padding: 12px; border-radius: 11px; font-size: 15px; }
.pwa button { width: 100%; margin: 8px 0; padding: 13px; background: var(--accent); color: #fff; border: 0; border-radius: 11px; font-weight: 700; cursor: pointer; }

/* ---------- Animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.content > * { animation: rise .3s ease both; }
.content > *:nth-child(2) { animation-delay: .03s; }
.content > *:nth-child(3) { animation-delay: .06s; }
.content > *:nth-child(4) { animation-delay: .09s; }

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 1.1fr 1fr; }
  .auth-hero { display: flex; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); width: var(--w); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; align-items: center; gap: 6px; }
  .grid2, .map-layout { grid-template-columns: 1fr; }
  .map-layout { height: auto; }
  .map { min-height: 70vh; }
  .content.rpt-with-map .rpt-split { grid-template-columns: 1fr; }
  .content.rpt-with-map .rpt-table { max-height: none; }
  .content.cc-with-map .map-layout, .content.cc-with-map .map, .content.cc-with-map .map-frame { height: 280px; min-height: 280px; max-height: 280px; }
  .content.rpt-with-map .map-layout, .content.rpt-with-map .map, .content.rpt-with-map .map-frame { min-height: 300px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; display: none; }
  .scrim.show { display: block; }
}

/* ---------- Dashboard range tabs + period summary ---------- */
.dash-head { flex-direction: column; align-items: flex-start; gap: 10px; }
.dh-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; }
.range-tabs { display: inline-flex; gap: 4px; background: var(--card-2, #eef2f6); padding: 4px; border-radius: 12px; border: 1px solid var(--line, #e2e8f0); }
.range-tabs .rt { border: 0; background: transparent; color: var(--muted, #64748b); padding: 6px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.range-tabs .rt:hover { color: var(--ink); }
.range-tabs .rt.active { background: var(--accent, #0b6e4f); color: #fff; box-shadow: 0 2px 6px rgba(11,110,79,.25); }
.period-card { margin-bottom: 18px; }
.period-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; }
.period-grid > div { text-align: center; padding: 4px 2px; }
.pg-val { display: block; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.pg-lab { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 1100px) { .period-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .period-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Dashboard tabs / panes ---------- */
.tab-pane[hidden] { display: none; }
.dash-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.dash-tabs .dt { border: 1px solid var(--line, #e2e8f0); background: var(--panel, #fff); color: var(--muted, #64748b); padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.dash-tabs .dt:hover { color: var(--ink); }
.dash-tabs .dt.active { background: var(--accent, #0b6e4f); color: #fff; border-color: var(--accent, #0b6e4f); box-shadow: 0 2px 8px rgba(11,110,79,.25); }

/* ---------- Map advanced filters ---------- */
.map-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 9px 10px; background: var(--card-2, #eef2f6); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; }
.map-filters select, .map-filters input { padding: 6px 8px; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; font-size: 12.5px; background: var(--panel, #fff); color: var(--ink); min-width: 90px; }
.map-filters .mf-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.map-filters .mf-count { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ---------- Command centre filters ---------- */
.cc-filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.cc-filters select { padding: 8px 10px; border: 1px solid var(--line, #e2e8f0); border-radius: 9px; font-size: 13px; background: var(--panel, #fff); color: var(--ink); }

/* ---------- Status dots (shared) ---------- */
.vdot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: #64748b; }
.status-MOVING { background: #0b8f5b !important; }
.status-STOPPED { background: #1d5cad !important; }
.status-IDLE { background: #c97812 !important; }
.status-BREAKDOWN { background: #c62828 !important; }
.status-MAINTENANCE { background: #6d28d9 !important; }
.status-NO_GPS { background: #64748b !important; }
.status-ACTIVE { background: #0f766e !important; }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Map advanced: layer bar / counters / legend / replay ---------- */
.map-layerbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 7px 10px; background: var(--card-2, #eef2f6); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; font-size: 12.5px; }
.map-layerbar .ml-label { font-weight: 600; color: var(--muted, #64748b); }
.map-layerbar label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.map-frame { position: relative; }
.map-counters { position: absolute; top: 10px; left: 10px; z-index: 500; background: rgba(255,255,255,.92); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; padding: 8px 10px; font-size: 11.5px; box-shadow: 0 2px 10px rgba(0,0,0,.12); max-width: 240px; }
.map-counters .mc-row { font-weight: 700; margin-bottom: 5px; color: var(--ink); }
.map-counters .mc-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px 2px 0; white-space: nowrap; color: var(--muted); }
.map-legend { position: absolute; bottom: 10px; left: 10px; z-index: 500; background: rgba(255,255,255,.92); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; padding: 7px 10px; font-size: 11px; display: flex; gap: 10px; flex-wrap: wrap; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
body.dark .map-counters, body.dark .map-legend { background: rgba(17,24,39,.92); }
.attn-ring { animation: pulseRing 1.6s ease-out infinite; }
@keyframes pulseRing { 0% { opacity: .9; } 50% { opacity: .35; } 100% { opacity: .9; } }
.replay-bar { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 600; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.96); border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); width: min(560px, 92%); }
body.dark .replay-bar { background: rgba(17,24,39,.96); }
.replay-bar .rp-btn { border: none; background: var(--accent, #0b6e4f); color: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 13px; }
.replay-bar input[type=range] { flex: 1; min-width: 80px; }
.rp-time { font-size: 12px; color: var(--ink); min-width: 130px; text-align: center; }
.rp-label { font-weight: 600; color: var(--muted, #64748b); white-space: nowrap; }

/* ---------- Vehicle list items (map sidebar) ---------- */
.veh-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: var(--panel, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 9px; padding: 7px 9px; margin-bottom: 6px; cursor: pointer; color: var(--ink); font-size: 12.5px; }
.veh-item:hover { border-color: var(--accent, #0b6e4f); }
.veh-item .vno { font-weight: 600; }
.veh-item .vspd { margin-left: auto; color: var(--muted, #64748b); font-size: 11.5px; }
.veh-item.gps-off { opacity: .75; }
.veh-row { display: flex; align-items: center; gap: 8px; }
.veh-row .veh-sel { width: 15px; height: 15px; accent-color: var(--accent, #0b6e4f); cursor: pointer; flex: 0 0 auto; }
.veh-row .veh-item { flex: 1; margin-bottom: 0; }
.veh-row { margin-bottom: 6px; }

/* ---------- Geofence activity feed (map) ---------- */
.geo-feed { position: absolute; bottom: 10px; right: 10px; z-index: 550; width: 250px; max-height: 220px; overflow: auto; background: rgba(255,255,255,.96); border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 8px 10px; box-shadow: 0 4px 16px rgba(0,0,0,.18); font-size: 11.5px; }
body.dark .geo-feed { background: rgba(17,24,39,.96); }
.geo-feed[aria-hidden="true"] { display: none; }
.gf-head { font-weight: 700; margin-bottom: 6px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.gf-count { background: var(--pink, #db2777); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.gf-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px dashed var(--line, #e2e8f0); }
.gf-tag { font-weight: 700; font-size: 10px; border-radius: 6px; padding: 1px 5px; }
.gf-row.in .gf-tag { background: #16a34a; color: #fff; }
.gf-row.out .gf-tag { background: #ea580c; color: #fff; }
.gf-veh { font-weight: 600; }
.gf-gf { color: var(--muted, #64748b); }
.gf-time { margin-left: auto; color: var(--muted, #64748b); }

/* ---------- Command centre: trends + activity stream ---------- */
.trend-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.trend { background: var(--panel-2, #f1f5f9); border: 1px solid var(--line, #e2e8f0); border-radius: 10px; padding: 8px 10px; }
body.dark .trend { background: #111827; }
.trend-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.trend-top span { color: var(--muted, #64748b); font-size: 11.5px; }
.trend-top b { font-size: 15px; }
.trend .spark { width: 100%; height: 40px; display: block; }
.ev-stream { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.ev-row { display: flex; align-items: center; gap: 7px; padding: 6px 4px; border-top: 1px dashed var(--line, #e2e8f0); font-size: 12px; }
.ev-tag { font-weight: 700; font-size: 10px; border-radius: 6px; padding: 1px 6px; }
.ev-row.in .ev-tag { background: #16a34a; color: #fff; }
.ev-row.out .ev-tag { background: #ea580c; color: #fff; }
.ev-veh { font-weight: 600; }
.ev-gf { color: var(--muted, #64748b); }
.ev-time { margin-left: auto; color: var(--muted, #64748b); white-space: nowrap; }


/* ---------- Rich side panel (map) ---------- */
.side-card { min-height: 100%; padding: 14px; font-size: 13px; }
.side-empty { color: var(--muted, #64748b); padding: 20px 6px; }
.side-title { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.side-title b { font-size: 17px; }
.side-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.side-actions button { flex: 1; min-width: 84px; border: 1px solid var(--line, #e2e8f0); background: var(--card-2, #eef2f6); border-radius: 9px; padding: 8px; cursor: pointer; font-size: 12px; color: var(--ink); }
.side-actions button:hover { border-color: var(--accent, #0b6e4f); }
.spark-wrap { margin-top: 12px; }
.spark { width: 100%; background: var(--card-2, #eef2f6); border-radius: 8px; }
.spark-meta { font-size: 11px; color: var(--muted, #64748b); margin-top: 3px; }

/* ---------- Shared telemetry grid ---------- */
.tele { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 10px; }
.tcell { display: flex; flex-direction: column; font-size: 11px; color: var(--muted, #64748b); }
.tcell b { font-size: 13px; color: var(--ink); font-weight: 600; }
.side-loc { margin-top: 10px; font-size: 12px; color: var(--muted, #64748b); word-break: break-all; }

/* ---------- Command centre layout ---------- */
.cc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cc-main { min-width: 0; }
.cc-rail { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .cc-grid { grid-template-columns: 1fr; } }
.zone-card { border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--panel, #fff); }
.zc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.zc-name { font-weight: 700; font-size: 15px; }
.zc-meta { font-size: 12px; color: var(--muted, #64748b); }
.ward-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ward-card { border: 1px dashed var(--line, #e2e8f0); border-radius: 10px; padding: 10px 12px; background: var(--card-2, #eef2f6); }
.wc-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.wc-meta { font-size: 11px; color: var(--muted, #64748b); font-weight: 500; }
.veh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-veh { display: inline-flex; align-items: center; gap: 6px; background: var(--panel, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 20px; padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--ink); }
.cc-veh:hover { border-color: var(--accent, #0b6e4f); background: var(--card-2, #eef2f6); }
.cc-veh .vno { font-weight: 600; }
.cc-veh .vspd { color: var(--muted, #64748b); font-size: 11px; }
.cc-veh .ign { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: none; }
.cc-veh .ign.on { background: #0b8f5b; box-shadow: 0 0 5px #0b8f5b; }

/* ---------- Attention desk ---------- */
.attn-desk .chart-head { display: flex; align-items: center; justify-content: space-between; }
.attn-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line, #e2e8f0); }
.attn-item:last-child { border-bottom: 0; }
.attn-item .ai-main { flex: 1; min-width: 0; line-height: 1.25; }
.attn-item .ai-main b { font-size: 13px; display: block; }
.attn-item .ai-main small { color: var(--muted, #64748b); font-size: 11px; }
.ai-go { border: 1px solid var(--line, #e2e8f0); background: var(--panel, #fff); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--accent, #0b6e4f); }
.ai-go:hover { background: var(--accent, #0b6e4f); color: #fff; }
.attn-item.sev-critical { background: color-mix(in srgb, #c62828 8%, transparent); border-radius: 8px; }
.attn-item.sev-warning { background: color-mix(in srgb, #c97812 9%, transparent); border-radius: 8px; }
.veh-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel, #fff); border: 1px solid var(--line, #e2e8f0); border-radius: 20px; padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--ink); }
.veh-chip:hover { border-color: var(--accent, #0b6e4f); background: var(--card-2, #eef2f6); }
.veh-chip .vno { font-weight: 600; }
.veh-chip .vspd { color: var(--muted, #64748b); font-size: 11px; margin-left: 2px; }
.veh-chip.attn { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.18); }
.attn-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line, #e2e8f0); }
.attn-row:last-child { border-bottom: 0; }
.attn-row .ai-main { flex: 1; min-width: 0; line-height: 1.25; }
.attn-row .ar-veh { background: none; border: none; cursor: pointer; color: var(--ink); font-weight: 700; font-size: 13px; padding: 0; }
.attn-row .ar-veh:hover { color: var(--accent, #0b6e4f); text-decoration: underline; }
.attn-row small { color: var(--muted, #64748b); font-size: 11px; display: block; }
.ar-locate { border: 1px solid var(--line, #e2e8f0); background: var(--panel, #fff); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--accent, #0b6e4f); }
.ar-locate:hover { background: var(--accent, #0b6e4f); color: #fff; }
.attn-row.sev-critical { background: color-mix(in srgb, #c62828 8%, transparent); border-radius: 8px; }

/* ---------- Management module ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-i {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  text-decoration: none; font-size: 13px; font-weight: 600; transition: .15s;
}
.tab-i:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tab-i.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(14,163,113,.3); }
.mgmt-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.mgmt-table { margin-top: 0; }
.mgmt-table .sh-inp { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.stack-form { max-width: 520px; }
.stack-form h2 { margin: 0 0 14px; font-size: 17px; }
.modal {
  border: 0; border-radius: 16px; padding: 0; max-width: 480px; width: calc(100% - 32px);
  box-shadow: var(--shadow-lg); background: var(--panel);
}
.modal:has(.ucc-prop-form) { max-width: min(720px, 96vw); }
.modal::backdrop { background: rgba(15,23,42,.45); }
.modal .stack-form { max-width: none; padding: 22px 24px; margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 90; padding: 12px 18px;
  border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  max-width: min(360px, 92vw); animation: rise .25s ease;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
.tog, .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.perm-scroll { overflow: auto; max-height: calc(100vh - 320px); border: 1px solid var(--line); border-radius: var(--radius); }
.perm-matrix th, .perm-matrix td { text-align: center; font-size: 12px; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; min-width: 180px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.perm-matrix .pc input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.mgmt-ucc { max-width: 560px; }
.mgmt-ucc .ucc-logo { display: block; max-height: 64px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.btn.danger, .btn.ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }


/* ---------- Live alerts ---------- */
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line, #e2e8f0); }
.alert-row:last-child { border-bottom: 0; }
.ar-main { flex: 1; min-width: 0; line-height: 1.25; }
.ar-main b { font-size: 12.5px; display: block; }
.ar-main small { color: var(--muted, #64748b); font-size: 11px; }
.ar-ack { border: 1px solid var(--line, #e2e8f0); background: var(--panel, #fff); border-radius: 8px; padding: 4px 9px; cursor: pointer; color: var(--muted, #64748b); font-size: 13px; }
.ar-ack:hover { color: #c62828; border-color: #c62828; }

/* ---------- Coverage board ---------- */
.cov-row { padding: 8px 2px; border-bottom: 1px solid var(--line, #e2e8f0); }
.cov-row:last-child { border-bottom: 0; }
.cov-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.cov-pct { color: var(--accent, #0b6e4f); }
.cov-bar { height: 8px; background: var(--card-2, #eef2f6); border-radius: 6px; overflow: hidden; margin: 5px 0 3px; }
.cov-bar i { display: block; height: 100%; background: linear-gradient(90deg, #0b8f5b, #0b6e4f); border-radius: 6px; }
.cov-sub { font-size: 11px; color: var(--muted, #64748b); }

/* ---------- Command centre drawer ---------- */
.cc-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 60; }
.cc-scrim[hidden] { display: none !important; }
.cc-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 360px; max-width: 92vw; background: var(--panel, #fff); box-shadow: -8px 0 30px rgba(0,0,0,.18); z-index: 61; display: flex; flex-direction: column; }
.cc-drawer[hidden] { display: none; }
.dr-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line, #e2e8f0); }
.dr-head b { font-size: 15px; }
.dr-close { border: none; background: var(--card-2, #eef2f6); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 15px; color: var(--muted, #64748b); }
.dr-body { padding: 16px; overflow: auto; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dr-actions button { flex: 1; min-width: 90px; border: 1px solid var(--line, #e2e8f0); background: var(--card-2, #eef2f6); border-radius: 9px; padding: 9px; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.dr-actions button:hover { border-color: var(--accent, #0b6e4f); }
.dr-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dr-edit { margin-top: 14px; border-top: 1px solid var(--line, #e2e8f0); padding-top: 12px; }
.dr-edit h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted, #64748b); }
.dr-edit label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted, #64748b); }
.dr-edit select, .dr-edit input { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; background: var(--panel, #fff); color: var(--ink); box-sizing: border-box; }
body.dark .dr-edit select, body.dark .dr-edit input { background: #0b1220; }
.dr-msg { display: block; margin-top: 8px; font-size: 12px; color: var(--accent, #0b6e4f); min-height: 14px; }


/* ---------- Live badge pulse ---------- */
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #0b8f5b; padding: 4px 10px; border: 1px solid color-mix(in srgb, #0b8f5b 40%, transparent); border-radius: 20px; }
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #0b8f5b; animation: livePulse 1.8s infinite; }
.live-badge.on .dot { animation: livePulseFast .8s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(11,143,91,.5); } 70% { box-shadow: 0 0 0 7px rgba(11,143,91,0); } 100% { box-shadow: 0 0 0 0 rgba(11,143,91,0); } }
@keyframes livePulseFast { 0% { box-shadow: 0 0 0 0 rgba(11,143,91,.7); } 100% { box-shadow: 0 0 0 9px rgba(11,143,91,0); } }

/* ---------- Ops glass: Command centre + Live map ---------- */
:root {
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 14px 44px rgba(16, 24, 40, 0.14);
  --glass-blur: blur(18px) saturate(160%);
  --map-tint: rgba(16, 24, 40, 0.03);
}
html[data-theme="dark"] {
  --glass-bg: rgba(15, 23, 42, 0.64);
  --glass-bg-strong: rgba(15, 23, 42, 0.9);
  --glass-border: rgba(148, 163, 184, 0.22);
  --glass-shadow: 0 16px 48px rgba(0, 0, 0, 0.52);
  --map-tint: rgba(0, 0, 0, 0.12);
}
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.glass-inset {
  background: color-mix(in srgb, var(--glass-bg) 85%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 12px;
}
.glass-float {
  background: var(--glass-bg-strong) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
}

.content.ops-command-page { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - var(--top-h)); background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent), radial-gradient(900px 500px at 90% 0%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent), var(--bg); }
.content.live-map-page:not(.lm-live-page) { background: var(--bg-soft); }
.content.lm-live-page { background: transparent; }
.ops-kpi-ribbon {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
  padding: 12px 14px; border-radius: 16px;
}
.okr-item {
  padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  backdrop-filter: blur(8px);
}
.okr-item em { display: block; font-style: normal; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.okr-item b { display: block; font-size: 22px; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.okr-sub { font-size: 10px; color: var(--muted); }
.okr-item.okr-live b { color: var(--accent); }
.okr-item.okr-warn b { color: var(--warn); }
.ops-command { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.ops-stage {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--glass-border) 80%, var(--line));
  box-shadow: var(--glass-shadow); min-height: min(68vh, 820px);
  padding: 0;
}
.ops-map-shell.ops-command .map-layout { height: min(68vh, 820px); min-height: 500px; }
.ops-map-shell.ops-live .map-layout { height: calc(100vh - var(--top-h)); min-height: 640px; }
.content.map-page:not(.lm-live-page), .content.live-map-page:not(.lm-live-page) { padding: 0; }
.content.map-page:not(.lm-live-page) .ops-map-shell, .content.live-map-page:not(.lm-live-page) .ops-map-shell { height: calc(100vh - var(--top-h)); min-height: 640px; }
.content.map-page:not(.lm-live-page) .ops-map-shell .map-layout, .content.live-map-page:not(.lm-live-page) .ops-map-shell .map-layout { height: 100%; min-height: 640px; }
.content.map-page .ops-map-shell .map-frame,
.content.live-map-page .ops-map-shell .map-frame,
.content.map-page .ops-map-shell .map,
.content.live-map-page .ops-map-shell .map { height: 100%; min-height: 480px; }

.ops-map-shell .fleet-list.glass-panel {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  box-shadow: none;
  border-radius: 0;
}
.ops-map-shell .map-layout { grid-template-columns: 360px 1fr; transition: grid-template-columns .28s ease; }
.ops-map-shell.fleet-collapsed .map-layout { grid-template-columns: 0 1fr; }
.ops-map-shell.fleet-collapsed .fleet-list {
  opacity: 0; pointer-events: none; transform: translateX(-12px);
  width: 0; min-width: 0; padding: 0; border: 0; overflow: hidden;
}
.ops-map-shell .fleet-list { transition: opacity .25s ease, transform .25s ease; }
.ops-map-shell .fl-head { background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); padding: 14px 16px; }
.ops-map-shell .fl-head-actions { display: flex; align-items: center; gap: 8px; }
.fl-collapse {
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: var(--muted); width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  font-size: 14px; line-height: 1; transition: .15s;
}
.fl-collapse:hover { color: var(--accent); border-color: var(--accent); }
.ops-map-shell.fleet-collapsed .fl-collapse { transform: rotate(180deg); }
.ops-map-shell .fl-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.ops-map-shell .fk {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 10px; padding: 8px 10px;
}
.ops-map-shell .fk em { display: block; font-style: normal; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ops-map-shell .fk b { font-size: 18px; font-weight: 750; color: var(--ink); }
.ops-map-shell .fl-tools { background: transparent; }
.ops-map-shell .map-filters, .ops-map-shell .map-layerbar { margin: 8px 10px; }
.ops-map-shell .veh-item { background: color-mix(in srgb, var(--panel) 82%, transparent); border-color: color-mix(in srgb, var(--line) 75%, transparent); flex-wrap: wrap; gap: 4px 8px; }
.ops-map-shell .veh-item .vtype { font-size: 10px; color: var(--muted); background: color-mix(in srgb, var(--panel-2) 80%, transparent); padding: 1px 6px; border-radius: 6px; }
.ops-map-shell .veh-item.active, .ops-map-shell .veh-item:hover { background: color-mix(in srgb, var(--accent-soft) 65%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ops-map-shell .veh-item.needs-attn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 55%, transparent); }
.ops-map-shell .map-frame::after {
  content: ""; pointer-events: none; position: absolute; inset: 0; z-index: 400;
  background: radial-gradient(ellipse at center, transparent 55%, var(--map-tint) 100%),
    linear-gradient(180deg, rgba(15,23,42,.06) 0%, transparent 14%, transparent 86%, rgba(15,23,42,.08) 100%);
}
.ops-map-shell .leaflet-container { background: #c5d4e0; }
html[data-theme="dark"] .ops-map-shell .leaflet-container { background: #0b1220; }

/* UCC Collection admin */
.ucc-shell { display: flex; flex-direction: column; gap: 14px; }
.ucc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ucc-head h2 { margin: 0; }
.ucc-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ucc-tab {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.ucc-tab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ucc-root { min-height: 420px; }
.ucc-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ucc-charts .card { padding: 12px; }
.ucc-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ucc-actions { display: flex; flex-wrap: wrap; gap: 4px; }

.survey-cov-shell { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - var(--top-h) - 32px); }
.survey-cov-toolbar { padding: 12px 14px; }
.survey-cov-map.map-layout { flex: 1; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.survey-cov-map .map, .survey-cov-map .map-frame { height: 100%; min-height: 480px; }
.survey-qr-admin .inline label { font-size: 13px; }
.ucc-prop-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; max-width: 640px; }
.ucc-prop-form label { grid-column: span 2; }
.ucc-prop-form .ucc-coords { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ucc-prop-form .ucc-coords label { grid-column: span 1; }
.ucc-prop-form textarea { width: 100%; min-height: 64px; resize: vertical; }
.ucc-prop-form #addSurveyCode { background: var(--bg-soft, #f8fafc); color: var(--muted, #64748b); }
.modal .ucc-prop-form { max-width: none; }
@media (max-width: 640px) {
  .ucc-prop-form, .ucc-prop-form .ucc-coords { grid-template-columns: 1fr; }
  .ucc-prop-form label, .ucc-prop-form .ucc-coords label { grid-column: span 1; }
}
.receipt-card { max-width: 420px; margin: 0 auto; padding: 20px; background: #fff; border-radius: 12px; }
.ops-map-shell .side-card.glass-float {
  right: 14px; top: 14px; width: 300px; border-radius: 16px;
  transform: translateX(110%); opacity: 0; transition: transform .28s ease, opacity .28s ease;
}
.ops-map-shell .side-card.glass-float.open { transform: none; opacity: 1; }
.ops-map-shell .side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.ops-map-shell .side-head h3 { margin: 0; font-size: 16px; }
.ops-map-shell .side-x { border: 0; background: color-mix(in srgb, var(--panel-2) 80%, transparent); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.ops-map-shell .tele-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.ops-map-shell .tele-k { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.ops-map-shell .tele-v { font-size: 13px; font-weight: 650; }
.ops-map-shell .side-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ops-map-shell .side-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ops-map-shell .side-spark, .ops-map-shell .side-hist { margin-top: 12px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.ops-map-shell .ss-label, .ops-map-shell .sh-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.ops-map-shell .sh-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; color: var(--muted); }
.ops-map-shell .sh-stats b { color: var(--ink); }

.ops-deck { border-radius: 18px; padding: 16px 18px 18px; }
.ops-deck-title { margin: 0; font-size: 17px; font-weight: 750; }
.ops-deck-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.ops-deck-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--panel-2) 80%, transparent); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.odt {
  border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 650; cursor: pointer; transition: .15s;
}
.odt:hover { color: var(--ink); }
.odt.on { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(14,163,113,.28); }
.ops-deck-pane { animation: rise .25s ease; }
.ops-deck-pane[hidden] { display: none !important; }
.ops-intel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card-lite { padding: 12px 14px; border-radius: 12px; }
.cc-filters.glass-inset { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; }
.cc-filters select { min-width: 130px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); }

#ccOps .zone-card {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
#ccOps .ward-card, #ccOps .ward-block {
  background: color-mix(in srgb, var(--panel-2) 75%, transparent);
  border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 10px; padding: 10px 12px; margin-top: 8px;
}
#ccOps .cc-veh, #ccOps .veh-chip {
  background: var(--glass-bg-strong); backdrop-filter: var(--glass-blur);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 999px; padding: 6px 10px; cursor: pointer;
}
#ccOps .cc-veh:hover, #ccOps .veh-chip:hover { border-color: var(--accent); }

.cc-drawer {
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.cc-scrim {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(15,23,42,.28) !important;
}
.cc-scrim[hidden] { display: none !important; }

/* Command centre: sharp panels (no glass blur) */
.content.ops-command-page .glass-panel,
.content.ops-command-page .glass-float,
.content.ops-command-page .glass-inset,
.content.ops-command-page .ops-kpi-ribbon .okr-item,
.content.ops-command-page .fleet-list,
.content.ops-command-page .ops-deck,
.content.ops-command-page .side-card,
.content.ops-command-page .map-legend,
.content.ops-command-page .map-counters,
.content.ops-command-page .replay-bar,
.content.ops-command-page #ccOps .cc-veh,
.content.ops-command-page #ccOps .veh-chip {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}
.content.ops-command-page .glass-panel,
.content.ops-command-page .ops-deck,
.content.ops-command-page .fleet-list {
  background: var(--panel) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow-sm) !important;
}
.content.ops-command-page .glass-inset,
.content.ops-command-page .glass-float {
  background: var(--panel) !important;
  border-color: var(--line) !important;
}
.content.ops-command-page .ops-map-shell .map-frame::after {
  display: none !important;
}

/* ---------- Realistic fleet map markers (no circle disc) ---------- */
.leaflet-div-icon.fleet-vm-wrap {
  background: transparent !important;
  border: 0 !important;
}
.vm-marker {
  position: relative;
  width: 34px;
  height: 52px;
  text-align: center;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .32));
}
.vm-marker.is-dim { opacity: .72; transform: scale(.88); }
.vm-marker.is-moving .vm-glyph {
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--vm-accent) 50%, transparent));
}
.vm-marker.needs-attn .vm-glyph {
  filter: drop-shadow(0 0 3px #f59e0b) drop-shadow(0 0 6px rgba(245, 158, 11, .45));
}
.vm-rot {
  width: 34px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  transition: transform .35s ease;
  transform-origin: 50% 55%;
}
.vm-glyph {
  width: 26px;
  height: 39px;
  display: block;
  overflow: visible;
}
.vm-plate {
  display: inline-block;
  margin-top: -1px;
  max-width: 56px;
  padding: 1px 4px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  color: #fff;
  background: var(--vm-label, #0f172a);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
}
.vm-sync-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
}
@keyframes vmPulse {
  0% { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--vm-accent) 40%, transparent)); }
  50% { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--vm-accent) 70%, transparent)); }
  100% { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--vm-accent) 40%, transparent)); }
}
.vm-marker.is-moving { animation: none; }
.vm-marker.is-moving .vm-rot { animation: vmPulse 2.2s ease-in-out infinite; }
.ops-map-shell .side-type { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.map-counters.glass-float { border-radius: 14px; padding: 10px 12px; }
.map-legend.glass-float { border-radius: 14px; padding: 8px 12px; font-size: 11px; }
.geo-feed.glass-float { border-radius: 14px; }
.replay-bar.glass-float { border-radius: 14px; backdrop-filter: var(--glass-blur); }

@media (max-width: 1100px) {
  .ops-map-shell .map-layout { grid-template-columns: 300px 1fr; }
  .ops-intel-grid { grid-template-columns: 1fr; }
  .ops-stage, .ops-map-shell.ops-command .map-layout { min-height: 460px; }
}
@media (max-width: 900px) {
  .ops-map-shell .map-layout { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .ops-map-shell .fleet-list { max-height: 38vh; }
  .ops-map-shell .side-card.glass-float { width: min(92vw, 300px); }
}
