/* Simon Jones Superfreight (SJSF) brand — taken from the SJSF quotation:
   navy #1F3050 (banner, headings, table heads), gold #B8934A (accent rule), pale grey-blue #EDEFF3 (panels),
   cream #FBF4E6 (call-outs), rule grey #D4D8DE. Navy sidebar with the white SJSF logo; Lato for text,
   IBM Plex Mono for codes. */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #edeff3;
  --line: #d4d8de;
  --fg: #1b2333;
  --muted: #5f6673;
  --accent: #1f3050;
  --accent-ink: #ffffff;
  --accent-soft: #e4e8f0;
  --gold: #b8934a;
  --gold-1: #d9bd85; --gold-2: #9c7a37; --gold-3: #c9a865;
  --cream: #fbf4e6;
  --navy: #1f3050;
  --btn-1: #2b4170; --btn-2: #1f3050;
  --side: #1f3050;
  --side-fg: #c3cad8;
  --side-hi: #ffffff;
  --ok: #2f7044; --ok-soft: #e0efe4;
  --warn: #a8530f; --warn-soft: #fbecd9;
  --bad: #b02a20; --bad-soft: #f8dedb;
  --info: #2c5d8c; --info-soft: #dde8f3;
  --violet: #634696; --violet-soft: #e9e2f3;
  --shadow: 0 1px 2px rgba(27, 35, 51, .06), 0 6px 24px rgba(27, 35, 51, .07);
  --f-head: "Lato", "Segoe UI", system-ui, sans-serif;
  --f-body: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 6px;
  --side-w: 240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1522; --surface: #161e2e; --surface-2: #1e2839; --line: #2d384d; --fg: #e8ebf1; --muted: #9aa3b2;
    --accent: #d4b578; --accent-ink: #121a2b; --btn-1: #dcc28c; --btn-2: #b8934a; --accent-soft: #2c2a22; --cream: #2c2718;
    --side: #0c1220; --side-fg: #a9b2c3; --side-hi: #ffffff;
    --ok: #74c08f; --ok-soft: #18291e; --warn: #f0a868; --warn-soft: #3a2a14; --bad: #f07a6f; --bad-soft: #3a1a17;
    --info: #86b4e0; --info-soft: #182637; --violet: #b49ae6; --violet-soft: #2a2140;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1522; --surface: #161e2e; --surface-2: #1e2839; --line: #2d384d; --fg: #e8ebf1; --muted: #9aa3b2;
  --accent: #d4b578; --accent-ink: #121a2b; --btn-1: #dcc28c; --btn-2: #b8934a; --accent-soft: #2c2a22; --cream: #2c2718;
  --side: #0c1220; --side-fg: #a9b2c3; --side-hi: #ffffff;
  --ok: #74c08f; --ok-soft: #18291e; --warn: #f0a868; --warn-soft: #3a2a14; --bad: #f07a6f; --bad-soft: #3a1a17;
  --info: #86b4e0; --info-soft: #182637; --violet: #b49ae6; --violet-soft: #2a2140;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: 1.6rem; line-height: 1.2; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
.mono, code { font-family: var(--f-mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num, .tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; background: linear-gradient(to right, var(--side) var(--side-w), transparent var(--side-w)); }
.side { background: var(--side); color: var(--side-fg); position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: block; padding: 14px 16px 6px; color: var(--side-hi); }
.brand svg, .brand .sj-logo { display: block; width: 196px; height: auto; margin: 6px 0 4px 2px; }
.brand-sub { padding: 0 2px; margin-top: 2px; }
.brand-mark { width: 30px; height: 30px; border: 1.5px solid currentColor; display: grid; place-items: center; font: 600 13px var(--f-mono); letter-spacing: -.04em; }
.brand-name { font: 600 15px/1.1 var(--f-head); letter-spacing: .02em; }
.brand-sub { font: 11px var(--f-mono); color: var(--side-fg); opacity: .75; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; padding: 6px 10px 16px; gap: 1px; }
.nav-sec { font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .55; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; color: var(--side-fg); font-size: 13.5px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--side-hi); text-decoration: none; }
.nav a.on { background: rgba(184, 147, 74, .14); color: var(--side-hi); box-shadow: inset 2px 0 0 var(--gold); }
.nav a.on .ico { color: var(--gold); }
.nav a .count { margin-left: auto; font: 600 11px var(--f-mono); background: #b02a20; color: #fff; padding: 0 6px; border-radius: 9px; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot .who { color: var(--side-hi); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 30; }
.search-results a { display: flex; gap: 10px; padding: 8px 12px; color: var(--fg); border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a.hi { background: var(--surface-2); text-decoration: none; }
.search-results .t { font: 600 10px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 64px; flex: none; padding-top: 3px; }
.top-actions { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.content { padding: 22px 24px 64px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.icon-btn.menu-btn { display: none; }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; justify-content: space-between; }
.page-head .eyebrow { font: 600 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 13.5px var(--f-body); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--line)); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--btn-1), var(--btn-2)); border-color: var(--btn-2); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn.is-busy { opacity: .7; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--fg); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font: 600 10px/16px var(--f-mono); }
.ico { width: 18px; height: 18px; flex: none; }
.btn .ico { width: 16px; height: 16px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; }
.panel-body { padding: 14px 16px; }
.panel-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.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); }
@media (max-width: 1100px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 2px; color: var(--fg); position: relative; }
a.kpi:hover { background: var(--surface-2); text-decoration: none; }
.kpi .k-label { font: 600 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .k-val { font: 600 30px/1.1 var(--f-head); font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--muted); }
.kpi.attn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--warn); }
.kpi.crit::before { background: var(--bad); }
.kpi.crit .k-val { color: var(--bad); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font: 600 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr[data-href] { cursor: pointer; }
.tbl tr[data-href]:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .code { font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; }
.tbl .t-main { font-weight: 500; }
.tbl .t-sub { color: var(--muted); font-size: 12.5px; }
.tbl tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 12px; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font: 500 12px/18px var(--f-body); white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-muted { background: var(--surface-2); color: var(--muted); }
.tag { font: 600 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; }
.tag-bad { color: var(--bad); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13.5px; min-width: 0; }
.filters input[type=search] { width: 240px; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full, .form .field.full { grid-column: 1 / -1; }
.form h3 { grid-column: 1 / -1; margin-top: 6px; font-size: .82rem; font-family: var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form, .form-3 { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.hint { color: var(--muted); font-size: 12px; }
.req { color: var(--bad); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding-top: 22px; }
.inline-calc { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); font-variant-numeric: tabular-nums; }
.inline-calc b { font-family: var(--f-mono); }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 11, .5); display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out; }
.modal { background: var(--surface); color: var(--fg); border-radius: 10px; width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-text { margin: 0; font-size: 15px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 200; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); right: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); font-size: 13.5px; transition: opacity .3s, transform .3s; border-left: 4px solid var(--ok); }
.toast-bad { border-left-color: var(--bad); }
.toast-warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .when { font: 600 12px var(--f-mono); color: var(--muted); width: 54px; flex: none; padding-top: 2px; }
.list .title { font-weight: 500; }
.list .sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.dir { font: 600 10px var(--f-mono); letter-spacing: .06em; padding: 1px 5px; border-radius: 3px; }
.dir-in { background: var(--info-soft); color: var(--info); }
.dir-out { background: var(--warn-soft); color: var(--warn); }

.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.sev-critical { background: var(--bad); }
.sev-warning { background: var(--warn); }
.sev-info { background: var(--info); }

/* ---------- zone bars ---------- */
.zone { display: grid; grid-template-columns: 96px minmax(0, 1fr) 72px; gap: 10px; align-items: center; padding: 6px 16px; }
.zone-name { font: 600 12.5px var(--f-mono); }
.bar { height: 10px; border-radius: 2px; background: var(--surface-2); display: flex; overflow: hidden; }
.bar span { display: block; height: 100%; }
.bar .b-occ { background: var(--accent); }
.bar .b-part { background: color-mix(in srgb, var(--accent) 45%, var(--surface-2)); }
.zone-n { font: 12px var(--f-mono); color: var(--muted); text-align: right; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 4px 16px 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- detail ---------- */
.detail-head { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 640px) { .detail-head { grid-template-columns: minmax(0, 1fr); } }
.art-image { width: 100%; aspect-ratio: 1; max-width: 100%; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.art-image img { width: 100%; height: 100%; object-fit: contain; }
.art-image .ph { border: 2px solid var(--muted); opacity: .5; }
.code-big { font: 600 13px var(--f-mono); letter-spacing: .06em; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 8px; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; font: 500 13.5px var(--f-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.tabs .n { font: 11px var(--f-mono); color: var(--muted); margin-left: 4px; }

.timeline { list-style: none; margin: 0; padding: 6px 16px 10px; }
.timeline li { position: relative; padding: 8px 0 8px 22px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .tl-when { font: 12px var(--f-mono); color: var(--muted); }
.timeline .tl-what { font-weight: 500; }
.arrow { color: var(--muted); padding: 0 4px; }

/* ---------- location map ---------- */
.zone-map { display: flex; flex-direction: column; gap: 18px; padding: 16px; }
.zone-map h3 { font: 600 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.cell { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font: 11.5px var(--f-mono); cursor: pointer; background: var(--surface); color: var(--fg); text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 48px; }
.cell .c-n { color: var(--muted); font-size: 11px; }
.cell-free { border-left: 3px solid var(--ok); }
.cell-partial { border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.cell-occupied { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.cell-inactive { opacity: .45; }
.cell:hover { border-color: var(--accent); }

/* ---------- thumbs ---------- */
.thumb { display: inline-grid; place-items: center; border-radius: 4px; background: var(--surface-2); flex: none; overflow: hidden; vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph span { display: block; border: 1.5px solid var(--muted); opacity: .6; }
.cell-art { display: flex; gap: 10px; align-items: center; min-width: 0; }
.cell-art > div { min-width: 0; }

/* ---------- workflow steps ---------- */
.steps { display: flex; gap: 0; overflow-x: auto; padding: 14px 16px; }
.step { flex: 1; min-width: 92px; position: relative; text-align: center; font-size: 12px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::before { display: none; }
.step .dotx { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 1; display: grid; place-items: center; }
.step.done { color: var(--fg); }
.step.done .dotx { background: var(--accent); border-color: var(--accent); }
.step.done::before, .step.cur::before { background: var(--accent); }
.step.cur { color: var(--fg); font-weight: 600; }
.step.cur .dotx { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- scanner ---------- */
.scan-box { display: flex; flex-direction: column; gap: 12px; }
.scan-video { width: 100%; min-height: 0; border-radius: 6px; overflow: hidden; background: #000; }
.scan-video:empty { display: none; }
.scan-input { display: flex; gap: 8px; }
.scan-input input { flex: 1; padding: 10px 12px; font: 16px var(--f-mono); letter-spacing: .04em; border: 2px solid var(--accent); border-radius: var(--r); background: var(--surface); color: var(--fg); min-width: 0; }
.scan-tip { font-size: 12.5px; color: var(--muted); }

/* ---------- labels ---------- */
.label-sheet { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.label { width: 100mm; max-width: 100%; aspect-ratio: 2 / 1; background: #fff; color: #000; border: 1px dashed #999; padding: 3mm 4mm; display: grid; grid-template-columns: 38mm minmax(0, 1fr); gap: 3.5mm; align-items: center; font-family: var(--f-body); }
.label > div:last-child { height: 100%; }
.label .lq svg { width: 100%; height: auto; display: block; }
.label .l-code { font: 700 16px var(--f-mono); letter-spacing: .04em; }
.label .l-title { font-size: 15px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.label .l-line { font-size: 12.5px; line-height: 1.25; overflow: hidden; }
.label .l-meta { display: flex; gap: 6px; flex-wrap: wrap; font: 600 9px var(--f-mono); }
.label .l-meta span { border: 1px solid #000; padding: 0 3px; }

/* ---------- signature ---------- */
.sig { width: 100%; height: 160px; border: 1px dashed var(--muted); border-radius: 6px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sig-img { display: block; max-height: 80px; max-width: 100%; margin-top: 6px; background: #fff; border-radius: 4px; padding: 4px; border: 1px solid var(--line); }

/* ---------- login ---------- */
.demo-users { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-users button { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); cursor: pointer; font: inherit; }
.demo-users button:hover { border-color: var(--accent); }
.demo-users b { display: block; font-size: 13.5px; }
.demo-users span { font-size: 12px; color: var(--muted); }
.banner { padding: 9px 14px; border-radius: 6px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-bad { background: var(--bad-soft); color: var(--bad); }
.banner-info { background: var(--info-soft); color: var(--info); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid figure { margin: 0; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--surface-2); position: relative; border: 1px solid var(--line); cursor: pointer; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; padding: 3px 6px; background: rgba(0, 0, 0, .55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-list a { display: flex; gap: 10px; align-items: center; }
.damage-rows { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; }
.damage-row { display: grid; grid-template-columns: 1.2fr 1.2fr .9fr 1.6fr auto; gap: 6px; }
.damage-row input, .damage-row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; }
@media (max-width: 640px) { .damage-row { grid-template-columns: 1fr 1fr; } }
.pick-row.done { opacity: .6; }
.pick-row.done .t-main { text-decoration: line-through; }
.sel-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); grid-column: 1 / -1; }
.sel-list label { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.sel-list label:last-child { border-bottom: 0; }
.new-art { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.new-art input, .new-art select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; }
.new-art .w2 { grid-column: span 2; }
@media (max-width: 640px) { .new-art { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; height: 100%; padding-top: env(safe-area-inset-top, 0px); }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
  .icon-btn.menu-btn { display: inline-grid; }
  .top { padding: 8px 16px; }
  .content { padding: 16px 16px 90px; }
  .hide-sm { display: none !important; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4); }
}
.fab { display: none; }
@media (max-width: 860px) {
  .fab { display: inline-flex; position: fixed; z-index: 50; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); cursor: pointer; }
  .fab .ico { width: 26px; height: 26px; }
}

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; }
  .label { border: 0; page-break-after: always; }
}
/* A document opened in a dialog prints on its own, at full length: the app behind it takes no space, the dialog is
   no longer fixed (fixed boxes repeat on every printed page) and nothing clips the document. */
@media print {
  html:has(.modal-wrap .print-area), body:has(.modal-wrap .print-area) { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  body:has(.modal-wrap .print-area) > :not(.modal-wrap) { display: none !important; }
  .modal-wrap:has(.print-area) { position: static !important; display: block !important; padding: 0 !important; background: none !important; animation: none !important; }
  .modal-wrap:has(.print-area) .modal { display: block !important; width: auto !important; max-height: none !important; box-shadow: none !important; background: none !important; border-radius: 0 !important; }
  .modal-wrap:has(.print-area) .modal-head, .modal-wrap:has(.print-area) .modal-foot { display: none !important; }
  .modal-wrap:has(.print-area) .modal-body, .modal-wrap:has(.print-area) :has(> .print-area) { padding: 0 !important; overflow: visible !important; background: none !important; max-height: none !important; }
  .modal-wrap:has(.print-area) .print-area { position: static !important; }
}


/* ---------- sign-in (SJSF Fine Art WMS) — always dark navy with the gold accent ---------- */
.auth { --bg: #0c1322; --surface: #121b2d; --surface-2: #1b2333; --line: #34405a; --fg: #eef1f6; --muted: #9aa3b2;
  --accent: #d4b578; --accent-ink: #121a2b; --accent-soft: #2c2a22; --btn-1: #dcc28c; --btn-2: #b8934a;
  --ok-soft: #18291e; --ok: #74c08f; --bad: #f08a7f; --bad-soft: #3a1a17; --info: #8fbbe6; --info-soft: #182637; --warn: #f0a868; --warn-soft: #3a2314;
  color-scheme: dark; position: relative; min-height: 100vh; min-height: 100dvh; background: #0b1120; color: var(--fg); overflow-x: hidden; display: flex; flex-direction: column; }
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-bg svg { position: absolute; left: -2%; bottom: 8%; width: min(820px, 72vw); height: auto; opacity: .7; }
.auth-bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(70% 60% at 20% 20%, rgba(184, 147, 74, .07), transparent 60%),
  radial-gradient(60% 70% at 85% 40%, rgba(255, 255, 255, .03), transparent 65%),
  linear-gradient(90deg, rgba(11, 17, 32, .25) 0%, rgba(11, 17, 32, .55) 45%, rgba(11, 17, 32, .9) 70%),
  linear-gradient(0deg, rgba(11, 17, 32, .95) 0%, transparent 35%); }
.auth-main { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; width: min(1180px, 100%); margin: 0 auto; padding: 40px 32px 24px; }
.auth-brand { display: flex; flex-direction: column; gap: 20px; }
.auth-brand .eq { width: min(420px, 100%); height: auto; display: block; }
.sj-brand { border-left: 2px solid var(--gold, #b8934a); padding: 6px 0 6px 26px; margin-left: -28px; display: flex; flex-direction: column; gap: 12px; }
.sj-sub { font: 600 13px var(--f-head); letter-spacing: .22em; color: var(--accent); margin-top: 10px; text-transform: uppercase; }
.auth-brand h1 { font: 600 clamp(26px, 3vw, 34px)/1.2 var(--f-head); color: #fff; letter-spacing: -.01em; }
.auth-brand h1 span { color: var(--accent); font-weight: 500; }
.auth-rule { width: 54px; height: 2px; background: var(--accent); }
.auth-brand p { margin: 0; max-width: 44ch; color: #d4dae4; font-size: 15.5px; line-height: 1.6; }
.auth-feats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 480px; }
.auth-feats div { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: #e2e7ef; line-height: 1.3; }
.auth-feats .ico { width: 38px; height: 38px; color: var(--accent); stroke-width: 1.4; }
.auth-tag { font: 600 14px var(--f-head); letter-spacing: .14em; color: var(--accent); }
.auth-tag + div { color: #e2e7ef; margin-top: 4px; }
.auth-card { justify-self: center; width: min(440px, 100%); background: linear-gradient(180deg, rgba(29, 44, 72, .92), rgba(17, 27, 46, .94)); border: 1px solid rgba(184, 147, 74, .22); border-radius: 18px; padding: 34px 30px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05); backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 16px; }
.auth-lock { width: 74px; height: 74px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; margin: 0 auto 2px; color: var(--accent); background: radial-gradient(circle, rgba(184, 147, 74, .12), transparent 70%); }
.auth-lock .ico { width: 30px; height: 30px; }
.auth-card h2 { text-align: center; font: 600 28px var(--f-head); color: #fff; }
.auth-card .lead { text-align: center; color: var(--muted); margin: -8px 0 6px; font-size: 14.5px; }
.auth-in { position: relative; }
.auth-in .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #aeb6c4; width: 20px; height: 20px; pointer-events: none; }
.auth-in input { width: 100%; height: 54px; padding: 0 48px 0 50px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 16, 30, .55); color: #fff; font: 15px var(--f-body); }
.auth-in input::placeholder { color: #9aa3b2; }
.auth-in input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 147, 74, .18); }
.auth-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: #aeb6c4; cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.auth-eye:hover { color: #fff; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: #e2e7ef; }
.auth-row label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.auth-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.auth-card a { color: var(--accent); }
.auth-go { height: 54px; border: 0; border-radius: 10px; background: linear-gradient(100deg, #dcc28c, #c4a160 60%, #b8934a); color: #121a2b; font: 600 16px var(--f-head); cursor: pointer; box-shadow: 0 8px 24px rgba(184, 147, 74, .18); }
.auth-go:hover { filter: brightness(1.05); }
.auth-go:disabled { opacity: .7; cursor: wait; }
.auth-or { display: flex; align-items: center; gap: 14px; color: #c3cad6; font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-qr { height: 52px; border-radius: 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 15.5px var(--f-head); display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.auth-qr:hover { background: rgba(184, 147, 74, .08); }
.auth-help { display: flex; align-items: center; justify-content: center; gap: 10px; color: #d4dae4; font-size: 14px; margin-top: 2px; }
.auth-help .ico { color: var(--accent); width: 22px; height: 22px; }
.auth-card .banner { font-size: 13.5px; }
.auth-card .field label { color: var(--muted); }
.auth-card .field input { height: 46px; background: rgba(10, 16, 30, .55); border-color: var(--line); color: #fff; }
.auth-strip { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 0 auto 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; background: rgba(20, 20, 19, .75); }
.auth-strip div { display: flex; gap: 14px; align-items: center; padding: 18px 22px; border-right: 1px solid rgba(255, 255, 255, .08); }
.auth-strip div:last-child { border-right: 0; }
.auth-strip .ico { width: 34px; height: 34px; color: var(--accent); flex: none; stroke-width: 1.5; }
.auth-strip b { display: block; color: #eef1f6; font-weight: 500; font-size: 14px; }
.auth-strip span { color: #9aa3b2; font-size: 13px; }
.auth-foot { position: relative; z-index: 1; text-align: center; color: #8f897d; font-size: 13px; padding: 6px 16px 18px; }
.demo-acc { margin-top: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.demo-acc summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.demo-acc .demo-users button { background: rgba(10, 16, 30, .5); border-color: var(--line); color: #eef1f6; }
.demo-acc .demo-users span { color: #9aa3b2; }
@media (max-width: 960px) {
  .auth-main { grid-template-columns: minmax(0, 1fr); padding: 28px 16px 16px; gap: 28px; }
  .auth-brand { align-items: flex-start; }
  .auth-brand p, .auth-feats, .auth-tag, .auth-tag + div { display: none; }
  .auth-brand .eq { width: 120px; }
  .auth-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-strip div:nth-child(2) { border-right: 0; }
  .auth-strip div:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .auth-bg svg { width: 120vw; opacity: .25; bottom: 40%; }
}
@media (max-width: 520px) { .auth-strip { grid-template-columns: minmax(0, 1fr); } .auth-strip div { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); } .auth-card { padding: 26px 18px 20px; } }
/* ---------- QR sign-in badge card ---------- */
.badge-card { width: 230px; margin: 4px auto; padding: 0 16px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #121a2b; text-align: center; box-shadow: var(--shadow); overflow: hidden; }
.badge-top { background: #1f3050; margin: 0 -16px; padding: 16px 18px 13px; border-bottom: 3px solid #b8934a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.badge-logo { width: 100%; display: block; }
.badge-sub { font: 700 8.5px var(--f-head); letter-spacing: .3em; color: #b8934a; text-transform: uppercase; margin-top: 10px; }
.badge-qr svg { width: 160px; height: 160px; margin: 12px auto 8px; display: block; }
.badge-name { font: 600 16px var(--f-head); }
.badge-role { font-size: 12px; color: #555; }
.badge-note { font-size: 10px; color: #777; margin-top: 8px; }
/* ---------- condition report sheet (SJSF format) ---------- */
.crsheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.cr-lh { padding-bottom: 10px; }
.cr-lh-img { display: block; width: 100%; height: auto; background: #fff; border-radius: 4px; }
.cr-lh-bar { display: block; width: 100%; height: 6px; margin-top: 12px; border-radius: 1px; }
.cr-logo { height: 88px; width: auto; max-width: 340px; object-fit: contain; object-position: left; }
.cr-logo-svg { width: 96px; color: var(--fg); }
:root[data-theme="dark"] img.cr-logo { background: #fff; border-radius: 6px; padding: 4px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.cr-logo { background: #fff; border-radius: 6px; padding: 4px 8px; } }
.cr-addr { text-align: right; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cr-band { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 18px 0 16px; padding: 14px 18px; background: #1b2333; color: #eef1f6; border-radius: 8px; }
.cr-kicker { font: 600 11px var(--f-head); letter-spacing: .28em; text-transform: uppercase; color: #d4b578; }
.cr-band-t { font: 600 19px var(--f-head); margin-top: 4px; }
.cr-band-t i { font-weight: 500; }
.cr-band-r { text-align: right; display: flex; flex-direction: column; font-family: var(--f-mono); font-size: 12px; color: #c3cad6; }
.cr-band-r b { color: #d4b578; font-size: 15px; }
.cr-cover { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cr-hero { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); min-height: 200px; }
.cr-hero svg { display: block; width: 100%; height: auto; max-height: 560px; }
.cr-fig svg { display: block; width: 100%; height: auto; max-height: min(72vh, 680px); }
.cr-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-h { margin: 26px 0 10px; font: 600 13px var(--f-head); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 12px; }
.cr-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-cell { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); min-width: 0; }
.cr-cell.wide { grid-column: 1 / -1; }
.cr-cell > label { background: var(--surface-2); font: 600 10.5px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 5px 10px; border-bottom: 1px solid var(--line); }
.cr-cell input, .cr-cell textarea, .cr-cell select { border: 0; border-radius: 0; background: transparent; padding: 8px 10px; font: 14px var(--f-body); color: var(--fg); width: 100%; min-width: 0; resize: vertical; }
.cr-cell input:focus, .cr-cell textarea:focus, .cr-cell select:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.cr-cell input:disabled, .cr-cell textarea:disabled, .cr-cell select:disabled { color: var(--fg); opacity: 1; -webkit-text-fill-color: var(--fg); }
.cr-v { padding: 8px 10px; font-size: 14px; }
.cr-cell .sig { height: 130px; margin: 8px 10px 0; width: calc(100% - 20px); }
.cr-cell .sig-img { margin: 8px 10px; }
.cr-cell .chips { padding: 6px 10px 10px; display: flex; gap: 8px; align-items: center; }
.cr-cell > .btn { margin: 0 10px 10px; align-self: flex-start; }
.cr-tools { position: sticky; top: 64px; z-index: 3; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.cr-pal { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-pal button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 20px; padding: 3px 10px 3px 4px; font: 12.5px var(--f-body); cursor: pointer; }
.cr-pal button.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; box-shadow: 0 0 0 1px var(--accent); }
.cr-tools-r { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cr-tools-r .muted { flex: 1; min-width: 200px; }
.cr-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.crg { flex: none; display: block; }
.cr-photo { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; break-inside: avoid; }
.cr-cap { display: flex; align-items: center; gap: 8px; background: var(--surface-2); padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cr-cap input { flex: 1; min-width: 0; border: 0; background: transparent; font: 600 13.5px var(--f-body); color: var(--fg); padding: 4px; }
.cr-cap span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cr-fig { position: relative; background: #111; touch-action: none; user-select: none; cursor: crosshair; }
.cr-fig .loading { color: #aaa; }
.crm.on { filter: drop-shadow(0 0 6px rgba(214,178,109,.9)); }
.cr-dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.cr-dt th { text-align: left; font: 600 10.5px var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cr-dt td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cr-dt tr.sel td { background: var(--accent-soft); }
.cr-dt input, .cr-dt select { width: 100%; min-width: 90px; border: 1px solid transparent; background: transparent; padding: 5px 6px; border-radius: 4px; font: 13px var(--f-body); color: var(--fg); }
.cr-dt input:hover, .cr-dt select:hover { border-color: var(--line); }
.cr-dt input:focus, .cr-dt select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.cr-dt input:disabled, .cr-dt select:disabled { -webkit-text-fill-color: var(--fg); opacity: 1; }
.cr-typ { display: flex; align-items: center; gap: 4px; }
.cr-typ select { min-width: 120px; font-weight: 600; }
.cr-letter { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: #121a2b; color: #fff; font: 700 12px var(--f-body); }
.cr-none, .cr-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.cr-empty { border: 1px dashed var(--line); border-radius: 8px; text-align: center; padding: 26px; }
.cr-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.cr-key span { display: inline-flex; align-items: center; gap: 6px; }
.cr-key span.used { color: var(--fg); font-weight: 600; }
.cr-key .cr-key-lv { flex-basis: 100%; margin-top: 4px; gap: 4px; }
.cr-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cr-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cr-savebar { position: sticky; bottom: 12px; z-index: 5; display: none; justify-content: flex-end; align-items: center; gap: 12px; margin: 12px auto 0; width: fit-content; margin-left: auto; padding: 8px 8px 8px 16px; background: #1b2333; color: #eef1f6; border-radius: 30px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13.5px; }
.cr-savebar.on { display: flex; }
@media (max-width: 820px) {
  .crsheet { padding: 16px 12px; border-radius: 8px; }
  .cr-cover, .cr-grid, .cr-sign, .cr-facts { grid-template-columns: minmax(0, 1fr); }
  .cr-logo { height: 60px; }
  .cr-band { flex-direction: column; align-items: flex-start; }
  .cr-band-r { text-align: left; }
  .cr-pal button span { display: none; }
  .cr-pal button { padding: 3px; }
  .cr-tools { position: static; }
}
.alt-ref { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; font: 500 11.5px var(--f-mono); color: var(--muted); vertical-align: 1px; }
.code.alt { color: var(--fg); font-weight: 500; }
.refs-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
@media (max-width: 640px) { .refs-box { grid-template-columns: minmax(0, 1fr); } }
.rep-wide td, .rep-wide th { white-space: nowrap; }
.rep-wide td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
/* ---------- dashboard charts (ASN = gold, SO = blue — validated for CVD separation & contrast) ---------- */
:root { --viz-in: #b8934a; --viz-out: #2a78d6; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --viz-in: #b8934a; --viz-out: #3987e5; } }
:root[data-theme="dark"] { --viz-in: #b8934a; --viz-out: #3987e5; }
.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; margin-bottom: 16px; }
.hero-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--hc); }
.hc-head { display: flex; gap: 12px; align-items: flex-start; }
.hc-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--hc) 14%, transparent); color: var(--hc); flex: none; }
.hc-ico .ico { width: 22px; height: 22px; }
.hc-title { font: 600 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hc-num { font: 600 38px/1.05 var(--f-head); color: var(--fg); margin-top: 2px; }
.hc-num small { font: 500 13px var(--f-body); color: var(--muted); margin-left: 6px; }
.hc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; }
.hc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.hc-facts b { color: var(--fg); margin-right: 3px; }
.hc-late { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); }
.hc-late .ico { width: 14px; height: 14px; }
.viz-pipe { display: flex; flex-direction: column; gap: 6px; }
.vp-row, .vb-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; margin: 0 -4px; border-radius: 4px; }
.vp-row:hover, .vb-row:hover { background: var(--surface-2); }
.vp-label, .vb-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-track, .vb-track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.vp-fill, .vb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.vp-val, .vb-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fg); white-space: nowrap; }
.vp-val em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--warn); }
.viz-bars { display: flex; flex-direction: column; gap: 8px; }
.vb-row { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 40px; }
.vb-label small { display: block; font-size: 11px; color: var(--muted); }
.vb-label { color: var(--fg); }
.vb-link { cursor: pointer; }
.viz-line svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.viz-legend i, .vz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.vz-grid { stroke: var(--line); stroke-width: 1; }
.vz-axis { fill: var(--muted); font: 11px var(--f-body); }
.vz-end { fill: var(--fg); font: 600 11.5px var(--f-body); }
.vz-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.vz-pt { transition: r .1s; }
.vz-pt.on { r: 5.5; }
.viz-tip { position: fixed; z-index: 100; display: none; pointer-events: none; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 260px; }
@media (max-width: 1180px) { .dash-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .hero-chart { grid-column: 1 / -1; } }
@media (max-width: 680px) { .dash-hero { grid-template-columns: minmax(0, 1fr); } .vp-row { grid-template-columns: 92px minmax(0, 1fr) 56px; } }
:root { --viz-neutral: #8d877b; }
.hc-links { display: flex; justify-content: space-between; font-size: 13px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.dash-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); }
.hero-chart .panel-body { padding-top: 10px; }
@media (max-width: 1180px) { .dash-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 680px) { .dash-hero { grid-template-columns: minmax(0, 1fr); } }
.doc-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
/* ---------- artwork components ---------- */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 14px 16px 16px; }
.comp { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface); }
.comp-img { width: 104px; height: 104px; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.comp-img img { width: 100%; height: 100%; object-fit: cover; }
.comp-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.comp-act { display: flex; gap: 2px; }
.comp-kv { margin-top: 6px; font-size: 12.5px; grid-template-columns: auto 1fr; gap: 2px 10px; }
.comp-pick { display: flex; gap: 12px; align-items: center; }
.comp-prev { width: 120px; height: 90px; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 4px; }
.comp-prev img { width: 100%; height: 100%; object-fit: cover; }
.comp-ed { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.comp-rows { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.comp-row { display: grid; grid-template-columns: 40px minmax(110px, 1.2fr) minmax(110px, 1.6fr) repeat(4, minmax(54px, .55fr)) minmax(90px, 1fr) 32px; gap: 6px; align-items: center; }
.comp-row input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; }
.comp-ph { width: 40px; height: 36px; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); font-size: 9px; text-align: center; line-height: 1.1; }
.comp-ph img { width: 100%; height: 100%; object-fit: cover; }
.comp-ph .ico { width: 18px; height: 18px; }
@media (max-width: 760px) { .comp-row { grid-template-columns: 40px 1fr 1fr 32px; } .comp-row [data-k=description] { grid-column: 2 / 4; } .comp-row [data-k=height_cm] { grid-column: 2; } }
/* ---------- client onboarding ---------- */
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field.invalid > label { color: var(--bad); }
.kyc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kyc-opt { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 13.5px; background: var(--surface); }
.kyc-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cdoc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cdoc { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r); cursor: pointer; background: var(--surface); min-width: 0; }
.cdoc:hover { border-color: var(--accent); }
.cdoc.on { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.cdoc-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.cdoc.on .cdoc-ico { color: var(--ok); }
.cdoc-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.cdoc-t small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdoc-list li { align-items: center; }
.cdoc-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.cdoc-dot .ico { width: 14px; height: 14px; }
.cdoc-dot.on { background: var(--ok-soft); color: var(--ok); }
.kyc-pop { display: flex; gap: 14px; }
.kyc-pop-ico { width: 42px; height: 42px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; flex: none; }
@media (max-width: 760px) { .cdoc-grid { grid-template-columns: 1fr 1fr; } .kyc-opts { grid-template-columns: 1fr; } }
.form .kyc-opt { display: flex; flex-direction: row; text-align: left; justify-content: flex-start; font-weight: 400; color: var(--fg); text-transform: none; letter-spacing: 0; }
.form .kyc-opt input[type=radio] { width: 16px; height: 16px; flex: none; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
.form .kyc-opt span, .form .kyc-opt b { display: inline; }
/* ---------- sales: requests for a quote ---------- */
.svc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.svc-chips span { font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: var(--surface-2); color: var(--fg); white-space: nowrap; }
.svc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.form .svc-pick label { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fg); }
.form .svc-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form .svc-pick input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.q-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.q-item { display: grid; grid-template-columns: minmax(150px, 2.2fr) 54px repeat(4, minmax(56px, .6fr)) minmax(70px, .8fr) minmax(90px, 1fr) 32px; gap: 6px; align-items: center; }
.q-item input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; }
.q-amount { font: 600 28px var(--f-head); color: var(--fg); }
@media (max-width: 760px) { .q-item { grid-template-columns: 1fr 1fr 1fr 32px; } .q-item [data-k=description] { grid-column: 1 / 4; } }
.bulk-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bulk-opt { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bulk-opt h3 { margin: 0; font: 600 15px var(--f-head); }
.bulk-opt p { margin: 0; flex: 1; }
@media (max-width: 640px) { .bulk-pick { grid-template-columns: 1fr; } }
@media (max-width: 1560px) { .hide-md { display: none; } }

/* outside jobs: crew picker */
.crew-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.form .crew-row { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fg); }
.form .crew-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form .crew-row input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.form .crew-row select { width: auto; padding: 3px 6px; font-size: 12px; }
.form .crew-row .grow { flex: 1; min-width: 0; }

/* condition report required on a job */
.cr-prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.cr-prog span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.form .cr-req { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--fg); font-size: 13px; }
.form .cr-req:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form .cr-req input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; }

/* quotation editor (SJSF quote format) */
.qe { display: flex; flex-direction: column; gap: 8px; }
.qe-head { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.qe-head label, .qe-sum label { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--fg); }
.qe-head .qe-wide { grid-column: 1 / -1; grid-template-columns: 110px 1fr; }
.qe input, .qe select, .qe textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; min-width: 0; width: 100%; }
.qe input:disabled { background: var(--surface-2); color: var(--muted); }
.qe-band { background: #EDEFF3; color: #1F3050; font-weight: 700; padding: 4px 8px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.qe-band span { font-weight: 400; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.qe-band select { width: auto; padding: 2px 6px; }
.qe-t { width: 100%; border-collapse: collapse; }
.qe-t th { background: #1F3050; color: #fff; font-size: 11.5px; font-weight: 600; padding: 5px 6px; text-align: left; }
.qe-t td { padding: 3px; border-bottom: 1px solid var(--line); }
.qe-t .n { text-align: right; white-space: nowrap; padding-right: 8px; font-variant-numeric: tabular-nums; }
.qe-t:not(.qe-chg) td:nth-child(n+3):nth-child(-n+7) input { width: 64px; }
.qe-chg tfoot td { border: 0; padding: 4px 8px; }
.qe-chg tfoot .qe-total td { background: #EDEFF3; color: #1F3050; font-weight: 700; }
.qe-sum { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 6px 12px; align-items: center; }
.qe-sum label { grid-template-columns: auto 1fr; }
.qe-sum .hint { grid-column: 1 / -1; }
@media (max-width: 760px) { .qe-head { grid-template-columns: 1fr; } .qe-sum { grid-template-columns: 1fr 1fr; } }
.q-brk { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.q-brk td { padding: 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.q-brk td.num { text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
.q-brk tr.t td { font-weight: 600; }
.qe-chg .qe-desc { margin-top: 3px; font-size: 12px; background: var(--surface) !important; }
.qe-chg .qe-int { background: rgba(120, 120, 140, .07); }
.qe-chg th.qe-int-h { background: #3b4a66; }
.qe-mamt { font-size: 11px; color: var(--muted); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.qe-mamt.neg, .qe-internal .neg { color: var(--bad); }
.qe-internal { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--r); background: rgba(120, 120, 140, .06); font-size: 12.5px; }
.qe-internal > b:first-child { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; width: 100%; }
.q-int { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
td .neg, .q-brk td.neg { color: var(--bad); }
.qe-drow { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center; }
.qe-drow select { flex: 1 1 100%; font-size: 12px; }
.qe-drow input { flex: 1 1 60%; }
.qe-chg input[data-c=service_new] { margin-top: 3px; }
.qe-act { white-space: nowrap; }
.qe [hidden] { display: none !important; }
.qe-chg td.qe-act { width: 34px; text-align: center; }
.qe-chg td.qe-act .icon-btn { display: grid; margin: 2px auto; }
.qe-chg tr.qe-sec td { background: #EDEFF3; color: #1F3050; padding: 6px 8px; border-bottom: 1px solid #b8c4dc; }
html[data-theme=dark] .qe-chg tr.qe-sec td { background: #1f3050; color: #e4e8f0; }
.qe-chg tr.qe-sec td b { margin-right: 10px; }
.qe-chg tr.qe-sec .btn { float: right; padding: 2px 8px; }
/* customs invoice & DA dialog */
.cd-items td { vertical-align: top; }
.cd-items input { width: 100%; min-width: 60px; }
.cd-items td:nth-child(3) input { width: 54px; min-width: 54px; }
.cd-items td:nth-child(5) input { width: 56px; min-width: 56px; }
.cd-items td:nth-child(2) { max-width: 260px; }
.cd-pay { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; }
.cd-pay > span { font-weight: 600; margin-right: 6px; }
.cd-pay label { display: inline-flex !important; grid-template-columns: none !important; gap: 4px; font-weight: 400 !important; }
.cd-pay input { width: auto !important; }
.cr-fixed{padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg-2, rgba(0,0,0,.03));font-weight:600}
.cr-link{display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:var(--fg)}
.site-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}
.site-photos figure{margin:0;cursor:zoom-in}
.site-photos img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;background:var(--line)}
.site-photos figcaption{font-size:11px;color:var(--muted);margin-top:3px}

/* charges: Category · Item · Description · Vendor (internal) · Cost · Margin · Selling · VAT */
.qe-chg select[data-c=category] { width: 150px; background: #FBF4E6; }
.qe-chg select[data-c=service] { width: 220px; background: #FBF4E6; }
html[data-theme=dark] .qe-chg select[data-c=category], html[data-theme=dark] .qe-chg select[data-c=service] { background: var(--surface-2); }
.qe-chg input[data-c=description] { min-width: 200px; width: 100%; }
.qe-chg select[data-c=vendor] { width: 150px; }
.qe-chg input[data-c=vendor_new] { width: 150px; margin-top: 3px; }
.qe-chg input[data-c=cost], .qe-chg input[data-c=margin_pct], .qe-chg input[data-c=amount] { width: 88px; }
.qe-chg select[data-c=vat_pct] { width: 64px; }
.qe-chg input[data-c=service_new] { width: 220px; display: block; }
.qe-chg [data-saveitem] { margin-top: 3px; }
.modal-wide:has(#qef) { width: min(1360px, 100%); }

.eq-logo, .sj-logo { display: block; height: auto; }
.auth-brand .eq { height: auto; }
/* round trip */
.rt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rt-leg { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; display: grid; gap: 8px; align-content: start; }
.rt-leg h3 { margin: 0; font-size: 13px; }
.rt-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rt-panel .panel-head h2 { display: flex; gap: 6px; align-items: center; }
.rt-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rt-card { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.rt-card.cur { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.rt-card .rt-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rt-card .rt-route { color: var(--muted); }
.rt-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(184, 135, 60, .14); color: #8a6224; }
@media (max-width: 760px) { .rt-grid, .rt-legs, .rt-dates { grid-template-columns: 1fr; } }
/* quotation · round trip */
.qe-rtroute .rt-leg .qe-head { margin: 0; }
.qe-jr { border: 1px solid var(--line); border-radius: var(--r); margin: 10px 0; padding: 8px 10px 10px; }
.qe-jr[data-j=outbound] { box-shadow: inset 3px 0 0 #3b6ea8; }
.qe-jr[data-j=return] { box-shadow: inset 3px 0 0 #b8934a; }
.qe-jr[data-j=shared] { box-shadow: inset 3px 0 0 #7a7a7a; }
.qe-jh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.qe-jh b { font-size: 14px; }
.qe-js { margin-left: auto; font-size: 13px; }
.qe-rt select[data-r=product_id] { width: 230px; background: #FBF4E6; }
html[data-theme=dark] .qe-rt select[data-r=product_id] { background: var(--surface-2); }
.qe-rt input[data-r=description] { min-width: 210px; width: 100%; }
.qe-rt input[data-r=qty] { width: 70px; } .qe-rt input[data-r=unit_price] { width: 100px; } .qe-rt select[data-r=unit] { width: 92px; } .qe-rt select[data-r=journey] { width: 100px; } .qe-rt select[data-r=vat_pct] { width: 64px; }
.qe-rt tr.qe-ri td { background: rgba(120, 120, 140, .07); padding: 4px 8px 8px; border-top: 0; }
.qe-rt tr.qe-ri td > * { margin-right: 10px; vertical-align: middle; }
.qe-rt tr.qe-ri select { width: 180px; } .qe-rt tr.qe-ri input[data-r=cost] { width: 100px; }
.qe-int-lbl { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.qe-gl { margin-top: 2px; }
.qe-rtsum { margin: 10px 0 4px auto; max-width: 420px; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; display: grid; gap: 4px; }
.qe-rtsum div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.qe-rtsum .t { border-top: 1px solid var(--line); padding-top: 6px; font-size: 15px; }

/* Company & letterhead: letterhead image previews */
.lh-set { display: grid; gap: 12px; }
.lh-prev { display: block; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin: 4px 0 6px; max-width: 640px; }
.lh-prev img { display: block; width: 100%; height: auto; }
.lh-prev-bar img { height: 8px; }

/* Quotation charges by Activity List: movement type, journeys, activity › category blocks, cascading picker */
.qe-mt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); background: var(--surface-2); }
.qe-mt b { font-size: 13.5px; } .qe-mt .req { color: var(--bad); }
.qe-mt label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.qe-mt input[type=radio] { width: auto; min-width: 0; margin: 0; }
.qe-al-t { min-width: 900px; }
.qe-al-t td { vertical-align: top; }
.qe-al-t tbody.qe-blk tr.qe-bh td { background: #EEF2F8; color: #1F3050; padding: 6px 8px; border-top: 1px solid #c9d3e6; }
html[data-theme=dark] .qe-al-t tbody.qe-blk tr.qe-bh td { background: #1f3050; color: #e4e8f0; }
.qe-al-t tr.qe-bh .qe-bt { margin-right: 12px; font-size: 13px; }
.qe-al-t tr.qe-bh .btn { padding: 2px 8px; margin-right: 4px; }
.qe-al-t td.qe-svc { width: 210px; }
.qe-al-t select[data-l=catalogue_id] { width: 210px; background: #FBF4E6; }
html[data-theme=dark] .qe-al-t select[data-l=catalogue_id] { background: var(--surface-2); }
.qe-al-t input[data-l=service] { width: 210px; border-style: dashed; }
.qe-al-t textarea[data-l=description] { min-width: 220px; width: 100%; resize: vertical; min-height: 34px; font-size: 13px; }
.qe-al-t input[data-l=qty] { width: 64px; } .qe-al-t select[data-l=unit] { width: 90px; } .qe-al-t input[data-l=unit_price] { width: 96px; }
.qe-al-t input[data-l=discount_pct] { width: 62px; } .qe-al-t select[data-l=vat_pct] { width: 62px; }
.qe-al-t td[data-o=amount] { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; padding-top: 12px; }
.qe-al-t tr.qe-ali td { background: rgba(120, 120, 140, .07); padding: 4px 8px 8px; border-top: 0; }
.qe-al-t tr.qe-ali td > * { margin-right: 10px; vertical-align: middle; }
.qe-al-t tr.qe-ali select { width: 180px; } .qe-al-t tr.qe-ali input[data-l=cost] { width: 96px; } .qe-al-t tr.qe-ali input[data-l=margin_pct] { width: 70px; }
.qe-al-t tr.qe-ali label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.qe-al-t td.qe-act .icon-btn { display: inline-grid; }
.qe-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: var(--r); }
.qe-pick-l { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.qe-pick select { width: auto; min-width: 170px; max-width: 260px; } .qe-pick input { width: 170px; }
.qe-rtsum .jt { color: var(--muted); }
.qe-jr[hidden] { display: none !important; }
.qa-tbl .qa-in { padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); font: inherit; width: 100%; min-width: 220px; }
.qa-tbl .qa-gl { min-width: 0; width: 90px; }
.qa-tbl tr.qa-off td { opacity: .6; }

/* one location, several clients */
.loc-clients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -4px 0 12px; font-size: 13px; }
.loc-clients b { margin-right: 4px; }
.pa-tbl td, .pa-tbl th { vertical-align: top; } .pa-tbl input[type=checkbox] { width: auto; }

/* ---------- SJSF quotation editor: options, schedule, terms ---------- */
.qe-opts { display: flex; flex-direction: column; gap: 8px; }
.qe-opt { border: 1px solid var(--line); border-left: 3px solid #1F3050; border-radius: var(--r); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.qe-opt-h { display: flex; gap: 10px; align-items: center; }
.qe-opt-h b { color: #1F3050; white-space: nowrap; }
.qe-opt-h input { flex: 1; min-width: 0; }
.qe-opt-b { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.qe-opt-f { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 12.5px; }
.qe-opt-f label { display: flex; gap: 6px; align-items: center; }
.qe-opt-f input[type=number] { width: 130px; }
.qe-optbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.qe-optsel { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: #1F3050; margin-right: 12px; }
.qe-optsel select { width: auto; max-width: 260px; background: #FBF4E6; }
.qe-sch { display: grid; grid-template-columns: 160px 1fr auto; gap: 6px; margin-bottom: 4px; }
.qe-tc summary { cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.qe-tc textarea { width: 100%; font-size: 12px; margin-bottom: 4px; }
.qe .check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; }
@media (max-width: 700px) {
  .qe-head { grid-template-columns: 1fr; }
  .qe-head label, .qe-head .qe-wide { grid-template-columns: 1fr; gap: 3px; }
  .qe-sch { grid-template-columns: 1fr auto; }
  .qe-sch input[type=date] { grid-column: 1 / -1; }
}

/* ---------- two-step sign-in (web/js/mfa.js) ---------- */
.banner-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.mfa-setup { display: flex; flex-direction: column; gap: 10px; }
.mfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; line-height: 1.5; }
.mfa-qr { background: #fff; padding: 10px; border-radius: 10px; width: 196px; margin: 10px 0 6px; border: 1px solid var(--line); }
.mfa-qr svg { display: block; width: 176px; height: 176px; }
.mfa-secret { font-size: 15px; letter-spacing: .06em; word-break: break-all; margin: 6px 0 2px; user-select: all; }
.mfa-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.mfa-code { font: 600 18px var(--f-mono); letter-spacing: .2em; width: 14ch; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
.mfa-rc { margin-top: 12px; }
.mfa-rc-list { columns: 2; margin: 6px 0 10px; padding-left: 26px; font-size: 15px; line-height: 1.8; }
.mfa-panel + .mfa-panel { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.auth .mfa-steps, .auth .mfa-setup { color: var(--fg); }
.auth .mfa-steps b { color: #fff; }
.auth .mfa-code { background: rgba(10, 16, 30, .55); color: #fff; }
.mfa-on { color: var(--ok); font-weight: 600; }
.sec-form { display: flex; flex-direction: column; gap: 10px; }
.sec-form .check { padding-top: 0; align-items: flex-start; }
.sec-form .check input { margin-top: 3px; }

/* ---------- Sign in with Microsoft 365 ---------- */
.auth-ms { display: flex; align-items: center; justify-content: center; gap: 12px; height: 54px; border-radius: 10px; background: #fff; color: #1b2333; font: 600 16px var(--f-head); text-decoration: none; border: 1px solid #d4d8de; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.auth-ms:hover { text-decoration: none; background: #f4f5f8; }
.auth-alt summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; padding: 4px 0 10px; }
.auth-alt[open] summary { margin-bottom: 6px; }
.auth-go-2 { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
