/* 8Bit Ops — application styles */
:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --border: #e3e3de;
  --border-strong: #cfcfc8;
  --text: #1b1e24;
  --text-2: #464b55;
  --muted: #727782;
  --side: #151a24;
  --side-2: #1d2330;
  --side-text: #aeb5c2;
  --accent: #1f5fd6;
  --accent-ink: #1849a8;
  --accent-soft: #e8effc;
  --green: #18794e;
  --green-soft: #e6f4ec;
  --amber: #a5650b;
  --amber-soft: #fdf3e1;
  --red: #c0392b;
  --red-soft: #fbeceA;
  --violet: #6741c4;
  --violet-soft: #f0ebfb;
  --grey-soft: #eeeeea;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 32, .06);
  --shadow-lg: 0 12px 32px rgba(20, 24, 32, .18);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13.5px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.app.collapsed { grid-template-columns: 60px 1fr; }
.side { grid-row: 1 / 3; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; overflow: hidden; }
.brand { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; letter-spacing: .02em; flex: none; }
.brand-name { color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: #7e8798; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #687184; padding: 12px 10px 6px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--side-text); padding: 7px 10px; border-radius: 5px; cursor: pointer; text-align: left; white-space: nowrap; position: relative; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: #24324d; color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: #5b8ff0; }
.nav-item .count { margin-left: auto; font-size: 11px; background: #2b3446; color: #d6dbe4; padding: 0 6px; border-radius: 9px; line-height: 18px; }
.nav-item .count.alert { background: var(--red); color: #fff; }
.collapsed .nav-item span, .collapsed .nav-group, .collapsed .brand-text, .collapsed .nav-item .count, .collapsed .side-foot .txt { display: none; }
.collapsed .nav-item { justify-content: center; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11.5px; }
.side-foot .demo { background: #232b3a; border-radius: 5px; padding: 8px 10px; color: #c8ceda; }

.top { grid-column: 2; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0; }
.top .biz { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.top .biz b { font-size: 13.5px; white-space: nowrap; }
.top .biz span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.top .clock { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; white-space: nowrap; padding: 0 10px; border-left: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 380px; margin-left: 8px; }
.search input { width: 100%; height: 34px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); padding: 0 10px 0 32px; }
.search .ic { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search-results { position: absolute; top: 38px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 40; max-height: 360px; overflow: auto; }
.search-results button { display: flex; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; align-items: center; }
.search-results button:hover { background: var(--accent-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); cursor: pointer; padding: 0 9px; position: relative; color: var(--text-2); white-space: nowrap; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.audio-state.ok { color: var(--green); }
.audio-state.warn { color: var(--amber); border-color: #ecd3a6; background: var(--amber-soft); }
.profile { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 3px 8px 3px 4px; cursor: pointer; background: #fff; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #dfe7f6; color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-size: 11.5px; flex: none; }
.profile .who { line-height: 1.15; }
.profile .who b { font-size: 12.5px; display: block; white-space: nowrap; }
.profile .who span { font-size: 11px; color: var(--muted); white-space: nowrap; }

.main { grid-column: 2; overflow-y: auto; padding: 20px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Primitives ---------- */
.btn { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn.locked { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #12613e; }
.btn-danger { color: var(--red); border-color: #e7bdb7; }
.btn-danger:hover { background: var(--red-soft); }
.btn-danger-solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--grey-soft); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn-xs { height: 24px; padding: 0 7px; font-size: 12px; gap: 4px; }
.btn-lg { height: 42px; padding: 0 16px; font-size: 14.5px; }
.btn-block { width: 100%; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.sep { height: 1px; background: var(--border); margin: 10px 0; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .mt-s { margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field.err .input, .field.err select { border-color: var(--red); }
.field .errmsg { font-size: 11.5px; color: var(--red); }
.input, select.input, textarea.input { height: 34px; border: 1px solid var(--border-strong); background: #fff; border-radius: var(--radius); padding: 0 10px; width: 100%; min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; }
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,95,214,.25); border-color: var(--accent); }
.input-sm { height: 28px; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 0 11px; height: 32px; cursor: pointer; border-right: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg.sm button { height: 27px; font-size: 12.5px; padding: 0 9px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; line-height: 18px; white-space: nowrap; background: var(--grey-soft); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--accent-soft); color: var(--accent-ink); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-grey { background: var(--grey-soft); color: var(--muted); }
.tag { font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid #efefeb; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: #f7f9fd; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--border); background: var(--surface-2); }
.tbl .actions-cell { text-align: right; white-space: nowrap; }
.tbl.compact td { padding: 6px 10px; }
.tbl.compact th { padding: 6px 10px; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .ic { width: 22px; height: 22px; margin-bottom: 6px; color: #a5a9b1; }
.note { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; }
.note.info { background: #f2f6fd; border-color: #d5e1f7; }
.note.warn { background: var(--amber-soft); border-color: #efd8ad; color: #6d4507; }
.note.err { background: var(--red-soft); border-color: #efc5bf; color: #8a2419; }
.note .ic { margin-top: 1px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .input { width: auto; }
.lock { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; min-width: 0; }
.kpi .k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 20px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.kpi .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.sw-gaming { background: var(--accent); } .sw-food { background: #d08a1e; } .sw-tour { background: var(--violet); }
.kpi.warn .v { color: var(--amber); }
.kpi.alert .v { color: var(--red); }

/* ---------- Stations ---------- */
.station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px; }
.station { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; text-align: left; border-top: 3px solid var(--green); transition: box-shadow .12s, border-color .12s; min-height: 156px; }
.station:hover { box-shadow: 0 4px 14px rgba(20,24,32,.08); border-color: var(--border-strong); }
.station.s-active { border-top-color: var(--accent); }
.station.s-reserved { border-top-color: var(--violet); }
.station.s-over { border-top-color: var(--red); background: #fffafa; }
.station.s-maint { border-top-color: #9a9ea6; background: var(--surface-2); }
.station.s-warn { border-top-color: var(--amber); }
.station .st-name { font-weight: 600; font-size: 14px; }
.station .st-type { font-size: 11.5px; color: var(--muted); }
.station .cd { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.station .meta { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.bar { height: 4px; background: var(--grey-soft); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.station.s-warn .bar > i { background: var(--amber); }
.station.s-over .bar > i { background: var(--red); }
.cd-warn { color: var(--amber); }
.cd-over { color: var(--red); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 180px minmax(0, 1fr) 360px; gap: 14px; height: calc(100vh - 56px - 20px - 40px - 60px); min-height: 520px; }
.pos > * { min-height: 0; }
.cat-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.cat-list button { border: 1px solid transparent; background: none; padding: 9px 10px; border-radius: var(--radius); text-align: left; cursor: pointer; display: flex; justify-content: space-between; color: var(--text-2); }
.cat-list button:hover { background: #fff; border-color: var(--border); }
.cat-list button.on { background: #fff; border-color: var(--border-strong); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.menu-pane { display: flex; flex-direction: column; min-height: 0; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow-y: auto; padding-bottom: 10px; align-content: start; }
.menu-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 11px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.menu-item:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.menu-item.off { opacity: .45; cursor: not-allowed; }
.menu-item .nm { font-weight: 600; font-size: 13px; line-height: 1.25; }
.menu-item .pr { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; }
.cart { display: flex; flex-direction: column; min-height: 0; }
.cart-lines { flex: 1; overflow-y: auto; }
.cart-line { padding: 9px 14px; border-bottom: 1px solid #efefeb; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.cart-line .mods { font-size: 11.5px; color: var(--muted); grid-column: 1 / -1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 26px; height: 26px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.totals { padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.totals .tr { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.totals .tr.grand { font-size: 17px; font-weight: 700; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--border); }
.totals .tr .muted { font-size: 12px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.opt { border: 1px solid var(--border-strong); background: #fff; border-radius: var(--radius); padding: 8px 10px; cursor: pointer; text-align: left; display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.opt:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Modals ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(17, 21, 29, .42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; display: flex; flex-direction: column; max-height: 88vh; }
.modal.lg { width: 820px; } .modal.xl { width: 1040px; } .modal.sm { width: 420px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 15.5px; margin: 0; font-weight: 650; }
.modal-head .sub { font-size: 12px; color: var(--muted); }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 10px 10px; align-items: center; flex-wrap: wrap; }
.backdrop.drawer { padding: 0; justify-content: flex-end; align-items: stretch; }
.backdrop.drawer .modal { border-radius: 0; height: 100vh; max-height: 100vh; width: 560px; }
.backdrop.drawer .modal.lg { width: 720px; }
.backdrop.drawer .modal-foot { border-radius: 0; }

/* ---------- Toasts / banners ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: #1d2330; color: #fff; padding: 10px 14px; border-radius: 7px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; max-width: 380px; font-size: 13px; animation: tin .18s ease-out; }
.toast.ok .ic { color: #59d38f; } .toast.warn .ic { color: #f5b544; } .toast.err .ic { color: #ff7b6e; } .toast.info .ic { color: #8db4ff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
#banners { position: fixed; top: 64px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: 380px; max-width: calc(100vw - 32px); }
.expiry { background: #fff; border: 1px solid #e6b1aa; border-left: 4px solid var(--red); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 12px 14px; }
.expiry.warning { border-color: #ecd09c; border-left-color: var(--amber); }
.expiry h4 { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.expiry .alert-meta { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.expiry .blocked { font-size: 12px; color: #8a2419; background: var(--red-soft); padding: 6px 8px; border-radius: 5px; margin-bottom: 8px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(192, 57, 43, .14); } }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-title { font-weight: 600; font-size: 15px; margin: 0 6px; }
.dayview { display: grid; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; max-height: calc(100vh - 230px); }
.dv-head { position: sticky; top: 0; background: var(--surface-2); z-index: 3; font-size: 11.5px; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-time { position: sticky; left: 0; background: var(--surface-2); z-index: 2; font-size: 11px; color: var(--muted); padding: 2px 6px; text-align: right; border-bottom: 1px solid #f0f0ec; }
.dv-cell { border-left: 1px solid var(--border); border-bottom: 1px solid #f0f0ec; position: relative; cursor: copy; }
.dv-cell:hover { background: #f6f9ff; }
.bk { position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 3px 6px; font-size: 11px; overflow: hidden; cursor: pointer; border: 1px solid; z-index: 1; line-height: 1.3; }
.bk b { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-pending { background: var(--amber-soft); border-color: #ebc98a; color: #6d4507; }
.bk-confirmed { background: var(--accent-soft); border-color: #b4c9f1; color: var(--accent-ink); }
.bk-checked_in { background: var(--green-soft); border-color: #a9d9be; color: var(--green); }
.bk-completed { background: var(--grey-soft); border-color: var(--border-strong); color: var(--muted); }
.bk-cancelled, .bk-no_show { background: #f7f7f5; border-color: var(--border); color: #9a9ea6; text-decoration: line-through; }
.weekview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.wv-day { border-right: 1px solid var(--border); min-height: 420px; display: flex; flex-direction: column; }
.wv-day:last-child { border-right: 0; }
.wv-day-head { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 12px; display: flex; justify-content: space-between; }
.wv-day-head.today { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.wv-list { padding: 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; cursor: copy; }
.wv-item { position: static; }
.monthview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.mv-dow { padding: 6px 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mv-cell { min-height: 98px; border-right: 1px solid #efefeb; border-bottom: 1px solid #efefeb; padding: 5px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mv-cell:nth-child(7n) { border-right: 0; }
.mv-cell.out { background: #fbfbf9; color: #b0b3b9; }
.mv-cell.today .d { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; }
.mv-cell .d { font-size: 12px; font-weight: 600; align-self: flex-start; }
.mv-chip { font-size: 10.5px; border-radius: 3px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid; }

/* ---------- Kitchen ---------- */
.kboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kcol { background: #ececE7; border-radius: var(--radius-lg); padding: 8px; min-height: 300px; display: flex; flex-direction: column; gap: 8px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-weight: 600; font-size: 12.5px; }
.kticket { background: #fff; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.kticket-head { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px dashed var(--border-strong); align-items: center; gap: 6px; }
.kticket ul { list-style: none; margin: 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.kticket li .q { font-weight: 700; margin-right: 6px; }
.kticket li .m { display: block; font-size: 11.5px; color: var(--muted); padding-left: 22px; }
.kticket .instr { margin: 0 10px 8px; padding: 6px 8px; background: var(--amber-soft); border-radius: 5px; font-size: 12px; color: #6d4507; }
.kticket .kfoot { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #efefeb; }
.age-late { color: var(--red); font-weight: 600; }

/* ---------- Tournament ---------- */
.bracket { display: flex; gap: 28px; overflow-x: auto; padding: 6px 2px 12px; }
.round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; min-width: 210px; }
.round h5 { margin: 0 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.match { border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; overflow: hidden; cursor: pointer; }
.match:hover { border-color: var(--accent); }
.match .p { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 12.5px; gap: 8px; }
.match .p + .p { border-top: 1px solid #efefeb; }
.match .p.win { font-weight: 700; background: var(--green-soft); }
.match .p.tbd { color: #a5a9b1; font-style: italic; }
.match .mmeta { font-size: 10.5px; color: var(--muted); padding: 3px 10px; background: var(--surface-2); border-top: 1px solid #efefeb; }

/* ---------- Charts ---------- */
.chart { width: 100%; display: block; }
.chart text { font-family: var(--font); font-size: 10.5px; fill: var(--muted); }
.chart .grid-line { stroke: #ececE8; }
.chart-tip { position: fixed; pointer-events: none; background: #1d2330; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 5px; z-index: 500; white-space: nowrap; }

/* ---------- Permission matrix ---------- */
.perm-tbl td, .perm-tbl th { text-align: center; }
.perm-tbl td:first-child, .perm-tbl th:first-child { text-align: left; }
.perm-tbl input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------- Receipt preview (screen) ---------- */
.preview-pane { background: #e9e9e4; border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 16px; max-height: 62vh; overflow-y: auto; }
.preview-pane .paper { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.copy-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: -10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos { grid-template-columns: 150px minmax(0, 1fr) 320px; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 60px 1fr; }
  .app .nav-item span, .app .nav-group, .app .brand-text, .app .nav-item .count, .app .side-foot .txt { display: none; }
  .app .nav-item { justify-content: center; }
  .g-main, .g-3, .g-4 { grid-template-columns: 1fr 1fr; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .kboard { grid-template-columns: 1fr 1fr; }
  .top .clock, .profile .who { display: none; }
}
@media (max-width: 720px) {
  .main { padding: 16px; }
  .kpis, .g-2, .g-main, .g-3, .g-4, .form-grid, .form-grid-3, .kboard { grid-template-columns: 1fr; }
  .search { display: none; }
  .weekview { grid-template-columns: 1fr; }
}
