/* JCC Fleet – mobile first, big touch targets, works in light and dark mode. */

:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #16202b;
  --muted: #5d6874;
  --line: #d8dee6;
  --brand: #12355b;
  --brand-ink: #ffffff;
  --primary: #1a56db;
  --accent: #f5a623;
  --good: #1e8e3e;
  --warn: #e8710a;
  --bad: #d93025;
  --good-bg: #e6f4ea;
  --warn-bg: #fff4e5;
  --bad-bg: #fce8e6;
  --chip: #eef2f7;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --radius: 14px;
  --tap: 52px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419;
    --card: #1a2129;
    --ink: #e6ebf0;
    --muted: #9aa6b2;
    --line: #2f3a45;
    --brand: #0d2742;
    --primary: #6ea0ff;
    --good-bg: #173524;
    --warn-bg: #3a2a14;
    --bad-bg: #3d1c1a;
    --chip: #25303b;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1419; --card: #1a2129; --ink: #e6ebf0; --muted: #9aa6b2; --line: #2f3a45; --brand: #0d2742;
  --primary: #6ea0ff; --good-bg: #173524; --warn-bg: #3a2a14; --bad-bg: #3d1c1a; --chip: #25303b; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
p { margin: .4em 0; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] { opacity: .7; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.right { text-align: right; }
.r { text-align: right; }
.block { display: block; width: 100%; }
.bad { color: var(--bad); }
.good { color: var(--good); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.between { justify-content: space-between; gap: 8px; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.grow2 { flex: 2; }
.grid2, .grid3 { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---- top bar / nav ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  background: var(--brand); color: var(--brand-ink);
  padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top));
}
.top-title { flex: 1; font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  font-size: 1.3rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.big { font-size: 1.5rem; min-width: var(--tap); min-height: var(--tap); background: var(--card); border: 1px solid var(--line); }
.icon-btn:disabled { opacity: .35; }
.topbar .icon-btn { color: var(--brand-ink); }
.lang-btn { border: 2px solid rgba(255,255,255,.6); background: transparent; color: #fff; border-radius: 10px; padding: 6px 10px; font-weight: 700; cursor: pointer; min-height: 40px; }
.banner { background: var(--warn-bg); color: var(--ink); padding: 8px 14px; font-weight: 600; border-bottom: 1px solid var(--line); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 62px; text-decoration: none; color: var(--muted); font-size: .78rem; font-weight: 600;
}
.bottomnav a.on { color: var(--primary); background: var(--chip); }
.nav-icon { font-size: 1.45rem; line-height: 1.1; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .bottomnav { position: sticky; top: 60px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  .bottomnav a { flex: 0 0 140px; flex-direction: row; gap: 8px; min-height: 48px; font-size: .95rem; }
}

.view { max-width: 980px; margin: 0 auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 12px; }

/* ---- cards / tiles ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.card-warn { border-left: 6px solid var(--warn); }
.card-good { border-left: 6px solid var(--good); }
.big-num { font-size: 2.2rem; font-weight: 800; min-width: 56px; text-align: center; }
.hello h2 { font-size: 1.35rem; margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 128px; padding: 14px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); text-align: center; font-weight: 700; box-shadow: var(--shadow);
}
.tile:active { transform: scale(.98); }
.tile-icon { font-size: 2.6rem; line-height: 1; }
.badge { position: absolute; top: 8px; right: 8px; background: var(--bad); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: .85rem; }

.menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 1.02rem; text-align: left; cursor: pointer; width: 100%;
}
.menu-item.bad { color: var(--bad); }

/* ---- buttons / inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
}
.btn.big { min-height: 60px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #1b1300; }
.btn-good { background: var(--good); color: #fff; }
.btn-bad { background: var(--bad); color: #fff; }
.btn-light { background: var(--card); color: var(--ink); border-color: var(--line); }
.link { background: none; border: 0; padding: 12px; cursor: pointer; text-decoration: underline; font-weight: 600; }

.input {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font-size: 1.05rem;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
.input:focus { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.input.num { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 600; }
textarea.input { min-height: 80px; resize: vertical; }
.search { flex: 1; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.picker-btn .caret { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field-label { font-weight: 700; font-size: .95rem; }
.hint { color: var(--muted); font-size: .8rem; }
.form { display: flex; flex-direction: column; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; white-space: nowrap; }
.check input { width: 22px; height: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 46px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--chip); font-weight: 700; cursor: pointer;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chips.small .chip { min-height: 38px; padding: 6px 12px; font-size: .88rem; font-weight: 600; }
.mini-chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0; font-size: .82rem; }

.seg { display: flex; background: var(--chip); border-radius: 14px; padding: 4px; gap: 4px; }
.seg-btn { flex: 1; min-height: var(--tap); border: 0; border-radius: 10px; background: transparent; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.seg-btn.on { background: var(--card); box-shadow: var(--shadow); color: var(--primary); }
.seg-btn.on.day { background: #fff3c4; color: #7a4f00; }
.seg-btn.on.night { background: #1f2a5a; color: #fff; }

/* ---- status ---- */
.status-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.empty-pill { background: transparent; color: var(--muted); border: 2px dashed var(--line); }
.pill-good { background: var(--good); }
.pill-warn { background: var(--warn); }
.status-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .status-grid { grid-template-columns: repeat(3, 1fr); } }
.status-btn {
  display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 10px;
  border: 3px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 800; text-align: left; cursor: pointer;
}
.status-btn.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 20%, transparent); }
.status-ico { font-size: 1.5rem; }

/* ---- DPR list ---- */
.dpr-top { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 4px 0 8px; }
@media (min-width: 900px) { .dpr-top { top: 108px; } }
.date-bar { display: flex; align-items: center; gap: 8px; }
.date-show {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--tap); background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-weight: 800; font-size: 1.15rem; cursor: pointer;
}
.date-show small { color: var(--good); }
.date-hidden { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.progress-row { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.progress { flex: 1; height: 12px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--good); transition: width .3s; }
.note { padding: 10px 12px; border-radius: 10px; margin: 0; font-weight: 600; }
.note.warn { background: var(--warn-bg); }

.veh-list, .card-list { display: flex; flex-direction: column; gap: 8px; }
.site-group { display: flex; flex-direction: column; gap: 8px; }
.site-head { margin: 8px 2px 0; font-size: 1rem; }
.veh-card {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-left: 8px solid var(--line); border-radius: 14px;
  text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.veh-card.done { background: color-mix(in srgb, var(--card) 92%, var(--good)); }
.veh-icon { font-size: 1.9rem; }
.veh-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.veh-no { font-size: 1.45rem; font-weight: 900; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.veh-sub { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- DPR entry ---- */
.entry { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.entry-details { display: flex; flex-direction: column; gap: 12px; }
.last-line { background: var(--chip); border-radius: 10px; padding: 8px 12px; font-size: .92rem; }
.meter { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 12px 12px; }
.meter legend { font-weight: 800; padding: 0 6px; }
.meter-row { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 8px; align-items: start; }
.run-out { display: flex; align-items: center; justify-content: center; min-height: var(--tap); border-radius: 12px; background: var(--good-bg); font-weight: 900; font-size: 1.2rem; }
.run-out.bad { background: var(--bad-bg); color: var(--bad); }
.rj-box { background: var(--chip); padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.rj-box.warn { background: var(--warn-bg); }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 8px; background: var(--card); padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 2; }
.sheet-body:has(.sticky-actions) { padding-bottom: 0; }

/* ---- sheets ---- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 640px; max-height: 94vh; background: var(--card); border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; animation: up .18s ease-out;
}
.sheet-wide { max-width: 900px; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; max-height: 88vh; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pick-item {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap); width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer;
}
.pick-item.is-current { border: 2px solid var(--primary); background: var(--chip); }
.pick-item.pick-new { border-style: dashed; color: var(--primary); }
.pick-item.pick-none { color: var(--muted); }
.pick-icon { font-size: 1.5rem; }
.pick-text { display: flex; flex-direction: column; }
.pick-text small { color: var(--muted); }
.confirm { display: flex; flex-direction: column; gap: 16px; }
.confirm-msg { font-size: 1.1rem; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  max-width: 92vw; padding: 12px 18px; border-radius: 12px; color: #fff; font-weight: 700; transition: .25s; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { background: var(--good); }
.toast-warn { background: var(--warn); }
.toast-bad { background: var(--bad); }

.spinner { width: 42px; height: 42px; margin: 40px auto; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-icon { font-size: 3rem; }

/* ---- login ---- */
.login { max-width: 640px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.login-logo { font: italic 900 3.4rem/1 "Arial Black", Arial, sans-serif; color: var(--brand); letter-spacing: 2px; }
.name-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .name-grid { grid-template-columns: repeat(3, 1fr); } }
.name-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; min-height: 100px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-weight: 700; cursor: pointer;
}
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; }
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-dots { display: flex; gap: 14px; margin: 6px 0; }
.pin-dots .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots .dot.on { background: var(--ink); }
.pin-msg { color: var(--bad); font-weight: 700; min-height: 1.4em; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; }
.key { height: 70px; border-radius: 16px; border: 1px solid var(--line); background: var(--chip); font-size: 1.7rem; font-weight: 800; cursor: pointer; }
.key-ok { background: var(--good); color: #fff; }

/* ---- RJ ---- */
.rj-card {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-left: 8px solid var(--warn); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.rj-card.k-bd { border-left-color: var(--bad); }
.rj-no { font-size: 1.15rem; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.stat { background: var(--chip); padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: .92rem; }
.stat.bad { background: var(--bad-bg); color: var(--bad); }
.complaint-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .complaint-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .complaint-grid { grid-template-columns: repeat(4, 1fr); } }
.complaint {
  display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; font-weight: 600; font-size: .92rem;
}
.complaint.on { border-color: var(--primary); background: color-mix(in srgb, var(--card) 80%, var(--primary)); }
.c-no { min-width: 28px; height: 28px; border-radius: 50%; background: var(--chip); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; }
.complaint.on .c-no { background: var(--primary); color: #fff; }
.c-icon { font-size: 1.3rem; }
.bill-row { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; margin-top: 6px; text-decoration: none; color: var(--ink); }
.bill-row.inactive { opacity: .55; }
.queued { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---- tyres ---- */
.truck { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 8px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.truck-front { font-weight: 800; color: var(--muted); letter-spacing: 2px; }
.axle { display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; width: 100%; max-width: 480px; gap: 6px; }
.axle-side { display: flex; gap: 4px; justify-content: center; }
.axle-side:first-child { justify-content: flex-end; }
.axle-side:last-child { justify-content: flex-start; }
.axle-bar { height: 14px; background: var(--line); border-radius: 7px; position: relative; }
.axle-bar span { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.wheel {
  width: 66px; height: 92px; border-radius: 12px; border: 3px dashed var(--line); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 2px;
}
.wheel.fitted { background: #263238; border: 3px solid #111; color: #fff; }
.w-serial { font-size: .72rem; font-weight: 800; word-break: break-all; text-align: center; }
.w-brand { font-size: .64rem; opacity: .8; }
.w-empty { font-size: 1.8rem; color: var(--muted); }
.spares { display: flex; gap: 12px; }
.spare-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.axle-edit { padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.axle-edit select { flex: 1; min-width: 140px; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hist-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* ---- reports ---- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table.data, table.cal, table.month-grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
.data th, .data td, .cal th, .cal td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.data tbody tr { cursor: pointer; }
.cal-cell { color: #fff; font-weight: 700; text-align: center !important; min-width: 64px; }
.cal-cell small { display: block; font-size: .72rem; }
.empty-cell { background: transparent; }
.month-grid th, .month-grid td { border: 1px solid var(--line); padding: 2px; text-align: center; font-size: .78rem; }
.month-grid .sticky-col { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 66px; }
.grid-cell { width: 22px; height: 30px; padding: 0 !important; }
.grid-cell .half { display: block; height: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-item i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.stack-bar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--chip); margin: 6px 0 10px; }
.count-row { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.big-count { font-size: 1.3rem; }
.site-row { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }

/* ---- transport ---- */
.fold > summary { font-weight: 800; font-size: 1.05rem; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.fold[open] > summary { margin-bottom: 10px; }
.doc-lbl { align-self: center; }
.pay-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.step { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--chip); color: var(--muted); }
.step.ok { background: var(--good-bg); color: var(--good); font-weight: 700; }
.step-card h3 { display: flex; align-items: center; gap: 8px; }
.step-no { width: 32px; height: 32px; border-radius: 50%; background: var(--chip); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.step-card.done .step-no { background: var(--good); color: #fff; }
.timeline { margin: 10px 0 0; padding-left: 22px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* ---- print ---- */
#print-root { display: none; }
@media print {
  body.printing { background: #fff; color: #000; padding: 0; }
  body.printing #app, body.printing .sheet-wrap, body.printing .toast { display: none !important; }
  body.printing #print-root { display: block; }
  @page { size: A4; margin: 10mm; }
}
.p-page { page-break-after: always; font: 11px/1.35 Arial, sans-serif; color: #000; }
.p-page:last-child { page-break-after: auto; }
.p-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 4px; margin-bottom: 6px; }
.p-logo { font: italic 900 30px/1 "Arial Black", Arial, sans-serif; letter-spacing: 1px; }
.p-company { font: italic 800 20px/1 Arial, sans-serif; }
.p-branch { font-style: italic; font-weight: 700; }
.p-copy { border: 1px solid #000; padding: 2px 6px; font-weight: 700; }
.p-title { text-align: center; font-weight: 800; font-size: 13px; margin: 4px 0 6px; }
.p-sec { font-weight: 800; font-style: italic; color: #555; margin: 6px 0 2px; }
.p-grid, .p-form, .p-table, .p-complaints { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.p-grid td, .p-form td, .p-table td, .p-table th, .p-complaints td { border: 1px solid #000; padding: 3px 5px; vertical-align: top; }
.p-lbl, .p-lbl2 { font-weight: 700; }
.p-lbl2 { width: 22%; background: #f4f4f4; }
.p-complaints td { text-align: center; font-size: 10px; }
.p-no { width: 22px; font-weight: 700; }
.p-on { background: #ddd; font-weight: 800; }
.p-box { border: 1px solid #000; margin-bottom: 6px; }
.p-box-title { font-weight: 800; padding: 3px 5px; border-bottom: 1px solid #000; }
.p-box-text { padding: 4px 6px; white-space: pre-wrap; background-image: repeating-linear-gradient(#fff 0 1.55em, #bbb 1.55em 1.6em); }
.p-table th { background: #eee; }
.p-blank td { height: 20px; }
.p-tall td { height: 90px; }
.p-footer, .p-foot-center { text-align: center; font-size: 10px; margin-top: 6px; }
.p-manifest { font-size: 10px; line-height: 1.2; }
.p-manifest .p-form { table-layout: fixed; margin-bottom: 3px; }
.p-manifest .p-form td { padding: 2px 4px; }
.p-manifest .p-sec { margin: 3px 0 1px; }
.p-manifest .p-footer, .p-manifest .p-foot-center { margin-top: 2px; }
.p-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-red { color: #c00; font-weight: 700; text-align: center; }
.p-party { width: 50%; }
.p-sign { display: flex; justify-content: space-between; margin-top: 40px; font-weight: 700; }
