/* OpenTech Taksi - panel design system (admin + company). Light and dark; no external fonts or libraries. */
:root {
  color-scheme: light;
  --bg: #f5f4f1; --surface: #ffffff; --surface-2: #faf9f7; --surface-3: #efede8;
  --border: #e6e3dc; --border-strong: #d3cfc5;
  --text: #1c1917; --text-2: #4a4740; --muted: #837e74;
  --accent: #feae0f; --accent-hover: #e89d00; --accent-soft: #fff3d6; --accent-ink: #1c1917; --link: #1f63b6; --info: #1f63b6;
  --side-bg: #1c1917; --side-text: #cfcbc1; --side-title: #ffffff; --side-sub: #9a958a; --side-line: #34302b; --side-hover: #292521; --side-active-bg: rgba(254, 174, 15, .15); --side-active: #feae0f;
  --good: #0a7d0a; --good-bg: #e3f5e3; --warn: #8a5a00; --warn-bg: #fff1cf; --bad: #c02f2f; --bad-bg: #fde8e8; --info-bg: #e7effb;
  --status-good: #0ca30c; --status-warning: #fab219; --status-critical: #d03b3b;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --grid: #e1e0d9; --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(15, 23, 41, .05), 0 1px 3px rgba(15, 23, 41, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 41, .12);
  --radius: 14px; --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0f0e0d; --surface: #1a1816; --surface-2: #201e1b; --surface-3: #2a2723;
    --border: #2f2c27; --border-strong: #433f38;
    --text: #f4f2ed; --text-2: #bdb8ad; --muted: #8f8a7f;
    --accent: #feae0f; --accent-hover: #ffc24a; --accent-soft: #3a2a05; --accent-ink: #1c1917; --link: #7fb0ec; --info: #7fb0ec;
    --side-bg: #141311; --side-text: #bdb8ad; --side-title: #ffffff; --side-sub: #8f8a7f; --side-line: #2a2723; --side-hover: #201e1b; --side-active-bg: rgba(254, 174, 15, .16); --side-active: #feae0f;
    --good: #3ec43e; --good-bg: #12301a; --warn: #f0b84a; --warn-bg: #33270b; --bad: #f07575; --bad-bg: #3a1717; --info-bg: #15263d;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --grid: #2c2c2a; --axis: #383835;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0e0d; --surface: #1a1816; --surface-2: #201e1b; --surface-3: #2a2723;
  --border: #2f2c27; --border-strong: #433f38;
  --text: #f4f2ed; --text-2: #bdb8ad; --muted: #8f8a7f;
  --accent: #feae0f; --accent-hover: #ffc24a; --accent-soft: #3a2a05; --accent-ink: #1c1917; --link: #7fb0ec; --info: #7fb0ec;
  --side-bg: #141311; --side-text: #bdb8ad; --side-title: #ffffff; --side-sub: #8f8a7f; --side-line: #2a2723; --side-hover: #201e1b; --side-active-bg: rgba(254, 174, 15, .16); --side-active: #feae0f;
  --good: #3ec43e; --good-bg: #12301a; --warn: #f0b84a; --warn-bg: #33270b; --bad: #f07575; --bad-bg: #3a1717; --info-bg: #15263d;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --grid: #2c2c2a; --axis: #383835;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 16px; font-weight: 650; margin: 28px 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .bad { color: var(--bad); } .good { color: var(--good); }
small, .small { font-size: 12.5px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: var(--side-title); }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--side-sub); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 520; }
.nav a svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav a:hover { background: var(--side-hover); color: var(--side-title); text-decoration: none; }
.nav a.on { background: var(--side-active-bg); color: var(--side-active); font-weight: 650; }
.nav a .count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid var(--side-line); }
.side-foot .who { font-size: 13px; color: var(--side-sub); margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who b { color: var(--side-title); display: block; }
.side-foot .who a { color: var(--side-active); }
.side .btn { background: transparent; color: var(--side-text); border-color: var(--side-line); }
.side .btn:hover { background: var(--side-hover); color: var(--side-title); }
.side .badge.info { background: var(--side-active-bg); color: var(--side-active); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 17px; font-weight: 650; flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
.theme-sun { display: none; } :root[data-theme="dark"] .theme-sun { display: block; } :root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-sun { display: block; } :root:not([data-theme="light"]) .theme-moon { display: none; } }
main { padding: 26px 28px 60px; width: 100%; max-width: 1280px; margin: 0 auto; }
.scrim { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); }
  .menu-btn { display: inline-grid; }
  .topbar, main { padding-left: 16px; padding-right: 16px; }
}

/* ---------- alerts ---------- */
.ok, .err, .notice { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.ok { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.err { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.notice { background: var(--info-bg); color: var(--info); }
#sos-banner { background: #b91c1c; color: #fff; padding: 11px 28px; font-weight: 650; }
#sos-banner button { margin-left: 10px; }
#sos-banner a { color: #fff; font-weight: 750; }
#sos-banner button { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); }

/* ---------- cards and stat tiles ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px 20px; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; } .panel-head .sub { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.card > span { color: var(--text-2); font-size: 13px; font-weight: 520; display: flex; align-items: center; gap: 8px; }
.card { --chip: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--chip) 9%, var(--surface)), var(--surface) 70%); }
.card > span::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--chip); flex: none; }
.card.c-blue { --chip: #2a78d6; } .card.c-green { --chip: #1baf7a; } .card.c-amber { --chip: #feae0f; } .card.c-violet { --chip: #6250d6; } .card.c-red { --chip: #e34948; } .card.c-orange { --chip: #eb6834; }
.card b { font-size: 30px; line-height: 1.1; font-weight: 720; letter-spacing: -.02em; }
.card b.bad { color: var(--bad); }
.card.hero { --chip: var(--accent); grid-column: span 2; background: linear-gradient(135deg, #1c1917, #2f2410); border: 0; color: #fff; overflow: hidden; }
.card.hero::after { content: ""; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%; border: 1.5px solid rgba(254, 174, 15, .35); box-shadow: 0 0 0 26px rgba(254, 174, 15, .06), 0 0 0 54px rgba(254, 174, 15, .04); }
.card.hero > span { color: rgba(255, 255, 255, .8); } .card.hero > span::before { background: var(--accent); } .card.hero b { font-size: 44px; color: var(--accent); }
.grid { display: grid; gap: 16px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid.two, .grid.three, .grid.wide-left { grid-template-columns: 1fr; } .card.hero { grid-column: auto; } }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border: 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--surface-2); }
td form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.table-scroll table { min-width: 640px; }
.panel table { box-shadow: none; border-radius: var(--radius-sm); }

/* ---------- forms and buttons ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; border-color: var(--accent); }
input::placeholder { color: var(--muted); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 17px; height: 17px; accent-color: var(--accent); }
button, .btn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; min-height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { background: var(--surface-3); text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
button.primary, .btn.primary, form.stack button:last-of-type { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover, form.stack button:last-of-type:hover { background: var(--accent-hover); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
button.danger:hover { background: var(--bad-bg); }
td button, .actions button { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
form.stack { display: grid; gap: 12px; max-width: 520px; }
label { font-weight: 560; color: var(--text-2); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 620; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-bg); color: var(--good); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }

/* ---------- charts ---------- */
.chart { position: relative; min-height: 120px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--muted); font: 11.5px var(--font); }
.chart text.ink { fill: var(--text-2); font-size: 12.5px; } .chart text.val { fill: var(--text); font-weight: 650; font-size: 12.5px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.chart .dot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.chart rect.bar { transition: opacity .1s; } .chart.dim rect.bar { opacity: .45; } .chart.dim rect.bar.on { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; vertical-align: 3px; }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 130px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 12.5px; transform: translate(-50%, -100%); white-space: nowrap; display: none; }
.tip b { display: block; margin-bottom: 4px; font-size: 12.5px; }
.tip div { display: flex; align-items: center; gap: 8px; justify-content: space-between; } .tip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 2px; } .tip span { color: var(--text-2); } .tip em { font-style: normal; font-weight: 700; }
.seg { display: flex; gap: 2px; height: 28px; margin: 4px 0 12px; }
.seg > div { border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; overflow: hidden; cursor: default; }
.seg > div.dark-text { color: #0b0b0b; }
.chart-table { margin-top: 12px; font-size: 13px; } .chart-table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.chart-table table { margin-top: 8px; box-shadow: none; }
.empty { display: grid; place-items: center; padding: 34px 10px; color: var(--muted); text-align: center; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, #14110f 0%, #26200f 60%, #4a3410 130%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1.5px solid rgba(254, 174, 15, .22); }
.login-hero::before { width: 620px; height: 620px; right: -220px; bottom: -240px; } .login-hero::after { width: 380px; height: 380px; right: -90px; bottom: -110px; }
.login-hero .brand { color: #fff; padding: 0; } .login-hero .brand span { color: rgba(255, 255, 255, .7); }
.login-hero h2 { font-size: 34px; line-height: 1.15; max-width: 440px; margin: 0 0 12px; } .login-hero p { color: rgba(255, 255, 255, .78); max-width: 420px; font-size: 16px; }
.login-hero ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .9); position: relative; z-index: 1; }
.login-hero li::before { content: "✓"; margin-right: 10px; font-weight: 800; color: var(--accent); }
.login-form-side { display: grid; place-items: center; padding: 32px 22px; background: var(--bg); position: relative; }
.login-form-side .theme-toggle { position: absolute; top: 18px; right: 18px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; } .login-card .lead { color: var(--text-2); margin-bottom: 24px; }
.login-card form { display: grid; gap: 14px; background: transparent; border: 0; }
.login-card input { width: 100%; min-height: 44px; } .login-card button { width: 100%; min-height: 46px; font-size: 15px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.login-card button:hover { background: var(--accent-hover); }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .topbar, .menu-btn { display: none !important; } .app { display: block; } main { padding: 0; } }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 0; }
.btn.disabled { opacity: .45; pointer-events: none; }
a.btn { color: var(--text); }

/* ---------- page bits ---------- */
tr.row-alert td { background: var(--bad-bg); }
td.subrow, .subrow { background: var(--surface-2); }
.map-box { height: 68vh; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
main figure { margin: 0; } main figure img { border-radius: var(--radius-sm); border: 1px solid var(--border); } main figcaption { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
main h3 + .table-scroll, main h3 + form { margin-top: 0; }

/* ---------- icon safety: no SVG can ever grow past its slot ---------- */
svg { max-width: 100%; }
svg[aria-hidden="true"] { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg, button svg { width: 18px; height: 18px; flex: none; }
.nav a svg { width: 19px; height: 19px; }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- dispatch board (iCabbi style) ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 120px; }
.board-col h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.board-col h4 em { font-style: normal; margin-left: auto; background: var(--surface-3); border-radius: 99px; padding: 0 9px; font-weight: 700; color: var(--text); }
.board-col h4::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--dot, var(--muted)); }
.ride-card { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--dot, var(--border-strong)); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; color: var(--text); font-size: 13px; }
.ride-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.ride-card b { font-size: 13.5px; } .ride-card .route { color: var(--text-2); margin: 3px 0; } .ride-card .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.board-empty { color: var(--muted); font-size: 13px; padding: 14px 4px; text-align: center; }
@media (max-width: 1000px) { .board { grid-template-columns: 1fr; } }

/* ---------- show / hide password (the eye sits INSIDE the field) ---------- */
.pw { position: relative; display: block; width: 100%; }
.pw > input { width: 100% !important; padding-right: 46px !important; }
.pw > .pw-toggle { position: absolute !important; right: 6px; top: 50%; transform: translateY(-50%); width: 34px !important; height: 34px; min-height: 0 !important; padding: 0 !important; margin: 0; border: 0 !important; border-radius: 8px; background: transparent !important; color: var(--muted) !important; display: inline-grid; place-items: center; box-shadow: none; }
.pw > .pw-toggle:hover { background: var(--surface-3) !important; color: var(--text) !important; }
.pw > .pw-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw > .pw-toggle[aria-pressed="true"] { color: var(--link) !important; }

/* ---------- companies page ---------- */
details.add-co { position: relative; } details.add-co > summary { list-style: none; cursor: pointer; } details.add-co > summary::-webkit-details-marker { display: none; }
details.add-co[open] .add-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; min-width: min(560px, 90vw); margin: 0; }
details.move > summary { cursor: pointer; color: var(--link); list-style: none; display: inline-block; padding: 4px 6px; } details.move > summary::-webkit-details-marker { display: none; }
details.move[open] > form { display: grid; gap: 8px; margin-top: 6px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 240px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 520; }
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; } .head-row h2 { margin: 0; } .head-row .spacer { flex: 1; }

/* ---------- live map of the drivers ---------- */
.live-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.live-bar input[type="search"] { min-width: 220px; flex: 1; max-width: 340px; }
.live-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.live-map { height: 72vh; min-height: 420px; }
.live-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; max-height: 72vh; overflow-y: auto; }
.live-legend { display: grid; gap: 4px; margin-bottom: 8px; }
.legend-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: var(--radius-sm); min-height: 0; font-weight: 520; }
.legend-row:hover { background: var(--surface-3); } .legend-row.on { background: var(--accent-soft); }
.live-row { display: flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); } .live-row:hover { background: var(--surface-3); }
.live-row .main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 7px 8px; min-height: 0; font-weight: 520; }
.live-row .st { font-size: 11.5px; color: var(--text-2); }
.live-row a.call { flex: none; padding: 5px 10px; border-radius: 99px; background: var(--good-bg); color: var(--good); font-weight: 650; font-size: 12.5px; white-space: nowrap; } .live-row a.call:hover { text-decoration: none; filter: brightness(.96); }
a.call-btn { display: inline-block; margin-top: 4px; padding: 5px 12px; border-radius: 99px; background: var(--good-bg); color: var(--good); font-weight: 650; }
.chip.zero { opacity: .5; }
.ring { width: 14px; height: 14px; border-radius: 50%; border: 4px solid; flex: none; }
.live-row .dot, .chip .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; }
.live-row .txt { flex: 1; min-width: 0; display: grid; } .live-row .txt b, .live-row .txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; min-height: 32px; border-radius: 99px; font-size: 13px; background: var(--surface); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.leaflet-tooltip.drv-label { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 2px 7px; font: 12px/1.25 var(--font); }
.leaflet-tooltip.drv-label::before { display: none; }
.drv-tip { display: grid; } .drv-tip b { font-size: 12.5px; } .drv-tip span { color: var(--muted); font-size: 11px; }
.drv-pop { display: grid; gap: 3px; font: 13px/1.4 var(--font); } .drv-pop a { margin-top: 4px; }
html[data-theme="dark"] .live-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .live-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9); } }
@media (max-width: 1000px) { .live-body { grid-template-columns: 1fr; } .live-side { max-height: 40vh; } .live-map { height: 55vh; } }

/* ---------- phone order: who takes it ---------- */
.nearby { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 0; } .nearby legend { padding: 0 6px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.near-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-weight: 500; color: var(--text); } .near-row small { display: block; }
