/* Layout: an Asana-style work app. Dark sidebar for navigation, a calm light workspace, white
   cards with fine borders, small rounded controls, soft status pills. Bethesda's blue is the
   one accent. Type is the device's own system face (SF on the shop iPads). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --ink: #1e1f21;
  --muted: #6d6e70;
  --line: #e4e5e8;
  --line-strong: #cfd1d6;
  --brand: #0a74b8;          /* Bethesda blue, deep enough for white text */
  --brand-2: #0863a0;
  --brand-ink: #ffffff;
  --brand-soft: #e8f3fb;
  --brand-bright: #1fa9e1;   /* the logo's blue, for focus rings and highlights */
  --side: #1e1f21;
  --side-ink: #f3f3f4;
  --side-muted: #a2a0a2;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-active: rgba(255, 255, 255, 0.13);
  --warn: #8f5a00;
  --warn-soft: #fdf2dc;
  --ok: #217a4f;
  --ok-soft: #e2f4ea;
  --danger: #c4314b;
  --info: #5b4fc4;
  --info-soft: #efedfc;
  --pin: #e0453a;
  --claim: #6a5ad6;
  --radius: 10px;
  --radius-sm: 6px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(30, 31, 33, 0.05);
  --shadow-pop: 0 12px 40px rgba(30, 31, 33, 0.18);
  --focus: 0 0 0 3px rgba(31, 169, 225, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.4em; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; margin-top: 1.3em; }
p { margin: 0 0 0.75em; }
a { color: var(--brand); }
svg { width: 1.15em; height: 1.15em; flex: none; }

.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; list-style: none; }
.label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }

/* ---- Shell: sidebar + workspace ---- */

.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  padding: max(14px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: var(--side); color: var(--side-ink);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: inherit; text-decoration: none; min-height: 48px; }
.brand-logo { width: 54px; height: auto; flex: none; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--brand-bright); color: #fff; font-weight: 700; font-size: 0.85rem;
}
.brand span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand strong { font-size: 0.92rem; font-weight: 600; }
.brand small { color: var(--side-muted); font-size: 0.76rem; }

.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-title { padding: 0 10px 6px; color: var(--side-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--side-ink); text-decoration: none; font-size: 0.92rem; opacity: 0.86;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.85; }
.nav-item:hover { background: var(--side-hover); opacity: 1; }
.nav-item.is-active { background: var(--side-active); opacity: 1; font-weight: 600; }
.nav-item:focus-visible { outline: none; box-shadow: var(--focus); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar select {
  min-height: 40px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: #2a2b2e; border: 1px solid #3b3c40; color: var(--side-ink); font-size: 0.9rem; font-weight: 500;
}
.sidebar .label { color: var(--side-muted); }
.loc-pick, .shift-pick { display: flex; flex-direction: column; gap: 5px; font-weight: 500; flex: 1; min-width: 0; }
.shift { display: flex; align-items: flex-end; gap: 10px; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-bright); color: #fff; font-weight: 700; font-size: 0.85rem;
}
.signout { color: var(--side-muted); font-size: 0.82rem; font-weight: 500; text-decoration: none; text-align: left; }
.signout:hover { color: var(--side-ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 24px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--muted);
}
.top-search:focus-within { background: #fff; border-color: var(--line-strong); box-shadow: var(--focus); }
.top-search input { border: 0 !important; background: transparent !important; min-height: 0 !important; padding: 0 !important; box-shadow: none !important; outline: none !important; font-size: 0.92rem; }
.topbar .btn-primary { margin-left: auto; }
.topbar .menu-btn { display: none; }
.scrim { display: none; }

.view { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px max(28px, env(safe-area-inset-right)) 48px 28px; }

/* ---- Sign-in ---- */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.signin-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px;
  padding: 32px 28px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop);
}
.signin-logo { width: 150px; align-self: center; margin-bottom: 4px; }
.signin-card h1 { font-size: 1.35rem; text-align: center; margin: 0; }
.signin-card > .muted { text-align: center; margin: 0 0 6px; }
.signin-card label { display: flex; flex-direction: column; gap: 6px; }
.form-error { color: var(--danger); font-weight: 500; min-height: 1.2em; margin: 0; font-size: 0.9rem; }

/* ---- Buttons & chips ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 500; text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-quiet { background: var(--surface-2); border-color: transparent; }
.btn-quiet:hover { background: #eceef1; }
.btn-lg { min-height: var(--tap); padding: 0 22px; font-size: 0.98rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link-btn {
  background: none; border: 0; padding: 0; color: var(--brand);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); line-height: 1; cursor: pointer; color: var(--ink);
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; min-height: 22px;
  font-size: 0.76rem; font-weight: 500; white-space: nowrap;
}
.chip svg { width: 0.95em; height: 0.95em; }
.chip-quiet { background: #eef0f3; color: #4f5156; }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-new { background: var(--brand-soft); color: var(--brand-2); }

.back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px; margin-bottom: 4px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.back:hover { color: var(--ink); }

/* ---- Layout blocks ---- */

.hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 14px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.source-tag { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

.search { display: flex; gap: 10px; margin-bottom: 16px; }
.search input { flex: 1; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 6px; border-top: 1px solid var(--line);
}
.list .row:hover { background: #fafbfc; }
.row:first-child { border-top: 0; }
.row-time { font-weight: 600; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; line-height: 1.25; }
.row-time small { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.row-tags { margin-top: 4px; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main .muted { font-size: 0.92rem; }
.row-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.row > * { min-width: 0; }
.row-link { color: inherit; text-decoration: none; }
.row.is-dim .row-main strong { color: var(--muted); }
.list .row:not(:has(.row-time)) { grid-template-columns: 1fr auto; }

.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vehicle-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.plate {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: 0.06em;
}

/* ---- Forms ---- */

input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  font: inherit; font-size: 0.95rem; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-bright); box-shadow: var(--focus); }
.btn:focus-visible, .link-btn:focus-visible { outline: none; box-shadow: var(--focus); }
label { font-weight: 500; font-size: 0.9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; }
.form-grid .span-2 { grid-column: span 2; }
label.block { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 8px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }

.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

.callout {
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius); margin: 12px 0;
  background: var(--brand-soft); font-size: 0.93rem;
}
.callout-ok { background: var(--ok-soft); }
.callout-warn { background: var(--warn-soft); color: #5c3a00; }
.callout-quiet { background: var(--surface-2); }
.callout-lock { background: var(--ok-soft); color: #14502f; align-items: center; flex-wrap: nowrap; }
.callout-lock svg { width: 1.4em; height: 1.4em; }
.callout-info { background: var(--info-soft); color: #3b3191; }
.callout > span { flex: 1 1 260px; }
.callout > svg { margin-top: 3px; }
.fine { font-size: 0.86rem; color: var(--muted); }
.row-main .fine { margin: 2px 0 0; }

/* "Already on file" stops at check-in: a question with two answers, both always visible. */
.dupe-stop { flex-direction: column; gap: 12px; }
.dupe-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quote { font-size: 1.1rem; border-left: 4px solid var(--claim); padding: 4px 0 4px 14px; margin: 6px 0 12px; }

.bookly-card, .account-card {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px; margin: 12px 0;
}
.bookly-card { background: var(--info-soft); }
.account-card { border: 1px solid var(--brand-2); background: var(--brand-soft); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.check-inline { margin-top: 0; align-self: end; }

.pills { border: 0; padding: 0; margin: 16px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.pills legend { font-weight: 600; margin-bottom: 8px; width: 100%; }
.pill-check input { position: absolute; opacity: 0; }
.pill-check span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.pill-check input:checked + span { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); }
.pill-check input:focus-visible + span { outline: 3px solid rgba(31, 169, 225, 0.35); }

.price-table { width: 100%; max-width: 520px; border-collapse: collapse; margin: 14px 0 0; }
.price-table td { padding: 7px 0; border-top: 1px solid var(--line); }
.price-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.price-table .total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--ink); }
.price-table .booked td { color: var(--muted); }
.price-table .diff-up td { color: var(--warn); font-weight: 700; }
.price-table .diff-down td { color: var(--ok); font-weight: 700; }

/* ---- Cards (people, vehicles) ---- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 8px; }
.card {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.card-form { gap: 10px; background: var(--surface); border-color: var(--brand-2); }
.card-form label:not(.check) { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.card-form > input { width: 100%; }
.card-actions { display: flex; gap: 10px; margin-top: 4px; }
.card-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.mini-list { list-style: none; padding: 0; margin: 0; width: 100%; display: grid; gap: 6px; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.inline-form { display: flex; gap: 10px; margin-top: 12px; }
.inline-form input { flex: 1; }

/* ---- Office: filters, tiles, tables, chart ---- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 150px; min-height: 44px; }
.filters input[type=search] { flex: 1 1 220px; }
.filters label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tile strong { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.tile .muted { font-size: 0.86rem; }
.tile-accent { border-color: var(--brand-2); background: var(--brand-soft); }
.tile-accent strong { color: var(--brand); }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.data-table th {
  text-align: left; font-size: 0.75rem; font-weight: 500;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table.clickable tbody tr { cursor: pointer; }
.data-table.clickable tbody tr:hover, .data-table tr[data-href]:hover { background: #fafbfc; }
.data-table tr[data-href] { cursor: pointer; }
.data-table .chip { margin-top: 2px; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bar-slot { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.bar { width: 100%; min-height: 2px; background: var(--brand-2); border-radius: 4px 4px 0 0; }
.bar-slot:hover .bar { background: var(--brand); }
.bar-slot:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1e1f21; color: #fff; padding: 5px 9px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; z-index: 2;
}
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; margin-top: 6px; }

/* ---- Claims ---- */

.dg-claim circle { fill: rgba(106, 90, 214, 0.14); stroke: var(--claim); stroke-width: 3; stroke-dasharray: 5 3; }
.dg-claim .dg-claim-dot { fill: var(--claim); stroke: none; }
.legend-pin, .legend-claim { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; }
.legend-pin { background: var(--pin); }
.legend-claim { border: 2px dashed var(--claim); }
.compare-row { padding: 12px 0; border-top: 1px solid var(--line); }
.compare-row:first-of-type { border-top: 0; }
.compare-row.is-focus { background: var(--info-soft); margin: 0 -20px; padding: 12px 20px; }
.compare-row h3 { margin-top: 0; }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare-pair figure { margin: 0; }
.compare-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.compare-pair figcaption { font-size: 0.85rem; margin-top: 6px; }
.no-photo { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); }

.merge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.merge-card { align-items: flex-start; }
.merge-card > span { gap: 4px; }
.evidence-grid img:not([src]), .signature-card img:not([src]) { background: var(--surface-2); min-height: 60px; }

.choices { display: grid; gap: 10px; margin: 12px 0; }
.choice {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface);
  transition: border-color 0.12s, background 0.12s;
}
.choice:hover { border-color: var(--line-strong); }
.choice input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.choice > span { display: flex; flex-direction: column; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

.segmented { border: 0; padding: 0; margin: 16px 0 4px; }
.segmented legend { font-weight: 600; margin-bottom: 8px; }
.segmented { display: flex; flex-wrap: wrap; gap: 10px; }
.segmented legend { width: 100%; }
.segmented label { flex: 1 1 180px; }
.segmented input { position: absolute; opacity: 0; }
.segmented label > span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  cursor: pointer; font-weight: 600;
}
.segmented label > span { flex-direction: column; line-height: 1.2; }
.segmented label > span small { font-weight: 500; opacity: 0.8; }
.segmented label { flex: 1 1 120px; }
.segmented input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.segmented input:focus-visible + span { outline: 3px solid rgba(31, 169, 225, 0.35); }

/* ---- Check-in stepper ---- */

.checkin-head { margin-bottom: 14px; }
.stepper { display: flex; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; overflow-x: auto; }
.stepper li { flex: 1 1 0; min-width: 110px; }
.stepper button {
  width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
}
.stepper button:disabled { cursor: default; }
.stepper span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); font-size: 0.85rem;
}
.stepper .current button { border-color: var(--brand); color: var(--ink); }
.stepper .current span { background: var(--brand); color: var(--brand-ink); }
.stepper .done button { color: var(--ink); }
.stepper .done span { background: var(--ok-soft); color: var(--ok); }
.step-error { color: var(--danger); font-weight: 600; min-height: 1.5em; margin: 0 4px 10px; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; }
/* Check-in buttons stay on screen, so staff never hunt for Next on a tall step. */
.checkin .step-nav {
  position: sticky; bottom: 0; z-index: 5;
  padding: 18px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(246, 247, 249, 0), var(--bg) 35%);
}

/* ---- Photo tiles ---- */

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.shot { position: relative; aspect-ratio: 4 / 3; }
.shot-hit {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
  cursor: pointer; overflow: hidden; text-align: center;
}
.shot.is-required .shot-hit { border-color: #9cc8e6; background: #f2f8fd; }
.shot-icon svg { width: 34px; height: 34px; color: var(--brand-2); }
.shot-label { font-weight: 700; }
.shot-hint { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.shot.has-photo .shot-hit { border: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 10px; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; font-size: 0.85rem; font-weight: 500;
}
.shot-retake {
  position: absolute; top: 8px; right: 8px; pointer-events: none;
  padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.75rem;
}
.shot-remove {
  position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.3rem; cursor: pointer;
}
.video-row, .demo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.video-row .btn { position: relative; }
.demo-row { font-size: 0.9rem; }

/* ---- Damage diagram ---- */

.damage-layout { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: start; margin-top: 10px; }
.diagram-wrap { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.car-diagram { display: block; width: 100%; height: auto; max-height: 480px; }
.car-diagram.is-interactive { cursor: crosshair; touch-action: manipulation; }
.dg-body { fill: #ffffff; stroke: #7d8a87; stroke-width: 2; }
.dg-roof { fill: #eef1ef; stroke: #9aa5a2; stroke-width: 1.5; }
.dg-glass { fill: #d9e6ea; stroke: #9aa5a2; stroke-width: 1.5; }
.dg-line { fill: none; stroke: #b4bdba; stroke-width: 1.5; }
.dg-wheel { fill: #39423f; }
.dg-label { font: 700 9px system-ui, sans-serif; letter-spacing: 0.12em; fill: #7d8a87; text-anchor: middle; }
.dg-pin circle { fill: var(--pin); stroke: #fff; stroke-width: 2.5; }
.dg-pin text { fill: #fff; font: 700 12px system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.damage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.damage-item { display: grid; grid-template-columns: auto 150px 1fr auto; gap: 10px; align-items: center; }
.pin-badge {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--pin); color: #fff; font-weight: 700; font-size: 0.9rem; flex: none;
}
.pin-badge.sm { width: 22px; height: 22px; font-size: 0.75rem; margin-right: 8px; vertical-align: -5px; }

/* ---- Review & signature ---- */

.review { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: start; }
.review h3:first-child { margin-top: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.thumbs img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; }
.waiver {
  margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  max-height: 320px; overflow: auto;
}
.waiver summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.waiver p { font-size: 0.95rem; margin-top: 0.75em; }
.sig-wrap { position: relative; margin: 10px 0; }
.sig-pad {
  display: block; width: 100%; height: 190px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff;
  touch-action: none; cursor: crosshair;
}
.sig-line {
  position: absolute; left: 24px; right: 24px; bottom: 34px;
  border-top: 1px solid var(--line-strong); padding-top: 4px;
  color: var(--muted); font-size: 0.8rem; pointer-events: none;
}
.sig-clear { position: absolute; top: 10px; right: 14px; }

/* ---- Condition report ---- */

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.facts > div { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.facts .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.facts .muted { font-size: 0.88rem; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.evidence-grid figure { margin: 0; }
.evidence-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.evidence-grid figcaption { font-size: 0.85rem; margin-top: 6px; }
.hash { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--muted); }
.evidence-video { width: 100%; max-width: 640px; border-radius: 12px; background: #000; }
.signature-card {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
}
.signature-card img { width: 220px; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.signature-card > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pickup p { margin-top: 10px; font-weight: 600; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 190px 1fr auto; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.log li:first-child { border-top: 0; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Toast ---- */

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 12px; background: #1e1f21; color: #fff; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* In-page confirm (askConfirm in ui.js) */
.ask-back {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 16px; background: rgba(30, 31, 33, 0.45);
}
.ask {
  width: min(440px, 100%); padding: 22px; border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}
.ask p { font-size: 1.05rem; font-weight: 600; margin-bottom: 18px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }


/* ---- Check-out: what to charge ---- */

.charge {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  margin: 4px 0 16px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid #cfe5f5;
}
.charge > div { display: flex; flex-direction: column; gap: 2px; }
.charge strong { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--brand-2); }
.charge ul { flex: 1 1 240px; max-width: 360px; }
.charge li { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }

/* ---- Settings: staff ---- */

.staff-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; margin-top: 8px; }
.staff-form label:not(.check) { display: flex; flex-direction: column; gap: 6px; }
.staff-form .card-actions { grid-column: 1 / -1; }

.card-retired { opacity: 0.7; background: var(--surface); border-style: dashed; }
.pin-ask input { text-align: center; font-size: 1.6rem; letter-spacing: 0.5em; margin-bottom: 4px; }
.pin-ask p:first-child { margin-bottom: 14px; }

/* ---- Protections: shift lock, Office lock, two-step sign-in, consent ---- */

.lock {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(30, 31, 33, 0.94); backdrop-filter: blur(6px);
}
.lock-card {
  width: min(560px, 100%); max-height: 100%; overflow: auto;
  padding: 28px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); text-align: center;
}
.lock-card h2 { font-size: 1.25rem; margin-bottom: 6px; }
.lock-card form { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock-card input[name=pin] { max-width: 220px; text-align: center; font-size: 1.8rem; letter-spacing: 0.5em; }
.lock-card .ask-actions { width: 100%; justify-content: center; }
.lock-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.lock-person {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; min-height: 110px; justify-content: center;
}
.lock-person:hover { border-color: var(--brand); background: var(--brand-soft); }
.lock-person:focus-visible { outline: none; box-shadow: var(--focus); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.nav-item.is-locked::after {
  content: ""; margin-left: auto; width: 14px; height: 14px; opacity: 0.6;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.office-locked { max-width: 520px; margin: 40px auto; text-align: center; padding: 36px 28px; }
.office-locked-icon svg { width: 40px; height: 40px; color: var(--muted); margin-bottom: 10px; }
.office-locked h1 { font-size: 1.35rem; }

.signin-card .steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 0.93rem; }
.signin-card .steps li { padding-left: 2px; }
.signin-card .qr { display: block; width: 180px; height: 180px; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.signin-card code { word-break: break-all; }

.consents { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 6px; margin: 14px 0 0; }
.consents legend { padding: 0 6px; font-weight: 600; font-size: 0.9rem; }
.consents .check { align-items: flex-start; font-size: 0.9rem; line-height: 1.4; }
.consents .check input { margin-top: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- iPad portrait and phones: the sidebar becomes a drawer ---- */

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: min(280px, 84vw);
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .menu-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .topbar .menu-btn { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(30, 31, 33, 0.4); }
  .menu-open .scrim { display: block; }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .view { padding: 20px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* ---- Narrow screens (phones, iPad split view) ---- */

@media (max-width: 760px) {
  .topbar .btn-primary { padding: 0 12px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .row-time { font-size: 0.9rem; color: var(--muted); }
  .row-side { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .damage-layout, .review { grid-template-columns: 1fr; }
  .diagram-wrap { max-width: 320px; }
  .damage-item { grid-template-columns: auto 1fr auto; }
  .damage-item input { grid-column: 1 / -1; }
  .facts { grid-template-columns: 1fr 1fr; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
  .stepper button { font-size: 0; gap: 0; justify-content: center; }
  .stepper li { min-width: 52px; }
  .stepper span { font-size: 0.85rem; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .compare-pair, .merge-grid { grid-template-columns: 1fr; }
  .filters select, .filters input:not([type=checkbox]) { min-width: 0; flex: 1 1 140px; }
  .tile strong { font-size: 1.6rem; }
}

/* ---- Print: the condition report as a document ---- */

@media print {
  body { background: #fff; }
  .topbar, .sidebar, .scrim, .no-print, .toast { display: none !important; }
  .layout { display: block; }
  .view { padding: 0; max-width: none; }
  .panel { box-shadow: none; break-inside: avoid; }
  .waiver { max-height: none; overflow: visible; }
  .waiver:not([open]) > p { display: block; }
  a { color: inherit; text-decoration: none; }
  .subnav, .back { display: none !important; }
  .compare-row { break-inside: avoid; }
  .compare-row.is-focus { margin: 0; padding: 12px 0; }
}
