/* Ooodles staff dashboard. Same palette and faces as the restaurant site (styles.css);
   Cagliostro is kept to the brand mark and page titles, Figtree carries all UI and data. */
@font-face {
  font-family: "Cagliostro";
  src: url("assets/cagliostro.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Figtree";
  src: url("assets/figtree.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --clay: #c35c3b;
  --clay-surface: #b0502e;
  --clay-deep: #9e4127;
  --cream: #fbefe6;
  --broth: #f4e1cf;
  --paper: #fffaf5;
  --card: #ffffff;
  --ink: #2a1810;
  --ink-soft: #664536;
  --line: #e6cbb6;
  --line-soft: #f1e2d6;
  --bokchoy: #2f6b45;
  --bokchoy-tint: #e3efe6;
  --yolk: #efb94a;
  --yolk-tint: #fbecc8;
  --display: "Cagliostro", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --zh: "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --z-sticky: 10;
  --z-toast: 40;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, ul, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
[lang="zh-Hant"] { font-family: var(--zh); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: var(--z-toast); padding: 10px 14px; background: var(--ink); color: var(--cream); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Demo disclosure */
.demo-note {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 20px;
  padding: 8px 20px; background: #1c0f09; color: var(--cream); font-size: .8125rem;
}
.demo-links { display: flex; align-items: center; gap: 18px; }
.demo-links a { text-underline-offset: 3px; }
.link-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.link-button .icon { width: 14px; height: 14px; }

/* Shell */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 6px; padding: 24px 16px;
  background: var(--ink); color: var(--cream);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.brand img { width: 46px; }
.brand-name { font: 400 1.625rem/1 var(--display); letter-spacing: .01em; }
.brand-name small { display: block; margin-top: 5px; font: 600 .75rem/1 var(--body); letter-spacing: .02em; color: #d9bfae; }
.location { display: flex; align-items: center; gap: 6px; margin: 14px 8px 18px; font-size: .8125rem; color: #d9bfae; }
.location .icon { width: 14px; height: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-caption { margin: 14px 12px 6px; font-size: .75rem; font-weight: 600; color: #bfa08e; }
.nav-caption:first-child { margin-top: 0; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; color: #f1ddd0;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.nav a:hover { background: rgba(251, 239, 230, .08); color: var(--cream); }
.nav a[aria-current="page"] { background: var(--clay-surface); color: var(--cream); }
.account { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(251, 239, 230, .14); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--yolk); color: var(--ink); font-weight: 700; }
.account strong { display: block; font-size: .9375rem; }
.account div span { font-size: .8125rem; color: #d9bfae; }

.main { padding: 36px 40px 64px; outline: none; }
.view { max-width: 1120px; margin-inline: auto; animation: view-in .22s var(--ease); }
@keyframes view-in { from { transform: translateY(4px); } }

/* Page heading */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 24px; margin-bottom: 24px; }
.page-head h1 { font: 400 2.5rem/1.05 var(--display); font-synthesis: none; letter-spacing: -.005em; }
.page-head p { margin-top: 6px; color: var(--ink-soft); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9375rem; }
.date-chip .icon { color: var(--clay-deep); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: .9375rem; text-decoration: none;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--clay-surface); color: var(--cream); }
.btn-primary:hover:not(:disabled) { background: var(--clay-deep); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-quiet:hover:not(:disabled) { background: var(--broth); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink);
  transition: background-color .18s var(--ease);
}
.icon-btn:hover { background: var(--broth); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9375rem; color: var(--clay-deep); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link .icon { width: 16px; height: 16px; }

/* Snapshot numbers */
.snapshot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.snapshot-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.snapshot > div { display: flex; flex-direction: column-reverse; gap: 2px; padding: 18px 22px; }
.snapshot > div + div { border-left: 1px solid var(--line-soft); }
.snapshot dt { font-size: .875rem; color: var(--ink-soft); }
.snapshot dd { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.snapshot dd.is-warning { color: var(--clay-deep); }

/* Panels */
.board-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 16px; }
.panel-title { display: flex; gap: 12px; }
.panel-title h2 { font-size: 1.0625rem; font-weight: 700; }
.panel-title p { font-size: .875rem; color: var(--ink-soft); }
.panel-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--broth); color: var(--clay-deep); }
.panel-icon.is-warning { background: var(--yolk-tint); color: #7a4d00; }
.panel-icon.is-positive { background: var(--bokchoy-tint); color: var(--bokchoy); }
.count { min-width: 32px; padding: 4px 10px; border-radius: 999px; background: var(--broth); font-weight: 700; font-size: .875rem; text-align: center; font-variant-numeric: tabular-nums; }
.footnote { display: flex; align-items: start; gap: 8px; margin-top: auto; padding-top: 16px; font-size: .8125rem; color: var(--ink-soft); }
.footnote .icon { width: 14px; height: 14px; margin-top: 2px; }

.attention-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.attention-list li:first-child { border-top: 0; padding-top: 0; }
.attention-list strong { display: block; font-weight: 600; }
.attention-list span.sub { font-size: .875rem; color: var(--ink-soft); }
.bar { display: block; width: 100%; height: 4px; margin-top: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--clay); border-radius: inherit; }

.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.badge-warning { background: var(--yolk-tint); color: #6b4300; }
.badge-positive { background: var(--bokchoy-tint); color: var(--bokchoy); }
.badge-neutral { background: var(--broth); color: var(--ink-soft); }
.badge-off { background: var(--ink); color: var(--cream); }

.note-copy { white-space: pre-wrap; font-size: 1rem; line-height: 1.6; }
.note-meta { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: .8125rem; color: var(--ink-soft); }
.note-editor { display: flex; flex-direction: column; gap: 8px; }
.note-editor label, .stepper > label { font-size: .875rem; font-weight: 600; }
textarea, input[type="number"], .search input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
textarea { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
textarea:focus, input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(195, 92, 59, .2); }
.form-actions, .sheet-foot { display: flex; justify-content: flex-end; gap: 10px; }

.recent { margin-bottom: 20px; }
.recent-list li + li { border-top: 1px solid var(--line-soft); }
.recent-list button, .row-button {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  width: 100%; min-height: 52px; padding: 8px 6px; border: 0; background: none; text-align: left; border-radius: var(--radius-sm);
}
.recent-list button:hover { background: var(--paper); }
.recent-list time { font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.recent-list .items { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .total { font-weight: 700; font-variant-numeric: tabular-nums; }

.connection { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px 22px; border-radius: var(--radius); background: var(--broth); }
.connection-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--clay-deep); }
.connection-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.connection h2 { font-size: 1.0625rem; font-weight: 700; }
.connection p { margin-top: 4px; font-size: .9375rem; color: var(--ink-soft); max-width: 70ch; }

/* Toolbar, tables */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-soft); }
.search input { min-height: 44px; padding: 0 14px 0 42px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.segmented button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-weight: 600; font-size: .875rem; white-space: nowrap; color: var(--ink-soft); transition: background-color .18s var(--ease), color .18s var(--ease); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.segmented-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fdf5ee; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); text-align: left; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .15s var(--ease); }
.table tbody tr:hover { background: var(--paper); }
.table th.num, .table td.num { text-align: right; }
.table .name strong { display: block; font-weight: 600; }
.table .name span { font-size: .8125rem; color: var(--ink-soft); }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-off .name strong { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: rgba(102, 69, 54, .5); }
.link-row { padding: 0; border: 0; background: none; font-weight: 700; color: var(--clay-deep); text-decoration: underline; text-underline-offset: 3px; font-variant-numeric: tabular-nums; }
.price-btn { padding: 4px 6px; margin: -4px -6px; border: 0; border-radius: 6px; background: none; font-variant-numeric: tabular-nums; text-decoration: underline dotted rgba(102, 69, 54, .5); text-underline-offset: 4px; }
.price-btn:hover { background: var(--broth); }
.items-cell { max-width: 380px; color: var(--ink-soft); }
.qty-ok { color: var(--ink); }
.qty-low { color: var(--clay-deep); font-weight: 700; }
.small-btn { min-height: 36px; padding: 0 14px; font-size: .875rem; }

/* Availability switch */
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: #d8c3b4; position: relative; cursor: pointer; transition: background-color .18s var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(42, 24, 16, .3); transition: translate .18s var(--ease); }
.switch input:checked { background: var(--bokchoy); }
.switch input:checked::after { translate: 16px 0; }

.empty { padding: 36px 20px; text-align: center; }
.empty h3 { font-size: 1rem; font-weight: 700; }
.empty p { margin-top: 4px; font-size: .9375rem; color: var(--ink-soft); }
.empty-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 50%; background: var(--bokchoy-tint); color: var(--bokchoy); }

/* Side sheets */
.sheet {
  margin: 0 0 0 auto; width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0; background: var(--card); color: var(--ink); box-shadow: -20px 0 60px -30px rgba(42, 24, 16, .5);
}
.sheet::backdrop { background: rgba(42, 24, 16, .4); }
.sheet[open] { animation: sheet-in .24s var(--ease); }
@keyframes sheet-in { from { translate: 24px 0; } }
.sheet-inner { display: flex; flex-direction: column; gap: 20px; min-height: 100%; padding: 24px; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet-kicker { font-size: .8125rem; font-weight: 600; color: var(--clay-deep); }
.sheet-head h2 { margin-top: 2px; font-size: 1.375rem; font-weight: 700; line-height: 1.25; }
.sheet-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line-soft); overflow: hidden; }
.sheet-stats > div { padding: 12px 14px; background: var(--card); }
.sheet-stats dt { font-size: .8125rem; color: var(--ink-soft); }
.sheet-stats dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.actions-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions-choice legend { margin-bottom: 8px; font-size: .875rem; font-weight: 600; }
.actions-choice label { position: relative; display: block; cursor: pointer; }
.actions-choice input { position: absolute; opacity: 0; }
.actions-choice span { display: block; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .8125rem; color: var(--ink-soft); line-height: 1.4; transition: border-color .18s var(--ease), background-color .18s var(--ease); }
.actions-choice strong { display: block; margin-bottom: 2px; font-size: .9375rem; color: var(--ink); }
.actions-choice input:checked + span { border-color: var(--clay-surface); background: #fdf1ea; box-shadow: inset 0 0 0 1px var(--clay-surface); }
.actions-choice input:focus-visible + span { outline: 3px solid var(--yolk); outline-offset: 2px; }
.stepper { display: flex; flex-direction: column; gap: 8px; }
.stepper-row { display: flex; align-items: center; gap: 8px; }
.stepper-row input { max-width: 140px; min-height: 44px; padding: 0 12px; text-align: center; font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.unit { font-weight: 600; color: var(--ink-soft); }
.unit-lead { font-size: 1.125rem; }
.preview { font-size: .9375rem; color: var(--ink-soft); }
.preview strong { color: var(--ink); }
.field-error { font-size: .875rem; font-weight: 600; color: var(--clay-deep); }
.used-by h3, .sheet-section { font-size: .875rem; font-weight: 600; }
.used-by ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.used-by li { padding: 4px 10px; border-radius: 999px; background: var(--broth); font-size: .8125rem; }
.sheet-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.line-items li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.line-items .qty { font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.line-items .zh { display: block; font-size: .8125rem; color: var(--ink-soft); }
.line-items .amt { font-variant-numeric: tabular-nums; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--ink-soft); }
.totals dd { text-align: right; }
.totals .grand { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: 1.0625rem; }

/* Nav count */
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--yolk); color: var(--ink); font-size: .75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* Board service strip */
.service-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px 24px; margin-bottom: 20px; padding: 16px 20px; border-radius: var(--radius); background: var(--ink); color: var(--cream); }
.service-state { display: flex; align-items: center; gap: 12px; }
.service-state strong { display: block; font-size: 1.0625rem; }
.service-state span:not(.state-dot) { font-size: .875rem; color: #e2c9b9; }
.state-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: #7fd39a; box-shadow: 0 0 0 4px rgba(127, 211, 154, .2); }
.state-dot.is-paused { background: var(--yolk); box-shadow: 0 0 0 4px rgba(239, 185, 74, .25); }
.service-counts { display: flex; gap: 22px; }
.service-counts > div { display: flex; flex-direction: column-reverse; align-items: center; }
.service-counts dt { font-size: .75rem; color: #e2c9b9; }
.service-counts dd { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.service-strip .btn-primary { background: var(--cream); color: var(--ink); }
.service-strip .btn-primary:hover { background: #fff; }

/* Printer health */
.device-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 12px 16px; border: 1px solid #cfe2d5; border-radius: var(--radius); background: var(--bokchoy-tint); }
.device-banner p { flex: 1; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.device-banner strong { color: var(--bokchoy); }
.device-banner span { font-size: .875rem; color: var(--ink-soft); }
.device-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--bokchoy); }
.device-banner.is-stale { border-color: #f0d59a; background: var(--yolk-tint); }
.device-banner.is-stale strong, .device-banner.is-stale .device-mark { color: #6b4300; }

/* Live board */
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.live-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lane { min-width: 0; padding: 14px; border-radius: var(--radius); background: #f8ece2; }
.lane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lane-head h2 { font-size: 1rem; font-weight: 700; }
.lane-head .count { background: var(--card); }
.lane-hint { margin: 2px 0 12px; font-size: .8125rem; color: var(--ink-soft); }
.lane-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lane-empty { padding: 22px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: .875rem; color: var(--ink-soft); text-align: center; }
.ticket { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 1px 0 rgba(42, 24, 16, .04); }
.ticket.is-fresh { animation: ticket-in .5s var(--ease); border-color: var(--yolk); box-shadow: 0 0 0 3px rgba(239, 185, 74, .35); }
@keyframes ticket-in { from { translate: 0 -6px; } }
.ticket-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.ticket-id { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.ticket-name { display: block; font-size: .8125rem; color: var(--ink-soft); }
.ticket-time { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ticket-time.is-new { color: var(--clay-deep); }
.ticket-time.is-late { color: var(--clay-deep); }
.ticket-lines { display: flex; flex-direction: column; gap: 6px; font-size: .9375rem; }
.ticket-lines li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; line-height: 1.35; }
.ticket-lines .qty { font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ticket-lines .zh { font-size: .8125rem; color: var(--ink-soft); }
.ticket-lines em { display: block; margin-top: 2px; font-style: normal; font-size: .8125rem; font-weight: 600; color: var(--clay-deep); }
.ticket-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.ticket-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.ticket-meta .badge { gap: 4px; }
.badge .icon { width: 12px; height: 12px; }
.ticket-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.ticket-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ticket-actions .btn { flex: 1 1 auto; }
.small-btn .icon { width: 15px; height: 15px; }
.decline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.decline > span { flex: 1 0 100%; font-size: .8125rem; font-weight: 600; }
.decline .link-button { margin-left: auto; font-size: .8125rem; color: var(--ink-soft); }

/* Pickup controls */
.controls { position: sticky; top: 20px; gap: 0; }
.control-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.control-row:first-of-type { border-top: 0; padding-top: 0; }
.control-copy strong, .switch-wide strong { display: block; font-size: .9375rem; }
.control-copy small, .switch-wide small { display: block; font-size: .8125rem; font-weight: 400; color: var(--ink-soft); line-height: 1.35; }
.switch-wide { justify-content: space-between; width: 100%; gap: 14px; }
.switch-wide input { flex: none; }
.mini-stepper { display: flex; align-items: center; gap: 6px; }
.mini-stepper .icon-btn { width: 34px; height: 34px; }
.mini-stepper .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.mini-stepper output { min-width: 56px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.segmented-sm button { min-height: 30px; padding: 0 10px; font-size: .8125rem; }
.controls .control-row:has(.segmented-sm) { flex-direction: column; align-items: stretch; }
.customer-preview { margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--broth); font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.customer-preview strong { color: var(--ink); }

/* Kitchen mode: bigger tickets, controls tucked away */
.is-kitchen .live-layout { grid-template-columns: 1fr; }
.is-kitchen .controls { display: none; }
.is-kitchen .ticket-lines { font-size: 1.125rem; }
.is-kitchen .ticket-id { font-size: 1.375rem; }
.is-kitchen .ticket-actions .btn { min-height: 52px; font-size: 1rem; }

/* Price history */
.history { margin-top: 20px; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.history-list li:first-child { border-top: 0; }
.history-list strong { display: block; font-weight: 600; }
.history-list span { font-size: .8125rem; color: var(--ink-soft); }
.history-change { font-size: .9375rem !important; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-change strong { display: inline; color: var(--ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast); translate: -50% 0;
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--cream); font-weight: 600; font-size: .9375rem;
  box-shadow: 0 12px 30px -12px rgba(42, 24, 16, .6); animation: toast-in .2s var(--ease);
}
.toast .icon { color: #9fd3b0; }
@keyframes toast-in { from { translate: -50% 8px; } }

/* Responsive */
@media (max-width: 1100px) {
  .board-grid { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .controls { position: static; }
}
@media (max-width: 900px) {
  .live-board { grid-template-columns: 1fr; }
  .service-strip { grid-template-columns: 1fr auto; }
  .service-strip .btn { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot > div:nth-child(3) { border-left: 0; }
  .snapshot > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .snapshot-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .snapshot-3 > div:nth-child(3) { border-left: 1px solid var(--line-soft); border-top: 0; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; }
  .sidebar { position: sticky; top: 0; z-index: var(--z-sticky); height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; }
  .brand img { width: 36px; }
  .brand-name { font-size: 1.375rem; }
  .brand-name small, .location, .nav-caption, .account { display: none; }
  .nav { flex-direction: row; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .nav a { min-height: 40px; padding: 0 12px; gap: 8px; white-space: nowrap; }
  .main { padding: 24px 16px 56px; }
  .page-head h1 { font-size: 2rem; }
  .connection { grid-template-columns: auto minmax(0, 1fr); }
  .connection > .text-link { grid-column: 2; }
}
@media (max-width: 560px) {
  .snapshot > div { padding: 14px 16px; }
  .snapshot dd { font-size: 1.375rem; }
  .snapshot dt { font-size: .8125rem; line-height: 1.3; }
  /* Tables drop their least-needed column on phones instead of scrolling sideways. */
  [data-view="stock"] .table :is(th, td):nth-child(4),
  [data-view="orders"] .table :is(th, td):nth-child(3),
  [data-view="menu"] .table :is(th, td):nth-child(4) { display: none; }
  .table th, .table td { padding: 12px; }
  .table .switch span:not(.sr-only) { display: none; }
  .recent-list button { grid-template-columns: 60px minmax(0, 1fr) auto; }
  .recent-list .badge { display: none; }
  .actions-choice { grid-template-columns: 1fr; }
  .service-strip { grid-template-columns: 1fr; }
  .service-counts { justify-content: space-between; }
  .device-banner { flex-wrap: wrap; }
  .device-banner .btn { width: 100%; }
  .search { max-width: none; }
  .demo-note { padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
