:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #111827; --text-muted: #6b7280; --border: #e5e7eb;
  --on: #16a34a; --off: #dc2626; --offline: #4b5563; --warn-bg: #fef3c7; --warn: #92400e;
  /* Sherbet Taxi Media brand */
  --s-red: #e13926; --s-blue: #395aa9; --s-green: #0e4f33; --s-pink: #f5bbc0; --s-ink: #0b0b0b;
  --brand: var(--s-red);
  --stripe: repeating-linear-gradient(115deg, var(--s-red) 0 46px, var(--s-blue) 46px 92px, var(--s-green) 92px 138px, var(--s-pink) 138px 184px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --surface: #111827; --text: #f3f4f6; --text-muted: #9ca3af; --border: #1f2937; --warn-bg: #422006; --warn: #fcd34d; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
body { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; display: block; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
.topbar { position: relative; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--stripe); }
.powered { margin: 4px 0 0; text-align: center; font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); }
.legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.moving { background: var(--on); } .dot.idle { background: var(--off); } .dot.offline { background: var(--offline); }
.who { margin-left: auto; white-space: nowrap; color: var(--text-muted); }
.banner { padding: 8px 16px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
#view-map { flex: 1; min-height: 0; display: flex; }
#map { flex: 1; min-height: 0; }
.cab-pin { width: 32px; height: 32px; }
.cab-pin svg { width: 32px; height: 32px; filter: drop-shadow(0 0 1px rgba(0,0,0,.9)) drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.cab-offline { opacity: .6; }
.leaflet-marker-icon.cab-pin-wrap { transition: transform 1.4s cubic-bezier(.4,0,.2,1) !important; }
.link-btn { background: none; border: 0; color: var(--text-muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0 0 0 8px; }
.login { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(11, 15, 23, .55); backdrop-filter: blur(3px); }
.login[hidden] { display: none; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-card .brand { justify-content: center; margin: 4px 0 6px; }
.login-card .brand img { height: 44px; }
.login-card { position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--stripe); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.login-card input { font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.login-card input:focus { outline: 2px solid var(--on); outline-offset: 1px; }
.login-card button { font: inherit; font-weight: 700; padding: 11px; border: 0; border-radius: 8px; background: var(--s-red); color: #fff; cursor: pointer; }
.login-card button:hover:not(:disabled) { background: #f5b800; }
.login-card button:disabled { opacity: .6; cursor: default; }
.login-error { color: #dc2626; font-weight: 600; font-size: 13px; }
.zooming .cab-pin-wrap { transition: none !important; }
.cab-cluster div { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--s-ink); color: var(--s-pink); font-weight: 800; font-size: 13px; border: 3px solid var(--s-pink); box-shadow: 0 0 0 3px rgba(17,24,39,.35), 0 2px 6px rgba(0,0,0,.4); }
.leaflet-cluster-anim .cab-pin-wrap { transition: transform .3s ease-out, opacity .3s ease-in !important; }

/* ── Phase 2: nav, pages, cards, tables ───────────────────────────────── */
.view[hidden] { display: none !important; }
.nav { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.nav button { font: inherit; font-weight: 600; border: 0; background: none; color: var(--text-muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.nav button.active { background: var(--s-ink); color: var(--s-pink); }
.map-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.map-tools select, .page input, .page select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.page { flex: 1; min-height: 0; overflow: auto; }
.page-inner { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.page h1 { margin: 0; font-size: 24px; }
.page h2 { margin: 0 0 12px; font-size: 17px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form input:not([type=file]) { flex: 1 1 200px; }
.btn { font: inherit; font-weight: 700; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.btn.primary { background: var(--s-red); color: #fff; border-color: var(--s-red); }
.btn.danger { color: #dc2626; }
.btn:disabled { opacity: .6; cursor: default; }
.link-btn.danger { color: #dc2626; }
.link-btn.back { align-self: flex-start; padding: 0; }
.form-msg { font-weight: 600; font-size: 13px; color: var(--text-muted); }
.form-msg.error, .error { color: #dc2626; }
.form-msg.ok { color: #16a34a; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.campaign-card { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.campaign-card:hover { border-color: var(--s-red); }
.campaign-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--bg); }
.campaign-title { font-weight: 700; }
.detail-head { display: flex; gap: 20px; flex-wrap: wrap; }
.detail-img { width: 320px; max-width: 100%; border-radius: 10px; background: var(--bg); display: block; }
.detail-meta { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--text-muted); font-size: 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table td.actions { white-space: nowrap; text-align: right; }
.proof { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; vertical-align: middle; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; text-transform: capitalize; background: var(--bg); color: var(--text-muted); }
.pill.live { background: #dcfce7; color: #166534; }
.pill.scheduled { background: #dbeafe; color: #1e40af; }
.assign-grid { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
@media (max-width: 720px) { .assign-grid { grid-template-columns: 1fr; } .detail-img { width: 100%; } }
.assign-grid #cab-search { width: 100%; }
.cab-picker { margin: 8px 0; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.cab-picker label { display: flex; align-items: center; gap: 6px; padding: 3px 4px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cab-picker label.already { opacity: .55; }
.assign-dates { display: flex; flex-direction: column; gap: 10px; }
.assign-dates label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.check-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) {
  .pill.live { background: #14532d; color: #bbf7d0; }
  .pill.scheduled { background: #1e3a8a; color: #bfdbfe; }
}
.nav[hidden], .map-tools[hidden] { display: none !important; }
.pop { display: flex; flex-direction: column; gap: 4px; }
.pop-reg { font-size: 15px; letter-spacing: .02em; }
.pop-state { color: #374151; }
.pop-ad img { display: block; width: 100%; max-height: 150px; object-fit: contain; border-radius: 6px; background: #f3f4f6; margin-top: 4px; }
.pop-title { font-weight: 700; }
.pop-meta { font-size: 12px; color: #4b5563; }
.pop-meta.muted { color: #9ca3af; }
.camp-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.camp-edit[hidden] { display: none; }
.camp-edit .btn { align-self: flex-start; padding: 6px 12px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.zone-tip { font-weight: 700; }
.zone-legend { background: rgba(255,255,255,.95); color: #111827; border-radius: 10px; padding: 8px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 13px; min-width: 170px; }
.zone-legend[hidden] { display: none; }
.zl-head { font-weight: 800; margin-bottom: 4px; }
.zl-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.zl-row i { width: 14px; height: 14px; border-radius: 3px; border: 2.5px solid; flex: none; }
.zl-row i.zl-out { border-color: #9ca3af; border-style: dashed; }
.zl-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.zl-row { width: 100%; font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; padding: 3px 4px; cursor: pointer; text-align: left; }
.zl-row:hover { background: #f3f4f6; }
.zl-row.on { background: #fde8ea; font-weight: 700; }
.zl-head .link-btn { font-size: 12px; font-weight: 600; color: #6b7280; padding-left: 6px; }
.leaflet-tooltip.borough-label { background: none; border: 0; box-shadow: none; padding: 0; color: #334155; font-size: 11px; font-weight: 700; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.leaflet-tooltip.borough-label::before { display: none; }
.hide-borough-labels .borough-label { display: none; }
.pop-place { font-size: 12px; font-weight: 700; color: #b45309; }
.zone-label span { display: inline-block; transform: translate(-50%, -50%); font-size: 18px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 6px #fff, 0 0 8px #fff; pointer-events: none; }
/* Dark base maps (OpenFreeMap): light text and legend on top. */
.dark-map { background: #0b0f17; }
.dark-map .zone-label span { text-shadow: 0 0 3px #000, 0 0 4px #000, 0 0 6px #000, 0 0 8px #000; }
.dark-map .leaflet-tooltip.borough-label { color: #cbd5e1; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000; }
.dark-map .zone-legend { background: rgba(17,24,39,.94); color: #f3f4f6; }
.dark-map .zl-row:hover { background: #1f2937; }
.dark-map .zl-row.on { background: #78350f; }
.dark-map .borough-line { stroke: #94a3b8; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.map-panel { position: absolute; top: 12px; right: 12px; z-index: 900; width: 340px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow-y: auto;
  background: rgba(17,24,39,.95); color: #f3f4f6; border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 13px; }
.map-panel[hidden] { display: none; }
#view-map { position: relative; }
.mp-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-bottom: 8px; }
.mp-head .link-btn { color: #9ca3af; text-decoration: none; font-size: 16px; }
.mp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 10px; }
.mp-stats div { display: flex; flex-direction: column; }
.mp-stats b { font-size: 16px; color: var(--s-pink); font-variant-numeric: tabular-nums; }
.mp-stats span { font-size: 11px; color: #9ca3af; }
.mp-zones { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 10px; }
.mp-zones .stat-table { flex: 1; }
.stat-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stat-table th { text-align: left; font-size: 11px; font-weight: 600; color: #9ca3af; padding: 3px 4px; border-bottom: 1px solid rgba(148,163,184,.25); }
.stat-table td { padding: 4px; border-bottom: 1px solid rgba(148,163,184,.12); }
.stat-table th:not(:first-child), .stat-table td:not(:first-child) { text-align: right; }
.mp-cabs tr[data-imei] { cursor: pointer; }
.mp-cabs tr[data-imei]:hover td { background: rgba(245,187,192,.14); }
.mp-cabs .reg { color: var(--s-pink); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.map-panel .muted { color: #9ca3af; }
.overview { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.overview .mp-zones { flex: 1 1 320px; }
.page .stat-table th { color: var(--text-muted); border-color: var(--border); }
.page .stat-table td { border-color: var(--border); }
h3.sub { font-size: 14px; margin: 16px 0 6px; color: var(--text-muted); }
svg.daily { width: 100%; height: 140px; display: block; }
svg.daily .axis { font-size: 10px; fill: var(--text-muted); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { border-top: 2px solid var(--border); }

/* ── Reports, alerts, usage, search, routes ───────────────────────────── */
.place-search input { width: 230px; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: #dc2626; color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 2px; }
.badge[hidden] { display: none; }
.pill.alert { background: #fee2e2; color: #991b1b; }
.route-box { background: #fff; color: #111827; padding: 6px 10px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 13px; }
.route-box[hidden] { display: none; }
.pop-route { font-size: 12px; margin-top: 2px; }
.pop-route a { color: #b45309; font-weight: 700; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range { margin-bottom: 12px; }
.range .chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(156,163,175,.45); background: transparent; color: inherit; cursor: pointer; }
.range .chip.active { background: var(--s-red); border-color: var(--s-red); color: #fff; font-weight: 700; }
.range-dates { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: 4px; padding: 4px 8px; border-radius: 10px; border: 1px dashed rgba(156,163,175,.45); }
.range-dates.active { border-style: solid; border-color: var(--s-red); }
.range-dates label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-grid a { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; font-size: 12px; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); }
.usage-row { margin: 12px 0; }
.usage-label { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.usage-label span { color: var(--text-muted); }
.usage-bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 4px; border: 1px solid var(--border); }
.usage-bar i { display: block; height: 100%; }
.mp-zone-head { display: flex; align-items: center; gap: 4px; font-size: 15px; margin-bottom: 8px; }
.mp-zone-head .link-btn { margin-left: auto; color: #9ca3af; font-size: 12px; }
.zone-table tr[data-zone] { cursor: pointer; }
.zone-table tr[data-zone]:hover td { background: rgba(245,187,192,.16); }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 8px 10px; }
  .brand img { height: 24px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav button { padding: 6px 10px; white-space: nowrap; }
  .map-tools { order: 4; width: 100%; gap: 8px; }
  .map-tools select, .place-search, .place-search input { flex: 1 1 140px; width: auto; min-width: 0; }
  .legend { width: 100%; gap: 10px; font-size: 12px; }
  .who { order: 2; }
  .map-panel { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-width: none; max-height: 48%; border-radius: 14px 14px 0 0; }
  .zone-legend { font-size: 11px; min-width: 0; padding: 6px 8px; }
  /* The bottom sheet already shows the zone breakdown. */
  #view-map:has(.map-panel:not([hidden])) .zone-legend { display: none; }
  .page-inner { padding: 14px 10px 40px; }
  .detail-head { flex-direction: column; }
  .inline-form input:not([type=file]), .inline-form select { flex: 1 1 100%; }
  .stats { gap: 14px; }
}

/* Search type-ahead */
.place-search { position: relative; }
.ac-box { position: absolute; top: calc(100% + 4px); left: 0; z-index: 1500; min-width: 100%; width: 340px; max-width: 92vw; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); overflow: hidden; }
.ac-box[hidden] { display: none; }
.ac-item { display: flex; flex-direction: column; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: 0; }
.ac-item span { font-size: 12px; color: var(--text-muted); }
.ac-item.on, .ac-item:hover { background: rgba(245,187,192,.18); }

.stat-table td:not(:first-child), .stat-table th:not(:first-child) { white-space: nowrap; }

/* Heatmap */
.heat-info { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 12px; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 3px; }
.heat-info b { font-size: 13px; }
.heat-info .heat-scale { display: block; height: 8px; border-radius: 4px; margin-top: 4px; background: linear-gradient(90deg, #2563eb, #16a34a, #facc15, #f97316, #dc2626); }
.heat-info .heat-ends { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 11px; }

/* Map panel date range */
.mp-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -2px 0 10px; }
.mp-range select, .mp-range input { font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(156,163,175,.45); background: rgba(255,255,255,.06); color: inherit; color-scheme: dark; }
.mp-range-label { font-size: 11px; color: #9ca3af; }
.mp-custom { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 12px; color: #9ca3af; }
.mp-custom[hidden] { display: none; }
.mp-custom input { flex: 1; min-width: 0; }
.mp-custom .btn { padding: 5px 10px; font-size: 12px; }
.mp-heat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; border: 1px solid rgba(156,163,175,.45); cursor: pointer; }
.mp-heat:has(input:checked) { border-color: var(--s-pink); color: var(--s-pink); }
.mp-range-label { width: 100%; }
#heat-toggle-wrap[hidden] { display: none; }
.mp-heat-key { max-width: none; margin: 0 0 10px; background: rgba(255,255,255,.05); border-color: rgba(156,163,175,.3); color: inherit; box-shadow: none; }
.mp-heat-key[hidden] { display: none; }

/* Impressions legend */
.info-btn { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 3px; padding: 0; border-radius: 50%; border: 1px solid currentColor; background: none; color: inherit; font: italic 700 10px/1 Georgia, serif; cursor: pointer; vertical-align: 1px; opacity: .8; }
.info-btn:hover, .info-btn.on { opacity: 1; color: var(--s-pink); }
.page .info-btn:hover, .page .info-btn.on { color: var(--s-red); }
.impr-legend { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(156,163,175,.35); background: rgba(127,127,127,.08); font-size: 12px; }
.impr-legend p { margin: 4px 0; }
.impr-legend table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.impr-legend td { padding: 3px 0; border-bottom: 1px solid rgba(156,163,175,.2); }
.impr-legend td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.impr-legend td i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.overview + .impr-legend { max-width: 520px; margin-top: 10px; }

/* Cab "More details" window */
.pop-more { display: block; width: 100%; margin: 8px 0 4px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--s-red); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.pop-more:hover { filter: brightness(1.08); }
.cm-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: rgba(11,11,11,.55); backdrop-filter: blur(2px); }
.cm-overlay[hidden] { display: none; }
body.cm-open { overflow: hidden; }
.cm { width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); color: var(--text); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.45); position: relative; }
.cm::before { content: ""; display: block; height: 6px; background: var(--stripe); border-radius: 16px 16px 0 0; }
.cm-body { padding: 18px 22px 20px; }
.cm-head { display: flex; gap: 16px; align-items: center; }
.cm-ad { width: 132px; height: 82px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); flex: none; }
.cm-id { flex: 1; min-width: 0; }
.cm-id h2 { margin: 0 0 2px; font-size: 22px; letter-spacing: .02em; }
.cm-sub { font-size: 13px; }
.cm-sub.muted { color: var(--text-muted); margin-top: 2px; }
.cm-x { align-self: flex-start; border: 0; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px; }
.cm-range { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 14px; }
.cm-range .chip { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: inherit; cursor: pointer; }
.cm-range .chip.active { background: var(--s-red); border-color: var(--s-red); color: #fff; font-weight: 700; }
.cm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.cm-kpis div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.cm-kpis b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cm-kpis span { font-size: 12px; color: var(--text-muted); }
.cm-kpis + .impr-legend { margin-top: -6px; margin-bottom: 14px; }
.cm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.cm-grid h3, .cm h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.cm-grid svg { max-width: 100%; height: auto; }
.cm-empty, .cm-loading { padding: 18px 0; }
.cm-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.cm-foot a { color: inherit; }
@media (max-width: 720px) {
  .cm-overlay { padding: 0; place-items: end stretch; }
  .cm { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .cm-kpis { grid-template-columns: 1fr 1fr; }
  .cm-grid { grid-template-columns: 1fr; }
  .cm-ad { width: 96px; height: 60px; }
}
.mp-cabs tr[data-imei] td:first-child::after { content: " ›"; color: var(--text-muted); font-weight: 400; }
.mp-head-btns { display: inline-flex; align-items: center; gap: 8px; }
.mp-expand { font: inherit; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; border: 1px solid rgba(156,163,175,.45); background: transparent; color: inherit; cursor: pointer; white-space: nowrap; }
.mp-expand:hover { border-color: var(--s-pink); color: var(--s-pink); }
.cm-back { align-self: flex-start; border: 1px solid var(--border); background: none; color: inherit; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex: none; }
.cm-wide { margin-top: 18px; }
.cm-cabs tbody tr { cursor: pointer; }
.cm-cabs tbody tr:hover td { background: rgba(225,57,38,.08); }
.cm-cabs .reg { color: var(--s-red); }
@media (prefers-color-scheme: dark) { .cm-cabs .reg { color: var(--s-pink); } }
.cm-bar { display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: rgba(127,127,127,.2); overflow: hidden; vertical-align: middle; }
.cm-bar i { display: block; height: 100%; background: var(--s-blue); }
