/* ============================================================
   ABR Diesel — shadcn-style design system (fleet-mgmt tokens).
   Indigo brand, DM Sans, JetBrains Mono. Manual theme toggle
   via :root[data-theme]. Structure mirrors the reference app.
   ============================================================ */
:root {
  color-scheme: light;
  --brand-50:#efeefe; --brand-100:#dcdafc; --brand-200:#bab5f9; --brand-300:#948cf4;
  --brand-400:#7568ec; --brand-500:#5b4dd3; --brand-600:#4f40c2; --brand-700:#4133a5;
  --brand-800:#352a85; --brand-900:#251d60;
  --n0:#ffffff; --n25:#fafafc; --n50:#f4f5f8; --n100:#eceef3; --n200:#dfe2ea;
  --n300:#c7ccd7; --n400:#9aa1b0; --n500:#6b7280; --n600:#4b5563; --n700:#2f3441;
  --n800:#1f2433; --n900:#131726;

  --bg: var(--n50);
  --bg-grad: radial-gradient(1100px 480px at 50% -12%, #ecebfb 0%, var(--n50) 58%);
  --surface: var(--n0);
  --surface-2: var(--n100);
  --sunken: var(--n50);
  --text: var(--n900);
  --text-2: var(--n700);
  --muted: var(--n500);
  --faint: var(--n400);
  --line: var(--n200);
  --line-soft: var(--n100);
  --line-strong: var(--n300);
  --primary: var(--brand-500); --primary-600: var(--brand-600); --primary-fg:#fff;
  --brand-soft: var(--brand-50); --brand-soft-fg: var(--brand-700);
  --success:#15803d; --success-bg:#dcfce7;
  --danger:#dc2626;  --danger-bg:#fde2e2;
  --warning:#b45309; --warning-bg:#fdecca;
  --ring: 246 60% 56%;
  --shadow-xs:0 1px 2px rgb(19 23 38 /.04);
  --shadow-sm:0 1px 2px rgb(19 23 38 /.04),0 1px 3px rgb(19 23 38 /.06);
  --shadow-md:0 2px 4px rgb(19 23 38 /.04),0 6px 16px rgb(19 23 38 /.06);
  --shadow-lg:0 4px 8px rgb(19 23 38 /.05),0 16px 32px rgb(19 23 38 /.08);
  --shadow-brand:0 8px 22px rgb(91 77 211 /.28);
  --r-sm:.5rem; --r-md:.625rem; --r-lg:.875rem; --r-xl:1.125rem; --r-2xl:1.5rem;
  /* System stack, no webfont request. The Google Fonts <link> was render-blocking
     on an external host — at a hub on a weak uplink the app painted nothing until
     it resolved. */
  --font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--n900);
  --bg-grad: radial-gradient(1100px 480px at 50% -12%, #1c1746 0%, var(--n900) 58%);
  --surface: var(--n800); --surface-2: var(--n700); --sunken:#171b2b;
  --text: var(--n50); --text-2: var(--n200); --muted: var(--n400); --faint: var(--n500);
  --line: var(--n700); --line-soft:#262c3b; --line-strong: var(--n600);
  --primary: var(--brand-400); --primary-600: var(--brand-500); --primary-fg:#14102e;
  --brand-soft:#2a2270; --brand-soft-fg: var(--brand-100);
  --success:#4ade80; --success-bg:#12331f;
  --danger:#f87171; --danger-bg:#3a1b1b;
  --warning:#fbbf24; --warning-bg:#3a2a0f;
  --ring:245 82% 75%;
  --shadow-xs:0 1px 2px rgb(0 0 0 /.5); --shadow-sm:0 1px 2px rgb(0 0 0 /.5);
  --shadow-md:0 6px 16px rgb(0 0 0 /.35); --shadow-lg:0 20px 50px rgb(0 0 0 /.55);
  --shadow-brand:0 8px 22px rgb(0 0 0 /.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100vh; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg); background-image: var(--bg-grad);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; }
html, body { max-width: 100%; overflow-x: hidden; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.overline { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .btxt { display: flex; flex-direction: column; line-height: 1.05; }
.brand .btxt b { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.brand .btxt span { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { padding: 7px 13px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600;
  color: var(--muted); text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--primary-fg); background: var(--primary); box-shadow: var(--shadow-xs); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who-text { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; line-height: 1; }
.who-text b { font-size: 13px; font-weight: 600; }
.who-text span { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 12.5px; font-weight: 700; color: var(--primary-fg);
  background: linear-gradient(150deg, var(--brand-400), var(--brand-600)); box-shadow: var(--shadow-xs); }
.iconbtn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: var(--r-md);
  background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); box-shadow: none; margin: 0; }
.iconbtn:hover { background: var(--surface-2); filter: none; box-shadow: none; }
.iconbtn svg { width: 17px; height: 17px; }

.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(150deg, var(--brand-400) 0%, var(--brand-600) 100%); box-shadow: var(--shadow-brand); }
.logo svg { width: 20px; height: 20px; }
.logo.lg { width: 64px; height: 64px; border-radius: 20px; }
.logo.lg svg { width: 36px; height: 36px; }

.page { max-width: 760px; margin: 0 auto; padding: 22px 16px 56px; }
.page.wide { max-width: 1180px; }

/* two-column form / layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; align-items: start; }
.grid-2 > div { min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.form-actions button { width: auto; margin: 0; }
.trip-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.trip-mini-grid .field-label { margin-top: 8px; }
.linkbtn { width: auto; margin: 0; padding: 0; background: none; box-shadow: none; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.linkbtn:hover { background: none; box-shadow: none; filter: brightness(1.1); text-decoration: underline; }
.linkbtn.wicon svg { width: 15px; height: 15px; }
.radio-check { display: flex; align-items: center; gap: 10px; margin-top: 30px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.radio-check input { appearance: none; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 50%; margin: 0; position: relative; cursor: pointer; }
.radio-check input:checked { border-color: var(--primary); }
.radio-check input:checked::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }

/* request card (details left, controls right) */
.req-card { display: flex; gap: 26px; align-items: flex-start; justify-content: space-between; }
.req-main { flex: 1; min-width: 0; }
.req-main .veh { font-weight: 700; font-size: 16px; margin-top: 8px; }
.req-main .meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.req-main .quote { font-style: italic; color: var(--muted); font-size: 13px; margin-top: 8px; }
.req-side { width: 440px; flex: none; }
.req-side .row { margin-top: 12px; }

/* horizontal job row */
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.job-row .badges { margin-top: 0; }

/* inline row: combobox + button */
.inline-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.inline-row button { margin: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head svg { width: 18px; height: 18px; color: var(--primary); }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.card-head .sub { margin: 0; color: var(--muted); font-size: 13px; }

/* jbadge extra colors */
.jbadge.neutral { background: var(--surface-2); color: var(--text-2); }
.jbadge.green { background: var(--success-bg); color: var(--success); }
.jbadge.yellow { background: var(--warning-bg); color: var(--warning); }

/* drop zone + empty state icon */
.drop .up-ic { display: block; margin: 0 auto 8px; width: 26px; height: 26px; color: var(--muted); }
.empty-icon { display: grid; place-items: center; gap: 8px; text-align: center; padding: 40px 20px; }
.empty-icon svg { width: 42px; height: 42px; color: var(--faint); }
.empty-icon b { font-size: 16px; font-weight: 700; }
.empty-icon small { color: var(--muted); font-size: 13px; max-width: 280px; }

/* icon header (stock IN / OUT / users) */
.icon-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.icon-head .ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.icon-head .ic svg { width: 20px; height: 20px; }
.icon-head .ic.green { background: var(--success-bg); color: var(--success); }
.icon-head .ic.amber { background: var(--warning-bg); color: var(--warning); }
.icon-head .ht .overline { display: block; }
.icon-head .ht b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }

.span2 { grid-column: 1 / -1; }
.in-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.in-foot .amt { color: var(--muted); font-size: 13px; }
.in-foot .amt b { font-family: var(--mono); color: var(--text-2); font-weight: 600; }
.in-foot button { width: auto; margin: 0; }

/* balances table */
th.center, td.center { text-align: center; }
th.right, td.right { text-align: right; }
.lot-toggle { width: auto; margin: 0; padding: 5px 11px; font-size: 12px; font-weight: 600; background: var(--surface-2);
  color: var(--text-2); border: 1px solid var(--line); box-shadow: none; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.lot-toggle:hover { background: var(--line); filter: none; box-shadow: none; }
.lot-toggle svg { width: 13px; height: 13px; transition: transform .15s; }
.lot-toggle.open svg { transform: rotate(180deg); }
.lot-lines { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.lot-lines .ll { margin: 2px 0; }
.lot-lines b { color: var(--text-2); font-family: var(--mono); font-weight: 600; }

/* user table actions */
.uactions { display: flex; gap: 6px; justify-content: flex-end; }
.uactions button { margin: 0; }

@media (max-width: 720px) { .req-card { flex-direction: column; } .req-side { width: 100%; } .grid-2, .trip-mini-grid { grid-template-columns: 1fr; } }
.page-head { margin-bottom: 6px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 4px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.op-dash { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 6px 0 14px; }
.op-dash h1 { margin: 5px 0 4px; font-size: 26px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; }
.op-dash p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 520px; }
.op-add { width: auto; margin: 0; flex: none; }
.op-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.op-queue { margin-top: 0; }
.approver-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.approver-board { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 14px; align-items: start; }
.approver-section { margin: 0; }
.approver-section .list-card { margin: 8px 0; box-shadow: none; }
.approver-section .empty { padding: 18px 8px; }
.reading-review-card { margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.reading-review-card .row-between { align-items: flex-start; }
.reading-review-card b { display: block; font-size: 15px; }
.reading-review-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.reading-review-card .sub { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.reading-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.reading-compare div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.reading-compare b { margin-top: 3px; font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; }
.reading-compare small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.reading-image-link { display: inline-flex; margin-top: 9px; font-size: 12px; font-weight: 700; color: var(--primary); text-decoration: none; }
.reading-custom { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.reading-custom label { margin-top: 8px; }
.reading-custom button { margin-top: 10px; }
.reading-review-actions.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reading-review-actions.compact button { padding: 9px 10px; font-size: 12.5px; }
.approver-clear { margin: 0; min-height: 144px; display: flex; flex-direction: column; justify-content: center; }
.approver-clear p { color: var(--muted); margin: 5px 0 0; }
.approver-loading { min-height: 160px; display: grid; place-items: center; text-align: center; }
.pull-refresh { display: none; pointer-events: none; height: 0; opacity: 0; text-align: center; color: var(--muted);
  font-size: 12px; font-weight: 700; transition: opacity .16s ease, transform .16s ease; }
.pull-refresh.show { opacity: 1; }
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0;
  color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.dash-row:last-child { border-bottom: 0; }
.dash-row b { font-size: 15px; }
.dash-row span { grid-column: 1; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.dash-row em { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--primary); font-style: normal; font-family: var(--mono); font-weight: 700; }
.diesel-breakdown .row-between { align-items: center; }
.qty-link { width: auto; margin: 0; padding: 8px 11px; border-radius: 9px; background: var(--brand-soft); color: var(--primary); box-shadow: none; }
.source-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.source-tile { margin: 0; padding: 12px; border-radius: var(--r-md); background: var(--sunken); color: var(--text); box-shadow: none; text-align: left; border: 1px solid var(--line); }
.source-tile span { display: block; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.source-tile b { display: block; margin-top: 6px; font-family: var(--mono); font-size: 18px; }
.source-detail { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.source-detail[hidden] { display: none; }
.source-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.source-row:last-child { border-bottom: 0; }
.source-row b, .source-row span, .source-row small { display: block; }
.source-row span { margin-top: 3px; color: var(--text-2); font-size: 13px; }
.source-row small { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.job-filters { display: grid; grid-template-columns: 1fr 190px; gap: 12px; }
.job-filters input, .job-filters select { margin-top: 0; }
.admin-event-filters { display: grid; grid-template-columns: 1.1fr 1fr 150px 110px auto; gap: 10px; align-items: end; }
.admin-event-filters > .field-label { grid-column: 1 / -1; margin: 0; }
.admin-event-filters input, .admin-event-filters select, .admin-event-filters button { margin: 0; min-width: 0; }
.event-table-wrap { width: 100%; overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-md); }
.admin-events-table { min-width: 1220px; }
.admin-events-table th:first-child, .admin-events-table td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line);
}
.admin-events-table th:first-child { z-index: 2; background: var(--brand-soft); }
.admin-event-cards { display: none; }
.admin-event-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: var(--sunken); }
.admin-event-card b { display: block; font-size: 15px; }
.admin-event-card span, .admin-event-card em { display: block; margin-top: 4px; color: var(--muted); font-style: normal; font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.event-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.job-detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; margin: 2px 0 6px; }
.job-detail-title { min-width: 0; }
.job-detail-title h1 { margin: 4px 0; font-size: 26px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.job-detail-title .meta { color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.job-detail-badges { margin: 12px 0 6px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.head-actions button { margin: 0; }
.job-detail-actions .linkbtn, .job-detail-actions .ghost { min-height: 34px; white-space: nowrap; }
.parchi-cards { display: none; gap: 10px; }
.parchi-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: var(--sunken); }
.parchi-card.fail { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.parchi-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.parchi-metrics span { padding: 4px 8px; border-radius: 7px; background: var(--surface); color: var(--text-2); font-family: var(--mono); font-size: 12px; }
.match-card { border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line)); background: var(--brand-soft);
  color: var(--brand-soft-fg); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; }
.match-card h2 { margin: 4px 0; font-size: 20px; }
.match-card p { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.parchi-actions { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 12px; }
.parchi-actions button { margin: 0; }
.job-parchi-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.job-parchi-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.job-parchi-result { min-width: 0; }
.parchi-preview { display: block; width: 100%; max-height: 280px; object-fit: contain; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); }
.parchi-review-photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.parchi-review-photo img { width: 120px; height: 120px; object-fit: contain; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.parchi-review-photo b { display: block; font-size: 14px; }
.parchi-review-photo span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.parchi-review { display: grid; gap: 10px; margin-top: 12px; }
.parchi-edit-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 13px; background: var(--sunken); }
.parchi-edit-card.fail { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.parchi-edit-card .row-between { gap: 12px; align-items: center; margin-bottom: 4px; }
.parchi-edit-card .row-between span { flex: none; font-size: 12px; font-weight: 700; white-space: nowrap; }
.parchi-edit-card small { display: block; color: var(--muted); margin-bottom: 10px; overflow-wrap: anywhere; }
.parchi-fuzzy-note { margin: 9px 0 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--warning); background: var(--warning-bg); font-size: 12px; font-weight: 700; line-height: 1.35; }
.parchi-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.parchi-edit-field { margin: 0; min-width: 0; }
.parchi-edit-field span { display: block; margin: 0 0 5px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; }
.parchi-edit-field input { margin: 0; min-width: 0; font-size: 14px; background: var(--surface); }
.edited-fields { margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font-size: 12px; }
.edited-fields.active { color: var(--warning); background: var(--warning-bg); font-weight: 700; }
.op-request-backdrop { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 18px;
  background: rgb(19 23 38 /.58); backdrop-filter: blur(6px); }
.op-request-panel { width: min(520px, 100%); max-height: min(760px, calc(100vh - 36px)); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 18px; box-shadow: 0 24px 70px rgb(0 0 0 /.32); }
.op-request-panel > .row-between { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.op-request-panel > .row-between .ghost { justify-self: end; white-space: nowrap; }
.op-request-panel h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.op-request-panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 6px; }

/* ---------- login (two-panel) ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-left { position: relative; color: #fff; padding: 46px; display: flex; flex-direction: column; gap: 28px;
  background: linear-gradient(160deg, var(--brand-500) 0%, var(--brand-700) 62%, var(--brand-900) 100%); overflow: hidden; }
.auth-left::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 80% 0%, rgba(255,255,255,.14), transparent 60%); }
.auth-left > * { position: relative; z-index: 1; }
.auth-left .brand .btxt b { color: #fff; }
.auth-left .brand .btxt span { color: rgba(255,255,255,.7); }
.auth-left .brand .logo { background: rgba(255,255,255,.16); box-shadow: none; }
.hero { margin-top: auto; }
.hero-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08); color: #fff; }
.hero-pill svg { width: 14px; height: 14px; }
.hero h1 { font-size: 46px; line-height: 1.03; font-weight: 700; letter-spacing: -.02em; margin: 18px 0 14px; }
.hero p { color: rgba(255,255,255,.82); font-size: 15px; max-width: 460px; margin: 0; line-height: 1.55; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.hero-stat { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); border-radius: var(--r-lg); padding: 14px; }
.hero-stat .k { font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.hero-stat .v { font-size: 24px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.auth-foot { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 6px; }
.auth-right { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-form { width: min(400px, 90vw); }
.auth-form .overline { display: block; margin-bottom: 8px; }
.auth-form h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-form .sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.auth-form label { font-size: 13px; margin: 16px 0 0; }
.auth-form input { padding: 13px; }
.password-wrap { position: relative; display: block; margin-top: 8px; }
.password-wrap input { padding-right: 74px; margin-top: 0; }
.show-pass { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: 7px 10px;
  border-radius: 8px; background: var(--sunken); color: var(--text-2); font-size: 12px; }
.remember-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px !important; margin-top: 12px !important; }
.remember-row input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); }
.auth-form .signin { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; padding: 14px; }
.auth-form .signin svg { width: 18px; height: 18px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-left { display: none; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 18px; margin: 14px 0; box-shadow: var(--shadow-md); }
.card:first-child { margin-top: 4px; }
.card h2 { margin: 0 0 3px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.field-label { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.field-label svg { width: 13px; height: 13px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }

/* ---------- forms ---------- */
label { display: block; margin: 12px 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
input, select, textarea { width: 100%; margin-top: 6px; padding: 11px 13px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px hsl(var(--ring) /.18); }
.readonly-field { width: 100%; margin-top: 6px; padding: 11px 13px; font-size: 15px; font-weight: 600;
  color: var(--text-2); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-md); }
.check { display: flex; align-items: center; gap: 9px; margin: 14px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

/* ---------- buttons ---------- */
button { width: 100%; padding: 12px 16px; margin-top: 12px; font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--primary-fg); background: var(--primary); border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; box-shadow: var(--shadow-xs); transition: transform .06s, filter .15s, box-shadow .15s, background .15s; }
button:hover { filter: brightness(1.06); box-shadow: var(--shadow-brand); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; }
button.secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); box-shadow: none; }
button.secondary:hover { background: var(--line); filter: none; box-shadow: none; }
button.danger { background: var(--danger); }
button.ghost { width: auto; padding: 9px 14px; color: var(--text-2); background: transparent; border: 1px solid var(--line-strong); box-shadow: none; margin-top: 0; }
button.ghost:hover { background: var(--surface-2); color: var(--text); filter: none; box-shadow: none; }
button.sm { padding: 7px 12px; font-size: 13px; margin-top: 0; }
button.wicon { display: flex; align-items: center; justify-content: center; gap: 9px; }
button.wicon svg { width: 18px; height: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; margin-top: 0; }

/* ---------- combobox (button -> searchable popover) ---------- */
.combo-btn { width: 100%; margin-top: 6px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 15px; font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: none; }
.combo-btn:hover { filter: none; box-shadow: none; background: var(--surface); }
.combo-btn.placeholder { color: var(--faint); font-weight: 400; }
.combo-btn svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.combo-panel { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; }
.combo-search { margin: 0 0 6px; width: 100%; padding: 9px 11px; font-size: 14px; }
.combo-list { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.combo-item { display: grid; grid-template-columns: minmax(112px, .38fr) minmax(0, 1fr); align-items: start; gap: 14px;
  padding: 10px 11px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; font-weight: 600; }
.combo-value { min-width: 0; color: var(--text); overflow-wrap: anywhere; line-height: 1.3; }
.combo-label { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; text-align: right;
  white-space: normal; overflow-wrap: anywhere; }
.combo-item.active, .combo-item:hover { background: var(--brand-soft); color: var(--brand-soft-fg); }
.combo-item.active .combo-value, .combo-item:hover .combo-value,
.combo-item.active .combo-label, .combo-item:hover .combo-label { color: var(--brand-soft-fg); }
.combo-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- pills / tags / badges / stat chips ---------- */
.pill { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .03em;
  text-transform: uppercase; background: var(--brand-soft); color: var(--brand-soft-fg); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 8px; margin: 8px 6px 0 0; font-variant-numeric: tabular-nums; }
.tag.app { background: var(--brand-soft); color: var(--brand-soft-fg); }
.tag.rem { background: var(--success-bg); color: var(--success); }
.tag.flag { background: var(--warning-bg); color: var(--warning); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.pending { background: var(--warning-bg); color: var(--warning); }
.badge.type { background: var(--brand-soft); color: var(--brand-soft-fg); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 2px; }
.stat { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; }
.stat .k { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v .unit { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat.accent .v .num { color: var(--primary); }
.source-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 2px; }
.source-mini .stat { padding: 9px 10px; border-radius: var(--r-md); background: var(--surface-2); }
.source-mini .stat .k { font-size: 9px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-mini .stat .v { font-size: 16px; margin-top: 3px; }
.source-mini .stat .v .unit { font-size: 10px; margin-left: 1px; }

/* ---------- list cards ---------- */
.list-card { position: relative; display: block; text-decoration: none; color: inherit; border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 15px 44px 15px 16px; margin: 10px 0; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .08s, box-shadow .15s, border-color .15s; cursor: pointer; }
.list-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); transform: translateY(-1px); }
.list-card .veh { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.list-card .meta { color: var(--muted); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.list-card .chev { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.list-card .chev svg { width: 20px; height: 20px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.jbadge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.jbadge b { font-family: var(--mono); }
.jbadge.app { background: var(--brand-soft); color: var(--brand-soft-fg); }
.jbadge.rem { background: var(--success-bg); color: var(--success); }
.jbadge.by { background: var(--surface-2); color: var(--muted); }

/* request-extra reveal */
.reveal-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-top: 8px; background: var(--surface); }
.reveal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.reveal-actions button { width: auto; margin: 0; }
.iconlabel { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- big readout & steps ---------- */
.big { font-family: var(--mono); font-size: 26px; font-weight: 600; text-align: center; padding: 14px;
  margin: 4px 0 8px; border-radius: var(--r-lg); background: var(--sunken); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.stepcard { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--surface); }
.stepcard .overline { display: block; }
.stepcard .st-title { font-weight: 700; font-size: 15px; margin: 5px 0 4px; }
.stepcard .st-read { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--primary); margin-bottom: 6px; min-height: 20px; }
.stepcard button { width: 100%; margin-top: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .steps, .two-col, .stats { grid-template-columns: 1fr; } }
.interval-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  margin: 12px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: var(--r-lg); background: var(--brand-soft); color: var(--brand-soft-fg); }
.interval-preview span { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.interval-preview b { font-family: var(--mono); font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.interval-preview small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

.interval-list { display: grid; gap: 10px; margin-top: 10px; }
.interval-card { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.interval-card .row-between { align-items: baseline; gap: 12px; }
.interval-card .row-between b { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.interval-card .row-between span { flex: none; font-family: var(--mono); font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.interval-meta { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.interval-readings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.interval-readings span { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-size: 12px; }
.interval-readings b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.interval-review, .interval-edits { margin-top: 9px; padding: 7px 9px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.interval-review.pending { background: var(--warning-bg); color: var(--warning); }
.interval-review.done { background: var(--success-bg); color: var(--success); }
.interval-edits { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.interval-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.interval-images a { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand-soft-fg); font-size: 12px; font-weight: 600; text-decoration: none; }

.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.err { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 16px; margin: 8px 0 0; }
.ok { color: var(--success); font-weight: 600; } .bad { color: var(--danger); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 13.5px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; padding: 9px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); background: var(--brand-soft); }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
/* ---------- chart ---------- */
.chart { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); }
.bar-val { text-align: right; font-family: var(--mono); font-weight: 600; }

/* ---------- file drop ---------- */
.drop { margin-top: 6px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: 22px;
  text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--primary); background: var(--surface-2); }
.drop b { color: var(--text); display: block; font-size: 14px; }
.drop small { font-size: 12px; }
.drop.has { border-style: solid; border-color: var(--primary); color: var(--text); }

/* ---------- autocomplete (legacy, still used) ---------- */
.ac-panel { position: absolute; z-index: 60; max-height: 268px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; }
.ac-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 14px; font-weight: 600; }
.ac-item small { color: var(--muted); font-size: 12px; font-weight: 500; }
.ac-item.active, .ac-item:hover { background: var(--brand-soft); color: var(--brand-soft-fg); }

/* ---------- camera modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgb(19 23 38 /.62); backdrop-filter: blur(5px); }
.modal-inner { width: min(500px, 96vw); box-shadow: var(--shadow-lg); }
.cam-frame { position: relative; border-radius: var(--r-md); overflow: hidden; background: #000; }
#cam, #canvas { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; }
#cam[hidden], #canvas[hidden] { display: none; }
.cam-reticle { position: absolute; left: 8%; right: 8%; top: 40%; height: 20%; border: 2.5px solid rgb(255 255 255 /.92);
  border-radius: 10px; box-shadow: 0 0 0 100vmax rgb(0 0 0 /.3); }
.cam-status { text-align: center; padding: 13px 6px 4px; color: var(--muted); font-size: 14px; }
.cam-status b { color: var(--warning); }
.cam-actions { display: flex; gap: 10px; margin-top: 8px; }
.cam-actions button { margin-top: 0; }
.reading-review-backdrop { position: fixed; inset: 0; z-index: 66; display: grid; place-items: center; padding: 18px;
  background: rgb(19 23 38 /.58); backdrop-filter: blur(6px); }
.reading-review-panel { width: min(430px, 100%); max-height: min(720px, calc(100vh - 36px)); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 16px; box-shadow: 0 24px 70px rgb(0 0 0 /.32); }
.reading-review-panel h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.reading-readout { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--brand-soft); color: var(--brand-soft-fg); text-align: center; }
.reading-readout span, .reading-readout small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.reading-readout b { display: block; margin: 4px 0; font-family: var(--mono); font-size: 34px; font-variant-numeric: tabular-nums; }
.reading-edit-box { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.reading-review-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-top: 12px; }
.reading-review-actions button { margin: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; max-width: 90vw;
  padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 4px solid var(--primary); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- misc ---------- */
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 24px auto; }
.mini-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
button.is-busy { cursor: wait; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }
input[type="file"] { display: none; }
@media (max-width: 560px) {
  .nav a { padding: 7px 10px; font-size: 12.5px; }
  .who-text { display: none; }
  .page { padding: 18px 12px 44px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 8px 10px; gap: 8px; }
  .brand { min-width: 0; }
  .brand .btxt b { display: block; max-width: 86px; white-space: normal; line-height: 1.02; }
  .nav { grid-column: 1 / -1; order: 3; margin: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 8px 11px; }
  .top-right { margin-left: 0; justify-self: end; }
  .bar-row { grid-template-columns: 90px 1fr 64px; }
  .op-dash { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .op-dash h1 { font-size: 24px; }
  .op-add { width: 100%; }
  .pull-refresh { display: block; margin: -8px 0 4px; }
  .op-summary { grid-template-columns: 1fr 1fr; }
  .op-summary .stat { padding: 11px; }
  .op-summary .stat .v { font-size: 19px; }
  .interval-preview { grid-template-columns: 1fr; gap: 4px; }
  .interval-preview b { font-size: 22px; }
  .op-queue .row-between { align-items: flex-start; }
  .approver-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approver-board { grid-template-columns: 1fr; }
  .approver-section.card, .approver-clear.card, .approver-loading.card { padding: 14px 12px; margin: 10px 0; border-radius: 14px; }
  .approver-section .list-card { padding: 13px 34px 13px 13px; border-radius: 13px; }
  .approver-section .list-card .veh { font-size: 15px; }
  .approver-section .list-card .meta {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 12px; line-height: 1.35;
  }
  .reading-review-card { padding: 11px; border-radius: 13px; }
  .reading-review-card .row-between { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .reading-review-card .linkbtn { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-align: center; }
  .reading-compare { grid-template-columns: 1fr; gap: 7px; }
  .reading-compare b { font-size: 18px; }
  .reading-review-actions.compact { grid-template-columns: 1fr; }
  .dash-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 0; }
  .dash-row em { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 3px; }
  .source-grid { grid-template-columns: 1fr; gap: 8px; }
  .diesel-breakdown .row-between { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .qty-link { width: 100%; text-align: center; }
  .approver-job-page { padding: 16px 10px 44px; }
  .approver-job-page > .ghost.sm:first-child {
    display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 58px;
    min-height: 36px; margin: 2px 0 10px; padding: 7px 10px;
  }
  .approver-job-page > .ghost.sm:first-child svg { width: 16px; height: 16px; }
  .approver-job-page .job-detail-head { grid-template-columns: 1fr; gap: 9px; margin-bottom: 8px; }
  .approver-job-page .job-detail-title h1 { font-size: 22px; line-height: 1.15; margin: 3px 0; }
  .approver-job-page .job-detail-title .meta {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 12px; line-height: 1.35;
  }
  .approver-job-page .job-detail-actions {
    display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%;
  }
  .approver-job-page .job-detail-actions .linkbtn,
  .approver-job-page .job-detail-actions .ghost {
    width: 100%; min-height: 36px; justify-content: center; padding: 8px 10px;
    border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
    text-decoration: none; box-shadow: none;
  }
  .approver-job-page .job-detail-badges { gap: 6px; margin: 10px 0; }
  .approver-job-page .job-detail-badges .jbadge { flex: 1 1 calc(50% - 6px); justify-content: space-between; padding: 5px 9px; font-size: 11.5px; }
  .approver-job-page .diesel-breakdown.card { padding: 14px; border-radius: 14px; }
  .approver-job-page .diesel-breakdown .row-between { grid-template-columns: 1fr; align-items: stretch; gap: 9px; }
  .approver-job-page .diesel-breakdown h2 { font-size: 16px; }
  .approver-job-page .qty-link { width: 100%; min-width: 0; padding: 8px 10px; }
  .approver-job-page .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .approver-job-page .source-tile { padding: 10px; border-radius: 12px; min-height: 72px; }
  .approver-job-page .source-tile span { font-size: 9.5px; letter-spacing: .06em; }
  .approver-job-page .source-tile b { margin-top: 5px; font-size: 16px; }
  .approver-job-page .source-detail { margin-top: 10px; padding-top: 9px; }
  .job-filters { grid-template-columns: 1fr; }
  .admin-event-filters { grid-template-columns: 1fr; padding: 14px 12px; }
  .admin-event-filters button { width: 100%; justify-content: center; }
  .admin-events-card.card { padding: 14px 12px; border-radius: 14px; }
  .admin-events-card .row-between { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .event-table-wrap { display: none; }
  .admin-event-cards { display: grid; gap: 10px; margin-top: 10px; }
  .head-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .head-actions .linkbtn, .head-actions .ghost { width: 100%; justify-content: center; }
  .parchi-cards { display: grid; }
  .parchi-cards ~ table, table:has(+ .parchi-cards) { display: none; }
  table + .parchi-cards { margin-top: 10px; }
  .parchi-cards + .hint { margin-top: 10px; }
  .parchi-actions { grid-template-columns: 1fr; }
  .job-parchi-card.card { padding: 14px; border-radius: 14px; }
  .job-parchi-grid { grid-template-columns: 1fr; gap: 12px; }
  .parchi-preview { max-height: 220px; }
  .parchi-review-photo { grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 8px; }
  .parchi-review-photo img { width: 86px; height: 86px; }
  .parchi-edit-card { padding: 11px; border-radius: 13px; }
  .parchi-edit-card .row-between { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .parchi-edit-card .row-between span { white-space: normal; text-align: right; overflow-wrap: anywhere; }
  .parchi-edit-grid { grid-template-columns: 1fr; gap: 8px; }
  .edited-fields { font-size: 11.5px; overflow-wrap: anywhere; }
  .op-request-backdrop { align-items: end; padding: 0; }
  .op-request-panel {
    width: 100dvw; max-width: 100dvw; max-height: 88dvh; border-radius: 18px 18px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
    padding: 16px 16px max(18px, env(safe-area-inset-bottom)); box-shadow: 0 -18px 54px rgb(0 0 0 /.42);
  }
  .reading-review-backdrop { align-items: end; padding: 0; }
  .reading-review-panel {
    width: 100dvw; max-width: 100dvw; max-height: 88dvh; border-radius: 18px 18px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
    padding: 16px 16px max(18px, env(safe-area-inset-bottom)); box-shadow: 0 -18px 54px rgb(0 0 0 /.42);
  }
  .reading-readout { padding: 12px; margin-top: 12px; }
  .reading-readout b { font-size: 30px; }
  .reading-review-actions { grid-template-columns: 1fr; }
  .op-request-panel > .row-between .ghost { padding: 7px 10px; }
  .op-request-panel textarea { min-height: 72px; }
  .combo-panel { max-width: calc(100dvw - 32px); }
  .combo-list { max-height: 276px; }
  .combo-item { grid-template-columns: 1fr; gap: 3px; padding: 10px 11px; }
  .combo-label { text-align: left; font-size: 11.5px; }
  .op-queue.card { padding: 14px 12px; }
  .op-queue .list-card { padding: 14px 34px 14px 14px; border-radius: 13px; }
  .op-queue .list-card .veh { font-size: 16px; }
  .op-queue .list-card .meta {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: 12.5px; line-height: 1.45;
  }
  .op-queue .badges { gap: 6px; margin-top: 10px; }
  .op-queue .jbadge { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
  .op-queue .jbadge.by { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { padding: 8px 12px; gap: 9px; }
  .brand { gap: 8px; }
  .brand .btxt { min-width: 0; }
  .brand .btxt b { font-size: 13px; }
  .brand .btxt span { font-size: 8.5px; }
  .logo, .avatar { width: 31px; height: 31px; border-radius: 9px; }
  .top-right { gap: 7px; }
  .iconbtn { width: 31px; height: 31px; }
  .top-right .ghost.sm { padding: 7px 9px; font-size: 12px; }
  .operator-job-page { padding: 14px 14px 40px; }
  .operator-job-page > .ghost.sm:first-child {
    display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 7px 10px;
    min-height: 34px; margin: 2px 0 8px;
  }
  .operator-job-page > .ghost.sm:first-child svg { width: 15px; height: 15px; }
  .operator-job-page .card { padding: 14px; margin: 9px 0; border-radius: 14px; }
  .operator-job-page .job-summary-card .veh { font-size: 15px; }
  .operator-job-page .job-summary-card .meta {
    display: block; overflow: visible; font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere;
  }
  .operator-job-page .job-summary-card .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px;
  }
  .operator-job-page .job-summary-card .stats .stat:nth-child(3) { grid-column: 1 / -1; }
  .operator-job-page .job-summary-card .source-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px;
  }
  .operator-job-page .job-summary-card .stat {
    min-width: 0; padding: 9px 8px; border-radius: 10px;
  }
  .operator-job-page .job-summary-card .stat .k {
    font-size: 8.5px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .operator-job-page .job-summary-card .stat .v { font-size: 16px; margin-top: 3px; }
  .operator-job-page .job-summary-card .stat .v .unit { font-size: 10px; margin-left: 1px; }
  .operator-job-page .hint { font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
  .operator-job-page .hub-fill-card h2 { font-size: 15px; }
  .operator-job-page .hub-fill-card .sub { font-size: 12px; line-height: 1.35; }
  .operator-job-page .steps { gap: 9px; }
  .operator-job-page .stepcard { padding: 11px 12px; border-radius: 12px; }
  .operator-job-page .stepcard .st-title { font-size: 14px; margin: 4px 0 3px; }
  .operator-job-page .stepcard .st-read { min-height: 14px; font-size: 13px; margin-bottom: 4px; }
  .operator-job-page .stepcard button { padding: 10px 12px; margin-top: 3px; }
  .operator-job-page .interval-history h2 { font-size: 15px; }
  .operator-job-page .interval-card { padding: 11px 12px; border-radius: 12px; }
  .operator-job-page .interval-card .row-between {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  }
  .operator-job-page .interval-meta { font-size: 11.5px; }
  .operator-job-page .interval-readings { grid-template-columns: 1fr; gap: 7px; margin-top: 8px; }
  .operator-job-page .interval-images a { flex: 1 1 128px; justify-content: center; }
}

/* ============================================================
   sheet dialogs (replace window.confirm / window.prompt)
   ============================================================ */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 20px; background: rgb(10 12 22 /.55); backdrop-filter: blur(3px); animation: fadeIn .14s ease; }
.sheet-panel { width: 100%; max-width: 460px; max-height: 88dvh; overflow-y: auto;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-lg); animation: sheetIn .18s ease; }
.sheet-panel.danger { border-top: 3px solid var(--danger); }
.sheet-head h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.25; }
.sheet-head .sub { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.sheet-field { margin-top: 14px; }
.sheet-field input, .sheet-field textarea, .sheet-field select { margin: 0; }
.sheet-error { margin-top: 6px; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.sheet-actions button { width: 100%; margin: 0; }
button.danger, .sheet-actions button.danger { color: #fff; background: var(--danger); box-shadow: none; }
button.danger:hover { filter: brightness(1.06); }
.ghost.danger { color: var(--danger); background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
body.sheet-open { overflow: hidden; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

/* ---------- full-screen image viewer ---------- */
.viewer-backdrop { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column;
  background: rgb(6 8 14 /.94); animation: fadeIn .14s ease; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px; color: #fff; font-size: 13.5px; font-weight: 600; }
.viewer-bar .ghost { color: #fff; border-color: rgb(255 255 255 /.35); background: transparent; }
.viewer-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 0 8px 16px;
  /* The page-level viewport no longer blocks zoom, and this keeps the gesture
     scoped to the photo itself. */
  touch-action: pinch-zoom; }

/* ---------- camera extras ---------- */
.cam-frame { position: relative; }
.cam-torch { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  width: auto; margin: 0; padding: 8px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgb(15 18 30 /.62); border: 1px solid rgb(255 255 255 /.28); box-shadow: none; }
.cam-torch svg { width: 15px; height: 15px; }
.cam-torch.on { color: #1c1608; background: #ffd25e; border-color: #ffd25e; }
.cam-fallback { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.cam-fallback p { margin: 0 0 10px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.cam-fallback button { width: 100%; margin: 0; }

/* ---------- offline bar ---------- */
.offline-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--danger); }

/* ---------- nav badges ---------- */
.nav a { position: relative; }
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px;
  padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--danger); }
.nav a.active .nav-badge { color: var(--danger); background: #fff; }

/* ---------- supply (hub + fuel) ---------- */
.supply-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.supply-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.supply-row.detail { margin: 0 0 14px; }
.supply-chip { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); }
.supply-chip.fuel { color: var(--brand-soft-fg); background: var(--brand-soft); border-color: transparent; }
.supply-chip.stock { color: var(--success); background: var(--success-bg); border-color: transparent; }
.supply-warn { margin-top: 9px; padding: 10px 11px; border-radius: var(--r-md); font-size: 12.5px; line-height: 1.45;
  color: var(--warning); background: var(--warning-bg); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); }

/* ---------- over-approval notice ---------- */
.over-notice { margin: 12px 0 0; padding: 11px 12px; border-radius: var(--r-md); font-size: 13px; line-height: 1.45;
  color: var(--warning); background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 32%, transparent); }
.two-col > div.required .field-label { color: var(--warning); }
.two-col > div.required input { border-color: color-mix(in srgb, var(--warning) 55%, transparent); }

/* ---------- flagged events ---------- */
.flagged-card { border-left: 3px solid var(--danger); }
.flag-row { margin-top: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); }
.flag-row b { display: block; font-size: 13.5px; }
.flag-row > span { display: block; margin-top: 4px; color: var(--danger); font-size: 12.5px; }
.interval-flag { margin-top: 9px; padding: 8px 10px; border-radius: var(--r-md); font-size: 12px; font-weight: 600;
  color: var(--danger); background: var(--danger-bg); }

/* ---------- events table ---------- */
.events-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.events-wrap td small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.evidence-cell { white-space: nowrap; }
.evidence-cell .linkbtn { margin-right: 8px; }

/* ---------- operator: my requests ---------- */
.request-row { padding: 13px; margin-top: 10px; border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--r-lg); background: var(--sunken); }
.request-row.ok { border-left-color: var(--success); }
.request-row.bad { border-left-color: var(--danger); }
.request-row.pending { border-left-color: var(--warning); }
.request-row .meta { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.request-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.request-facts span { padding: 4px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface-2); }
.badge.ok { color: var(--success); background: var(--success-bg); }
.badge.bad { color: var(--danger); background: var(--danger-bg); }
.badge.pending { color: var(--warning); background: var(--warning-bg); }

/* ---------- admin: stock by fuel type ---------- */
.hub-block { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.hub-block:last-child { border-bottom: 0; padding-bottom: 0; }
.fuel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.fuel-tile { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.fuel-tile.empty { opacity: .6; }
.fuel-name { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); }
.fuel-tile b { display: block; margin: 5px 0 7px; font-size: 19px; font-variant-numeric: tabular-nums; }
.fuel-tile small { color: var(--muted); font-size: 12px; }
.in-foot .amt span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 500; }
.hint.warn { color: var(--warning); font-weight: 600; }

/* ---------- admin: hub picker ---------- */
.hub-picker { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sunken); }
.hub-all { padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid var(--line); font-weight: 600; }
.hub-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.hub-picker-grid.disabled { opacity: .45; pointer-events: none; }
.hub-option { margin: 0; font-size: 13px; }

/* ---------- profile ---------- */
.readonly-field { padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  color: var(--text-2); font-size: 13.5px; background: var(--sunken); }

@media (max-width: 560px) {
  .sheet-backdrop { align-items: end; padding: 0; }
  .sheet-panel { width: 100dvw; max-width: 100dvw; border-radius: 18px 18px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    padding: 18px 16px max(20px, env(safe-area-inset-bottom)); }
  .sheet-actions { grid-template-columns: 1fr; }
  .sheet-actions button:first-child { order: 2; }
  .fuel-grid { grid-template-columns: 1fr; }
  .hub-picker-grid { grid-template-columns: 1fr 1fr; }
  .supply-chip { font-size: 11.5px; }
  .admin-event-filters select { width: 100%; }
}
