:root {
  color-scheme: light;
  --ink:#172b38; --muted:#526775; --line:#d8e2e6; --soft:#eff4f5; --paper:#fff;
  --accent:#00685b; --accent-light:#e4f3ee; --rail:#162e37;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px; line-height:1.55; color:var(--ink); background:#f2f5f6;
}
* { box-sizing:border-box }
body { margin:0; min-height:100vh; display:grid; grid-template-columns:216px minmax(0,1fr); grid-template-rows:1fr auto }
button,input,textarea { font:inherit }
button, summary, a { -webkit-tap-highlight-color:transparent }
button { background:white; color:var(--ink); border:1px solid #cbd8dd; border-radius:6px; min-height:34px; padding:5px 12px; cursor:pointer; font-weight:550; transition:background-color .14s,border-color .14s }
button:hover { background:#f2f7f6; border-color:#8ea7ac }
button:active { background:#e4eceb }
button:disabled { opacity:.6; cursor:wait }
button.primary { color:white; background:var(--accent); border-color:var(--accent) }
button.primary:hover { background:#005449 }
:focus-visible { outline:3px solid #267bba; outline-offset:3px }
h1:focus:not(:focus-visible) { outline:none }
::selection { background:#b9e1d8; color:#102d29 }
a { color:var(--accent); text-underline-offset:3px }
.skip { position:fixed; left:12px; top:-100px; z-index:6; padding:8px 14px; background:white }
.skip:focus { top:10px }
.sidebar { background:var(--rail); color:white; grid-row:1 / -1; min-width:0 }
.brand { display:flex; align-items:center; gap:12px; padding:27px 22px 24px; border-bottom:1px solid #344b52 }
.brand strong { display:block; font-size:23px; line-height:1.25; letter-spacing:-.025em }
.brand small { display:block; color:#b7ccd1; font-size:12px; margin-top:3px }
.brand-mark { width:35px; height:35px; flex-shrink:0; border-radius:9px; background:#9ce7d3; display:grid; place-items:center; position:relative }
.brand-mark::before { content:""; width:20px; height:14px; border:2px solid #164439; border-radius:4px }
.brand-mark::after { content:""; width:6px; height:6px; border:2px solid #164439; border-radius:50%; position:absolute }
#nav { position:sticky; top:0; padding:21px 12px }
.nav-group { margin:0 0 24px }
.nav-label { display:block; font-size:12px; color:#a5bdc4; margin:0 12px 8px }
nav button { width:100%; display:flex; align-items:center; gap:13px; padding:9px 13px; border:0; background:transparent; color:#dce8eb; text-align:left; margin:2px 0; font-weight:500 }
nav button:hover { color:white; background:#253f48 }
nav button[aria-current=true] { color:white; background:#21554f; font-weight:650 }
nav button[aria-current=true] .glyph { color:#9ef3d9 }
.glyph,.workspace-icon { position:relative; display:inline-block; width:17px; height:17px; flex:none; color:inherit }
.glyph::before,.glyph::after,.workspace-icon::before,.workspace-icon::after { content:""; position:absolute; box-sizing:border-box }
.overview::before,.workspace-icon::before { inset:2px 1px; border:1.6px solid; border-radius:2px }
.overview::after,.workspace-icon::after { left:6px; top:3px; height:11px; border-left:1.5px solid }
.people::before { left:5px; top:1px; width:7px; height:7px; border:1.5px solid; border-radius:50% }
.people::after { left:2px; bottom:1px; width:13px; height:7px; border:1.5px solid; border-radius:7px 7px 2px 2px }
.package::before { inset:3px 1px 1px; border:1.5px solid; border-radius:2px }
.package::after { top:6px; left:2px; right:2px; border-top:1.5px solid }
.place::before { width:12px; height:12px; top:1px; left:3px; border:1.5px solid; border-radius:50% 50% 2px 50%; transform:rotate(45deg) }
.place::after { width:4px; height:4px; border:1.3px solid; border-radius:50%; top:5px; left:7px }
.orders::before,.ledger::before { inset:1px 2px; border:1.5px solid; border-radius:2px }
.orders::after { left:6px; top:6px; width:5px; height:5px; border-block:1.5px solid }
.ledger::after { inset:6px 3px 2px 7px; border-left:1.5px solid; border-top:1.5px solid }
main { min-width:0 }
.topbar { min-height:58px; background:#fff; border-bottom:1px solid var(--line); padding:10px clamp(18px,3.1vw,48px); display:flex; align-items:center; justify-content:space-between; gap:12px }
.workspace-name,.top-tools,#tools { display:flex; align-items:center; gap:10px }
.workspace-name { color:#425865; font-weight:600 }
.top-tools { color:var(--muted); font-size:13px }
#mode { display:inline-flex; align-items:center; gap:7px }
#mode:not(:empty)::before { content:""; width:7px; height:7px; background:#178570; border-radius:50% }
#tools:not(:empty) { border-left:1px solid var(--line); padding-left:12px; margin-left:5px; gap:6px }
#tools button { font-size:12px; min-height:30px; padding:4px 9px }
.workspace { padding:30px clamp(18px,3.1vw,48px) 40px; max-width:1610px; margin-inline:auto }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 22px }
h1,h2,h3,p,pre { margin:0 }
h1 { font-size:29px; line-height:1.3; font-weight:700; letter-spacing:-.025em }
h2 { font-size:17px; line-height:1.45 }
h3 { font-size:15px; line-height:1.55; overflow-wrap:anywhere }
#as-of { color:var(--muted); font-size:13px }
#status { margin:0 0 16px; padding:10px 14px; color:#854321; background:#fff3e6; border-radius:6px; white-space:pre-line }
#status:empty { display:none }
#body,.panel,.day-side,.dashboard-layout { min-width:0 }
.panel { background:var(--paper); border:1px solid var(--line); border-radius:9px; overflow-wrap:anywhere }
.panel-heading { padding:16px 20px; min-height:56px; display:flex; gap:10px; align-items:center; border-bottom:1px solid var(--line) }
.panel-heading .count { margin-left:auto }
.count,.badge,.queue-total { display:inline-flex; align-items:center; padding:1px 7px; border-radius:5px; color:#435a68; background:#edf2f4; font-size:12px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums }
.badge { margin-left:10px; vertical-align:middle }
.badge.positive,.queue-total { color:#066653; background:#e4f3ec }
.badge.waiting { color:#815118; background:#fff1d8 }
.queue-total { margin-left:auto }
.dashboard-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(205px,26%); gap:20px; align-items:start }
.day-side { display:grid; gap:16px }
.queue-filters { display:flex; gap:4px; flex-wrap:wrap; padding:13px 16px; border-bottom:1px solid var(--line) }
.queue-filters button { min-height:30px; font-size:13px; border-color:transparent; color:var(--muted); padding:4px 10px }
.queue-filters button[aria-pressed=true] { background:var(--accent-light); color:var(--accent) }
.queue-group > summary,.quiet-queues > summary,.order-details > summary { cursor:pointer }
.queue-group > summary { padding:10px 20px; font-weight:650; background:#f6f9fa; border-bottom:1px solid #e1e9eb; font-size:13px }
.queue-group > summary .count { margin-left:8px; background:#e7eef0 }
summary::marker { color:#637983; font-size:.86em }
.quiet-queues { margin:0 20px; padding:14px 0; font-size:13px; color:var(--muted) }
.quiet-queues p { margin-top:8px; line-height:1.9 }
.queue-empty { display:grid; justify-items:center; gap:10px; padding:45px 14px; border-bottom:1px solid var(--line); color:#4c616a }
.complete-icon { position:relative; background:#e4f3ec; width:38px; height:38px; border-radius:50% }
.complete-icon::after { content:""; position:absolute; top:10px; left:15px; width:7px; height:13px; border:solid var(--accent); border-width:0 2px 2px 0; transform:rotate(45deg) }
.duty-panel { background:#e6f2ee; border-color:#c5ddd4 }
.duty-panel .panel-heading { color:#254f47; border-color:#ccdfd8 }
.duty-body { display:grid; padding:16px 20px 18px; gap:1px }
.duty-body strong { font-size:18px }
.duty-body small { color:var(--muted); font-variant-numeric:tabular-nums }
.duty-body button { margin-top:14px; justify-self:start; color:#225e51; border-color:#a7c7bb }
.schedule-row { display:grid; grid-template-columns:50px minmax(0,1fr); gap:1px 8px; width:100%; padding:13px 16px; text-align:left; border:0; border-radius:0; border-bottom:1px solid var(--line); background:transparent }
.schedule-row:last-child { border-bottom:0; border-radius:0 0 8px 8px }
.schedule-row time { font-variant-numeric:tabular-nums; color:var(--accent); font-weight:650 }
.schedule-row small { grid-column:2; color:var(--muted); font-weight:400 }
.empty { margin:0; padding:18px 20px; color:var(--muted) }
.record { padding:16px 20px; border-bottom:1px solid #e4eaed; min-width:0 }
.record:last-child { border-bottom:0 }
.meta, .order-id { color:var(--muted); overflow-wrap:anywhere; white-space:pre-wrap }
pre { white-space:pre-wrap; font:inherit }
.record .meta { margin-top:5px; font-size:13px; line-height:1.65 }
.actions,dialog footer,#identity-actions { display:flex; gap:7px; flex-wrap:wrap }
.actions { margin-top:11px }
.actions button { font-size:13px; min-height:32px }
.record img { width:92px; height:66px; object-fit:cover; border-radius:5px; margin:12px 8px 0 0 }
.order-id { font:12px/1.5 "SFMono-Regular",Consolas,monospace; margin-top:3px }
.order-facts { display:grid; grid-template-columns: 1.4fr 1fr .8fr; max-width:680px; gap:6px 14px; margin:12px 0 7px }
.order-facts small { display:block; color:var(--muted); font-size:12px }
.order-facts strong { font-weight:560; font-variant-numeric:tabular-nums }
.order-details { font-size:13px; color:var(--accent) }
.order-details .meta { background:#f4f7f8; border-radius:6px; padding:10px 12px; color:#415865 }
.places-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr)); gap:18px; align-items:start }
.search-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:14px 20px; border-bottom:1px solid var(--line) }
input,textarea { border:1px solid #abbcc3; border-radius:6px; padding:8px 10px; color:var(--ink); background:white; min-width:0; width:100%; caret-color:var(--accent) }
input::placeholder { color:#5e727c }
#search { width:min(340px,100%) }
.search-form button { min-height:39px }
label { display:block; color:#354e5a; font-weight:550; margin-top:14px }
label input,label textarea { display:block; margin-top:5px; font-weight:400 }
textarea { min-height:76px; resize:vertical }
.finance-panel { padding-bottom:20px }
.finance-panel > :not(.panel-heading) { margin:14px 20px 0 }
.finance-panel > label { max-width:570px }
.finance-panel > p { max-width:75ch; font-size:13px; color:var(--muted) }
.finance-panel article { padding:12px 0; border-bottom:1px solid var(--line) }
.finance-panel > section:empty { display:none }
dialog { width:min(490px,calc(100vw - 28px)); max-height:88dvh; padding:22px; border:1px solid var(--line); border-radius:11px; color:var(--ink); box-shadow:0 16px 70px #102b3940 }
dialog::backdrop { background:#112a38a8 }
dialog h2 { margin-bottom:16px; font-size:19px }
dialog footer { justify-content:flex-end; margin-top:20px; border-top:1px solid var(--line); padding-top:16px }
#fields pre,#fields output { display:block; padding:12px; background:var(--soft); border-radius:6px; font-size:13px }
#fields output { margin-top:12px }
#identity-dialog { width:min(660px,calc(100vw - 28px)) }
#identity-actions { margin:14px 0 }
#identity-status { color:var(--muted) }
#identity-detail { overflow-wrap:anywhere; font-variant-numeric:tabular-nums }
#identity-detail:not(:empty) { padding:12px; border-radius:6px; background:#f1f6f5 }
#identity-detail canvas { display:block; max-width:100%; max-height:54vh; object-fit:contain; margin:auto }
.site-registration { grid-column:2; text-align:center; padding:12px 20px; font-size:12px }
.site-registration a { color:var(--muted) }
body[data-view=login] { display:flex; flex-direction:column; background:#edf3f3 }
[data-view=login] .sidebar { background:var(--rail) }
[data-view=login] .brand { padding:14px max(22px,calc((100% - 1170px)/2)); gap:11px; border:0 }
[data-view=login] .brand > div { display:flex; align-items:center; gap:12px }
[data-view=login] #nav,[data-view=login] .topbar { display:none }
[data-view=login] main { display:grid; flex:1; align-content:center; min-height:65vh }
[data-view=login] .workspace { width:min(414px,calc(100% - 32px)); margin:42px auto; padding:32px; border:1px solid var(--line); background:white; border-radius:12px; box-shadow:0 10px 36px #1937320c }
[data-view=login] .page-heading { margin-bottom:20px }
[data-view=login] h1 { font-size:24px }
#operator-login { display:grid; gap:14px }
#operator-login label { margin:0 }
#operator-login input,#operator-login button { min-height:42px }
#operator-login button { margin-top:3px }
[data-view=login] #body > p { margin:0 0 12px; color:var(--muted) }
@media(max-width:1050px) {
  body { grid-template-columns:180px minmax(0,1fr) }
  .dashboard-layout { grid-template-columns:minmax(0,1fr) minmax(195px,28%); gap:12px }
  .workspace { padding-inline:18px }
}
@media(max-width:850px) {
  .dashboard-layout { grid-template-columns:minmax(0,1fr) }
  .day-side { grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); align-items:start }
}
@media(max-width:700px) {
  body { display:flex; flex-direction:column }
  .brand { padding:12px 16px; border:0 }
  .brand > div { display:flex; align-items:center; gap:10px }
  .brand strong { font-size:21px }
  .brand-mark { width:29px; height:29px }
  #nav { position:static; display:flex; overflow-x:auto; padding:0 10px 8px; scrollbar-width:thin }
  .nav-group { display:contents }
  .nav-label,.glyph { display:none }
  nav button { width:auto; flex:none; padding:6px 11px; min-height:32px }
  .topbar { padding:8px 14px; min-height:45px }
  .workspace-name { font-size:12px; gap:4px }
  .top-tools { font-size:12px; gap:4px }
  #tools:not(:empty) { padding-left:5px }
  .workspace { padding:18px 12px 25px }
  .page-heading { margin:0 2px 14px }
  h1 { font-size:24px }
  .record,.panel-heading,.search-form { padding:12px 14px }
  .queue-filters { padding:8px; gap:1px }
  .queue-filters button { padding:4px 8px }
  .order-facts { grid-template-columns:1.5fr 1fr .8fr; font-size:13px }
  .search-form { flex-wrap:wrap } #search { flex:1; width:0; min-width:140px }
  .day-side { grid-template-columns:1fr }
  .site-registration { margin-top:auto }
}
@media(prefers-reduced-motion:reduce) { button { transition:none } }

@media(min-width:960px) {
  .order-list .order-record {
    display:grid;
    grid-template-columns:minmax(220px,1fr) minmax(280px,1.25fr);
    align-items:start;
    column-gap:26px;
  }
  .order-list .order-record h3,.order-list .order-id { grid-column:1 }
  .order-list .order-facts { grid-column:2; grid-row:1 / 3; width:100%; margin:0 }
  .order-list .order-details { grid-column:1 / -1; margin-top:8px }
  .order-list .actions { grid-column:1 / -1; margin-top:8px }
}

