/* Fleet Control Room - Material 3, violet seed, served by fleet-api at /ops.
   Everything is local: fonts and icons live in ./fonts (the API's content
   security policy allows nothing from other origins). */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 400 600;
  font-display: block;
  src: url(fonts/material-symbols-rounded.woff2) format("woff2");
}

:root {
  color-scheme: light;
  --primary: #5b2bc4;
  --on-primary: #ffffff;
  --primary-container: #e9ddff;
  --on-primary-container: #22005d;
  --secondary-container: #e8def8;
  --on-secondary-container: #1e192b;
  --tertiary: #795900;
  --tertiary-container: #ffdf9e;
  --on-tertiary-container: #261a00;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #410002;
  --success: #1b6c3a;
  --success-container: #b4f1c0;
  --on-success-container: #00210c;
  --surface: #fdf7ff;
  --surface-dim: #ded8e0;
  --surface-lowest: #ffffff;
  --surface-low: #f8f1fa;
  --surface-container: #f2ecf4;
  --surface-high: #ece6ee;
  --surface-highest: #e6e0e9;
  --on-surface: #1d1b20;
  --on-surface-variant: #49454e;
  --outline: #7a757f;
  --outline-variant: #cac4cf;
  --inverse-surface: #322f35;
  --inverse-on-surface: #f5eff7;
  --inverse-primary: #d0bcff;
  --scrim: rgba(0, 0, 0, 0.32);
  --brand-yellow: #ffc928;
  --brand-pink: #ff3b8d;
  --elev-1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --elev-2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --elev-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.3);
  --radius-xs: 4px; --radius-s: 8px; --radius-m: 12px; --radius-l: 16px; --radius-xl: 28px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #d0bcff; --on-primary: #3a0092; --primary-container: #5222b0; --on-primary-container: #e9ddff;
    --secondary-container: #4a4458; --on-secondary-container: #e8def8;
    --tertiary: #f6be3b; --tertiary-container: #5c4300; --on-tertiary-container: #ffdf9e;
    --error: #ffb4ab; --on-error: #690005; --error-container: #93000a; --on-error-container: #ffdad6;
    --success: #98d7a6; --success-container: #00522a; --on-success-container: #b4f1c0;
    --surface: #141218; --surface-dim: #141218; --surface-lowest: #0f0d13; --surface-low: #1d1b20;
    --surface-container: #211f26; --surface-high: #2b2930; --surface-highest: #36343b;
    --on-surface: #e6e0e9; --on-surface-variant: #cac4cf; --outline: #948f99; --outline-variant: #49454e;
    --inverse-surface: #e6e0e9; --inverse-on-surface: #322f35; --inverse-primary: #5b2bc4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #d0bcff; --on-primary: #3a0092; --primary-container: #5222b0; --on-primary-container: #e9ddff;
  --secondary-container: #4a4458; --on-secondary-container: #e8def8;
  --tertiary: #f6be3b; --tertiary-container: #5c4300; --on-tertiary-container: #ffdf9e;
  --error: #ffb4ab; --on-error: #690005; --error-container: #93000a; --on-error-container: #ffdad6;
  --success: #98d7a6; --success-container: #00522a; --on-success-container: #b4f1c0;
  --surface: #141218; --surface-dim: #141218; --surface-lowest: #0f0d13; --surface-low: #1d1b20;
  --surface-container: #211f26; --surface-high: #2b2930; --surface-highest: #36343b;
  --on-surface: #e6e0e9; --on-surface-variant: #cac4cf; --outline: #948f99; --outline-variant: #49454e;
  --inverse-surface: #e6e0e9; --inverse-on-surface: #322f35; --inverse-primary: #5b2bc4;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 20px; letter-spacing: .01em;
  background: var(--surface); color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }

.ms {
  font-family: "Material Symbols Rounded"; font-weight: 400; font-style: normal;
  font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  user-select: none; flex: none;
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.ms.s18 { font-size: 18px; } .ms.s20 { font-size: 20px; } .ms.s28 { font-size: 28px; } .ms.s40 { font-size: 40px; }

/* type scale */
.display-s { font-size: 36px; line-height: 44px; font-weight: 700; letter-spacing: -.01em; }
.headline-m { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.01em; }
.headline-s { font-size: 24px; line-height: 32px; font-weight: 700; }
.title-l { font-size: 22px; line-height: 28px; font-weight: 700; }
.title-m { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: .01em; }
.title-s { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .01em; }
.body-l { font-size: 16px; line-height: 24px; }
.body-m { font-size: 14px; line-height: 20px; }
.body-s { font-size: 12px; line-height: 16px; letter-spacing: .02em; }
.label-l { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .01em; }
.label-m { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; }
.label-s { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .05em; }
.muted { color: var(--on-surface-variant); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: 20px; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  background: var(--primary); color: var(--on-primary); overflow: hidden;
  transition: box-shadow .15s, background-color .15s;
}
.btn .ms { font-size: 18px; margin-left: -8px; }
.btn::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity .15s; }
.btn:hover::after { opacity: .08; } .btn:active::after { opacity: .12; }
.btn:hover { box-shadow: var(--elev-1); }
.btn[disabled] { background: color-mix(in srgb, var(--on-surface) 12%, transparent); color: color-mix(in srgb, var(--on-surface) 38%, transparent); box-shadow: none; cursor: default; }
.btn[disabled]::after { display: none; }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.outlined { background: transparent; color: var(--primary); border: 1px solid var(--outline); }
.btn.outlined:hover { box-shadow: none; }
.btn.text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn.text:hover { box-shadow: none; }
.btn.danger { background: var(--error); color: var(--on-error); }
.btn.danger-outlined { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn.success { background: var(--success); color: #fff; }
:root[data-theme="dark"] .btn.success { color: #00210c; }
.btn.small { height: 32px; padding: 0 16px; font-size: 13px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 20px; border: 0; background: transparent;
  color: var(--on-surface-variant); display: inline-grid; place-items: center; cursor: pointer; overflow: hidden;
}
.icon-btn::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; }
.icon-btn:hover::after { opacity: .08; }
.icon-btn[disabled] { opacity: .38; cursor: default; }

/* ── chips ─────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--outline-variant); background: transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--on-surface-variant);
}
.chip .ms { font-size: 18px; }
.chip.selected { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
.chip .count { font-variant-numeric: tabular-nums; opacity: .8; }
.status {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-highest); color: var(--on-surface-variant);
}
.status .ms { font-size: 16px; }
.status.applicant { background: var(--surface-highest); color: var(--on-surface-variant); }
.status.pending_review, .status.pending { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.status.active, .status.approved { background: var(--success-container); color: var(--on-success-container); }
.status.rejected, .status.expired, .status.missing { background: var(--error-container); color: var(--on-error-container); }
.status.suspended { background: #ffe0c2; color: #3a1d00; }
.status.deactivated { background: var(--inverse-surface); color: var(--inverse-on-surface); }
:root[data-theme="dark"] .status.suspended { background: #6b3b00; color: #ffdcbe; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .status.suspended { background: #6b3b00; color: #ffdcbe; } }
.flag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--error-container); color: var(--on-error-container); font-size: 12px; font-weight: 700; }
.flag .ms { font-size: 16px; }
.env-badge { height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; display: inline-flex; align-items: center; background: var(--brand-yellow); color: #261a00; }
.env-badge.production { background: var(--error); color: var(--on-error); }

/* ── text fields ───────────────────────────────────────── */
.field { position: relative; display: block; }
.field input, .field select, .field textarea {
  width: 100%; height: 56px; padding: 16px; border-radius: 4px; border: 1px solid var(--outline);
  background: transparent; font-size: 16px; line-height: 24px; outline: none;
}
.field textarea { height: auto; min-height: 112px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--on-surface); }
.field input:focus, .field textarea:focus, .field select:focus { border: 2px solid var(--primary); padding: 15px; }
.field label {
  position: absolute; left: 12px; top: -9px; padding: 0 4px; background: var(--field-bg, var(--surface));
  font-size: 12px; line-height: 16px; color: var(--on-surface-variant); font-weight: 600;
}
.field input:focus + label, .field textarea:focus + label { color: var(--primary); }
.field .support { display: block; margin: 4px 16px 0; font-size: 12px; color: var(--on-surface-variant); }
.field.error input, .field.error textarea { border-color: var(--error); }
.field.error label, .field.error .support { color: var(--error); }
.search {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 16px; border-radius: 24px;
  background: var(--surface-high); min-width: 280px;
}
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; height: 100%; }

/* ── layout ────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: 64px 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--outline-variant); z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand .name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.brand .sub { font-size: 12px; font-weight: 600; color: var(--on-surface-variant); margin-top: -2px; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; background: var(--surface); overflow-y: auto; }
.rail a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 80px; text-decoration: none;
  color: var(--on-surface-variant); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.rail .ind { position: relative; width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background .2s; }
.rail a:hover .ind { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.rail a.active { color: var(--on-surface); }
.rail a.active .ind { background: var(--secondary-container); color: var(--on-secondary-container); }
.rail a.active .ms { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.rail .badge {
  position: absolute; top: 0; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--error); color: var(--on-error); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.main { overflow-y: auto; background: var(--surface-low); border-top-left-radius: 24px; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 32px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .titles { flex: 1; min-width: 260px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--on-surface-variant); text-decoration: none; font-weight: 600; margin-bottom: 8px; }
.crumb:hover { color: var(--primary); }

/* ── cards and tables ──────────────────────────────────── */
.card { background: var(--surface-lowest); border-radius: var(--radius-m); border: 1px solid var(--outline-variant); }
.card.filled { background: var(--surface-highest); border-color: transparent; }
.card-pad { padding: 20px 24px; }
.card h2 { margin: 0 0 4px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.kpi { padding: 20px; display: flex; flex-direction: column; gap: 6px; min-height: 132px; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
a.kpi:hover { box-shadow: var(--elev-2); transform: translateY(-1px); }
.kpi .top { display: flex; align-items: center; gap: 8px; color: var(--on-surface-variant); font-weight: 600; }
.kpi .value { font-size: 40px; line-height: 48px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--on-surface-variant); font-size: 13px; }
.kpi.alert .value { color: var(--error); }
.kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-container); color: var(--on-primary-container); }
.kpi-icon.warn { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.kpi-icon.ok { background: var(--success-container); color: var(--on-success-container); }
.kpi-icon.bad { background: var(--error-container); color: var(--on-error-container); }
.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--on-surface-variant); padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--outline-variant); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; background: var(--primary-container); color: var(--on-primary-container); }
.avatar.lg { width: 64px; height: 64px; border-radius: 32px; font-size: 24px; }
.empty { padding: 48px 24px; text-align: center; color: var(--on-surface-variant); }
.empty .ms { font-size: 48px; color: var(--outline); display: block; margin: 0 auto 8px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--outline-variant); }

/* ── rider detail ──────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px; }
.hero .who { flex: 1; min-width: 240px; }
.hero .who .headline-s { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.fact .k { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--on-surface-variant); }
.fact .v { margin-top: 2px; font-size: 15px; font-weight: 600; word-break: break-word; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 16px; background: var(--surface-container); font-weight: 600; font-size: 13px; }
.step.done { background: var(--success-container); color: var(--on-success-container); }
.docs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.doc { overflow: hidden; display: flex; flex-direction: column; }
.doc .thumb { position: relative; height: 180px; background: var(--surface-container); display: grid; place-items: center; cursor: zoom-in; overflow: hidden; border-bottom: 1px solid var(--outline-variant); }
.doc .thumb img { width: 100%; height: 100%; object-fit: contain; }
.doc .thumb .pdf { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--on-surface-variant); font-weight: 600; }
.doc .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.doc .reason { font-size: 13px; color: var(--error); }
.doc .doc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.doc.old { opacity: .72; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 38px; bottom: -10px; width: 2px; background: var(--outline-variant); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-highest); color: var(--on-surface-variant); }
.timeline .dot .ms { font-size: 16px; }
.timeline .what { font-weight: 600; }
.timeline .when { font-size: 12px; color: var(--on-surface-variant); }
.timeline .why { font-size: 13px; margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }

/* ── viewer (document zoom) ────────────────────────────── */
.viewer { position: fixed; inset: 0; z-index: 30; background: rgba(12, 8, 24, .96); display: grid; grid-template-rows: 64px 1fr 88px; color: #fff; }
.viewer .vbar { display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #0c0818; }
.viewer .vbar .icon-btn { color: #fff; }
.viewer .stage { overflow: hidden; display: grid; place-items: center; cursor: grab; }
.viewer .stage img { max-width: 92%; max-height: 92%; transition: transform .15s; user-select: none; -webkit-user-drag: none; }
.viewer .vfoot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; background: #0c0818; }
body.viewing #snackbar { bottom: 104px; }
.viewer .vfoot .meta { color: #d8d0f0; font-size: 13px; }

/* ── dialog and snackbar ───────────────────────────────── */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: grid; place-items: center; padding: 24px; animation: fade .15s ease-out; }
.dialog { width: min(560px, 100%); background: var(--surface-high); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--elev-3); --field-bg: var(--surface-high); animation: rise .2s cubic-bezier(.2,0,0,1); }
.dialog .dicon { display: block; text-align: center; color: var(--primary); margin-bottom: 12px; }
.dialog h2 { margin: 0 0 12px; }
.dialog .dbody { color: var(--on-surface-variant); margin-bottom: 20px; }
.dialog .dactions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
#snackbar {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  min-width: 288px; max-width: 560px; padding: 14px 16px; border-radius: 4px; z-index: 50;
  background: var(--inverse-surface); color: var(--inverse-on-surface); box-shadow: var(--elev-3);
  transition: opacity .2s, transform .2s; font-weight: 500;
}
#snackbar.show { opacity: 1; transform: translate(-50%, 0); }
#snackbar.error { background: var(--error-container); color: var(--on-error-container); }

/* ── sign in ───────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth .art {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 0%, #6d33e0 0%, transparent 60%), linear-gradient(135deg, #3b168f, #140638);
}
.auth .art .big { font-size: 44px; line-height: 52px; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.auth .art .big em { font-style: normal; color: var(--brand-yellow); }
.auth .art .lines { position: absolute; right: -40px; bottom: 80px; width: 420px; opacity: .16; }
.auth .art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; color: #e3d9ff; font-weight: 500; }
.auth .art li { display: flex; gap: 10px; align-items: center; }
.auth .art li .ms { color: var(--brand-yellow); }
.auth .form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth .box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 20px; }
.auth .box h1 { margin: 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--error-container); color: var(--on-error-container); font-weight: 500; }
.alert.info { background: var(--primary-container); color: var(--on-primary-container); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .art { display: none; } }

.loading { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--secondary-container); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-high) 50%, var(--surface-container) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 64px 1fr 80px; }
  .rail { grid-row: 3; flex-direction: row; justify-content: space-around; padding: 8px 0; border-top: 1px solid var(--outline-variant); overflow-x: auto; }
  .rail a { width: 64px; }
  .main { border-radius: 0; }
  .page { padding: 20px 16px 48px; }
  .hide-sm { display: none; }
}

/* ── phase 1: live map, jobs, cities, merchants ────────────── */
.live .page-head { margin-bottom: 16px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.live-map { height: calc(100vh - 230px); min-height: 420px; }
.live-side { display: flex; flex-direction: column; }
.live-kpis { grid-template-columns: 1fr; gap: 12px; }
.live-kpis .kpi { min-height: 0; padding: 14px 16px; }
.live-kpis .kpi .value { font-size: 30px; line-height: 36px; }
.live-job { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--outline-variant); text-decoration: none; color: inherit; }
.live-job:last-child { border-bottom: 0; }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }
.job-map { height: 300px; }
.city-map { height: 240px; }
.select { height: 40px; border-radius: 20px; border: 1px solid var(--outline); background: transparent; padding: 0 14px; font-weight: 600; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--outline-variant); cursor: default; }
.check-row input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.ok-ic { color: var(--success); }
.pick-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--outline-variant); cursor: pointer; }
.pick-row:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 14px; }
.secret-row { padding: 8px 0; }
.secret { flex: 1; font-size: 13px; padding: 10px 12px; border-radius: 8px; background: var(--surface-container); word-break: break-all; }
.leaflet-container { font-family: var(--font); background: var(--surface-container); }
@media (max-width: 1100px) { .live-grid { grid-template-columns: 1fr; } .live-map { height: 420px; } }
