/* ==========================================================================
   Movra Admin — control room
   Midnight sidebar, quiet surfaces, mint for "live" and good news, amber for attention.
   ========================================================================== */
.admin {
  --a-bg: #F2F4F8; --a-surface: #FFFFFF; --a-surface-2: #F8FAFC; --a-surface-3: #EEF1F6;
  --a-text: #0F172A; --a-text-2: #475467; --a-muted: #7A8599; --a-faint: #A7B0C0;
  --a-line: #E5E9F0; --a-line-2: #D5DBE5;
  --a-hover: #F4F6FA; --a-ring: 0 0 0 4px rgba(var(--ink-rgb), .07);
  --a-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --a-shadow-lg: 0 20px 50px -18px rgba(15, 23, 42, .28);
  --side: 264px; --top: 64px;
  background: var(--a-bg); color: var(--a-text); font-size: 14px;
}
.admin[data-theme="dark"] {
  --a-bg: #070B14; --a-surface: #0E1422; --a-surface-2: #121A2B; --a-surface-3: #182236;
  --a-text: #E9EDF5; --a-text-2: #B4BDCC; --a-muted: #8792A6; --a-faint: #5E6A80;
  --a-line: #1C263A; --a-line-2: #29354D; --a-hover: #131C2E; --a-ring: 0 0 0 4px rgba(255,255,255,.06);
  --a-shadow: none; --a-shadow-lg: 0 20px 50px -18px rgba(0,0,0,.8);
  --surface: #0E1422; --surface-2: #121A2B; --surface-3: #182236; --line: #1C263A; --line-2: #29354D; --text: #E9EDF5; --text-2: #B4BDCC; --muted: #8792A6;
  color-scheme: dark;
}
.admin[data-theme="dark"] h1, .admin[data-theme="dark"] h2, .admin[data-theme="dark"] h3, .admin[data-theme="dark"] h4 { color: var(--a-text); }
.admin[data-theme="dark"] .badge-green, .admin[data-theme="dark"] .badge-completed, .admin[data-theme="dark"] .badge-approved, .admin[data-theme="dark"] .badge-paid, .admin[data-theme="dark"] .badge-resolved, .admin[data-theme="dark"] .badge-available, .admin[data-theme="dark"] .badge-active { background: rgba(18, 184, 134, .16); color: #5EE3B6; }
.admin[data-theme="dark"] .badge-red, .admin[data-theme="dark"] .badge-cancelled, .admin[data-theme="dark"] .badge-no_driver, .admin[data-theme="dark"] .badge-rejected, .admin[data-theme="dark"] .badge-suspended, .admin[data-theme="dark"] .badge-blocked, .admin[data-theme="dark"] .badge-urgent { background: rgba(239, 68, 68, .16); color: #FF9C9C; }
.admin[data-theme="dark"] .badge-amber, .admin[data-theme="dark"] .badge-searching, .admin[data-theme="dark"] .badge-pending, .admin[data-theme="dark"] .badge-scheduled, .admin[data-theme="dark"] .badge-high { background: rgba(245, 159, 0, .16); color: #FFC766; }
.admin[data-theme="dark"] .badge-blue, .admin[data-theme="dark"] .badge-in_progress, .admin[data-theme="dark"] .badge-on_trip, .admin[data-theme="dark"] .badge-open, .admin[data-theme="dark"] .badge-acknowledged { background: rgba(62, 123, 250, .18); color: #9BBBFF; }
.admin[data-theme="dark"] .badge-teal, .admin[data-theme="dark"] .badge-accepted, .admin[data-theme="dark"] .badge-arrived { background: rgba(18, 184, 134, .14); color: #63E6BE; }
.admin[data-theme="dark"] .badge, .admin[data-theme="dark"] .badge-offline, .admin[data-theme="dark"] .badge-closed { background: var(--a-surface-3); color: var(--a-text-2); }
.admin[data-theme="dark"] .btn-ink { background: #E9EDF5; color: #0B1324; }
.admin[data-theme="dark"] .btn-line { background: var(--a-surface); color: var(--a-text); box-shadow: inset 0 0 0 1.5px var(--a-line-2); }
.admin[data-theme="dark"] .btn-soft { background: var(--a-surface-3); color: var(--a-text); }
.admin[data-theme="dark"] .input, .admin[data-theme="dark"] .select, .admin[data-theme="dark"] .textarea { background: var(--a-surface-2); border-color: var(--a-line-2); color: var(--a-text); }
.admin[data-theme="dark"] .leaflet-container { background: #111827; }

/* ---------- shell ---------- */
.a-shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.a-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: rgba(255,255,255,.72); z-index: 50; }
.a-brand { display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.a-brand small { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--brand); background: rgba(var(--brand-rgb), .12); padding: 3px 7px; border-radius: 6px; }
.a-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.a-nav-group { margin-top: 16px; }
.a-nav-group:first-child { margin-top: 4px; }
.a-nav-label { padding: 0 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.32); }
.a-nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: rgba(255,255,255,.68); transition: background .15s, color .15s; }
.a-nav a .ic { width: 19px; height: 19px; color: rgba(255,255,255,.45); transition: color .15s; }
.a-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.a-nav a:hover .ic { color: rgba(255,255,255,.8); }
.a-nav a.is-active { background: rgba(255,255,255,.08); color: #fff; }
.a-nav a.is-active .ic { color: var(--brand); }
.a-nav a.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.a-nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.1); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.a-nav .count.is-hot { background: var(--red); }
.a-nav .count.is-warn { background: var(--accent); color: var(--ink); }
.a-nav .count.is-live { background: rgba(var(--brand-rgb), .18); color: var(--brand); }
.a-side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.a-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.a-user:hover { background: rgba(255,255,255,.05); }
.a-user img { width: 36px; height: 36px; border-radius: 10px; }
.a-user b { display: block; color: #fff; font-size: 13.5px; }
.a-user small { font-size: 12px; color: rgba(255,255,255,.45); }

.a-main { min-width: 0; display: flex; flex-direction: column; }
.a-top { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--a-bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--a-line); }
.a-top .a-burger { display: none; }
.a-search { display: flex; align-items: center; gap: 10px; width: min(440px, 100%); height: 40px; padding: 0 12px; border-radius: 12px; background: var(--a-surface); border: 1px solid var(--a-line); color: var(--a-muted); cursor: text; box-shadow: var(--a-shadow); text-align: left; }
.a-search span { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-search .kbd { flex: 0 0 auto; }
.a-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.a-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--a-surface); border: 1px solid var(--a-line); font-weight: 700; font-size: 13px; color: var(--a-text-2); white-space: nowrap; }
.a-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .22); animation: blink 1.6s infinite; }
.a-pill b { color: var(--a-text); }
@keyframes blink { 50% { box-shadow: 0 0 0 6px rgba(var(--brand-rgb), .05); } }
.a-icon-btn { position: relative; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--a-text-2); background: var(--a-surface); border: 1px solid var(--a-line); }
.a-icon-btn:hover { color: var(--a-text); border-color: var(--a-line-2); }
.a-icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--a-surface); }

.a-content { padding: 24px; max-width: 1560px; width: 100%; margin: 0 auto; }
.a-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.a-head h1 { font-size: 26px; margin: 0; color: var(--a-text); }
.a-head p { margin: 4px 0 0; color: var(--a-muted); font-weight: 500; }
.a-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--a-muted); margin-bottom: 6px; }
.a-crumbs a:hover { color: var(--a-text); }
.a-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards & grid ---------- */
.a-card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 16px; box-shadow: var(--a-shadow); min-width: 0; }
.a-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.a-card-head h3 { font-size: 15px; margin: 0; color: var(--a-text); }
.a-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--a-muted); }
.a-card-body { padding: 16px 18px 18px; }
.a-card-foot { padding: 12px 18px; border-top: 1px solid var(--a-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a-grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }
.mt { margin-top: 16px; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--a-surface-3); color: var(--a-text); }
.kpi-icon.is-brand { background: rgba(var(--brand-rgb), .12); color: var(--brand-700); }
.kpi-icon.is-accent { background: rgba(var(--accent-rgb), .16); color: var(--accent-700); }
.kpi-icon.is-blue { background: rgba(62, 123, 250, .12); color: #2F5FD0; }
.kpi-icon.is-violet { background: rgba(123, 97, 255, .12); color: #5B3FD9; }
.kpi-icon.is-red { background: rgba(239, 68, 68, .12); color: #C22B2B; }
.admin[data-theme="dark"] .kpi-icon.is-brand { color: #5EE3B6; } .admin[data-theme="dark"] .kpi-icon.is-blue { color: #9BBBFF; } .admin[data-theme="dark"] .kpi-icon.is-violet { color: #B7A8FF; } .admin[data-theme="dark"] .kpi-icon.is-accent { color: #FFC766; }
.kpi-label { font-size: 13px; font-weight: 700; color: var(--a-muted); }
.kpi-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--a-text); margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--a-muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--green-700); background: rgba(18, 184, 134, .12); }
.delta.down { color: var(--red-700); background: rgba(239, 68, 68, .1); }
.admin[data-theme="dark"] .delta.up { color: #5EE3B6; } .admin[data-theme="dark"] .delta.down { color: #FF9C9C; }
.kpi-spark { position: absolute; right: 12px; bottom: 12px; width: 96px; height: 34px; opacity: .9; }

/* ---------- tables ---------- */
.a-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--a-line); }
.a-toolbar .input, .a-toolbar .select { height: 38px; font-size: 13.5px; border-radius: 10px; width: auto; }
.a-toolbar .input-group { flex: 1; min-width: 200px; max-width: 340px; }
.a-toolbar .input-group .input { width: 100%; padding-left: 38px; }
.a-toolbar .input-group > .ic { left: 12px; }
.a-tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--a-line); overflow-x: auto; }
.a-tabs a { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; font-weight: 700; font-size: 13.5px; color: var(--a-muted); white-space: nowrap; }
.a-tabs a:hover { color: var(--a-text); }
.a-tabs a.is-active { color: var(--a-text); }
.a-tabs a.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--ink); }
.admin[data-theme="dark"] .a-tabs a.is-active::after { background: var(--brand); }
.a-tabs .n { font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--a-surface-3); color: var(--a-text-2); }
.table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.a-table th { position: sticky; top: 0; text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--a-muted); background: var(--a-surface-2); padding: 10px 14px; border-bottom: 1px solid var(--a-line); white-space: nowrap; }
.a-table th a { display: inline-flex; align-items: center; gap: 4px; }
.a-table td { padding: 12px 14px; border-bottom: 1px solid var(--a-line); vertical-align: middle; color: var(--a-text-2); }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tbody tr { transition: background .12s; }
.a-table tbody tr:hover td { background: var(--a-hover); }
.a-table tr[data-href] { cursor: pointer; }
.a-table .t-strong { font-weight: 700; color: var(--a-text); }
.a-table .t-sub { display: block; font-size: 12px; color: var(--a-muted); font-weight: 500; margin-top: 1px; }
.a-table .t-right { text-align: right; }
.a-table .t-num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--a-text); white-space: nowrap; }
.a-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.a-person img { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; background: var(--a-surface-3); }
.a-person div { min-width: 0; }
.a-person b { display: block; color: var(--a-text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-person small { display: block; color: var(--a-muted); font-size: 12px; white-space: nowrap; }
.a-route { display: flex; flex-direction: column; gap: 2px; min-width: 180px; max-width: 280px; }
.a-route span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--a-text); font-weight: 600; }
.a-route span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.a-route span + span::before { border-radius: 2px; background: var(--a-text); }
.a-empty { padding: 48px 20px; text-align: center; color: var(--a-muted); }
.a-empty .ic { margin: 0 auto 10px; color: var(--a-faint); }
.a-empty h3 { font-size: 16px; color: var(--a-text); margin-bottom: 4px; }
.a-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--a-line); font-size: 13px; color: var(--a-muted); font-weight: 600; flex-wrap: wrap; }
.a-pager nav { display: flex; gap: 4px; }
.a-pager a, .a-pager span.p { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--a-text-2); border: 1px solid var(--a-line); background: var(--a-surface); }
.a-pager a:hover { border-color: var(--a-line-2); color: var(--a-text); }
.a-pager .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.a-pager .is-disabled { opacity: .4; }

.vehicle-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--a-text); white-space: nowrap; }
.vehicle-chip i { width: 8px; height: 8px; border-radius: 3px; }

/* ---------- forms ---------- */
.a-form { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px 18px; }
.a-form .field { grid-column: span 12; }
.a-form .w-6 { grid-column: span 6; } .a-form .w-4 { grid-column: span 4; } .a-form .w-3 { grid-column: span 3; } .a-form .w-8 { grid-column: span 8; }
.a-form .field > label { font-size: 13px; color: var(--a-text-2); }
.a-form .input, .a-form .select { height: 42px; font-size: 14px; }
.a-section { padding: 20px; }
.a-section + .a-section { border-top: 1px solid var(--a-line); }
.a-section-head { margin-bottom: 14px; }
.a-section-head h3 { font-size: 15px; margin: 0; color: var(--a-text); }
.a-section-head p { margin: 2px 0 0; font-size: 13px; color: var(--a-muted); }
.a-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--a-line); border-radius: 12px; background: var(--a-surface-2); }
.a-switch-row b { display: block; color: var(--a-text); font-size: 14px; }
.a-switch-row small { color: var(--a-muted); font-size: 12.5px; }
.color-input { display: flex; align-items: center; gap: 10px; }
.color-input input[type=color] { width: 46px; height: 42px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 3px; background: var(--surface); cursor: pointer; }
.a-sticky-foot { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: color-mix(in srgb, var(--a-surface) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--a-line); border-radius: 0 0 16px 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--a-text-2); background: var(--a-surface); }
.check-card:has(input:checked) { border-color: var(--brand); background: rgba(var(--brand-rgb), .06); color: var(--a-text); }
.check-card input { accent-color: var(--brand-700); width: 16px; height: 16px; }

/* ---------- detail pages ---------- */
.a-dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 13.5px; }
.a-dl dt { color: var(--a-muted); font-weight: 600; }
.a-dl dd { margin: 0; color: var(--a-text); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.a-profile { display: flex; align-items: center; gap: 16px; }
.a-profile img { width: 72px; height: 72px; border-radius: 20px; }
.a-profile h2 { margin: 0; font-size: 22px; color: var(--a-text); }
.a-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--a-line); }
.a-stat-row > div { padding: 14px 18px; }
.a-stat-row > div + div { border-left: 1px solid var(--a-line); }
.a-stat-row small { display: block; font-size: 12px; font-weight: 700; color: var(--a-muted); }
.a-stat-row b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--a-text); margin-top: 2px; }
.a-timeline { position: relative; padding-left: 22px; }
.a-timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--a-line); }
.a-tl { position: relative; padding-bottom: 14px; }
.a-tl:last-child { padding-bottom: 0; }
.a-tl::before { content: ""; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--a-surface); border: 2.5px solid var(--brand); }
.a-tl.is-admin::before { border-color: var(--blue); }
.a-tl.is-red::before { border-color: var(--red); }
.a-tl b { display: block; font-size: 13.5px; color: var(--a-text); font-weight: 600; }
.a-tl small { font-size: 12px; color: var(--a-muted); }
.map-box { height: 320px; border-radius: 16px 16px 0 0; overflow: hidden; }
.a-card > .map-box:only-child { border-radius: 16px; }

/* ---------- list rows in cards ---------- */
.a-rows > * { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--a-line); }
.a-rows > *:first-child { border-top: 0; }
.a-rows > a:hover { background: var(--a-hover); }
.a-rows .grow b { display: block; color: var(--a-text); font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-rows .grow small { color: var(--a-muted); font-size: 12px; }
.bar-line { height: 8px; border-radius: 99px; background: var(--a-surface-3); overflow: hidden; }
.bar-line i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }

.alert-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--a-line); background: var(--a-surface); }
.alert-card + .alert-card { margin-top: 8px; }
.alert-card.is-red { border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .05); }
.alert-card.is-amber { border-color: rgba(245, 159, 0, .35); background: rgba(245, 159, 0, .06); }
.alert-card b { display: block; color: var(--a-text); font-size: 13.5px; }
.alert-card small { color: var(--a-muted); font-size: 12.5px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--a-line); stroke-dasharray: 3 4; }
.chart .axis text { fill: var(--a-muted); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 8px 10px; border-radius: 10px; white-space: nowrap; box-shadow: var(--a-shadow-lg); transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; }
.chart-tip b { color: var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; font-weight: 700; color: var(--a-text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; font-size: 10.5px; color: var(--a-muted); font-weight: 700; }
.heat span { aspect-ratio: 1; border-radius: 4px; background: var(--a-surface-3); }
.heat em { font-style: normal; display: flex; align-items: center; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }

/* ---------- dropdown / modal / drawer ---------- */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 14px; box-shadow: var(--a-shadow-lg); padding: 6px; z-index: 80; display: none; }
.dd.is-open .dd-menu { display: block; animation: ddIn .15s var(--ease); }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--a-text-2); text-align: left; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--a-hover); color: var(--a-text); }
.dd-menu hr { border: 0; border-top: 1px solid var(--a-line); margin: 6px 0; }
.a-modal { position: fixed; inset: 0; z-index: 120; background: rgba(5, 9, 18, .5); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fadeIn .15s; }
.a-modal[hidden] { display: none; }
.a-modal-card { width: 100%; max-width: 520px; background: var(--a-surface); border-radius: 18px; box-shadow: var(--a-shadow-lg); border: 1px solid var(--a-line); max-height: 84vh; overflow-y: auto; animation: modalIn .2s var(--ease); }
.a-modal-card.is-wide { max-width: 760px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fadeIn { from { opacity: 0; } }
.a-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--a-line); }
.a-modal-head h3 { margin: 0; font-size: 16px; color: var(--a-text); }
.a-modal-body { padding: 18px; }
.a-modal-foot { padding: 14px 18px; border-top: 1px solid var(--a-line); display: flex; justify-content: flex-end; gap: 8px; }
.palette .input { height: 50px; border: 0; border-bottom: 1px solid var(--a-line); border-radius: 0; font-size: 16px; padding-left: 48px; background: transparent; box-shadow: none !important; }
.palette-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--a-text-2); }
.palette-results a.is-active, .palette-results a:hover { background: var(--a-hover); color: var(--a-text); }
.palette-results small { color: var(--a-muted); }
.palette-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a-faint); }

/* ---------- live map page ---------- */
.live-wrap { position: relative; height: calc(100vh - var(--top)); display: grid; grid-template-columns: 1fr 380px; }
.live-map { position: relative; height: 100%; }
.live-map .mv-vehicle { width: 32px; height: 32px; margin: 6px; }
.live-map .mv-vehicle svg { width: 32px; height: 32px; }
.live-panel { border-left: 1px solid var(--a-line); background: var(--a-surface); display: flex; flex-direction: column; min-height: 0; }
.live-stats { position: absolute; z-index: 500; top: 16px; left: 16px; right: 16px; display: flex; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.live-stat { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--a-surface); border: 1px solid var(--a-line); box-shadow: var(--a-shadow-lg); }
.live-stat b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--a-text); line-height: 1; }
.live-stat small { font-size: 11.5px; font-weight: 700; color: var(--a-muted); }
.live-stat i { width: 10px; height: 10px; border-radius: 50%; }
.live-filters { position: absolute; z-index: 500; left: 16px; bottom: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.live-filters .chip { box-shadow: var(--a-shadow-lg); background: var(--a-surface); color: var(--a-text-2); }
.live-filters .chip.is-active { background: var(--ink); color: #fff; }
.admin[data-theme="dark"] .live-filters .chip.is-active { background: var(--brand); color: var(--ink); }
.live-list { flex: 1; overflow-y: auto; }
.live-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--a-line); cursor: pointer; }
.live-item:hover, .live-item.is-active { background: var(--a-hover); }
.live-item .grow b { display: block; color: var(--a-text); font-size: 13.5px; }
.live-item .grow small { display: block; color: var(--a-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mv-driver-dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.live-drawer { position: absolute; z-index: 600; top: 16px; right: 16px; bottom: 16px; width: 360px; background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 18px; box-shadow: var(--a-shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: drawerIn .25s var(--ease); }
@keyframes drawerIn { from { opacity: 0; transform: translateX(20px); } }
.sos-banner { position: absolute; z-index: 700; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--red); color: #fff; font-weight: 700; box-shadow: 0 16px 40px -10px rgba(239, 68, 68, .7); animation: sosPulse 1.6s infinite; }
@keyframes sosPulse { 50% { box-shadow: 0 16px 40px -10px rgba(239, 68, 68, .2); } }

/* ---------- auth ---------- */
.a-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; background: var(--a-surface); }
.a-auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); }
.a-auth-art { position: relative; background: var(--ink); overflow: hidden; }
.a-auth-art svg.city-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.a-auth-art .quote { position: absolute; left: 48px; right: 48px; bottom: 48px; color: #fff; }
.a-auth-art .quote h2 { color: #fff; font-size: 34px; max-width: 520px; }
.a-auth-art .quote p { color: rgba(255,255,255,.7); max-width: 460px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g-side { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .live-wrap { grid-template-columns: 1fr; } .live-panel { display: none; } }
@media (max-width: 960px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); transform: translateX(-100%); transition: transform .28s var(--ease); }
  .a-shell.is-nav-open .a-side { transform: none; box-shadow: var(--a-shadow-lg); }
  .a-shell.is-nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(5, 9, 18, .45); z-index: 45; }
  .a-top .a-burger { display: grid; }
  .a-top { padding: 0 14px; }
  .a-search span, .a-search .kbd { display: none; }
  .a-search { width: 40px; padding: 0; justify-content: center; }
  .a-pill.hide-sm { display: none; }
  .a-content { padding: 16px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .a-form .w-6, .a-form .w-4, .a-form .w-3, .a-form .w-8 { grid-column: span 12; }
  .a-auth { grid-template-columns: 1fr; }
  .a-auth-art { display: none; }
  .a-stat-row { grid-template-columns: repeat(2, 1fr); }
  .live-drawer { left: 16px; width: auto; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr; } .a-dl { grid-template-columns: 1fr; gap: 2px 0; } .a-dl dd { margin-bottom: 8px; } }
