@font-face {
  font-family: "Huari Display";
  src: url("/assets/SourceHanSansCN-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --board: #eee9dc;
  --board-deep: #e4dfd1;
  --paper: #fffdf6;
  --paper-strong: #ffffff;
  --ink: #202521;
  --ink-soft: #535b54;
  --line: #b9b7aa;
  --line-soft: #d8d4c7;
  --graphite: #1d231f;
  --graphite-2: #2d342f;
  --green: #146b57;
  --green-soft: #dce9df;
  --yellow: #e7b93f;
  --yellow-soft: #f7edc8;
  --red: #b94a3a;
  --red-soft: #f4ddd7;
  --blue: #356b78;
  --blue-soft: #dde8e8;
  --focus: 0 0 0 3px rgba(20, 107, 87, .22);
  --lift: 0 12px 28px rgba(39, 43, 38, .12);
  color: var(--ink);
  background: var(--board);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: weight;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--board); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--board); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: var(--green); text-underline-offset: 4px; }
::selection { color: var(--paper); background: var(--green); }
* { scrollbar-color: var(--ink-soft) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: var(--ink-soft); background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.hidden { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: clamp(20px, 4vw, 58px); background: var(--graphite); }
.login-shell { width: min(1240px, 100%); min-height: min(760px, calc(100vh - 80px)); display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .65fr); overflow: hidden; background: var(--board); box-shadow: 0 28px 64px rgba(0, 0, 0, .25); }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(30px, 5vw, 72px); border-right: 1px solid var(--line); }
.login-intro::after { position: absolute; right: 44px; bottom: 0; width: 1px; height: 55%; content: ""; background: var(--line); }
.brand-lockup, .command-brand { display: flex; align-items: center; gap: 14px; }
.brand-lockup > div, .command-brand > div { display: grid; gap: 2px; }
.brand-lockup strong { font-size: 14px; letter-spacing: .02em; }
.brand-lockup span, .command-brand span { color: var(--ink-soft); font-size: 11px; }
.brand-code { min-width: 88px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px 7px; color: var(--graphite) !important; background: var(--yellow); font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif; font-size: 13px !important; font-weight: 800; letter-spacing: .08em; }
.login-message { max-width: 720px; margin: 76px 0 58px; }
.login-message h1 { max-width: 8ch; margin: 0 0 24px; font-family: "Huari Display", sans-serif; font-size: clamp(58px, 8vw, 104px); font-weight: 900; line-height: .96; letter-spacing: -.035em; text-wrap: balance; }
.login-message p { max-width: 32em; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.85; }
.dispatch-route { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.dispatch-route li { min-height: 80px; display: grid; align-content: center; gap: 8px; padding: 14px 16px 10px 0; border-right: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.dispatch-route li:last-child { border-right: 0; }
.dispatch-route span { color: var(--green); font-family: "Avenir Next Condensed", sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.login-card { align-self: center; width: 100%; padding: clamp(30px, 4vw, 58px); background: var(--paper); }
.login-card-head { margin-bottom: 34px; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.login-card h2 { margin: 0 0 8px; font-family: "Huari Display", sans-serif; font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.login-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.login-card label + label { margin-top: 18px; }
.demo-accounts { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); color: var(--ink-soft); font-size: 12px; }
.demo-accounts summary { cursor: pointer; font-weight: 700; }
.demo-accounts p { margin: 8px 0 0; font-size: 12px; }

label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; outline: 0; color: var(--ink); background: var(--paper-strong); transition: border-color .16s ease, box-shadow .16s ease; }
textarea { min-height: 104px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #787e78; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: var(--focus); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--green); }
.form-error { min-height: 20px; margin: 10px 0 4px !important; color: var(--red) !important; font-size: 12px !important; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid var(--ink); border-radius: 3px; color: var(--ink); background: var(--paper); font-size: 12px; font-weight: 800; line-height: 1; text-decoration: none; transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button:hover { background: var(--yellow-soft); }
.button.primary { color: var(--paper); border-color: var(--green); background: var(--green); }
.button.primary:hover { border-color: #0d5545; background: #0d5545; }
.button.ghost { background: transparent; }
.button.ghost:hover { background: var(--paper); }
.button.success { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.button.danger { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.button.small { min-height: 31px; padding: 6px 9px; font-size: 11px; }
.button.wide { width: 100%; min-height: 50px; }
.button.is-loading::before { width: 13px; height: 13px; content: ""; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }

.app-shell { min-height: 100vh; }
.command-bar { position: sticky; top: 0; z-index: 30; min-height: 68px; display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; align-items: stretch; color: var(--paper); background: var(--graphite); }
.command-brand { padding: 0 22px; border-right: 1px solid rgba(255,255,255,.14); }
.command-brand strong { color: var(--paper); font-size: 14px; }
.command-brand span { color: #aeb9b0; }
.command-brand .brand-code { min-width: auto; color: var(--graphite) !important; }
.main-nav { display: flex; align-items: stretch; overflow-x: auto; }
.nav-item { min-width: 112px; min-height: 68px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 0; border-right: 1px solid rgba(255,255,255,.09); color: #aeb9b0; background: transparent; font-size: 12px; font-weight: 700; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: var(--paper); background: var(--graphite-2); }
.nav-item.active { position: relative; color: var(--graphite); background: var(--yellow); }
.nav-item.active::after { position: absolute; right: 18px; bottom: -6px; left: 18px; height: 6px; content: ""; background: var(--yellow); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.user-area { display: flex; align-items: center; gap: 11px; padding: 0 18px; border-left: 1px solid rgba(255,255,255,.14); }
.user-copy { display: grid; text-align: right; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: #aeb9b0; font-size: 10px; }
.avatar, .icon-button { display: grid; place-items: center; border: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; color: var(--graphite); background: var(--yellow); font-weight: 800; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: var(--paper); }
.command-bar .icon-button { border-color: rgba(255,255,255,.24); color: var(--paper); background: transparent; }
.icon-button:hover { background: var(--yellow-soft); }
.command-bar .icon-button:hover { background: var(--graphite-2); }
.icon-button svg { width: 17px; height: 17px; }
.main { min-width: 0; }
.topbar { min-height: 118px; display: flex; align-items: flex-end; justify-content: space-between; padding: 30px clamp(20px, 3vw, 46px) 22px; border-bottom: 1px solid var(--line); background: var(--board); }
.topbar h1 { margin: 0; font-family: "Huari Display", sans-serif; font-size: clamp(32px, 4vw, 48px); font-weight: 900; line-height: 1; letter-spacing: -.025em; }
.page-context { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }
.runtime-state { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; color: var(--ink-soft); font-size: 11px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.view-container { width: 100%; max-width: 1780px; margin: 0 auto; padding: 24px clamp(20px, 3vw, 46px) 68px; }
.notice { position: fixed; top: 82px; left: 50%; z-index: 100; max-width: min(520px, calc(100vw - 32px)); transform: translateX(-50%); padding: 12px 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 3px; color: var(--paper); background: var(--graphite); box-shadow: var(--lift); font-size: 12px; }
.notice.error { background: var(--red); }
.loading-state { min-height: 300px; display: grid; place-items: center; color: var(--ink-soft); font-size: 12px; }
.loading-state::before { width: 23px; height: 23px; content: ""; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .75s linear infinite; }

.dispatch-summary { display: grid; grid-template-columns: 1.1fr .85fr .85fr 1.4fr; border: 1px solid var(--ink); background: var(--paper); }
.dispatch-stat { min-height: 108px; display: grid; align-content: space-between; gap: 10px; padding: 16px 18px; border-right: 1px solid var(--line); }
.dispatch-stat:last-child { border-right: 0; }
.dispatch-stat span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.dispatch-stat strong { font-family: "Avenir Next Condensed", "PingFang SC", sans-serif; font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.dispatch-stat small { color: var(--ink-soft); font-size: 10px; }
.dispatch-stat.attention { background: var(--yellow-soft); }
.dispatch-stat.closed { color: var(--paper); background: var(--green); }
.dispatch-stat.closed span, .dispatch-stat.closed small { color: #dcebe5; }
.dispatch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 18px; }
.dispatch-board, .load-rail, .panel, .table-wrap { min-width: 0; border: 1px solid var(--line); background: var(--paper); }
.board-head, .panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.board-head h2, .panel-head h2 { margin: 0; font-size: 15px; }
.board-head p, .panel-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; }
.stage-rail { display: grid; grid-template-columns: repeat(6, minmax(100px, 1fr)); overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--board-deep); }
.stage-node { min-height: 88px; position: relative; display: grid; align-content: center; gap: 5px; padding: 13px 14px; border-right: 1px solid var(--line); }
.stage-node:last-child { border-right: 0; }
.stage-node::before { width: 10px; height: 10px; content: ""; border: 2px solid var(--ink-soft); border-radius: 50%; background: var(--board-deep); }
.stage-node strong { font-family: "Avenir Next Condensed", sans-serif; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.stage-node span { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.stage-node.hot::before { border-color: var(--yellow); background: var(--yellow); }
.stage-node.done::before { border-color: var(--green); background: var(--green); }
.ticket-stack { display: grid; }
.work-ticket { width: 100%; min-height: 94px; display: grid; grid-template-columns: minmax(170px, .82fr) minmax(220px, 1.35fr) minmax(120px, .7fr) 150px; align-items: stretch; padding: 0; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: var(--paper); text-align: left; }
.work-ticket:last-child { border-bottom: 0; }
.work-ticket:hover { background: #faf6e9; }
.ticket-id, .ticket-main, .ticket-owner, .ticket-hours { display: grid; align-content: center; gap: 5px; padding: 14px 16px; border-right: 1px dashed var(--line); }
.ticket-hours { border-right: 0; }
.ticket-id strong { color: var(--green); font-family: "Avenir Next Condensed", sans-serif; font-size: 15px; letter-spacing: .02em; }
.ticket-id span, .ticket-main span, .ticket-owner span, .ticket-hours span { color: var(--ink-soft); font-size: 10px; }
.ticket-main strong { font-size: 13px; line-height: 1.45; }
.ticket-owner strong { font-size: 12px; }
.ticket-hours strong { font-family: "Avenir Next Condensed", sans-serif; font-size: 18px; font-variant-numeric: tabular-nums; }
.load-rail { align-self: start; }
.load-list { display: grid; }
.load-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.load-item:last-child { border-bottom: 0; }
.load-mark { width: 34px; height: 26px; display: grid; place-items: center; color: var(--paper); background: var(--green); font-family: "Avenir Next Condensed", sans-serif; font-size: 11px; font-weight: 800; }
.load-item strong { display: block; font-size: 12px; }
.load-item span { color: var(--ink-soft); font-size: 10px; }
.load-item > div { min-width: 0; }
.load-count { font-family: "Avenir Next Condensed", sans-serif; font-size: 20px !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.rail-note { padding: 15px; border-top: 1px solid var(--ink); color: var(--ink-soft); background: var(--yellow-soft); font-size: 11px; line-height: 1.55; }
.followup-list { display: grid; border-bottom: 1px solid var(--ink); }
.followup-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: var(--paper); text-align: left; }
.followup-item:last-child { border-bottom: 0; }
.followup-item:hover { background: var(--yellow-soft); }
.followup-item strong { font-size: 12px; }
.followup-item span { color: var(--ink-soft); font-size: 10px; }
.followup-item b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--green); font-size: 10px; }
.followup-empty { padding: 15px; border-bottom: 1px solid var(--ink); color: var(--ink-soft); font-size: 11px; }
.rail-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 15px 9px; border-bottom: 1px solid var(--line); background: var(--board-deep); }
.rail-section-title strong { font-size: 12px; }
.rail-section-title span { color: var(--ink-soft); font-size: 10px; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.toolbar-copy { max-width: 68ch; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.search { min-width: min(390px, 42vw); position: relative; }
.search svg { position: absolute; left: 12px; top: 13px; width: 17px; height: 17px; color: var(--ink-soft); pointer-events: none; }
.search input { padding-left: 37px; }
.result-count { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.filter-tabs { display: flex; flex-wrap: wrap; margin: 0 0 16px; border: 1px solid var(--line); background: var(--paper); }
.filter-tabs button { min-height: 38px; padding: 7px 13px; border: 0; border-right: 1px solid var(--line); color: var(--ink-soft); background: transparent; font-size: 11px; font-weight: 700; }
.filter-tabs button:last-child { border-right: 0; }
.filter-tabs button:hover { background: var(--yellow-soft); }
.filter-tabs button.active { color: var(--paper); background: var(--green); }
.order-ledger { border: 1px solid var(--line); background: var(--paper); }
.ledger-head { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.4fr) minmax(120px, .8fr) 160px 160px; border-bottom: 1px solid var(--ink); background: var(--board-deep); }
.ledger-head span { padding: 10px 14px; border-right: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.ledger-head span:last-child { border-right: 0; }
.order-strip { width: 100%; min-height: 96px; display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.4fr) minmax(120px, .8fr) 160px 160px; padding: 0; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); background: var(--paper); text-align: left; }
.order-strip:last-child { border-bottom: 0; }
.order-strip:hover { background: #faf6e9; }
.order-strip > span { min-width: 0; display: grid; align-content: center; gap: 5px; padding: 13px 14px; border-right: 1px dashed var(--line); }
.order-strip > span:last-child { border-right: 0; }
.order-strip strong { overflow: hidden; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; }
.order-strip small { overflow: hidden; color: var(--ink-soft); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; }
.order-code { color: var(--green); font-family: "Avenir Next Condensed", sans-serif; font-size: 14px !important; letter-spacing: .03em; }
.hour-triad { display: flex !important; grid-auto-flow: column; align-items: center; justify-content: space-between; gap: 7px !important; font-family: "Avenir Next Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.hour-triad b { display: grid; gap: 3px; font-size: 16px; }
.hour-triad em { color: var(--ink-soft); font-family: "Avenir Next", sans-serif; font-size: 9px; font-style: normal; font-weight: 600; }

.panel-body { padding: 17px; }
.quick-list { display: grid; }
.quick-item { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.quick-item:last-child { border-bottom: 0; }
.quick-item strong { font-size: 12px; }
.quick-item span { color: var(--ink-soft); font-size: 11px; }
.empty { padding: 58px 20px; text-align: center; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; }
.table-wrap { overflow: auto; }
.panel > .table-wrap { border: 0; }
table { width: 100%; min-width: 840px; border-collapse: collapse; }
th { padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--ink); color: var(--ink-soft); background: var(--board-deep); font-size: 10px; font-weight: 800; text-align: left; white-space: nowrap; }
th:last-child { border-right: 0; }
td { padding: 13px; border-right: 1px dashed var(--line); border-bottom: 1px solid var(--line-soft); font-size: 11px; line-height: 1.55; vertical-align: middle; }
td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #faf6e9; }
.cell-title { display: grid; gap: 3px; }
.cell-title strong, .order-link { color: var(--green); font-size: 12px; font-weight: 800; }
.cell-title span { color: var(--ink-soft); }
.order-link { padding: 0; border: 0; background: transparent; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.order-link:hover { text-decoration-color: currentColor; }
.number-cell { font-family: "Avenir Next Condensed", sans-serif; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { min-height: 25px; display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid var(--blue); border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.status.green { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.status.amber { color: #73540b; border-color: #ad7e12; background: var(--yellow-soft); }
.status.red { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.badge { display: inline-flex; padding: 5px 8px; border: 1px solid var(--green); border-radius: 3px; color: var(--green); background: var(--green-soft); font-family: "Avenir Next Condensed", sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(22, 25, 22, .5); }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 50; width: min(780px, 96vw); height: 100dvh; overflow: auto; background: var(--paper); box-shadow: -22px 0 50px rgba(20, 24, 21, .22); transform: translateX(102%); transition: transform .24s cubic-bezier(.22, 1, .36, 1); }
.detail-drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 28px 18px; border-bottom: 2px solid var(--ink); background: rgba(255, 253, 246, .98); }
.drawer-head h2 { margin: 12px 0 4px; font-family: "Huari Display", sans-serif; font-size: 28px; font-weight: 900; line-height: 1; }
.drawer-head p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.drawer-content { display: grid; gap: 20px; padding: 22px 28px 52px; }
.drawer-lead { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.75; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.info-box { min-height: 82px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--board); }
.info-box:nth-child(3n) { border-right: 0; }
.info-box:nth-last-child(-n+3) { border-bottom: 0; }
.info-box span { display: block; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.info-box strong { display: block; margin-top: 7px; font-size: 12px; line-height: 1.45; }
.info-box.hours strong { font-family: "Avenir Next Condensed", sans-serif; font-size: 21px; font-variant-numeric: tabular-nums; }
.detail-section { padding-top: 18px; border-top: 1px solid var(--ink); }
.detail-section h3 { margin: 0 0 12px; font-size: 14px; }
.timeline { display: grid; }
.timeline-item { position: relative; padding: 0 0 20px 26px; border-left: 1px solid var(--line); }
.timeline-item::before { position: absolute; top: 2px; left: -6px; width: 10px; height: 10px; content: ""; border: 2px solid var(--paper); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 6px 0; font-size: 11px; line-height: 1.7; }
.timeline-item small { color: var(--ink-soft); line-height: 1.55; }
.work-hours { display: grid; margin-top: 9px; border-top: 1px dashed var(--line); }
.work-hours > div { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; color: var(--ink-soft); font-size: 10px; }
.inline-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--blue); border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; }
.chip svg { width: 13px; height: 13px; }
.chip.covered { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.subtle { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.warning-box { margin: 0 0 16px; padding: 12px; border: 1px solid #ad7e12; color: #684c0c; background: var(--yellow-soft); font-size: 11px; line-height: 1.6; }
dialog { width: min(700px, calc(100vw - 28px)); max-height: 90dvh; padding: 0; border: 0; border-radius: 4px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 70px rgba(20, 24, 21, .28); }
dialog::backdrop { background: rgba(22, 25, 22, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; border-bottom: 2px solid var(--ink); }
.modal-head h2 { margin: 0; font-family: "Huari Display", sans-serif; font-size: 23px; font-weight: 900; }
.modal-body { max-height: calc(90dvh - 138px); overflow: auto; padding: 22px 24px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--board); }
.modal-foot .form-error { flex: 1; margin: 0 auto 0 0 !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field-group { display: grid; gap: 8px; }
.field-label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.check-card { min-height: 50px; display: flex; align-items: center; gap: 9px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); font-size: 11px; font-weight: 500; }
.check-card:hover { background: var(--yellow-soft); }
.check-card:has(input:checked) { color: #0d5545; background: var(--green-soft); }
.check-card input { flex: 0 0 auto; }
.check-card span { min-width: 0; }
.mobile-nav { display: none; }
.report-sheet-panel { margin-top: 18px; }
.report-summary { display: grid; grid-template-columns: .75fr 1.15fr .9fr 1.2fr; margin-bottom: 18px; border: 1px solid var(--ink); background: var(--paper); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ticket-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.ticket-stack, .order-ledger { animation: ticket-in .42s cubic-bezier(.16, 1, .3, 1); }

@media (max-width: 1120px) {
  .command-bar { grid-template-columns: 190px minmax(0, 1fr) auto; }
  .nav-item { min-width: 94px; padding-inline: 10px; }
  .nav-item span { display: none; }
  .dispatch-layout { grid-template-columns: 1fr; }
  .load-rail { display: grid; grid-template-columns: 1fr 1fr; }
  .load-rail .board-head, .load-rail .rail-note { grid-column: 1 / -1; }
  .load-list { grid-template-columns: repeat(2, 1fr); }
  .load-item:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .work-ticket { grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.4fr) minmax(120px, .7fr) 130px; }
}

@media (max-width: 820px) {
  .login-screen { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; }
  .login-intro { min-height: 48vh; padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-intro::after { display: none; }
  .login-message { margin: 46px 0 32px; }
  .login-message h1 { font-size: clamp(50px, 14vw, 80px); }
  .login-card { padding: 32px 24px; }
  .command-bar { grid-template-columns: 1fr auto; min-height: 62px; }
  .command-brand { padding: 0 16px; border: 0; }
  .main-nav { display: none; }
  .user-area { padding: 0 12px; }
  .user-copy { display: none; }
  .topbar { min-height: 96px; padding: 22px 18px 17px; }
  .topbar h1 { font-size: 34px; }
  .runtime-state { display: none; }
  .view-container { padding: 16px 14px 94px; }
  .mobile-nav { position: fixed; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; z-index: 30; display: flex; justify-content: space-around; padding: 7px 6px; border: 1px solid rgba(255,255,255,.16); border-radius: 4px; background: rgba(29, 35, 31, .98); box-shadow: 0 16px 34px rgba(20, 24, 21, .24); }
  .mobile-nav button { min-width: 58px; min-height: 48px; display: grid; place-items: center; gap: 2px; padding: 4px 8px; border: 0; border-radius: 2px; color: #aeb9b0; background: transparent; font-size: 10px; }
  .mobile-nav button svg { width: 18px; height: 18px; }
  .mobile-nav button.active { color: var(--graphite); background: var(--yellow); }
  .dispatch-summary, .report-summary { grid-template-columns: repeat(2, 1fr); }
  .dispatch-stat { border-bottom: 1px solid var(--line); }
  .dispatch-stat:nth-child(2) { border-right: 0; }
  .dispatch-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .work-ticket { grid-template-columns: 138px minmax(190px, 1fr) 126px; }
  .ticket-owner { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .search { min-width: 0; flex: 1; }
  .ledger-head, .order-strip { grid-template-columns: 145px minmax(220px, 1fr) 130px 150px; }
  .ledger-head span:nth-child(3), .order-strip > span:nth-child(3) { display: none; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .info-box:nth-child(3n) { border-right: 1px solid var(--line); }
  .info-box:nth-child(2n) { border-right: 0; }
  .info-box:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .info-box:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .login-intro { display: none; }
  .login-card { min-height: 100vh; display: grid; align-content: center; }
  .command-brand div { display: none; }
  .command-brand .brand-code { min-width: 86px; }
  .topbar { min-height: 88px; }
  .topbar h1 { font-size: 30px; }
  .dispatch-summary, .report-summary { grid-template-columns: 1fr 1fr; }
  .dispatch-stat { min-height: 96px; padding: 13px; }
  .dispatch-stat strong { font-size: 25px; }
  .dispatch-layout { gap: 12px; margin-top: 12px; }
  .stage-rail { grid-template-columns: repeat(6, 108px); }
  .work-ticket { grid-template-columns: 112px minmax(0, 1fr); min-height: 104px; }
  .ticket-id, .ticket-main, .ticket-hours { padding: 12px; }
  .ticket-hours { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--line); }
  .load-rail { display: block; }
  .load-list { grid-template-columns: 1fr; }
  .load-item:nth-child(odd) { border-right: 0; }
  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .filter-tabs button { min-height: 44px; flex: 0 0 auto; font-size: 12px; }
  .ledger-head { display: none; }
  .order-ledger { border: 0; background: transparent; }
  .order-strip { grid-template-columns: minmax(0, 1fr) 122px; min-height: 0; margin-bottom: 9px; border: 1px solid var(--line); }
  .order-strip > span { border-right: 0; }
  .order-strip > span:nth-child(1) { border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
  .order-strip > span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; border-top: 0; }
  .order-strip > span:nth-child(5) { grid-column: 2; grid-row: 1; border-bottom: 1px dashed var(--line); }
  .order-strip > span:nth-child(3) { display: grid; grid-column: 1; grid-row: 3; border-top: 1px dashed var(--line); border-right: 1px dashed var(--line); }
  .order-strip > span:nth-child(4) { grid-column: 2; grid-row: 3; display: flex; align-items: flex-start; justify-content: center; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); }
  .order-strip small { font-size: 11px; }
  .order-strip strong { font-size: 13px; }
  .hour-triad em { font-size: 10px; }
  .status { min-height: 28px; font-size: 11px; }
  .page-context, .subtle { font-size: 11px; }
  .result-count { display: none; }
  .form-grid, .check-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .detail-drawer { width: 100vw; }
  .drawer-head, .drawer-content { padding-right: 17px; padding-left: 17px; }
  .drawer-head h2 { font-size: 24px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  dialog { width: 100vw; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 4px 4px 0 0; }
  .modal-body { max-height: calc(92dvh - 138px); padding: 18px; }
  .modal-head, .modal-foot { padding-right: 18px; padding-left: 18px; }
  .card-table { overflow: visible; border: 0; background: transparent; }
  .card-table table, .card-table tbody { display: block; min-width: 0; }
  .card-table thead { display: none; }
  .card-table tr { display: grid; margin-bottom: 9px; padding: 4px 12px; border: 1px solid var(--line); background: var(--paper); }
  .card-table td { min-height: 40px; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-right: 0; border-bottom: 1px dashed var(--line); }
  .card-table td::before { content: attr(data-label); color: var(--ink-soft); font-size: 9px; font-weight: 800; }
  .card-table td:last-child { border-bottom: 0; }
  .card-table td.primary-cell { grid-template-columns: 1fr; padding: 12px 0 9px; }
  .card-table td.primary-cell::before, .card-table .empty-cell::before { display: none; }
  .card-table .empty-cell { display: block; padding: 0; border: 0; }
}

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