/* DockClock. MVP Logistics design system tokens; flat surfaces, hairline borders.
 * Aptos is not self hosted until its web license is confirmed; the stack falls back to Segoe UI. */
:root {
  --mvp-navy: #0F3B5B; --mvp-navy-700: #0B2C45; --mvp-navy-900: #061827;
  --mvp-blue: #28ADE3; --mvp-blue-600: #1E92C5; --mvp-blue-300: #7CCBEB; --mvp-blue-100: #DCF1FB;
  --mvp-red: #D7222B;
  --paper: #F7F9FB; --mist: #ECEFF3; --stone-300: #C7CED5; --stone-500: #8A95A0; --stone-700: #4A5560; --ink: #1A2530;
  --ok: #17704A; --ok-bg: #E3F4EC; --warn: #8A5200; --warn-bg: #FCEFD9; --bad: #B61920; --bad-bg: #FBE6E7; --link: #12689A;
  --font: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --focus: 0 0 0 3px rgba(40, 173, 227, 0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { color: var(--mvp-navy-900); margin: 0; line-height: 1.25; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; margin-bottom: 10px; } h4 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 0 0 8px; }
a { color: var(--link); }
code, .code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13px; }
.code { display: block; white-space: pre-wrap; word-break: break-all; background: var(--mist); padding: 12px; border-radius: var(--r-sm); margin: 8px 0; }
.muted { color: var(--stone-700); }
.small { font-size: 13px; }
.neg { color: var(--bad); }
.ok-txt { color: var(--ok); font-weight: 600; }
.danger-txt { color: var(--bad) !important; }
.grow { flex: 1; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--mvp-navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.brand-mark { height: 20px; }
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-clock { font-size: 14px; opacity: .85; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-txt small { font-size: 12px; opacity: .75; white-space: nowrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease); }
.btn:focus-visible, .input:focus, button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12px; }
.btn-lg { min-height: 52px; font-size: 15px; }
.btn-primary { background: var(--mvp-navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--mvp-navy-700); }
.btn-secondary { background: #fff; color: var(--mvp-navy); border-color: var(--stone-300); }
.btn-secondary:hover:not(:disabled) { border-color: var(--mvp-navy); }
.btn-ghost { background: transparent; color: var(--mvp-navy); }
.btn-ghost:hover:not(:disabled) { background: var(--mist); }
.btn-ghost-inv { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-inv:hover { background: rgba(255,255,255,.1); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--stone-700); border-radius: var(--r-sm); cursor: pointer; }
.icon-btn:hover { background: var(--mist); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.flip .ic { transform: scaleX(-1); }
.input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--stone-300); border-radius: var(--r-sm); }
.input:focus { border-color: var(--mvp-blue); }
select.input { padding-right: 28px; }
textarea.input { resize: vertical; }
.field { display: block; font-size: 13px; font-weight: 600; color: var(--stone-700); margin: 12px 0 4px; }
.fl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--stone-700); min-width: 140px; }
.fl .input { font-weight: 400; font-size: 15px; }
.search { position: relative; display: block; margin: 8px 0; }
.search .ic { position: absolute; left: 12px; top: 13px; color: var(--stone-500); }
.search .input { padding-left: 40px; }
.sw-check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.sw-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--mvp-navy); }
.fs { border: 1px solid var(--mist); border-radius: var(--r-md); padding: 8px 14px 12px; margin: 14px 0 0; }
.fs legend { font-weight: 700; font-size: 13px; color: var(--mvp-navy); padding: 0 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 8px 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mvp-blue-600); }
.eyebrow img { height: 8px; }
.eyebrow.on { color: var(--ok); }
.card { background: #fff; border: 1px solid var(--mist); border-radius: var(--r-lg); }
.pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h3 { margin: 0; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--mvp-blue-100); color: var(--mvp-navy); font-weight: 700; font-size: 13px; }
.top .avatar { background: var(--mvp-blue); color: #fff; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar.alt .ic { width: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 13px; background: var(--mist); color: var(--ink); white-space: nowrap; border-left: 4px solid var(--c, var(--stone-300)); }
.chip.sm { font-size: 12px; }
.chip.on { background: var(--ok-bg); color: var(--ok); border-left-color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-left-color: var(--warn); }
.tag { display: inline-block; padding: 0 6px; border-radius: var(--r-sm); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--mist); color: var(--stone-700); }
.tag.on { background: var(--ok-bg); color: var(--ok); }
.flag { display: inline-block; margin: 2px 4px 2px 0; padding: 0 6px; border-radius: var(--r-sm); font-size: 12px; background: var(--warn-bg); color: var(--warn); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; flex: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); }
.empty { padding: 20px; text-align: center; color: var(--stone-700); border: 1px dashed var(--stone-300); border-radius: var(--r-md); grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--stone-300); border-radius: var(--r-sm); overflow: hidden; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; background: #fff; font: inherit; font-weight: 600; font-size: 14px; color: var(--stone-700); cursor: pointer; }
.seg-b + .seg-b { border-left: 1px solid var(--stone-300); }
.seg-b.on, .seg-b[aria-selected="true"] { background: var(--mvp-navy); color: #fff; }
.seg-b .count { font-size: 12px; opacity: .8; }
.seg-b .ic { width: 16px; height: 16px; }
.tabs-seg { margin: 16px 0 10px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--mist); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--mvp-blue); width: 0; transition: width 360ms var(--ease); }

/* ---------- views ---------- */
.view { padding: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* kiosk */
.kiosk { max-width: 1240px; margin: 0 auto; display: grid; gap: 16px; grid-template-columns: minmax(300px, 420px) 1fr; align-items: start; }
.kiosk-cam { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.kiosk-names { padding: 20px; display: flex; flex-direction: column; min-height: 60dvh; }
.names-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 8px; align-content: start; flex: 1; }
.name-btn { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; background: #fff; border: 1px solid var(--mist); border-radius: var(--r-md); font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.name-btn:hover { border-color: var(--mvp-blue); }
.name-btn .nm { line-height: 1.25; }
.dot-on { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.mgr-row { display: flex; justify-content: flex-end; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--mist); }
.cam { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: var(--mvp-navy-900); }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-ring { position: absolute; inset: 10% 25% 18%; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); transition: border-color 220ms var(--ease); pointer-events: none; }
.cam[data-state="scanning"] .cam-ring { border-color: var(--mvp-blue); }
.cam[data-state="match"] .cam-ring { border-color: #3ccf8e; }
.cam[data-state="unknown"] .cam-ring { border-color: var(--mvp-red); }
.cam-msg { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 10px; border-radius: var(--r-md); background: rgba(6,24,39,.82); color: #fff; font-weight: 600; font-size: 14px; text-align: center; }

/* PIN and enroll */
.pin { max-width: 440px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pin .back { align-self: flex-start; }
.pin .cam { max-width: 360px; }
.pin .sw-check { text-align: left; font-size: 14px; color: var(--stone-700); }
.pin-msg { min-height: 22px; color: var(--stone-700); }
.pin-msg.bad { color: var(--bad); font-weight: 600; }
.pin-dots { display: flex; gap: 14px; margin: 6px 0 10px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mvp-navy); }
.pin-dots span.on { background: var(--mvp-navy); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.keypad button { height: 64px; border: 1px solid var(--mist); border-radius: var(--r-md); background: #fff; font: inherit; font-size: 24px; font-weight: 600; color: var(--ink); cursor: pointer; }
.keypad button:active { background: var(--mvp-blue-100); }
.keypad button[data-k="del"] { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }

/* clock page */
.clock-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; padding-bottom: 90px; }
.clock-left { display: grid; gap: 16px; }
.status-off h2 { margin: 2px 0 6px; }
.status-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.timer { font-size: 40px; font-weight: 700; color: var(--mvp-navy-900); font-variant-numeric: tabular-nums; line-height: 1.1; }
.timer.sm { font-size: 18px; }
.alloc-lines { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--mist); }
.alloc-lines li { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--mist); }
.al-name { font-weight: 600; }
.al-share { font-weight: 700; color: var(--mvp-navy); font-variant-numeric: tabular-nums; }
.al-h { color: var(--stone-700); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.note-line { margin-top: 8px; font-size: 14px; color: var(--stone-700); }
.wk-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.wk-top b { font-size: 22px; font-variant-numeric: tabular-nums; }
.today { list-style: none; margin: 0; padding: 0; }
.tl-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--mist); }
.tl-time { font-size: 13px; color: var(--stone-700); font-variant-numeric: tabular-nums; }
.tl-cust { display: flex; flex-wrap: wrap; gap: 4px; }
.tl-h { font-weight: 700; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.tile { position: relative; border: 1px solid var(--mist); border-radius: var(--r-md); background: #fff; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.tile-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; min-height: 92px; padding: 12px 44px 12px 16px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.tile-main:disabled { cursor: default; }
.tile-name { font-weight: 700; line-height: 1.25; color: var(--mvp-navy-900); }
.tile-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.tile-check { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--stone-300); border-radius: var(--r-sm); color: #fff; }
.tile-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.tile.sel { border-color: var(--mvp-navy); box-shadow: 0 0 0 2px var(--mvp-navy) inset; }
.tile.sel .tile-check { background: var(--mvp-navy); border-color: var(--mvp-navy); }
.tile.run { border-color: var(--ok); background: var(--ok-bg); }
.tile.run .tile-check { background: var(--ok); border-color: var(--ok); }
.star { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--stone-300); cursor: pointer; border-radius: var(--r-sm); }
.star:hover { color: var(--stone-500); }
.star.on { color: #C97A14; }
.star.on .ic { fill: #E9A23B; stroke: #C97A14; }
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--mvp-navy); }
.bar-txt { display: flex; flex-direction: column; min-width: 0; }
.bar-txt b { color: var(--mvp-navy-900); }
.bar-txt small { color: var(--stone-700); }
.bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.idle { position: sticky; top: 56px; z-index: 16; margin: -16px -16px 12px; padding: 10px 16px; background: var(--warn-bg); color: var(--warn); text-align: center; font-weight: 600; }

/* split dialog */
.split-row { display: grid; grid-template-columns: auto 1fr 44px 70px 44px auto; gap: 6px; align-items: center; padding: 6px 0; }
.sr-name { font-weight: 600; }
.step { height: 44px; border: 1px solid var(--stone-300); background: #fff; border-radius: var(--r-sm); font-size: 20px; font-weight: 700; color: var(--mvp-navy); cursor: pointer; }
.input.pct { text-align: right; font-variant-numeric: tabular-nums; }
.pct-sign { color: var(--stone-700); }
.split-total { font-weight: 700; margin: 8px 0 0; }
.split-total.ok { color: var(--ok); } .split-total.bad { color: var(--bad); }
.alloc-row { display: grid; grid-template-columns: 1fr 80px auto 44px; gap: 6px; align-items: center; margin: 6px 0; }
.preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; padding: 12px; background: var(--paper); border-radius: var(--r-md); font-size: 14px; }
.preview p { margin: 2px 0 0; }

/* dialog */
.dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); color: var(--ink); }
.dialog.wide { width: min(860px, calc(100% - 24px)); }
.dialog::backdrop { background: rgba(6,24,39,.55); }
#dialog-body { padding: 20px; }
#dialog-body > h2 { margin-bottom: 8px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.wk-nav { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.ms-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--stone-700); }
.acct-list { display: grid; gap: 6px; margin-top: 10px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--mist); border-radius: var(--r-md); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.acct:hover { border-color: var(--mvp-blue); }
.acct span:last-child { display: flex; flex-direction: column; }
.acct small { color: var(--stone-700); }
.sched { display: grid; gap: 4px; }
.sched-row { display: grid; grid-template-columns: 150px 1fr auto 1fr; gap: 8px; align-items: center; }
.pick-list { max-height: 220px; overflow: auto; border: 1px solid var(--mist); border-radius: var(--r-md); padding: 4px 12px; margin: 8px 0; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 150%); opacity: 0; visibility: hidden;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r-md); background: var(--mvp-navy-900); color: #fff; font-weight: 600;
  transition: transform 220ms var(--ease), opacity 220ms, visibility 220ms; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.bad { background: var(--bad); }
body[data-view="clock"] .toast { bottom: 96px; }

/* ---------- console ---------- */
.console { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
.nav { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.nav-b { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; font: inherit; font-weight: 600; color: var(--stone-700); cursor: pointer; text-align: left; }
.nav-b:hover { background: var(--mist); color: var(--ink); }
.nav-b.on { background: var(--mvp-navy); color: #fff; }
.console-body { min-width: 0; }
.page-h { margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 12px; margin-bottom: 12px; }
.filters .grow { flex: 1; min-width: 200px; }
.range-line { margin: 0 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #fff; border: 1px solid var(--mist); border-radius: var(--r-md); }
.kpi-l { font-size: 12px; font-weight: 700; color: var(--stone-700); text-transform: uppercase; letter-spacing: .06em; }
.kpi-v { font-size: 26px; font-weight: 700; color: var(--mvp-navy-900); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-s { font-size: 12px; color: var(--stone-700); }
.kpi.pos .kpi-v { color: var(--ok); } .kpi.neg .kpi-v { color: var(--bad); }
.kpi.warn { border-color: var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.stack-col { display: grid; gap: 16px; align-content: start; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--mist); text-align: left; vertical-align: middle; }
.tbl th { font-size: 12px; font-weight: 700; color: var(--stone-700); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tbl th button { all: unset; cursor: pointer; }
.tbl th button:focus-visible { box-shadow: var(--focus); }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--stone-300); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--paper); }
.tbl.periods th.grp { text-align: center; background: var(--mvp-blue-100); color: var(--mvp-navy); }
.tbl.matrix td.heat { background: rgba(40, 173, 227, calc(var(--h) * 0.45)); }
.chips-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--mist); }
.live-list { list-style: none; margin: 0; padding: 0; }
.live-list li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--mist); }
.ll-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ll-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ll-time { display: flex; flex-direction: column; align-items: flex-end; }
.ll-time small { color: var(--stone-700); font-size: 12px; }
.big { font-size: 28px; font-weight: 700; color: var(--mvp-navy-900); }
.steps { padding-left: 20px; } .steps li { margin: 4px 0; }
.guide summary { cursor: pointer; font-weight: 700; color: var(--mvp-navy); padding: 8px 0; }
.file-btn { position: relative; }
.preview-box { margin-top: 14px; padding: 14px; border: 1px solid var(--mist); border-radius: var(--r-md); background: var(--paper); }

/* charts */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--stone-700); margin: 6px 0; }
.legend .sw { width: 12px; height: 12px; }
.sw-a, .s-rev, .ag0 { background: var(--mvp-navy); } .sw-b, .s-cost, .ag1 { background: var(--mvp-blue); } .s-profit { background: var(--ok); } .ag2 { background: #C97A14; } .ag3 { background: var(--stone-500); }
.pairbars { display: grid; gap: 6px; }
.pb-row { display: grid; grid-template-columns: 140px 1fr 86px; gap: 10px; align-items: center; font-size: 13px; }
.pb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-bars { display: grid; gap: 2px; }
.pb { height: 9px; border-radius: 2px; min-width: 1px; }
.pb.a { background: var(--mvp-navy); } .pb.b { background: var(--mvp-blue); }
.pb-val { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; font-size: 12px; }
.chart-wrap svg { width: 100%; height: auto; }
.linechart .grid { stroke: var(--mist); } .linechart .zero { stroke: var(--stone-300); }
.linechart .tick { font-size: 11px; fill: var(--stone-700); font-family: var(--font); }
.linechart .ln { fill: none; stroke-width: 2.5; }
.linechart .ln.s-rev { stroke: var(--mvp-navy); } .linechart .ln.s-cost { stroke: var(--mvp-blue); } .linechart .ln.s-profit { stroke: var(--ok); stroke-dasharray: 5 3; }
.linechart .pt.s-rev { fill: var(--mvp-navy); } .linechart .pt.s-cost { fill: var(--mvp-blue); } .linechart .pt.s-profit { fill: var(--ok); }
.stack { display: flex; height: 22px; border-radius: var(--r-sm); overflow: hidden; margin: 8px 0; background: var(--mist); }
.stack-seg { height: 100%; }
.minibar { display: inline-block; width: 60px; height: 6px; background: var(--mist); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.minibar span { display: block; height: 100%; }

/* ---------- breakpoints ---------- */
@media (max-width: 1100px) {
  .kiosk { grid-template-columns: 1fr; }
  /* one column: running clock, then customers, then week and today */
  .clock-grid { display: flex; flex-direction: column; }
  .clock-left { display: contents; }
  #status { order: 1; } .clock-right { order: 2; } #week { order: 3; } .clock-left > .card:last-child { order: 4; }
  .kiosk-cam { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .kiosk-cam .cam { max-width: 280px; }
  .kiosk-cam h1 { font-size: 22px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .console { grid-template-columns: 1fr; padding-bottom: 72px; }
  .nav { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 18; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 4px 4px max(4px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--stone-300); }
  .nav-b { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 2px; font-size: 11px; justify-content: center; text-align: center; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } .hide-sm { display: none; } }
@media (max-width: 640px) {
  body { font-size: 15px; }
  .view { padding: 12px; }
  .idle { margin: -12px -12px 12px; }
  .dialog, .dialog.wide { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92dvh; }
  #dialog-body { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
  .row2, .preview { grid-template-columns: 1fr; }
  .kiosk-cam { flex-direction: column; align-items: stretch; }
  .kiosk-cam .cam { max-width: none; aspect-ratio: 16 / 10; }
  .name-grid { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .timer { font-size: 32px; }
  .tl-row { grid-template-columns: 1fr auto; } .tl-time { grid-column: 1 / -1; }
  .sched-row { grid-template-columns: 1fr 1fr auto 1fr; } .sched-row .sw-check { grid-column: 1 / -1; }
  .who-txt small { display: none; }
  .top-clock { display: none; }
  .pb-row { grid-template-columns: 100px 1fr 70px; }
  .kpi-v { font-size: 22px; }
  .action-bar { flex-direction: column; align-items: stretch; } .bar-btns { justify-content: stretch; } .bar-btns .btn { flex: 1; }
  .filters .fl { min-width: calc(50% - 6px); flex: 1; }
}
@media (max-width: 380px) { .name-grid, .tiles { grid-template-columns: 1fr; } .keypad { grid-template-columns: repeat(3, 68px); } }

/* ---------- server version additions ---------- */
.brand-mark { height: 28px; width: 28px; }
.kiosk-device { max-width: 640px; margin: 24px auto; padding: 28px; }
.kiosk-device h1 { margin: 4px 0 10px; }
.device-tag { white-space: nowrap; }
.notice-card { border-color: var(--warn); }
.pin-big { font-size: 44px; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; margin: 12px 0; }
.pin-in { letter-spacing: .4em; font-size: 20px; max-width: 180px; }
.enroll-pin { width: 100%; max-width: 280px; text-align: left; }
.pin-cell { font-size: 20px; font-weight: 700; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.top-right .btn-ghost-inv { text-decoration: none; }
@media print {
  body * { visibility: hidden; }
  #dialog, #dialog * { visibility: visible; }
  #dialog { position: absolute; inset: 0; box-shadow: none; width: 100%; max-height: none; }
  .dlg-actions { display: none; }
}
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; } }
