/* Hotel POS — design tokens and components (Phase 1: auth, owner portal, provider console) */
:root {
  --ink: #101a2b;
  --ink-2: #1b2840;
  --ink-line: #2c3a55;
  --text: #1c2433;
  --muted: #5b6678;
  --line: #d8dce3;
  --surface: #f3f4f6;
  --paper: #ffffff;
  --accent: #8f5f0f;
  --accent-hover: #7a500b;
  --accent-soft: #f6ebd6;
  --accent-on-dark: #e0b25a;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --warn: #9a5a00;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --idle: #5b6678;
  --idle-soft: #e8eaee;
  --r-control: 6px;
  --r-panel: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 15px/1.5 var(--sans); color: var(--text); background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--paper); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--bad); border-color: #e3b4b0; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ----------------------------------------------------------------- fields */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; background: var(--paper);
  border: 1px solid #b9c0cc; border-radius: var(--r-control);
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.field input[readonly] { background: var(--surface); color: var(--muted); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--bad); min-height: 0; }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { padding: 10px 12px; border-radius: var(--r-control); background: var(--bad-soft); color: #7d1913; font-size: 14px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: start; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ------------------------------------------------------------- auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; }
.auth-brand { background: var(--ink); color: #dfe5ef; padding: 56px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark { font: 600 30px/1.1 var(--serif); color: #fff; letter-spacing: .2px; }
.brand-mark::after { content: ""; display: block; width: 36px; height: 3px; background: var(--accent-on-dark); margin-top: 14px; }
.brand-line { max-width: 34ch; font-size: 17px; line-height: 1.55; color: #b9c3d4; }
.auth-foot { font-size: 13px; color: #7f8ca3; }
.auth-foot button { color: #b9c3d4; }
.auth-main { padding: 48px 32px; display: flex; align-items: center; justify-content: center; background: var(--paper); }
.auth-form { width: 100%; max-width: 560px; display: grid; gap: 24px; }
.auth-form h1 { font-size: 26px; line-height: 1.2; }
.auth-form .lead { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.auth-form form { display: grid; gap: 18px; }
.auth-alt { color: var(--muted); font-size: 14px; }
.notice { padding: 10px 12px; border-radius: var(--r-control); background: var(--warn-soft); color: #5e3700; font-size: 14px; }

/* room-key tag: Hotel ID + Hotel Code after registration */
.keytag { position: relative; background: var(--ink); color: #fff; border-radius: 14px 14px 14px 14px; padding: 28px 28px 24px 84px; border-left: 6px solid var(--accent-on-dark); }
.keytag::before { content: ""; position: absolute; left: 28px; top: 30px; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 4px var(--ink-line); }
.keytag dl { margin: 0; display: grid; gap: 18px; }
.keytag dt { font-size: 13px; color: #9fb0c9; }
.keytag dd { margin: 2px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.keytag .big { font: 600 30px/1.1 var(--sans); letter-spacing: 2px; font-variant-numeric: tabular-nums; color: var(--accent-on-dark); }
.keytag .btn { background: transparent; color: #dfe5ef; border-color: var(--ink-line); }
.keytag .btn:hover { background: var(--ink-2); }

/* ------------------------------------------------------------ app chrome */
.topbar { background: var(--ink); color: #fff; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 0 20px; min-height: 56px; display: flex; align-items: center; gap: 16px; }
.topbar .brand { font: 600 18px var(--serif); }
.topbar .where { color: #9fb0c9; font-size: 14px; margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--ink-line); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; color: #b9c3d4; }
.topbar .btn { background: transparent; color: #dfe5ef; border-color: var(--ink-line); min-height: 34px; }
.topbar .btn:hover { background: var(--ink-2); }
.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; display: grid; gap: 20px; }
.page.narrow { max-width: 860px; }

.band { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--paper); border-left-width: 6px; }
.band > div:first-child { flex: 1 1 360px; min-width: 0; }
.band h1 { font-size: 20px; line-height: 1.3; }
.band p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.band.s-ok { border-left-color: var(--ok); }
.band.s-warn { border-left-color: #c98a1b; background: #fffaf0; }
.band.s-pending { border-left-color: var(--accent); background: #fffaf0; }
.band .big-num { font-size: 28px; font-weight: 700; line-height: 1; text-align: right; font-variant-numeric: tabular-nums; }
.band .big-num small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 6px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel > header { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel > header h2 { font-size: 16px; }
.panel > .body { padding: 6px 20px 8px; }
.panel > .pad { padding: 18px 20px; display: grid; gap: 14px; }

.rows { margin: 0; }
.row { display: grid; grid-template-columns: 200px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eceef2; }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); font-size: 14px; }
.row dd { margin: 0; overflow-wrap: anywhere; }
.row .code { font-weight: 600; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.row .sub { display: block; font-size: 13px; color: var(--muted); }
.inline-form { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 320px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ACTIVE { background: var(--ok-soft); color: var(--ok); }
.pill.PENDING, .pill.NOT_SET { background: var(--warn-soft); color: var(--warn); }
.pill.EXPIRED, .pill.SUSPENDED { background: var(--bad-soft); color: var(--bad); }

/* --------------------------------------------------------- provider console */
.summary { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); }
.summary button { text-align: left; background: none; border: 0; border-right: 1px solid var(--line); padding: 14px 18px; cursor: pointer; }
.summary button:last-child { border-right: 0; }
.summary button:hover { background: var(--surface); }
.summary button[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--accent); background: #fffaf0; }
.summary b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary span { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .field { flex: 1 1 260px; }
.toolbar .count { color: var(--muted); font-size: 14px; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
table.grid td { padding: 12px 16px; border-bottom: 1px solid #eceef2; vertical-align: middle; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid tbody tr:focus-visible { outline-offset: -2px; }
table.grid .name { font-weight: 600; }
table.grid .id { display: block; font-size: 13px; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.scroll-x { overflow-x: auto; }

/* drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(16, 26, 43, .5); z-index: 40; display: flex; }
.drawer { margin-left: auto; width: min(560px, 100%); background: var(--paper); height: 100%; overflow-y: auto; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(16, 26, 43, .18); }
.drawer > header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer > header h2 { font-size: 18px; }
.drawer > header p { color: var(--muted); font-size: 14px; }
.drawer .content { padding: 20px; display: grid; gap: 18px; flex: 1; align-content: start; }
.drawer > footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--paper); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.scrim.center { align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--paper); border-radius: 10px; width: min(460px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(16, 26, 43, .28); }
.modal > header { padding: 18px 20px 0; }
.modal > header h2 { font-size: 18px; }
.modal .content { padding: 14px 20px 6px; display: grid; gap: 14px; }
.modal > footer { padding: 16px 20px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.temp-pass { font: 600 22px var(--sans); letter-spacing: 2px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-control); text-align: center; user-select: all; }

/* toasts + offline */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 12px 14px; border-radius: var(--r-control); background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(16, 26, 43, .25); border-left: 4px solid var(--accent-on-dark); }
.toast.error { border-left-color: #ef7f78; }
.toast.ok { border-left-color: #62c28f; }
.offline-bar { background: #3a2a05; color: #ffe2a3; text-align: center; padding: 6px 12px; font-size: 14px; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; gap: 18px; }
  .brand-line { font-size: 15px; }
  .auth-foot { display: none; }
  .auth-main { padding: 28px 20px 48px; align-items: flex-start; }
  .summary { grid-template-columns: repeat(3, 1fr); }
  .summary button:nth-child(3) { border-right: 0; }
  .summary button:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .toasts { bottom: auto; top: 12px; left: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr auto; }
  .row dt { grid-column: 1 / -1; }
  .keytag { padding: 76px 20px 20px; }
  .keytag::before { left: 20px; top: 24px; }
  .keytag .big { font-size: 24px; }
  .topbar .where, .topbar .who { display: none; }
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr { padding: 12px 16px; border-bottom: 1px solid #eceef2; }
  table.grid td { padding: 2px 0; border: 0; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary button { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .summary button:nth-child(2n) { border-right: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .toasts, .btn { display: none !important; } }

/* ------------------------------------------------- setup / connection panel */
.pill.IDLE { background: var(--idle-soft); color: var(--idle); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
details.setup > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.setup[open] > summary { margin-bottom: 8px; }
ol.steps { margin: 8px 0 12px; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 18px; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 40px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center;
}
ol.steps > li > p { color: var(--muted); margin: 2px 0 8px; max-width: 70ch; }
ol.steps > li > .actions { margin-bottom: 10px; }
.codebox { width: 100%; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px 12px; border: 1px solid #b9c0cc; border-radius: var(--r-control); background: var(--surface); resize: vertical; color: var(--text); }

/* =====================================================================
   Hotel app (dashboard, POS, kitchen, ...)
   ===================================================================== */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; flex: none; }
.spin.big { width: 34px; height: 34px; border-width: 3px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.tick { display: inline-block; font-weight: 800; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.btn.busy { opacity: .85; }
.btn.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-lg { min-height: 48px; font-size: 16px; }
.loading-block, .boot { display: grid; gap: 12px; justify-items: center; padding: 48px 20px; color: var(--muted); text-align: center; }
.boot { min-height: 70vh; align-content: center; }
.muted { color: var(--muted); } .small { font-size: 13px; } .bad { color: var(--bad); }
.stack { display: grid; gap: 16px; align-content: start; }
.pad { padding: 14px 16px; }
.spacer { flex: 1; }
.btnrow, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; background: var(--surface); padding: 1px 5px; border-radius: 4px; }

/* shell */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #c9d2e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-top { padding: 20px 18px 14px; border-bottom: 1px solid var(--ink-line); }
.side-brand { font: 600 20px var(--serif); color: #fff; }
.side-hotel { font-size: 13px; color: #8f9db5; margin-top: 4px; overflow-wrap: anywhere; }
.side-nav { padding: 10px 8px; display: grid; gap: 2px; flex: 1; align-content: start; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; color: #c9d2e1; text-decoration: none; font-weight: 500; }
.nav-item .ni { width: 20px; text-align: center; color: #8f9db5; }
.nav-item:hover { background: var(--ink-2); }
.nav-item.on { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent-on-dark); }
.nav-item.on .ni { color: var(--accent-on-dark); }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--ink-line); display: grid; gap: 8px; }
.side-foot .who { display: grid; font-size: 13px; color: #8f9db5; } .side-foot .who strong { color: #fff; font-size: 14px; }
.side-foot .btn { background: transparent; color: #dfe5ef; border-color: var(--ink-line); }
.side-foot .btn:hover { background: var(--ink-2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 12px; padding: 0 20px; min-height: 56px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar h1 { font-size: 18px; }
.burger { display: none; background: none; border: 0; font-size: 22px; padding: 6px; cursor: pointer; }
.screen { padding: 20px; flex: 1; max-width: 1400px; width: 100%; }
.nav-scrim { display: none; }
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--idle-soft); color: var(--idle); min-width: 84px; justify-content: center; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.saving { background: var(--warn-soft); color: var(--warn); }
.sync.saved { background: var(--ok-soft); color: var(--ok); }
.sync.off, .sync.error { background: var(--bad-soft); color: var(--bad); } .sync.off .dot, .sync.error .dot { background: var(--bad); }

/* generic bits */
.toolbar, .filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.toolbar { align-items: center; } .filters .field { min-width: 150px; }
.filters .btnrow { padding-bottom: 1px; }
.search { min-height: 40px; padding: 6px 12px; border: 1px solid #b9c0cc; border-radius: var(--r-control); min-width: 220px; background: var(--paper); }
.tabs { display: inline-flex; background: var(--idle-soft); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 7px 14px; border-radius: 6px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--paper); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg { display: inline-flex; background: var(--idle-soft); border-radius: 8px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 16px; border-radius: 6px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg.wide { display: flex; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); display: grid; gap: 4px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r-panel); }
.empty strong { color: var(--text); }
.sec { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 4px 0 10px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.inline-dates { display: flex; gap: 8px; }

/* tables (data) */
.tablewrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #eceef2; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f8f9fb; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: var(--ink); border-color: var(--ink); } .stat.hero .k, .stat.hero .s { color: #9fb0c9; } .stat.hero .v { color: var(--accent-on-dark); }
.trows { display: grid; } .trow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f0f1f4; font-variant-numeric: tabular-nums; }
.trow:last-child { border-bottom: 0; } .trow.grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.bar-stack { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.cbar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.b-sales { background: var(--accent); } .b-exp { background: #8ea0bd; }
.bar-l { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: currentColor; }
.lg.b-sales { background: none; color: var(--accent); } .lg.b-exp { background: none; color: #8ea0bd; }
.hbars { display: grid; gap: 8px; } .hb { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar { background: var(--idle-soft); border-radius: 4px; height: 12px; } .hbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.setup .step { display: flex; gap: 12px; align-items: center; padding: 8px 0; text-decoration: none; color: var(--text); font-weight: 600; }
.setup .step.done { color: var(--muted); font-weight: 500; } .chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; font-size: 12px; color: var(--accent); }
.step.done .chk { background: var(--ok); border-color: var(--ok); color: #fff; }

/* tables map */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tcard { text-align: left; background: var(--paper); border: 1px solid var(--line); border-top-width: 5px; border-radius: var(--r-panel); padding: 12px 14px; cursor: pointer; display: grid; gap: 4px; min-height: 104px; align-content: start; }
.tcard:hover { box-shadow: 0 4px 14px rgba(16,26,43,.12); }
.tcard .tn { font-weight: 700; font-size: 16px; } .tcard .ts { font-size: 13px; color: var(--muted); }
.tcard .tinfo { display: grid; font-size: 13px; color: var(--muted); } .tcard .tinfo strong { color: var(--text); font-size: 16px; } .tcard .tinfo.free { color: var(--ok); font-weight: 600; }
.tcard .tflag { font-size: 12px; font-weight: 700; color: var(--warn); }
.t-FREE { border-top-color: var(--ok); } .t-OCCUPIED { border-top-color: var(--accent); background: #fffaf0; } .t-BILLING { border-top-color: #3b6fb6; background: #f1f6fd; }

/* pills */
.sp, .kp { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--idle-soft); color: var(--idle); }
.s-OPEN { background: var(--warn-soft); color: var(--warn); } .s-BILLED { background: #e4eefb; color: #2a5ea5; } .s-PAID { background: var(--ok-soft); color: var(--ok); } .s-CANCELLED { background: var(--bad-soft); color: var(--bad); }
.k-SENT { background: #e4eefb; color: #2a5ea5; } .k-PREPARING { background: var(--warn-soft); color: var(--warn); } .k-READY { background: var(--ok-soft); color: var(--ok); } .k-SERVED { background: var(--idle-soft); color: var(--idle); }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-top { display: grid; gap: 10px; margin-bottom: 12px; position: sticky; top: 56px; background: var(--surface); padding: 4px 0 8px; z-index: 5; }
.pos-top .search { width: 100%; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mcard { position: relative; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; cursor: pointer; padding: 0 0 10px; display: grid; gap: 2px; align-content: start; }
.mcard.static { cursor: default; } .mcard:not(.static):hover { box-shadow: 0 4px 14px rgba(16,26,43,.14); } .mcard:not(.static):active { transform: scale(.98); }
.mcard img, .mcard .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--idle-soft); display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #aab3c2; }
.mcard .mn, .mcard .mp, .mcard .muted, .mcard .btnrow { padding: 0 10px; } .mcard .mn { font-weight: 600; margin-top: 6px; line-height: 1.25; } .mcard .mp { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.mcard.off { opacity: .55; } .mcard .btnrow { margin-top: 6px; }
.mcard .badge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; font-weight: 700; padding: 0 6px; }
.cart { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-panel); position: sticky; top: 76px; display: grid; gap: 0; max-height: calc(100vh - 96px); overflow: auto; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.cart .totals { padding: 8px 16px; border-top: 1px solid var(--line); } .cart-actions { padding: 12px 16px 16px; display: grid; gap: 8px; }
.cust { position: relative; } .suggest { display: grid; border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; overflow: hidden; } .suggest:empty { display: none; }
.sug { text-align: left; border: 0; border-bottom: 1px solid #eceef2; background: var(--paper); padding: 8px 12px; cursor: pointer; } .sug:hover { background: var(--accent-soft); }
.lines { display: grid; } .lines .line { display: grid; grid-template-columns: 1fr auto 82px 30px; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #eceef2; }
.lines.compact .line { padding: 6px 0; grid-template-columns: 1fr auto 90px 0; }
.line .ln { display: grid; gap: 3px; justify-items: start; min-width: 0; } .line .note { font-size: 13px; color: var(--muted); } .line .lt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.note-btn { font-size: 13px; text-decoration: none; color: var(--muted); font-weight: 500; text-align: left; }
.lq { display: flex; align-items: center; gap: 8px; } .qty { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 18px; line-height: 1; cursor: pointer; } .qty-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

/* order + bill dialogs */
.modal.wide { width: min(720px, 100%); }
.order-dlg, .bill-dlg { display: grid; gap: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); } .meta strong { color: var(--text); }
.order-dlg .lines, .bill-dlg .lines { border: 1px solid var(--line); border-radius: 8px; } .order-dlg .line:last-child, .bill-dlg .line:last-child { border-bottom: 0; }
.totals { display: grid; } .dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.pay-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 12px; background: #fafbfc; } .pay-box h3, .pays-done h3 { font-size: 15px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; } .pay-rows { display: grid; gap: 8px; }
.pay-row { display: grid; grid-template-columns: 130px 120px 1fr 34px; gap: 8px; } .pay-row select, .pay-row input { min-height: 40px; padding: 6px 10px; border: 1px solid #b9c0cc; border-radius: 6px; background: var(--paper); min-width: 0; }
.pays-done { border-top: 1px dashed var(--line); padding-top: 10px; }
.pic { display: flex; gap: 14px; align-items: center; } .pic img, .pic .ph { width: 120px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--idle-soft); display: grid; place-items: center; color: #aab3c2; font-size: 13px; }

/* kitchen */
.kboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kcol { background: #e9ecf1; border-radius: 10px; padding: 12px; display: grid; gap: 12px; align-content: start; min-height: 300px; }
.kcol h2 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; } .count { background: var(--ink); color: #fff; border-radius: 999px; padding: 0 9px; font-size: 13px; }
.k-col-SENT { border-top: 4px solid #3b6fb6; } .k-col-PREPARING { border-top: 4px solid #d08a1c; } .k-col-READY { border-top: 4px solid var(--ok); }
.ticket { background: var(--paper); border-radius: 8px; padding: 12px; display: grid; gap: 10px; box-shadow: 0 1px 3px rgba(16,26,43,.12); }
.ticket.late { box-shadow: 0 0 0 2px var(--bad); }
.ticket header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } .ticket header span { font-size: 13px; color: var(--muted); } .ticket .age { margin-left: auto; font-weight: 700; color: var(--text); }
.ticket ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 16px; } .ticket li.dim { color: var(--muted); font-size: 14px; } .ticket .note { font-size: 13px; color: var(--bad); }

/* reservations, staff, misc */
.resv { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 8px; padding: 12px 14px; }
.resv .rt { font-size: 20px; font-weight: 700; } .resv.st-COMPLETED, .resv.st-CANCELLED, .resv.st-NO_SHOW { opacity: .6; border-left-color: var(--idle); } .resv.st-SEATED { border-left-color: var(--ok); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; display: grid; gap: 6px; } .perm-group legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0 4px; }
.check.changed { font-weight: 700; color: var(--accent); }
.seg.wide + * { margin-top: 0; }
.stack > .tabs { justify-self: start; }

/* mobile / tablet */
@media (max-width: 1000px) {
  .pos { grid-template-columns: 1fr; } .cart { position: static; max-height: none; }
  .kboard { grid-template-columns: 1fr; } .cols { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 24px rgba(0,0,0,.3); }
  body.nav-open .side { transform: none; } body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(16,26,43,.5); z-index: 44; }
  .burger { display: block; } .screen { padding: 14px; } .bar { padding: 0 12px; }
  .pay-row { grid-template-columns: 1fr 1fr; } .pay-row input:nth-of-type(2) { grid-column: 1 / -1; }
  .resv { grid-template-columns: 56px 1fr; } .resv .btnrow, .resv .sp { grid-column: 2; justify-self: start; }
  .form-grid { grid-template-columns: 1fr; } .lines .line { grid-template-columns: 1fr auto 74px 28px; padding: 10px 12px; }
  .search { min-width: 0; flex: 1; }
}
@media print {
  .side, .bar, .toolbar, .nav-scrim, .toasts, .offline-bar { display: none !important; }
  .app { display: block; } .screen { padding: 0; max-width: none; } body { background: #fff; }
}

/* direct bill / quick pay */
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn-ok:hover { background: #18663f; } .btn-ok:disabled { opacity: .5; }
.qpay { border: 2px solid var(--ok); border-radius: 10px; padding: 14px; display: grid; gap: 12px; background: #f6fbf8; }
.qpay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; } .qpay-total span { font-weight: 600; color: var(--muted); } .qpay-total strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.qpay-methods button { padding: 10px 8px; }
.qpay-extra { display: grid; gap: 8px; } .qpay-extra input { min-height: 46px; font-size: 18px; padding: 8px 12px; border: 1px solid #b9c0cc; border-radius: 6px; background: var(--paper); width: 100%; }
.qpay-change { font-size: 16px; } .qpay-change strong { font-size: 20px; color: var(--ok); }
.qpay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .qpay-actions .btn-lg { min-height: 54px; font-size: 17px; } .qpay-actions > :nth-child(n+3) { grid-column: span 1; }
.qlines { max-height: 34vh; overflow: auto; }
.qdisc summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; } .qdisc[open] summary { margin-bottom: 8px; }
@media (max-width: 560px) { .qpay-actions { grid-template-columns: 1fr; } }
