/* Haulstead: dark side rail, dispatch board (trip list beside a route sketch), planner and records */
.app-body { --bar: 41px; font-size: 15px; }
.demo-bar { min-height: var(--bar); border-bottom: 1px solid #b6d3c6; }
.xc { --xc-bar: #1f5a43; --xc-bar-hi: #12392a; --xc-b2: #c07a1e; --xc-b2-hi: #94590d; --xc-grid: #e4e9e6; --xc-base: #a5b0aa; --xc-ink: #17211d; --xc-ink2: #4d5a54; --xc-hover: rgba(31, 90, 67, .07); --xc-tip: #12271e; --xc-value: 58px; --xc-label: minmax(72px, 112px); }

/* ---------------- shell and side rail ---------------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - var(--bar)); }
.side { position: sticky; top: 0; align-self: start; min-height: 0; display: flex; flex-direction: column; height: calc(100vh - var(--bar)); padding: 18px 12px 12px; overflow-y: auto; background: var(--navy); color: #d3ded8; }
.shell { background: linear-gradient(90deg, var(--navy) 232px, transparent 232px); }
.side .brand { padding: 0 8px; color: #fff; }
.side .brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.side-co { padding: 7px 8px 0; font-size: 13px; color: #9db3a8; }
.side nav { margin-top: 6px; }
.side-group h2 { margin: 14px 8px 6px; font-size: 12.5px; font-weight: 600; color: #8ea79b; }
.side-group ul { display: grid; gap: 6px; }
.side nav a { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 0 10px; border-radius: var(--radius); color: #d3ded8; font-weight: 600; text-decoration: none; }
.side nav a:hover { background: #1d3a2e; color: #fff; }
.side nav a.is-on { background: #fff; color: var(--navy); font-weight: 700; }
.side nav a.is-on .icon { color: var(--accent); }
.pill { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: #f3d77a; color: #3c2b00; font-size: 12px; font-style: normal; font-weight: 700; line-height: 20px; text-align: center; }
.pill-alert { background: #ffb4ae; color: #5c0b0e; }
.side-foot { display: grid; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid #2c4a3d; }
.whoami { display: flex; align-items: center; gap: 10px; margin-top: 0; padding: 0 6px 4px; }
.side nav + .side-foot { margin-top: auto; }
.whoami div { display: grid; line-height: 1.3; }
.whoami strong { color: #fff; font-size: 14px; }
.whoami div span { font-size: 12.5px; color: #9db3a8; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-dark); font-size: 12.5px; font-weight: 800; }
.side-foot button { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius); background: none; color: #d3ded8; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.side-foot button:hover { background: #1d3a2e; color: #fff; }

.main { min-width: 0; padding: 24px 28px 48px; }
.main > * + *, .m-content > * + * { margin-top: 16px; }
.page-head, .record-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head h1, .record-head h1, .locked h1 { font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: -.012em; }
.page-head p, .record-head p { margin-top: 2px; color: var(--ink-2); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.back + .record-head { margin-top: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.record-head .badges { margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 700; line-height: 19px; white-space: nowrap; }
.tone-ok { background: var(--ok-tint); color: var(--accent-dark); }
.tone-go { background: var(--accent); color: #fff; }
.tone-neutral { background: var(--soft); color: var(--ink-2); }
.tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-danger { background: var(--danger-tint); color: var(--danger); }
.tone-info { background: var(--info-tint); color: var(--info); }
.tone-wait { background: var(--wait-tint); color: var(--wait); }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 13.5px; }
.nowrap { white-space: nowrap; }

.card { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card h2 { font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head a { font-size: 14px; font-weight: 600; }
.card > .hint { margin-top: 10px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-flush > .rows { border: 0; border-radius: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: grid; align-content: start; gap: 1px; padding: 13px 18px; color: inherit; text-decoration: none; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
a.stat:hover { background: #f6f8f7; }
.stat > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.stat strong { font-size: 29px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { font-size: 13px; color: var(--ink-2); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab b { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .75; }
.tab.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; }
.searchfield { display: flex; flex: 1 1 220px; align-items: center; gap: 8px; max-width: 380px; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); }
.searchfield:focus-within { outline: 3px solid #1f6fd6; outline-offset: 1px; }
.searchfield input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--ink); }
.filter select { min-height: 40px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }

.table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: #f7f9f8; color: var(--ink-2); font-size: 12.5px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 16px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover { background: #f4f8f6; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-main small { display: block; color: var(--ink-2); font-size: 13px; }
td small { color: var(--ink-2); }
.list-count { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.more-row { display: flex; justify-content: center; padding: 10px; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 28px 18px; text-align: center; }
.empty h3 { font-size: 16px; }
.empty p { max-width: 42ch; color: var(--ink-2); }
.empty .btn { margin-top: 6px; }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: var(--radius); background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn.boxed { border: 1px solid var(--line-2); background: var(--surface); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.line-actions { display: inline-flex; gap: 2px; white-space: nowrap; }
.locked-note { display: inline-grid; place-items: center; width: 34px; }

.lane { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.lane .icon { width: 14px; height: 14px; color: var(--accent); }

/* ---------------- signature screen: dispatch board ---------------- */
.main.main-board { padding: 0; }
.main-board > * + * { margin-top: 0; }
.board { display: grid; grid-template-columns: 372px minmax(0, 1fr); height: calc(100vh - var(--bar)); min-height: 560px; }
.board .board-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-2); background: var(--surface); }
.board-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 14px 12px; }
.board-title h1 { font-size: 22px; font-weight: 800; letter-spacing: -.012em; }
.board .board-list > .tabs { flex: none; padding: 0 14px 10px; flex-wrap: wrap; overflow: visible; }
.board .board-list > .tabs .tab { min-height: 31px; padding: 0 9px; }
.board .board-list > .filterbar { flex: none; flex-wrap: nowrap; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.board .filterbar .searchfield { flex: 1 1 150px; min-width: 0; }
.board .filter select { width: 142px; }
.board-scroll { flex: 1; position: relative; min-height: 0; overflow-y: auto; }
.trip-day { position: sticky; top: 0; z-index: 2; padding: 5px 14px; border-bottom: 1px solid var(--line); background: #eef2f0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.trip-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.trip-row:hover { background: #f5f8f7; }
.trip-row.is-selected { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }
.trip-time { display: grid; align-content: start; font-variant-numeric: tabular-nums; line-height: 1.15; }
.trip-time b { font-size: 17px; font-weight: 800; }
.trip-time small { font-size: 12px; color: var(--ink-2); }
.trip-body { display: grid; gap: 1px; min-width: 0; line-height: 1.35; }
.trip-body > span { font-size: 13.5px; color: var(--ink-2); }
.trip-body strong { font-size: 15px; }
.trip-body .badges { margin-top: 5px; }
.trip-row.status-booked .trip-who { color: var(--wait); font-weight: 700; }
.board-detail { min-width: 0; min-height: 0; overflow-y: auto; padding: 20px 24px 48px; }

.trip-detail { max-width: 1040px; }
.trip-detail > * + * { margin-top: 14px; }
.trip-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 18px; }
.trip-head :is(h1, h2) { font-size: 23px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.trip-head :is(h1, h2) span { font-weight: 500; color: var(--ink-2); font-size: .8em; margin-left: 6px; }
.trip-head p { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 3px 0 7px; color: var(--ink-2); }
.trip-head p .lane { color: var(--ink); font-weight: 700; }
.alert { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid #eab4b2; border-radius: var(--radius-lg); background: var(--danger-tint); color: #6d1215; }
.alert > .icon { margin-top: 2px; }
.alert li { font-size: 14px; }
.alert-plain { border-color: var(--line-2); background: var(--soft); color: var(--ink); }
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.progress li { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.progress i { height: 6px; border-radius: 3px; background: #d5ddd9; }
.progress .is-done i { background: var(--accent); }
.progress .is-now { color: var(--ink); font-weight: 800; }
.progress .is-now i { background: #d9a41c; }

.sketch { margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.sketch svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.sketch figcaption { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.sketch figcaption strong { color: var(--ink); margin-right: 4px; }
.sk-land { fill: #eef1ea; } .sk-grid { stroke: rgba(70, 100, 85, .08); stroke-width: 1; }
.sk-water { fill: #c9dde6; stroke: #9fbfce; stroke-width: 1.2; stroke-linejoin: round; }
.sk-river { fill: none; stroke: #a9c8d6; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.sk-border { fill: none; stroke: #a9b3a6; stroke-width: 1; stroke-dasharray: 5 4; }
.sk-state { fill: #9aa597; font-size: 17px; font-weight: 700; }
.sk-casing { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.sk-route { fill: none; stroke: #1f5a43; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.sk-route.is-planned { stroke-dasharray: 2 10; }
.sk-arrow { fill: none; stroke: #12271e; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sk-via, .sk-other { fill: #fff; stroke: #5d6b64; stroke-width: 1.5; }
.sk-other { stroke: #98a49d; }
.sk-a { fill: #fff; stroke: #12271e; stroke-width: 4; } .sk-b { fill: #12271e; stroke: #fff; stroke-width: 2; }
.sketch text { paint-order: stroke; stroke: #eef1ea; stroke-width: 4px; stroke-linejoin: round; }
.sketch .sk-end { fill: #0f1f18; font-size: 15px; font-weight: 800; } .sketch .sk-town { fill: #46544d; font-size: 12.5px; font-weight: 600; } .sketch .sk-faint { fill: #7d8a83; font-size: 12px; }
.sk-truck rect, .sk-truck path { fill: #f6c445; stroke: #12271e; stroke-width: 1.6; stroke-linejoin: round; }
.sk-truck .sk-glass { fill: none; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.stops li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 11px; }
.stops li + li { margin-top: 16px; }
.stops i { width: 14px; height: 14px; margin-top: 4px; border: 4px solid var(--navy); border-radius: 50%; background: #fff; }
.stops .stop-b i { border-radius: 2px; background: var(--navy); }
.stops .stop-a::after { content: ""; position: absolute; left: 6px; top: 21px; bottom: -18px; border-left: 2px dashed var(--line-2); }
.stops div { display: grid; }
.stops span { font-size: 14px; color: var(--ink-2); }
.crew { display: grid; gap: 12px; }
.crew li { display: flex; gap: 11px; align-items: center; }
.crew div { display: grid; line-height: 1.35; min-width: 0; }
.crew div > span, .crew small { font-size: 13px; color: var(--ink-2); }
.crew a, .crew strong { font-weight: 700; }
.facts > div { display: grid; grid-template-columns: minmax(96px, 40%) minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.history li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line-2); font-size: 14px; line-height: 1.4; }
.history span { display: block; font-size: 12.5px; color: var(--ink-2); }
.lines > li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lines > li:last-child { border-bottom: 0; }
.lines > li > div { flex: 1; display: grid; min-width: 0; line-height: 1.4; }
.lines > li > div > span { font-size: 13.5px; color: var(--ink-2); }
.lines b { font-variant-numeric: tabular-nums; }
.sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 2px solid var(--line-2); }
.sums dt { font-size: 13px; color: var(--ink-2); } .sums dd { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pod-proof { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.pod-proof h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.pod-proof > div { max-width: 300px; flex: 1 1 200px; }
.signature { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfb; }
.signature polyline { fill: none; stroke: #16221c; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pod-photo { width: 100%; max-width: 240px; border-radius: var(--radius); }
.drive-next { display: grid; gap: 6px; }
.btn-big { width: 100%; min-height: 52px; font-size: 17px; }

/* ---------------- planner ---------------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav strong { min-width: 132px; text-align: center; }
.plan-wrap { border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); }
.plan { table-layout: fixed; min-width: 900px; }
.plan th, .plan td { border-right: 1px solid var(--line); }
.plan tr > :last-child { border-right: 0; }
.plan thead th { font-size: 13px; padding-inline: 8px; }
.plan thead th:first-child { width: 142px; padding-left: 14px; }
.plan thead th.is-today { background: var(--accent); color: #fff; }
.plan tbody th { background: var(--surface); color: var(--ink); font-size: 14px; white-space: normal; vertical-align: top; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.plan tbody th small { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.plan td, .plan td:first-child { height: 56px; padding: 4px; vertical-align: top; }
.plan td.is-blocked { background: repeating-linear-gradient(135deg, #e6e9e7 0 6px, #f4f6f5 6px 12px); }
.plan-open th, .plan-open td { background: #fdf8e4; }
.plan tbody .plan-open th { background: #fdf8e4; }
.plan-block { display: block; font-size: 12px; font-weight: 700; color: #4c5852; line-height: 1.3; padding: 1px 3px; }
.plan-chip { display: grid; margin-bottom: 4px; padding: 4px 7px; border: 1px solid #a9c9ba; border-left: 4px solid var(--accent); border-radius: 4px; background: #eef7f2; color: var(--ink); font-size: 12.5px; line-height: 1.3; text-decoration: none; }
.plan-chip:hover { border-color: var(--accent); }
.plan-chip span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; font-weight: 700; }
.plan-chip .icon { width: 12px; height: 12px; }
.plan-chip small { font-size: 12px; color: var(--ink-2); }
.plan-chip.status-booked { border-color: #d9bd57; border-left-color: #a87c00; background: #fff6cf; }
.plan-chip.status-delivered, .plan-chip.status-closed { border-color: var(--line-2); border-left-color: #85918b; background: #f3f5f4; }
.plan-chip.has-issue { border-color: var(--danger); border-left-color: var(--danger); background: var(--danger-tint); }

/* ---------------- overview and reports ---------------- */
.over-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.attn li + li { border-top: 1px solid var(--line); }
.attn a { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 10px; align-items: center; padding: 8px 0; color: inherit; text-decoration: none; }
.attn a:hover strong { text-decoration: underline; }
.attn i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); }
.attn i .icon { width: 16px; height: 16px; }
.attn div { display: grid; line-height: 1.35; min-width: 0; }
.attn strong { font-size: 14.5px; }
.attn div span { font-size: 13.5px; color: var(--ink-2); }
.attn > li > a > .icon { color: var(--ink-2); }
.attn.today a { grid-template-columns: 62px minmax(0, 1fr) auto; }
.today b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.today .badges { justify-content: flex-end; max-width: 120px; }
.over-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.over-side > .card:last-child { flex: 1; }
.fleet-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.fleet-now a { display: grid; padding: 7px 10px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); color: inherit; text-decoration: none; line-height: 1.35; }
.fleet-now b { font-family: var(--mono); font-size: 13.5px; }
.fleet-now span { font-size: 12.5px; color: var(--ink-2); }
.fleet-now .is-on_trip a { border-top-color: #d9a41c; }
.fleet-now .is-shop a { border-top-color: #8b968f; background: #f3f5f4; }
.fleet-now .is-blocked a { border-top-color: var(--danger); background: #fdf1f0; }
.checks li { position: relative; padding: 5px 0 5px 24px; }
.checks li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 12px; height: 12px; border: 2px solid var(--accent); border-radius: 3px; }

.locked { display: grid; justify-items: center; gap: 10px; padding: 72px 20px; text-align: center; }
.locked > .icon { width: 36px; height: 36px; color: var(--accent); }
.locked p { max-width: 46ch; color: var(--ink-2); }

/* ---------------- popups, forms, toasts ---------------- */
dialog { width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); overflow: hidden; box-shadow: 0 30px 70px -20px rgba(10, 30, 20, .55); }
dialog.is-wide { width: min(860px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 28, 20, .56); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; font-weight: 800; }
.modal-body { min-height: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > * + * { margin-top: 12px; }
.modal-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.modal-note { color: var(--ink-2); }
.modal-note:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.form-grid > .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field > span { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { color: var(--danger); font-size: 13px; font-weight: 700; line-height: 1.4; }
.error:empty { display: none; }
.form-error { padding: 9px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 700; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; font-size: 14px; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.sign-pad { width: 100%; aspect-ratio: 3 / 1; height: auto; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fbfcfb; touch-action: none; cursor: crosshair; }
.sign-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pick legend { margin-bottom: 6px; font-weight: 800; }
.pick legend small { font-weight: 500; color: var(--ink-2); margin-left: 6px; }
.pick-list { display: grid; gap: 6px; }
.pick-row { display: grid; grid-template-columns: 19px minmax(0, 1fr); gap: 10px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; }
.pick-row:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #f1f8f4; }
.pick-row input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); }
.pick-row > span { display: grid; min-width: 0; line-height: 1.35; }
.pick-row small { font-size: 13px; color: var(--ink-2); }
.pick-row .why, .pick-row .free { display: flex; gap: 6px; margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--danger); }
.pick-row .free { color: var(--accent); }
.pick-row .why .icon, .pick-row .free .icon { width: 14px; height: 14px; margin-top: 2px; }
.pick-row.is-blocked { cursor: not-allowed; background: #f6f7f7; border-style: dashed; }
.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: 0 12px 28px -12px rgba(10, 30, 20, .6); }
.toast .icon { margin-top: 2px; color: #8fdcb7; }
.toast-warn .icon { color: #ffc35c; }

/* ---------------- role screen ---------------- */
.signin { max-width: 1040px; margin: 0 auto; padding: 44px 24px 56px; text-align: center; }
.signin h1 { margin-top: 30px; font-size: 32px; font-weight: 800; letter-spacing: -.015em; }
.signin-sub { max-width: 60ch; margin: 8px auto 0; color: var(--ink-2); }
.signin .roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; text-align: left; }
.signin .role { display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); text-align: left; cursor: pointer; }
.signin .role:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.role-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius); background: var(--navy); color: #fff; }
.role-icon .icon { width: 22px; height: 22px; }
.role-title { margin-top: 14px; font-size: 20px; font-weight: 800; }
.role-name { color: var(--ink-2); }
.role-short { display: none; }
.role-points { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.role-points span { display: flex; gap: 8px; line-height: 1.4; }
.role-points .icon { width: 15px; height: 15px; margin-top: 3px; color: var(--accent); }
.noscript { padding: 40px; text-align: center; }
.rows { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

@media (max-width: 1240px) {
  .board { grid-template-columns: 320px minmax(0, 1fr); }
  .board .filter select { width: 134px; } .board .filterbar .searchfield { flex-basis: 90px; }
  .over-grid, .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .fleet-now { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .shell { grid-template-columns: 196px minmax(0, 1fr); background: linear-gradient(90deg, var(--navy) 196px, transparent 196px); }
  .side { padding-inline: 8px; }
  .main { padding: 20px 18px 40px; }
  .board { grid-template-columns: 270px minmax(0, 1fr); }
  .board .board-list > .filterbar { flex-wrap: wrap; }
  .board .filterbar .searchfield { flex-basis: 100%; }
  .board .filter, .board .filter select { width: 100%; }
  .board-detail { padding: 16px 14px 40px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) and (min-width: 761px) {
  .signin .roles { grid-template-columns: minmax(0, 1fr); }
  .progress li span { font-size: 11.5px; }
}
/* Loading placeholder shown while a screen opens */
.page-skel { display: grid; grid-column: 1 / -1; align-content: start; gap: 14px; width: 100%; min-width: 0; padding: 2px; }
.page-skel i { display: block; height: 96px; border-radius: var(--radius-lg, 8px); background: linear-gradient(90deg, rgba(100, 112, 128, .13) 25%, rgba(100, 112, 128, .05) 50%, rgba(100, 112, 128, .13) 75%); background-size: 200% 100%; animation: skel-shimmer 1s linear infinite; }
.page-skel .sk-title { width: min(280px, 70%); height: 30px; }
.page-skel .sk-line { width: min(420px, 90%); height: 14px; }
.page-skel > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.page-skel .sk-block { height: 280px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .page-skel > div { grid-template-columns: minmax(0, 1fr); } .page-skel > div i { height: 68px; } }
.page-in > * { animation: page-in .3s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
.page-skel.is-flush { box-sizing: border-box; padding: 22px 24px; }
