/* ===================== Amerco Books: styles ===================== */
:root {
  --bg: #EDF1F4; --surface: #FFFFFF; --surface-2: #F5F8FA; --line: #D6DFE6; --line-2: #E6ECF0;
  --ink: #0F2231; --ink-2: #3A5163; --ink-3: #647A8A; --nav: #0E2A3E; --nav-2: #133750; --nav-ink: #B9CBD8;
  --brand: #F15B2E; --brand-2: #D9481D; --brand-soft: #FDE7DF; --sea: #29A9E1; --sea-ink: #12739E; --sea-soft: #E0F2FB;
  --good: #1B8A57; --good-soft: #E1F3EA; --warn: #9A6200; --warn-soft: #FBF0D9; --bad: #C0303A; --bad-soft: #FBE4E6;
  --focus: #29A9E1; --shadow: 0 10px 40px rgba(14, 42, 62, .18);
  --f-body: 'Barlow', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-cond: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', 'Segoe UI', sans-serif;
  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0C1C28; --surface: #11283A; --surface-2: #0F2333; --line: #23405A; --line-2: #1B3448;
  --ink: #E7EFF4; --ink-2: #AFC2D0; --ink-3: #7E96A8; --nav: #081621; --nav-2: #0F2636; --nav-ink: #9FB6C7;
  --brand: #F3683E; --brand-2: #F58660; --brand-soft: #3A2419; --sea: #4DB9E8; --sea-ink: #6CC6EE; --sea-soft: #12344A;
  --good: #43BE83; --good-soft: #10352A; --warn: #E3A945; --warn-soft: #3A2E12; --bad: #F2707B; --bad-soft: #3F1D23;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1C28; --surface: #11283A; --surface-2: #0F2333; --line: #23405A; --line-2: #1B3448;
    --ink: #E7EFF4; --ink-2: #AFC2D0; --ink-3: #7E96A8; --nav: #081621; --nav-2: #0F2636; --nav-ink: #9FB6C7;
    --brand: #F3683E; --brand-2: #F58660; --brand-soft: #3A2419; --sea: #4DB9E8; --sea-ink: #6CC6EE; --sea-soft: #12344A;
    --good: #43BE83; --good-soft: #10352A; --warn: #E3A945; --warn-soft: #3A2E12; --bad: #F2707B; --bad-soft: #3F1D23;
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--f-body); font-feature-settings: "tnum" 1, "lnum" 1; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--sea-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-cond); font-weight: 600; margin: 0; line-height: 1.15; letter-spacing: .005em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 10px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.warnc { color: var(--warn); }
.brandc { color: var(--brand); }
.seac { color: var(--sea-ink); }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--nav); color: var(--nav-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; }
.brand img { width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 3px; object-fit: contain; }
.brand b { display: block; font: 700 19px/1.05 var(--f-cond); letter-spacing: .01em; }
.brand span { display: block; font-size: 12px; color: var(--nav-ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--nav-ink); font-weight: 500; text-decoration: none; position: relative; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: var(--nav-2); color: #fff; }
.nav a.on { background: var(--nav-2); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .cnt { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .08); margin: 10px 4px; }
.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.who div { min-width: 0; }
.who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { display: block; font-size: 12px; }
.side-tools { display: flex; gap: 6px; }
.side-tools button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--nav-2); border: 0; color: var(--nav-ink); border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 13px; }
.side-tools button:hover { color: #fff; }
.side-tools svg { width: 16px; height: 16px; }
.mode { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.mode i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.mode i.local { background: var(--warn); }
.mode i.off { background: var(--bad); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 12px 28px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.top-title { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.top-title h1 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title .back { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); }
.top-title .back:hover { background: var(--surface); text-decoration: none; }
.top-logo { display: none; width: 34px; height: 34px; border-radius: 7px; background: #fff; padding: 2px; object-fit: contain; }
.content { max-width: 1320px; width: 100%; margin: 0 auto; padding: 22px 28px 60px; }
.searchbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-3); cursor: pointer; min-width: 220px; }
.searchbtn svg { width: 16px; height: 16px; }
.searchbtn kbd { margin-left: auto; font: 600 11px var(--f-body); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--ink-3); }
.bottombar { display: none; }

/* ---------- buttons, chips, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.dark { background: var(--nav); border-color: var(--nav); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.paid, .badge.good, .badge.accepted, .badge.converted { background: var(--good-soft); color: var(--good); }
.badge.overdue, .badge.bad, .badge.late, .badge.declined { background: var(--bad-soft); color: var(--bad); }
.badge.unpaid, .badge.partial, .badge.warn, .badge.due, .badge.expired { background: var(--warn-soft); color: var(--warn); }
.badge.sent, .badge.info, .badge.open, .badge.issued, .badge.filed { background: var(--sea-soft); color: var(--sea-ink); }
.badge.draft, .badge.void { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--line); }
.badge.void { text-decoration: line-through; }
.badge.brand { background: var(--brand-soft); color: var(--brand-2); }
.badge.z { background: var(--sea-soft); color: var(--sea-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--nav); border-color: var(--nav); color: #fff; }
.chip .n { font-size: 12px; opacity: .75; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 5px 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--nav); color: #fff; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 0 10px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a .n { font-weight: 500; font-size: 13px; margin-left: 4px; color: var(--ink-3); }

/* ---------- panels and grids ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px 0; }
.panel-h h2, .panel-h h3 { flex: 1; min-width: 0; }
.panel-b { padding: 14px 18px 18px; }
.panel-b.flush { padding: 8px 0 4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.lede { color: var(--ink-2); max-width: 70ch; }
.hr { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); }
.kpi { padding: 14px 18px 15px; border-left: 1px solid var(--line-2); min-width: 0; text-decoration: none; color: inherit; display: block; }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--surface-2); text-decoration: none; }
.kpi .l { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.kpi .v { font: 600 27px/1.15 var(--f-cond); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { font-size: 12.5px; margin-top: 2px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d b { font-weight: 600; }

/* ---------- corridor board (the hero) ---------- */
.corridor { background: var(--nav); color: #DCE8F0; border-radius: var(--r-l); overflow: hidden; position: relative; }
.corridor-h { display: flex; align-items: flex-end; gap: 16px; padding: 18px 22px 4px; flex-wrap: wrap; }
.corridor-h h2 { color: #fff; font-size: 23px; }
.corridor-h p { margin: 2px 0 0; color: #9FB6C7; font-size: 13.5px; }
.corridor-h .leg { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; color: #9FB6C7; }
.corridor-h .leg i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.corridor svg { display: block; width: 100%; height: auto; }
.corridor .lane-path { fill: none; stroke-linecap: round; transition: opacity .15s; }
.corridor .lane:hover .lane-path { opacity: 1 !important; }
.corridor .lane text { font-family: var(--f-body); }
.corridor .lane .nm { font: 600 15px var(--f-cond); fill: #fff; }
.corridor .lane .fig { font: 600 15px var(--f-cond); fill: #fff; }
.corridor .lane .meta { font-size: 11.5px; fill: #8FA8BA; }
.corridor .lane { cursor: pointer; }
.corridor-compact { display: none; padding: 6px 16px 16px; }
.cc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.cc-row:first-child { border-top: 0; }
.cc-row b { color: #fff; font: 600 15px var(--f-cond); }
.cc-row .fig { color: #fff; font: 600 15px var(--f-cond); text-align: right; }
.cc-row .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cc-row .bar i { display: block; height: 100%; border-radius: 3px; }
.cc-row .meta { grid-column: 1 / -1; font-size: 12px; color: #8FA8BA; }
.corridor-empty { padding: 30px 22px 36px; color: #9FB6C7; }

/* ---------- lists and tables ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--surface-2); }
.tbl tbody tr.sel td { background: var(--sea-soft); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.tbl .strong { font-weight: 600; }
.tbl .chk { width: 34px; padding-right: 0; }
.tbl input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.tbl td.grp { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.tbl.dense td { padding: 7px 10px; }
.tbl.dense th { padding: 7px 10px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.li:first-child { border-top: 0; }
a.li:hover { background: var(--surface-2); text-decoration: none; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .amt { font-weight: 600; white-space: nowrap; text-align: right; }
.ico { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.ico svg { width: 18px; height: 18px; }
.ico.brand { background: var(--brand-soft); color: var(--brand-2); }
.ico.sea { background: var(--sea-soft); color: var(--sea-ink); }
.ico.good { background: var(--good-soft); color: var(--good); }
.ico.bad { background: var(--bad-soft); color: var(--bad); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }
.sumline { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); padding: 10px 2px 0; }
.sumline b { color: var(--ink); font-weight: 600; }
.bulkbar { position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 10px; background: var(--nav); color: #fff; border-radius: 12px; padding: 8px 10px 8px 16px; box-shadow: var(--shadow); margin-top: 12px; flex-wrap: wrap; }
.bulkbar .grow { flex: 1; }
.bulkbar .btn { background: var(--nav-2); border-color: var(--nav-2); color: #fff; }
.bulkbar .btn.primary { background: var(--brand); border-color: var(--brand); }

/* ---------- insights / action queue ---------- */
.insight { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.insight:first-child { border-top: 0; }
.insight .ico { grid-row: span 2; }
.insight h4 { font: 600 15px/1.3 var(--f-body); }
.insight p { margin: 2px 0 8px; font-size: 13.5px; color: var(--ink-2); }
.insight.urgent h4 { color: var(--bad); }
.insight .btn { justify-self: start; }

/* ---------- bars and charts ---------- */
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 0; }
.hbar .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .v { font-weight: 600; white-space: nowrap; }
.hbar .track { grid-column: 1 / -1; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 3px; background: var(--sea); }
.hbar .track i.brand { background: var(--brand); }
.hbar .track i.ink { background: var(--nav); }
.hbar .m { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { fill: var(--ink-3); font-size: 11px; font-family: var(--f-body); }
.chart .grid-l { stroke: var(--line-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid .span2 { grid-column: span 2; }
.fgrid .span3 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--bad); font-weight: 500; }
.inp, select.inp, textarea.inp { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 11px; color: var(--ink); min-width: 0; }
textarea.inp { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; line-height: 1.45; }
select.inp { padding-right: 28px; }
.inp:focus { border-color: var(--sea); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sea) 22%, transparent); }
.inp.bad { border-color: var(--bad); }
.inp.r { text-align: right; }
.inp.sm { height: 32px; font-size: 14px; padding: 0 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.fsec { border-top: 1px solid var(--line-2); padding-top: 14px; }
.fsec > h3 { margin-bottom: 10px; }
.callout { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; background: var(--sea-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--sea) 35%, transparent); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.callout.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.callout.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.callout b { font-weight: 600; }
.callout .btn { margin-top: 8px; }
.quick { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; }
.quick svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.quick input { flex: 1; border: 0; background: transparent; height: 36px; outline: none; min-width: 0; }

/* doc editor lines */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 12px; font-weight: 600; color: var(--ink-3); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 6px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lines textarea.inp { min-height: 38px; height: 38px; resize: vertical; }
.lines .amt { font-weight: 600; text-align: right; padding-top: 14px; white-space: nowrap; }
.lines .trk { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 4px 0 8px; border-radius: 6px; background: var(--sea-soft); color: var(--sea-ink); font-size: 12px; font-weight: 600; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 3px; font-size: 14px; line-height: 1; }
.totals { margin-left: auto; min-width: 280px; display: grid; grid-template-columns: 1fr auto; gap: 6px 22px; font-size: 14.5px; }
.totals .g { font: 700 20px var(--f-cond); }
.suggest { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px 8px 12px; font-size: 13.5px; }
.suggest .grow { flex: 1; }

/* ---------- overlays ---------- */
.ov { position: fixed; inset: 0; z-index: 60; background: rgba(8, 22, 33, .42); opacity: 0; transition: opacity .18s ease; }
.ov.in { opacity: 1; }
.drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer.wide { width: min(980px, 100vw); }
.drawer.in { transform: none; opacity: 1; }
.dr-h { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); }
.dr-h h2 { flex: 1; min-width: 0; }
.dr-h .sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; font-family: var(--f-body); font-weight: 400; }
.dr-b { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.dr-f { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--surface); flex-wrap: wrap; }
.dr-f .grow { flex: 1; }
.modal { position: fixed; z-index: 71; left: 50%; top: 18vh; transform: translate(-50%, 8px); width: min(460px, calc(100vw - 32px)); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); opacity: 0; transition: opacity .16s, transform .16s; }
.modal.in { opacity: 1; transform: translate(-50%, 0); }
.modal .dr-b { padding: 18px 20px 8px; }
.ov.top { z-index: 70; }
.palette { position: fixed; z-index: 81; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; transition: opacity .12s; }
.palette.in { opacity: 1; }
.ov.pal { z-index: 80; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.pal-in svg { width: 20px; height: 20px; color: var(--ink-3); }
.pal-in input { flex: 1; border: 0; outline: none; background: transparent; font-size: 17px; height: 32px; }
.pal-list { max-height: min(430px, 58vh); overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pal-item .grow { flex: 1; min-width: 0; }
.pal-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item.on { background: var(--sea-soft); }
.pal-grp { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 10px 4px; }
.menu { position: fixed; z-index: 90; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); padding: 5px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button svg { width: 17px; height: 17px; color: var(--ink-3); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 2px; }
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100vw - 24px)); }
.toast { pointer-events: auto; background: var(--nav); color: #fff; border-radius: 11px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 14px; display: flex; align-items: center; gap: 10px; max-width: 100%; animation: tin .18s ease; }
.toast.bad { background: var(--bad); }
.toast.good i { color: #7BE3AE; }
.toast button { border: 0; background: rgba(255, 255, 255, .15); color: #fff; border-radius: 7px; padding: 4px 9px; cursor: pointer; font-weight: 600; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- A4 document preview ---------- */
.docwrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.paper-scroll { overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 22px; }
.paper { width: 794px; min-height: 1123px; margin: 0 auto; background: #fff; color: #1B2A36; box-shadow: 0 2px 18px rgba(14, 42, 62, .12); padding: 46px 52px 40px; font: 400 12.5px/1.45 var(--f-body); position: relative; display: flex; flex-direction: column; }
.paper .p-top { display: flex; justify-content: space-between; gap: 20px; }
.paper .p-logo { width: 190px; }
.paper .p-co { text-align: right; font-size: 11.5px; color: #4A5D6B; }
.paper .p-co b { display: block; font: 700 16px var(--f-cond); color: #0F2231; margin-bottom: 2px; }
.paper .p-title { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 22px; border-bottom: 3px solid #F15B2E; padding-bottom: 8px; }
.paper .p-title h1 { font: 700 30px var(--f-cond); color: #0F2231; letter-spacing: .02em; }
.paper .p-title .st { font: 700 18px var(--f-cond); color: #C0303A; border: 2px solid #C0303A; border-radius: 6px; padding: 1px 10px; transform: rotate(-4deg); }
.paper .p-title .st.paid { color: #1B8A57; border-color: #1B8A57; }
.paper .p-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; margin-top: 12px; }
.paper .p-meta div span { display: block; font-size: 10.5px; color: #6B7F8E; font-weight: 600; }
.paper .p-meta div b { font-weight: 600; color: #0F2231; }
.paper .p-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
.paper .p-box h4 { font: 600 11px var(--f-body); color: #29A9E1; margin-bottom: 4px; }
.paper .p-box { font-size: 12px; white-space: pre-line; }
.paper .p-box b { font-weight: 600; font-size: 13px; }
.paper table.p-lines { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 12px; }
.paper table.p-lines th { background: #0E2A3E; color: #fff; font-weight: 600; font-size: 11px; text-align: left; padding: 7px 8px; }
.paper table.p-lines th.r, .paper table.p-lines td.r { text-align: right; white-space: nowrap; }
.paper table.p-lines td { padding: 7px 8px; border-bottom: 1px solid #E3E9EE; vertical-align: top; white-space: pre-line; }
.paper table.p-lines tr:nth-child(even) td { background: #F7FAFC; }
.paper .p-foot { display: grid; grid-template-columns: 1fr 250px; gap: 26px; margin-top: 16px; }
.paper .p-tot { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; font-size: 12.5px; }
.paper .p-tot .g { font: 700 17px var(--f-cond); color: #fff; background: #F15B2E; padding: 6px 10px; margin: 4px -10px 0; display: contents; }
.paper .p-tot .gt { background: #F15B2E; color: #fff; font: 700 16px var(--f-cond); padding: 7px 10px; border-radius: 6px; grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 4px; }
.paper .p-bank { font-size: 11.5px; color: #33475A; }
.paper .p-bank h4 { font: 600 11px var(--f-body); color: #29A9E1; margin-bottom: 3px; }
.paper .p-notes { margin-top: 16px; font-size: 11.5px; color: #33475A; white-space: pre-line; }
.paper .p-end { margin-top: auto; padding-top: 18px; border-top: 1px solid #E3E9EE; font-size: 11px; color: #6B7F8E; display: flex; justify-content: space-between; gap: 16px; }
.paper .p-band { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #F15B2E 0 60%, #29A9E1 60% 100%); }
.docside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.flag { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 13.5px; }
.flag.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.flag.info { border-left-color: var(--sea); background: var(--sea-soft); }
.flag b { display: block; margin-bottom: 2px; }
.flag .btns { margin-top: 8px; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; color: var(--line); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }
.hero-empty { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 34px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 30px; align-items: center; }
.hero-empty h2 { font-size: 30px; margin-bottom: 10px; }
.steps { display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { list-style: none; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--nav); color: #fff; font: 600 14px/26px var(--f-cond); text-align: center; }
.steps { padding: 0; margin: 0; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 90px 20px; color: var(--ink-3); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.ai-out { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.ai-q { font-weight: 600; margin: 14px 0 6px; }
.ai-q:first-child { margin-top: 0; }
.pill-note { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.meter { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sea); }
.vatbox { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.vatbox:first-child { border-top: 0; }
.vatbox .fn { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font: 600 13px var(--f-cond); color: var(--ink-2); }
.vatbox .amt { font-weight: 600; text-align: right; white-space: nowrap; }
.vatbox.total { border-top: 2px solid var(--ink); font-weight: 700; }
.vatbox.total .amt { font: 700 20px var(--f-cond); }
.period-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.period-list a:first-child { border-top: 0; }
.period-list a:hover { background: var(--surface-2); }
.period-list a.on { background: var(--sea-soft); }
.period-list .s { font-size: 12.5px; color: var(--ink-3); }
.acct { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; border-left: 1px solid var(--line-2); }
.acct:first-child { border-left: 0; }
.acct .v { font: 600 24px var(--f-cond); }
.grid-accts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); }
.fleet-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.fleet-card:first-child { border-top: 0; }
.plate { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px; border: 2px solid #0F2231; background: #fff; color: #0F2231; font: 700 15px var(--f-cond); letter-spacing: .04em; white-space: nowrap; }
.plate.trailer { border-color: #F15B2E; }
.fleet-stats { display: grid; grid-template-columns: repeat(4, minmax(80px, auto)); gap: 2px 18px; text-align: right; font-size: 13px; }
.fleet-stats b { display: block; font: 600 16px var(--f-cond); }
.fleet-stats span { color: var(--ink-3); font-size: 12px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--ink-3); cursor: pointer; display: block; }
.dropzone:hover, .dropzone.over { border-color: var(--sea); background: var(--sea-soft); color: var(--ink); }
.dropzone input { display: none; }

/* ---------- additions: company switcher, bell, login ---------- */
.err { color: var(--bad); font-size: 13px; font-weight: 500; }
.tbl td svg { width: 15px; height: 15px; vertical-align: -3px; }
.co-switch { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; color: #fff; padding: 6px 6px; margin-bottom: 14px; cursor: pointer; text-align: left; border-radius: 10px; }
.co-switch:hover { background: var(--nav-2); }
.co-switch img { width: 42px; height: 42px; border-radius: 8px; background: #fff; padding: 3px; object-fit: contain; flex: none; }
.co-switch .co-t { flex: 1; min-width: 0; }
.co-switch b { display: block; font: 700 17px/1.1 var(--f-cond); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-switch .co-t span { display: block; font-size: 12px; color: var(--nav-ink); margin-top: 2px; }
.co-switch > svg { width: 16px; height: 16px; color: var(--nav-ink); flex: none; }
.co-ini { width: 42px; height: 42px; border-radius: 8px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 20px var(--f-cond); flex: none; }
.co-ini.sm { width: 28px; height: 28px; border-radius: 50%; font-size: 14px; background: var(--nav-2); }
.bell { position: relative; }
.bell .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.demo-bar { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 7px 28px; font-weight: 500; }
.totals .g { font: 700 20px var(--f-cond); }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
.login-card { background: var(--surface); padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.login-card h1 { font-size: 32px; }
.login-logo { width: 170px; margin-bottom: 18px; background: #fff; border-radius: 8px; }
.login-side { background: var(--nav); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.login-side::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #F15B2E 0 60%, #29A9E1 60% 100%); }
.login-side h2 { font: 700 44px/1.02 var(--f-cond); max-width: 14ch; }
.login-side p { color: var(--nav-ink); font-size: 16px; }
@media (max-width: 860px) { .hide-m { display: none !important; } .login { grid-template-columns: minmax(0, 1fr); } .login-side { display: none; } .login-card { padding: 40px 22px; } .demo-bar { padding: 7px 14px; } }

/* ---------- agreements ---------- */
.paper.contract { font-size: 13.5px; line-height: 1.55; }
.paper.contract .k-band { height: 6px; margin: -1px -1px 18px; background: linear-gradient(90deg, #F15B2E 0 60%, #29A9E1 60% 100%); border-radius: 4px 4px 0 0; }
.paper.contract .k-head { display: flex; gap: 18px; align-items: center; border-bottom: 3px solid #F15B2E; padding-bottom: 12px; margin-bottom: 16px; }
.paper.contract .k-head img { width: 110px; }
.paper.contract h1 { font: 700 28px/1.05 var(--f-cond); color: #0E2A3E; margin: 0; }
.paper.contract .k-head p { margin: 4px 0 0; color: #4A5D6B; }
.paper.contract h2 { font: 700 17px var(--f-cond); color: #0E2A3E; border-bottom: 2px solid #29A9E1; padding-bottom: 3px; margin: 22px 0 8px; }
.paper.contract h2.k-sch { border-bottom-color: #F15B2E; text-transform: uppercase; }
.paper.contract p { margin: 0 0 7px; text-align: justify; padding-left: 38px; position: relative; }
.paper.contract p .k-n { position: absolute; left: 0; color: #F15B2E; font-weight: 700; }
.paper.contract p.k-edited { background: #FFF6E5; }
.paper.contract mark { background: #FFE86B; color: inherit; font-weight: 600; padding: 0 2px; }
.k-cover, .k-tbl, .k-sign { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.k-cover th { background: #0E2A3E; color: #fff; text-align: left; font-size: 11.5px; letter-spacing: .03em; width: 30%; padding: 8px 10px; vertical-align: top; }
.k-cover td { background: #F4F8FB; padding: 8px 10px; border-bottom: 1px solid #DDE5EC; }
.k-tbl th, .k-sign th { background: #0E2A3E; color: #fff; text-align: left; padding: 7px 10px; font-size: 12px; }
.k-tbl td { padding: 7px 10px; border-bottom: 1px solid #DDE5EC; vertical-align: top; }
.k-tbl td:first-child { font-weight: 700; color: #0E2A3E; width: 30%; }
.k-tbl tr:nth-child(even) td { background: #F4F8FB; }
.k-sign td { border: 1px solid #DDE5EC; padding: 12px 10px; width: 50%; font-weight: 600; color: #4A5D6B; }
.k-draft { background: #FFF1EB; border-left: 4px solid #F15B2E; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
details > summary { cursor: pointer; padding: 6px 0; }

/* ---------- inbox, idle lock ---------- */
.idle-lock { position: fixed; inset: 0; z-index: 9999; background: rgba(14, 42, 62, .92); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(6px); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 2px dashed var(--sea); background: var(--sea-soft); border-radius: 14px; padding: 22px 16px; cursor: pointer; color: var(--ink); }
.dropzone > svg { width: 30px; height: 30px; color: var(--sea); flex: none; }
.dropzone.over { background: #d4ecf9; }
.dropzone input[type=file] { display: none; }
.dropzone.big { padding: 34px 20px; font-size: 15px; }
.inbox-row { gap: 10px; flex-wrap: wrap; }
.inbox-row .ico { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); flex: none; }
.inbox-row .ico.sea { background: var(--sea-soft); color: var(--sea); }
.inbox-row .ico svg { width: 18px; height: 18px; }

.ai-provs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.ai-prov { display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface); }
.ai-prov.on { border-color: var(--brand); background: var(--brand-soft, #fff3ee); }
.ai-prov input { position: absolute; opacity: 0; pointer-events: none; }

.th-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.th-card { position: relative; display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--line); border-radius: var(--r-l); padding: 12px; cursor: pointer; background: var(--surface); }
.th-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.th-card input { position: absolute; opacity: 0; pointer-events: none; }
.th-sw { display: flex; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.th-sw i { width: 28%; }
.th-sw b { flex: 1; margin: 10px; border-radius: 6px; display: flex; gap: 6px; align-items: flex-end; padding: 8px; }
.th-sw u { display: block; width: 26px; height: 12px; border-radius: 4px; }
input[type=color].inp { padding: 3px; height: 40px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line-2); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .docwrap { grid-template-columns: minmax(0, 1fr); }
  .docside { position: static; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top-in { padding: 10px 16px; min-height: 56px; }
  .top-logo { display: block; }
  .top-title h1 { font-size: 21px; }
  .searchbtn { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .searchbtn span, .searchbtn kbd { display: none; }
  .content { padding: 16px 14px 110px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 1px solid var(--line-2) !important; border-top: 1px solid var(--line-2); padding: 12px 14px; }
  .kpi:nth-child(odd) { border-left: 0 !important; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi .v { font-size: 23px; }
  .corridor svg.wide-only { display: none; }
  .corridor-compact { display: block; }
  .corridor-h .leg { margin-left: 0; }
  .bottombar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--nav); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; }
  .bottombar a, .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--nav-ink); background: transparent; border: 0; padding: 5px 0; text-decoration: none; cursor: pointer; border-radius: 9px; }
  .bottombar a.on { color: #fff; }
  .bottombar svg { width: 21px; height: 21px; }
  .bottombar .plus { flex: none; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; background: var(--brand); color: #fff; justify-content: center; box-shadow: 0 6px 18px rgba(241, 91, 46, .45); }
  .bottombar .plus svg { width: 24px; height: 24px; }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .drawer, .drawer.wide { width: 100vw; }
  .fgrid, .fgrid.three { grid-template-columns: minmax(0, 1fr); }
  .fgrid .span2 { grid-column: auto; }
  .hero-empty { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .tbl .hide-m { display: none; }
  .fleet-card { grid-template-columns: minmax(0, 1fr) auto; }
  .fleet-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: left; }
  .paper-scroll { padding: 10px; }
  .bulkbar { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .lines-wrap { overflow-x: auto; }
  .lines { min-width: 720px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- print: only the document ---------- */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .side, .top, .bottombar, .docside, .toasts, .no-print, .ov, .drawer, .modal { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .docwrap { display: block; }
  .paper-scroll { border: 0; padding: 0; background: #fff; overflow: visible; }
  .paper { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; }
}

/* 1.1: trips, incidents, statement lines */
.chk-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.plate.sm { font-size: 12px; padding: 2px 7px; }
.tlog { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.tlog .tl { position: relative; padding: 0 0 12px 16px; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.tlog .tl::before { content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sea, #2a7ab0); }
.tlog .tl.st::before { background: var(--brand); border-color: var(--brand); }
.tlog .tl span { color: var(--ink-2, inherit); }
.split-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.split-row:last-of-type { border-bottom: 0; }
