/* ==========================================================================
   HVERSE Travel Claims — stylesheet
   Mobile first. Breakpoints: 600 · 768 · 1024 (sidebar) · 1280
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #123154;
  --navy-600: #1a4273;
  --navy-800: #0d2542;
  --night: #0a1d33;
  --signal: #f5c542;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dfe4eb;
  --line-soft: #edf0f4;
  --ink: #152235;
  --ink-2: #3a4759;
  --muted: #5d6a7c;
  --faint: #8a95a5;
  --focus: #2f6fd6;

  --pending: #8a5a00;   --pending-bg: #fdf1d8; --pending-dot: #e0a526;
  --approved: #1b6b44;  --approved-bg: #e0f2e8; --approved-dot: #2f9b62;
  --rejected: #a72a20;  --rejected-bg: #fbe6e3; --rejected-dot: #d9493c;
  --review: #1d57a3;    --review-bg: #e3ecf9;   --review-dot: #3c7ad4;

  --sans: "Geist", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(18, 49, 84, .05), 0 2px 8px rgba(18, 49, 84, .04);
  --shadow-lg: 0 18px 50px rgba(10, 29, 51, .22);
  --side-w: 256px;
  --top-h: 60px;
  --bnav-h: 64px;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
img { height: auto; }
a { color: var(--navy-600); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.0625rem; font-weight: 620; }
h3 { font-size: .9375rem; font-weight: 620; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 8px; }
.ico { flex: none; display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 560; font-size: .9375rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #c4ccd7; background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-800); border-color: var(--navy-800); }
.btn-success { background: var(--approved-dot); border-color: var(--approved-dot); color: #fff; }
.btn-success:hover { background: #26844f; border-color: #26844f; }
.btn-danger { color: var(--rejected); border-color: #efb7b0; }
.btn-danger:hover { background: var(--rejected-bg); border-color: var(--rejected-dot); }
.btn-warn { color: var(--pending); border-color: #ecd09a; }
.btn-warn:hover { background: var(--pending-bg); border-color: var(--pending-dot); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--navy-600); padding: 0 10px; }
.btn-ghost:hover { background: rgba(18, 49, 84, .06); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--navy-600); cursor: pointer; font-weight: 520; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: .8125rem; font-weight: 580; color: var(--ink-2); }
.hint { font-size: .8125rem; color: var(--muted); }
.field-error { font-size: .8125rem; color: var(--rejected); font-weight: 520; }
.input, .select, .textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  font-size: 16px; /* prevents zoom on iOS */ line-height: 1.3;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #a3adbb; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(26, 66, 115, .14); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--rejected-dot); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235d6a7c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.textarea { min-height: 88px; resize: vertical; }
input[type="date"].input, input[type="time"].input { min-height: 44px; }
input[type="number"].input { -moz-appearance: textfield; }
input[type="number"].input::-webkit-inner-spin-button, input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 68px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; font-size: .8125rem; font-weight: 600; color: var(--navy-600); cursor: pointer; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.pw-meter i { height: 4px; border-radius: 2px; background: var(--line); }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--rejected-dot); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: var(--pending-dot); }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--review-dot); }
.pw-meter[data-score="4"] i { background: var(--approved-dot); }
.check { display: flex; align-items: center; gap: 10px; font-size: .9375rem; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 9px;
  border-radius: 999px; font-size: .8125rem; font-weight: 580; white-space: nowrap; line-height: 1.35;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-pending { background: var(--pending-bg); color: var(--pending); }
.badge-approved { background: var(--approved-bg); color: var(--approved); }
.badge-rejected { background: var(--rejected-bg); color: var(--rejected); }
.badge-review { background: var(--review-bg); color: var(--review); }
.badge-neutral { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge-claimed { background: var(--approved-dot); color: #fff; font-weight: 650; letter-spacing: .04em; }
.badge-claimed::before { background: #fff; }

/* ---------- alerts & toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: .9375rem; border: 1px solid transparent; }
.alert .ico { margin-top: 2px; }
.alert-error { background: var(--rejected-bg); color: var(--rejected); border-color: #f4c9c3; }
.alert-success { background: var(--approved-bg); color: var(--approved); border-color: #bfe3cd; }
.alert-info { background: var(--review-bg); color: var(--review); border-color: #c5d7f2; }
.alert-warn { background: var(--pending-bg); color: var(--pending); border-color: #f0d8a4; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.toast {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: max-content; max-width: calc(100% - 32px);
  display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: #fff;
  box-shadow: var(--shadow-lg); font-weight: 520; font-size: .9375rem;
  animation: toast-in .25s ease-out;
}
.toast.is-error { background: var(--rejected); }
.toast button { background: none; border: 0; color: #fff; opacity: .8; cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-104%); transition: transform .24s ease; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.shell.nav-open .sidebar { transform: none; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10, 29, 51, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
.shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 14px; }
.brand a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--muted); }
.brand img { height: 17px; width: auto; }
.brand span { font-size: .8125rem; font-weight: 520; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sep { height: 1px; background: var(--line-soft); margin: 8px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 520; font-size: .9375rem;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: #e9eef6; color: var(--navy); font-weight: 620; }
.nav a[aria-current="page"] .ico { color: var(--navy); }
.nav .ico { color: var(--faint); }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--navy); color: #fff; font: 600 .75rem/22px var(--mono); text-align: center; }
.side-user { margin-top: auto; border-top: 1px solid var(--line-soft); padding: 14px 8px 0; display: flex; flex-direction: column; gap: 10px; }
.side-user .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e3e9f2; color: var(--navy); display: grid; place-items: center; font-weight: 650; font-size: .8125rem; flex: none; }
.side-user .name { font-weight: 600; font-size: .9375rem; }
.side-user .role { font-size: .8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .links { display: flex; gap: 6px; flex-wrap: wrap; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .logo-sm img { height: 13px; width: auto; display: block; }
.topbar .page-who { display: none; min-width: 0; }
.topbar .page-who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .page-who span { font-size: .8125rem; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.dot-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--rejected-dot); color: #fff; font: 600 .6875rem/19px var(--mono); text-align: center; border: 2px solid #fff; box-sizing: content-box; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.content { width: 100%; max-width: 1280px; padding: 20px var(--gutter) 32px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .875rem; font-weight: 520; margin-bottom: 8px; }
.back:hover { color: var(--ink); }

.footer {
  margin-top: auto; border-top: 1px solid var(--line); background: var(--surface);
  padding: 16px var(--gutter) calc(var(--bnav-h) + 18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: .8125rem; color: var(--muted); text-align: center;
}
.powered { display: inline-flex; align-items: center; gap: 7px; }
.powered img { width: 14px; height: 14px; }
.powered a { color: var(--navy); font-weight: 700; letter-spacing: .14em; text-decoration: none; }
.powered a:hover { text-decoration: underline; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bottom-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: .6875rem; font-weight: 560; min-width: 0; padding: 0 2px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav a span.lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a[aria-current="page"] { color: var(--navy); }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy); }
.bottom-nav .dot-count { top: 6px; right: auto; left: calc(50% + 4px); }
.has-actionbar .bottom-nav { display: none; }
.has-actionbar .footer { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.card-head .meta { font-size: .875rem; color: var(--muted); }
.card-body { padding: 16px; }
.card-flush { overflow: hidden; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }

/* KPIs */
.kpis-wrap { container-type: inline-size; container-name: kpis; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container kpis (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.kpi { container-type: inline-size; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.kpi .k { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); font-weight: 520; }
.kpi .k i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.kpi .v { font-family: var(--mono); font-size: clamp(1.05rem, 10.5cqi, 1.75rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi .s { font-size: .8125rem; color: var(--muted); }

/* status lines */
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); font-weight: 540; text-decoration: none; }
.status-line .amt { font-family: var(--mono); white-space: nowrap; }
.status-pending { background: var(--pending-bg); color: var(--pending); }
.status-approved, .status-claimed { background: var(--approved-bg); color: var(--approved); }
.status-rejected { background: var(--rejected-bg); color: var(--rejected); }
.status-review { background: var(--review-bg); color: var(--review); }
.status-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
a.status-line:hover { filter: brightness(.97); }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- responsive tables ---------- */
.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: .8125rem; font-weight: 580; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table td.num { white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table tfoot td { font-weight: 620; background: var(--surface-2); border-top: 1px solid var(--line); }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: #fafbfd; }
.table .strong { font-weight: 580; }
.table .sub { display: block; font-size: .8125rem; color: var(--muted); }
.claim-no { font-family: var(--mono); font-weight: 560; color: var(--navy-600); text-decoration: none; white-space: nowrap; }
.claim-no:hover { text-decoration: underline; }
.row-link { color: inherit; text-decoration: none; }

/* Tables stack into labelled rows when THEIR container is narrow (not the viewport),
   so they stay readable next to a sidebar, in half-width cards and on phones. */
.table-wrap { container-type: inline-size; container-name: tbl; }
@container tbl (max-width: 680px) {
  .table.stacked thead { display: none; }
  .table.stacked, .table.stacked tbody, .table.stacked tfoot { display: block; }
  .table.stacked tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .table.stacked tr:last-child { border-bottom: 0; }
  .table.stacked td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; overflow-wrap: anywhere; }
  .table.stacked td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--faint); font-weight: 560; margin-bottom: 1px; }
  .table.stacked td.full { grid-column: 1 / -1; }
  .table.stacked td.end { justify-self: end; text-align: right; }
  .table.stacked td:empty { display: none; }
  .table.stacked tfoot tr { background: var(--surface-2); }
  .table.stacked tfoot td { background: none; border: 0; }
  .table.stacked tr.is-link:hover td { background: none; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 767.98px) {
    .table.stacked thead { display: none; }
    .table.stacked, .table.stacked tbody, .table.stacked tfoot { display: block; }
    .table.stacked tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
    .table.stacked td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; overflow-wrap: anywhere; }
    .table.stacked td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--faint); font-weight: 560; margin-bottom: 1px; }
    .table.stacked td.full { grid-column: 1 / -1; }
    .table.stacked td.end { justify-self: end; text-align: right; }
    .table.stacked td:empty { display: none; }
  }
  @media (min-width: 768px) { .table-wrap { overflow-x: auto; } }
}
.table:not(.stacked) { min-width: 560px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* filters, tabs, pagination */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .875rem; font-weight: 520; white-space: nowrap; }
.chip b { font-family: var(--mono); font-weight: 560; color: var(--muted); }
.chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-current="true"] b { color: #c9d6e8; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; min-height: 40px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; color: var(--muted); text-decoration: none; font-weight: 560; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--navy); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: .875rem; color: var(--muted); }
.pager .btns { display: flex; gap: 6px; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { display: grid; grid-template-columns: minmax(64px, 110px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .875rem; }
.bar .track { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 5px; background: var(--navy); min-width: 2px; }
.bar .amt { font-family: var(--mono); white-space: nowrap; }

/* chain */
.chain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chain-list li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.chain-list .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 600 .75rem var(--mono); flex: none; }

/* ==========================================================================
   Claim detail
   ========================================================================== */
.detail { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.facts dt { font-size: .8125rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 540; overflow-wrap: anywhere; }
.sec-title { display: flex; align-items: center; gap: 10px; }
.sec-letter { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #e9eef6; color: var(--navy); font: 600 .8125rem var(--mono); flex: none; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sum-row span:first-child { color: var(--muted); }
.sum-row span:last-child { font-family: var(--mono); white-space: nowrap; }
.sum-row.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; font-weight: 620; }
.sum-row.total span:first-child { color: var(--ink); }
.sum-pay { display: flex; justify-content: space-between; gap: 12px; margin: 10px -16px -16px; padding: 14px 16px; background: #e9eef6; color: var(--navy); font-weight: 680; border-radius: 0 0 var(--r) var(--r); font-size: 1.0625rem; }
.sum-pay span:last-child { font-family: var(--mono); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before, .timeline li.skip::before { background: var(--approved-dot); }
.timeline .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface); color: var(--faint); font: 600 .75rem var(--mono); z-index: 1; }
.timeline li.done .dot { background: var(--approved-dot); border-color: var(--approved-dot); color: #fff; }
.timeline li.skip .dot { border-color: var(--approved-dot); color: var(--approved); }
.timeline li.current .dot { background: var(--pending-bg); border-color: var(--pending-dot); color: var(--pending); }
.timeline li.review .dot { background: var(--review-bg); border-color: var(--review-dot); color: var(--review); }
.timeline li.rejected .dot { background: var(--rejected-dot); border-color: var(--rejected-dot); color: #fff; }
.timeline li.returned .dot { background: var(--pending-dot); border-color: var(--pending-dot); color: #fff; }
.timeline .t { font-weight: 600; }
.timeline .m { font-size: .8125rem; color: var(--muted); }
.timeline .c { margin-top: 6px; padding: 8px 10px; font-size: .875rem; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.timeline li.todo .t { color: var(--muted); font-weight: 520; }

.trail { list-style: none; margin: 0; padding: 0; }
.trail li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: .875rem; }
.trail li:first-child { padding-top: 0; }
.trail li:last-child { border-bottom: 0; padding-bottom: 0; }
.trail .when { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.trail q { color: var(--ink-2); }

.decision { border-color: #edd29b; box-shadow: 0 0 0 3px rgba(224, 165, 38, .12); }
.decision.pay { border-color: #b9dfc8; box-shadow: 0 0 0 3px rgba(47, 155, 98, .12); }
.decision .btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.decision .btns .btn { padding: 0 8px; }
.proof-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* thumbnails */
.thumbs { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.thumb { position: relative; min-width: 0; }
.thumb > button {
  width: 100%; display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; color: inherit;
}
.thumb > button:hover { border-color: var(--navy-600); }
.thumb .pv { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #eef1f5; display: grid; place-items: center; overflow: hidden; }
.thumb .pv img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .ft { padding: 6px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font: 600 .8125rem var(--mono); color: var(--navy); }
.thumb .ft.pdf { color: #b3261e; }
.thumb .ft.sheet { color: #1b6b44; }
.thumb .chk { position: absolute; left: 6px; top: 6px; }
.thumb .meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thumb .nm { font-size: .875rem; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .lb { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .rm { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: #fff; box-shadow: var(--shadow); }
.file-link { background: none; border: 0; padding: 0; color: var(--navy-600); cursor: pointer; font-size: .875rem; text-decoration: underline; text-underline-offset: 2px; text-align: left; overflow-wrap: anywhere; }

/* ==========================================================================
   Claim form
   ========================================================================== */
.claim-form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.claim-form .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.lines[data-lines] { container-type: inline-size; container-name: lines; }
.line { position: relative; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.line > .field { min-width: 0; }
.line .field > label, .line .field > .label { font-size: .75rem; }
.line .line-no { grid-area: no; font-size: .8125rem; font-weight: 620; color: var(--ink-2); padding-right: 44px; align-self: center; }
.line .remove { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--faint); }
.line .remove:hover { background: var(--rejected-bg); color: var(--rejected); }
.f-date { grid-area: date; } .f-time { grid-area: time; } .f-desc { grid-area: desc; } .f-from { grid-area: from; } .f-to { grid-area: to; }
.f-km { grid-area: km; } .f-amt { grid-area: amt; } .f-file { grid-area: file; } .f-cat { grid-area: cat; } .f-loc { grid-area: loc; }
.line-travel { grid-template-areas: "no no" "date time" "desc desc" "from to" "km km"; }
.line-toll { grid-template-areas: "no no" "date amt" "from to" "file file"; }
.line-da { grid-template-areas: "no no" "date amt" "loc loc"; }
.line-other { grid-template-areas: "no no" "cat amt" "desc desc" "file file"; }
@container lines (min-width: 540px) {
  .line-travel { grid-template-columns: 1.2fr .9fr 1fr 1fr .8fr; grid-template-areas: "no no no no no" "desc desc desc desc desc" "date time from to km"; }
  .line-toll { grid-template-columns: 1.1fr 1fr 1fr .9fr; grid-template-areas: "no no no no" "date from to amt" "file file file file"; }
  .line-da { grid-template-columns: 1fr 2fr 1fr; grid-template-areas: "no no no" "date loc amt"; }
  .line-other { grid-template-columns: 1.1fr 2fr .9fr; grid-template-areas: "no no no" "cat desc amt" "file file file"; }
}
@container lines (min-width: 860px) {
  .line { padding-right: 52px; align-items: end; }
  .line .line-no { display: none; }
  .line .remove { top: auto; bottom: 5px; }
  .line-travel { grid-template-columns: 1.15fr .8fr 2.2fr 1fr 1fr .75fr; grid-template-areas: "date time desc from to km"; }
  .line-toll { grid-template-columns: 1.1fr 1fr 1fr .9fr 1.6fr; grid-template-areas: "date from to amt file"; }
  .line-da { grid-template-areas: "date loc amt"; }
  .line-other { grid-template-columns: 1.1fr 1.8fr .9fr 1.6fr; grid-template-areas: "cat desc amt file"; }
}
.calc { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; padding: 0 12px; border-radius: var(--r-sm); background: #e9eef6; color: var(--navy); font-family: var(--mono); font-weight: 560; white-space: nowrap; }
.formula { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.uploader { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px dashed #c3ccd8; border-radius: var(--r-sm); background: var(--surface); position: relative; font-size: .875rem; color: var(--muted); min-width: 0; }
.uploader input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.uploader.has-file { border-style: solid; border-color: #9fd2b4; background: var(--approved-bg); color: var(--approved); }
.uploader.is-busy { border-color: var(--review-dot); color: var(--review); }
.uploader.is-error { border-color: var(--rejected-dot); color: var(--rejected); }
.uploader .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploader .act { position: relative; z-index: 2; flex: none; }
.dropzone { min-height: 72px; justify-content: center; text-align: center; flex-direction: column; gap: 4px; padding: 12px; }
.dropzone.is-over { border-color: var(--navy-600); background: #eef3fa; }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--review-dot); width: 0; transition: width .15s; }
.summary .card-body { display: flex; flex-direction: column; }
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(18, 49, 84, .07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.actionbar .lbl { font-size: .75rem; color: var(--muted); }
.actionbar .amt { font-family: var(--mono); font-weight: 650; font-size: 1.0625rem; color: var(--navy); white-space: nowrap; }
.actionbar .btns { display: flex; gap: 8px; }
.desk-actions { display: none; }

/* ==========================================================================
   File viewer
   ========================================================================== */
.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(10, 29, 51, .6); display: grid; }
.viewer-box {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  width: 100%; height: 100%; background: var(--surface); overflow: hidden;
}
.viewer-head { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.viewer-head .ttl { flex: 1; min-width: 0; }
.viewer-head .ttl b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.viewer-head .ttl span { font-size: .8125rem; color: var(--muted); }
.viewer-stage { position: relative; background: #e8ecf1; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.viewer-stage .center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.viewer-stage img.vimg { display: block; max-width: 100%; max-height: calc(100vh - 260px); box-shadow: 0 6px 24px rgba(18, 49, 84, .18); background: #fff; transition: transform .2s; }
.viewer-stage.zoomed img.vimg { max-width: none; max-height: none; }
.viewer-stage .pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px; }
.viewer-stage canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 4px 18px rgba(18, 49, 84, .15); }
.viewer-stage .sheet { margin: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: auto; }
.viewer-stage .sheet table { border-collapse: collapse; font-size: .8125rem; }
.viewer-stage .sheet th, .viewer-stage .sheet td { border: 1px solid var(--line-soft); padding: 6px 10px; white-space: nowrap; }
.viewer-stage .sheet th { background: var(--surface-2); color: var(--muted); font: 500 .75rem var(--mono); }
.viewer-tools { position: sticky; top: 10px; z-index: 2; display: flex; justify-content: flex-end; gap: 6px; padding: 10px 10px 0; pointer-events: none; }
.viewer-tools .icon-btn { pointer-events: auto; box-shadow: var(--shadow); }
.viewer-side { border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; max-height: 44vh; display: flex; flex-direction: column; gap: 14px; }
.viewer-side .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-soft); font-size: .875rem; display: flex; flex-direction: column; gap: 4px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* confirm dialog */
.dialog { position: fixed; inset: 0; z-index: 85; display: grid; place-items: end center; background: rgba(10, 29, 51, .45); padding: 0; }
.dialog-box { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.dialog-box .form-actions { justify-content: flex-end; }

/* notifications & mail */
.notif { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.notif.unread .d { background: var(--navy-600); }
.notif.unread .tx { font-weight: 600; }
.notif .when { font-size: .8125rem; color: var(--muted); margin-top: 2px; }
.mail { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.mail:last-child { border-bottom: 0; }
.mail pre { margin: 0; white-space: pre-wrap; font: .875rem/1.55 var(--sans); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px 12px; overflow-wrap: anywhere; }

/* admin */
.user-row { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.user-row:last-child { border-bottom: 0; }
.user-row .who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.user-row .who > div { min-width: 0; }
.user-row .who b { display: block; }
.user-row .who span { display: block; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.user-row form { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.user-row form .btn { grid-column: 1 / -1; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-list .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.cat-list .item.off span { color: var(--faint); text-decoration: line-through; }

/* error pages */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 16px; }
.error-page .code { font: 600 3.5rem/1 var(--mono); color: #c7d0dc; letter-spacing: -.04em; }
.error-page h1 { margin: 12px 0 8px; }
.error-page p { color: var(--muted); max-width: 44ch; margin: 0 auto 20px; }

/* ==========================================================================
   Landing / auth — the odometer and the road
   ========================================================================== */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.hero {
  position: relative; overflow: hidden; color: #cfd9e6;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(47, 111, 214, .20) 0%, rgba(47, 111, 214, 0) 55%),
    linear-gradient(180deg, var(--navy) 0%, var(--night) 100%);
  padding: calc(22px + env(safe-area-inset-top, 0px)) 20px 28px;
  display: flex; flex-direction: column; gap: 22px;
}
.hero::after { /* faint map grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-brand img { height: 16px; width: auto; }
.hero-brand span { font-size: .8125rem; color: #9fb0c6; }
.hero h1 { font-size: clamp(1.75rem, 7vw, 3.4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 640; color: #fff; max-width: 12ch; }
.hero .lede { max-width: 42ch; color: #b9c6d6; font-size: 1rem; }
@media (max-width: 599.98px) {
  .hero { gap: 16px; padding-bottom: 30px; }
  .hero .lede { display: none; }
  .hero h1 { font-size: 1.9rem; }
  .odometer { gap: 10px; }
  .odo .reel { font-size: 1.7rem; }
  .odo-meta b { font-size: .875rem; }
  .road { padding-top: 20px; }
  .road::before { top: 20px; }
  .road::after { top: 28px; }
}

.odometer { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.odo { display: inline-flex; gap: 3px; padding: 6px; background: #06121f; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 10px 30px rgba(0,0,0,.25); }
.odo .reel { position: relative; width: .72em; height: 1.18em; overflow: hidden; border-radius: 5px; background: linear-gradient(180deg, #0b1b2e, #13263d 50%, #0b1b2e); font: 560 clamp(1.9rem, 9vw, 3.6rem)/1.18 var(--mono); color: #f3f6fa; text-align: center; }
.odo .reel.tenth { background: linear-gradient(180deg, #e9eef5, #fff 50%, #e9eef5); color: var(--navy); }
.odo .reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 70%, rgba(0,0,0,.35)); pointer-events: none; }
.odo .strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d) * -1.18em)); animation: roll 1.8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
.odo .strip span { height: 1.18em; }
@keyframes roll { from { transform: translateY(0); } }
.odo-meta { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.odo-meta b { font: 560 .9375rem var(--mono); color: #fff; }
.odo-meta span { font-size: .8125rem; color: #9fb0c6; }

.road { position: relative; margin-top: 4px; padding: 26px 0 4px; }
.road::before { content: ""; position: absolute; left: 0; right: 0; top: 26px; height: 18px; border-radius: 9px; background: #0a1a2c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.road::after { content: ""; position: absolute; left: 12px; right: 12px; top: 34px; height: 2px; background: repeating-linear-gradient(90deg, var(--signal) 0 18px, transparent 18px 34px); animation: lane 1.6s linear infinite; opacity: .9; }
@keyframes lane { to { background-position: 34px 0; } }
.stops { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.stops li { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.stops .pin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--night); border: 2px solid rgba(245, 197, 66, .85); color: var(--signal); font: 600 .75rem var(--mono); margin-top: -8px; box-shadow: 0 0 0 4px rgba(10, 29, 51, .9); }
.stops li:last-child .pin { background: var(--signal); color: var(--night); border-color: var(--signal); }
.stops b { font-size: .75rem; color: #fff; font-weight: 600; line-height: 1.2; }
.stops span { font-size: .6875rem; color: #93a6bd; line-height: 1.3; display: none; }
.hero-foot { display: none; }

.auth-panel { display: flex; justify-content: center; padding: 0 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.auth-inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 18px; margin-top: -14px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 20px; box-shadow: 0 10px 30px rgba(18, 49, 84, .08); display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin-top: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 10px; background: #eef1f5; }
.seg a { display: grid; place-items: center; min-height: 40px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 580; }
.seg a[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(18, 49, 84, .12); }
.code-input { font: 600 1.75rem/1 var(--mono); letter-spacing: .5em; text-align: center; padding: 14px 8px 14px calc(8px + .5em); min-height: 60px; }
.auth-alt { text-align: center; font-size: .875rem; color: var(--muted); }
.auth-foot { text-align: center; font-size: .8125rem; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.setup-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .875rem; }
.setup-checks li { display: flex; gap: 8px; align-items: center; }
.setup-checks .ok { color: var(--approved); }
.setup-checks .no { color: var(--rejected); }

/* ==========================================================================
   Breakpoints
   ========================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 20px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-row form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dialog { place-items: center; padding: 16px; }
  .dialog-box { border-radius: var(--r-lg); padding: 22px; }
  .stops span { display: block; }
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
  h1 { font-size: 1.75rem; }
  .kpi { padding: 16px 18px; }
  .card-head { padding: 14px 20px; }
  .card-body { padding: 18px 20px; }
  .sum-pay { margin: 10px -20px -18px; padding: 14px 20px; }
  .toolbar { padding: 12px 20px; }
  .viewer { padding: 24px; place-items: center; }
  .viewer-box { width: min(1200px, 100%); height: min(880px, 100%); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 320px; }
  .viewer-head { grid-column: 1 / -1; padding: 10px 14px; }
  .viewer-side { border-top: 0; border-left: 1px solid var(--line); max-height: none; padding: 16px; }
  .viewer-side .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { bottom: 24px; }
  .hero { padding: 32px 36px 36px; }
  .auth-card { padding: 28px; }
}

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); background: linear-gradient(90deg, var(--surface) calc(var(--side-w) - 1px), var(--line) calc(var(--side-w) - 1px), var(--line) var(--side-w), var(--bg) var(--side-w)); }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: auto; transform: none; box-shadow: none; transition: none; z-index: 20; }
  .scrim, .menu-btn, .topbar .logo-sm, .bottom-nav { display: none !important; }
  .topbar .page-who { display: block; }
  .footer { padding-bottom: 18px; justify-content: space-between; text-align: left; }
  .has-actionbar .footer { padding-bottom: 18px; }
  .content { padding: 28px 32px 40px; gap: 24px; }
  .actionbar { display: none; }
  .desk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .toast { bottom: 28px; }
  .user-row { grid-template-columns: minmax(220px, 1fr) minmax(0, 2.2fr); align-items: center; }
  .user-row form { grid-template-columns: 1.1fr 1fr 1fr .8fr auto; }
  .user-row form .btn { grid-column: auto; }

  .auth { grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); }
  .hero { min-height: 100vh; min-height: 100dvh; padding: 44px 52px; justify-content: space-between; gap: 32px; position: sticky; top: 0; }
  .hero h1 { font-size: clamp(3rem, 4.6vw, 4.4rem); }
  .hero-foot { display: flex; justify-content: space-between; gap: 12px; font-size: .8125rem; color: #8ea2ba; }
  .hero-foot .powered a { color: #fff; }
  .auth-panel { align-items: center; padding: 40px 32px; }
  .auth-inner { margin-top: 0; }
  .auth-card { padding: 32px; }
}

@media (min-width: 1280px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { grid-template-columns: minmax(0, 1fr) 340px; }
  .detail-side { order: 2; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
  .claim-form { grid-template-columns: minmax(0, 1fr) 300px; }
  .claim-form .summary { position: sticky; top: calc(var(--top-h) + 16px); }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (max-width: 359.98px) {
  :root { --gutter: 12px; }
  .decision .btns { grid-template-columns: minmax(0, 1fr); }
  .actionbar .btns .btn { padding: 0 12px; }
  .stops b { font-size: .6875rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .actionbar, .footer, .decision { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

