:root {
  /* light warm background, charcoal text, terracotta brand (approved by the owner) */
  --bg: #faf8f6; --card: #fff; --ink: #231c18; --muted: #75695f; --line: #ebe4dd; --line-strong: #d6ccc2;
  --brand: #b4492a; --brand-ink: #8f3a21; --brand-soft: #fbefe9; --brand-soft-2: #f6dfd4; --brand-line: #ecc3b2;
  /* semantic: green = pay / send / done, amber = waiting (checked bill, pending price), red = cancel / delete */
  --ok: #15803d; --ok-bg: #15803d; --ok-bg-2: #166534; /* white text >= 4.5:1 */ --ok-soft: #ecfdf3; --ok-line: #bbf7d0;
  --warn: #b45309; --warn-soft: #fff7e6; --warn-line: #fcd9a8;
  --danger: #b91c1c; --danger-soft: #fef2f2; --danger-soft-2: #fee2e2; --danger-line: #fecaca;
  /* used as small status text: darker steps so 13px text clears 4.5:1 on white (#16a34a/#d97706 were ~3.2:1) */
  --free: #15803d; --busy: #b4492a; --resv: #b45309;
  /* dashboard pair checked for colour-blind contrast: blue income vs terracotta expense */
  --inc: #2563eb; --exp: #c2410c;
  --ring: rgba(180, 73, 42, .18); --header-bg: rgba(255, 255, 255, .9);
  --r: 12px; --shadow: 0 1px 2px rgba(35, 28, 24, .05);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "IBM Plex Sans Thai", "Sarabun", "Leelawadee UI", "Tahoma", sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
header { position: sticky; top: 0; z-index: 5; background: var(--header-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
header h1 { font-size: 17px; font-weight: 600; margin: 0 12px 0 0; display: flex; align-items: center; gap: 8px; }
header h1::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav button { background: transparent; color: var(--muted); border: 0; padding: 7px 12px; font-size: 15px; cursor: pointer; border-radius: 8px; }
nav button:hover { color: var(--ink); }
nav button.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
main { padding: 20px 16px; max-width: 1200px; margin: 0 auto; }
.hidden { display: none !important; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid transparent; padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 500; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--brand-soft-2); }
.btn.brand { background: var(--brand); color: #fff; }
.btn.brand:hover:not(:disabled) { background: var(--brand-ink); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--line-strong); background: var(--card); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft-2); }
.btn.sm { padding: 6px 11px; font-size: 14px; border-radius: 8px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

input, select, textarea { font-family: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input[readonly] { background: var(--bg); }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .muted { font-size: 13px; }
.stat b { display: block; font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tbl { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; text-align: left; min-height: 108px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.tbl:hover { border-color: var(--line-strong); }
.tbl:active { transform: scale(.98); }
.tbl b { font-size: 18px; font-weight: 600; display: block; margin-bottom: 4px; }
.tbl .st { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tbl .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tbl.free .st { color: var(--free); }
.tbl.busy { background: var(--brand-soft); border-color: var(--brand-line); } .tbl.busy .st { color: var(--busy); }
.tbl.resv { border-color: var(--warn-line); } .tbl.resv .st { color: var(--resv); }
.tbl.checked { background: var(--warn-soft); border-color: var(--warn-line); } .tbl.checked .st { color: var(--resv); }
.tbl small { color: var(--muted); display: block; margin-top: 6px; font-size: 13px; }

table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
tr.void td { color: var(--muted); text-decoration: line-through; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.stat.good b { color: var(--free); } .stat.bad b { color: var(--danger); }
.stat small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { position: relative; }
.chart { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart .tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(15,23,42,.12); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; margin-bottom: 8px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 4px; }
.scroll-x { overflow-x: auto; }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow: auto; z-index: 10; }
.sheet { background: var(--bg); border-radius: 16px; width: 100%; max-width: 1080px; padding: 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, .18); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left; font-size: 15px; color: var(--ink); min-height: 72px; transition: border-color .15s, background .15s; }
.mi:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.mi:active:not(:disabled) { transform: scale(.98); }
.mi span { display: block; color: var(--brand); font-weight: 600; margin-top: 4px; font-size: 14px; }
.cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: 14px; transition: all .15s; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.qty { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: 16px; }
.qty button:hover { border-color: var(--brand); color: var(--brand); }
.note { font-size: 13px; color: var(--brand); cursor: pointer; background: none; border: 0; padding: 0; }
.tag { font-size: 11px; font-weight: 600; background: var(--brand-soft); color: var(--brand-ink); padding: 2px 7px; border-radius: 99px; margin-left: 6px; }
.line { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; padding: 2px 0; }
.total { font-size: 22px; font-weight: 600; display: flex; justify-content: space-between; margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--line); }
.total span:last-child { color: var(--brand); }
.muted { color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.qr { text-align: center; margin-top: 10px; }
.qr svg { width: 200px; height: 200px; }
.qa { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 12px; }


/* ---------- layout polish: tablet + phone ---------- */
.btn { min-height: 40px; }
.btn.sm { min-height: 34px; }
.btn.lg { flex: 1 1 100%; padding: 14px 18px; font-size: 17px; font-weight: 600; }
.qty button { width: 36px; height: 36px; }
.jump { display: none; }
/* pay + check-bill stay pinned to the bottom while the order card scrolls */
.paybar { position: sticky; bottom: 0; z-index: 2; background: var(--card); margin: 10px -16px -16px; padding: 12px 16px 16px; border-top: 1px solid var(--line); box-shadow: 0 -8px 20px rgba(15,23,42,.08); }@media (min-width: 761px) {
  .split > .order { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}
@media (max-width: 760px) {
  header { padding: 8px 12px; gap: 6px; }
  nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav button { flex: 0 0 auto; }
  main { padding: 14px 12px; }
  .card { padding: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
  .stat { padding: 12px; }
  .stat b { font-size: 19px; }
  .tables { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .tbl { min-height: 92px; padding: 11px; }
  .tbl b { font-size: 16px; }
  input, select, textarea { font-size: 16px; } /* stop iOS zooming on focus */
  .modal { padding: 0; }
  .sheet { border-radius: 0; min-height: 100%; padding: 12px 12px 84px; }
  .sheet-head h2 { font-size: 18px; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; }
  .mi { min-height: 64px; padding: 10px; font-size: 14px; }
  .cats.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .cats.scroll::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 8px 14px; }
  .jump { display: flex; justify-content: space-between; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 11; box-shadow: 0 8px 24px rgba(15,23,42,.25); }
  .jump.off { display: none; }
  .paybar { margin: 10px -14px -14px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
  #toast { bottom: 80px; }
}

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 15px; box-shadow: 0 10px 30px rgba(15,23,42,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#receipt { display: none; }
@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body { background: #fff; }
  body > *:not(#receipt) { display: none !important; }
  #receipt { display: block; width: 72mm; font-size: 12px; font-family: "Tahoma", sans-serif; color: #000; }
  #receipt .c { text-align: center; }
  #receipt h3 { margin: 0; font-size: 16px; }
  #receipt table { width: 100%; border-collapse: collapse; }
  #receipt td { padding: 2px 0; vertical-align: top; }
  #receipt .r { text-align: right; }
  #receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #receipt .big { font-size: 15px; font-weight: 700; }
  #receipt.kitchen { font-size: 16px; }
  #receipt.kitchen h3 { font-size: 22px; }
  #receipt svg { width: 40mm; height: 40mm; }
}
#login { position: fixed; inset: 0; background: linear-gradient(180deg, var(--brand-soft), var(--bg) 60%); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#login form { width: 100%; max-width: 360px; padding: 28px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who button { background: transparent; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.who button:hover { border-color: var(--line-strong); }
#sync { display: inline-flex; align-items: center; gap: 5px; }
#sync.ok { color: var(--free); } #sync.off { color: var(--danger); }
.role { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); }

/* user permissions */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; cursor: pointer; }
.perm:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.perm input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex: none; }
.perm.off { cursor: default; opacity: .7; }

/* ---------- menu tab ---------- */
.menu-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.menu-tools input[type=search] { flex: 1 1 auto; }
.mgroup { font-size: 13px; font-weight: 600; color: var(--muted); padding: 14px 4px 6px; border-bottom: 1px solid var(--line); }
.mrow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.mrow.out .mname, .mrow.out .mprice { color: var(--muted); text-decoration: line-through; }
.mrow.editing { background: var(--brand-soft); border-radius: 8px; }
.mname { min-width: 0; overflow-wrap: anywhere; }
.mprice { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 72px; }
.mact { display: flex; gap: 6px; }
.stock { min-width: 72px; min-height: 34px; border-radius: 99px; border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--free); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.stock.off { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
@media (max-width: 760px) {
  .mrow { grid-template-columns: 1fr auto; row-gap: 8px; }
  .mrow .stock { justify-self: start; }
  .mrow .mact { justify-self: end; }
}

/* dish added by staff, price waiting for approval */
.tag.wait { background: var(--warn-soft); color: var(--resv); }
.tbl.wait { border-color: var(--warn-line); } .tbl.wait .st { color: var(--resv); }
.mrow.wait { background: var(--warn-soft); border-radius: 8px; }
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--resv); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }

/* semantic action buttons */
.btn.ok { background: var(--ok-bg); color: #fff; }
.btn.ok:hover:not(:disabled) { background: var(--ok-bg-2); }
.btn.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.btn.warn:hover:not(:disabled) { border-color: var(--warn); }

/* =====================================================================
   Maroon & gold shell (owner's mockup). Only the page chrome is dark:
   cards, the table sheet and the QR stay light so text and scanning keep
   their contrast. @media print above is untouched.
   ===================================================================== */
:root {
  --page-1: #4a0a12; --page-2: #7a1522;
  --gold: #f2c45a; --gold-2: #d99a2b; --gold-ink: #5a2a05; --cream: #fffaf2;
  --on-dark: #fff4e6; --on-dark-muted: #f3d9c6; --glass: rgba(255, 255, 255, .08); --glass-line: rgba(255, 220, 170, .22);
  --brand: #9b1c27; --brand-ink: #7a1520; --brand-soft: #fbeeee; --brand-soft-2: #f5dcdc; --brand-line: #e9bcbc;
  --ring: rgba(155, 28, 39, .2);
}
body { background: radial-gradient(120% 80% at 50% 0%, var(--page-2), var(--page-1) 70%) fixed, var(--page-1); color: var(--ink); }
header { background: linear-gradient(180deg, rgba(74, 10, 18, .96), rgba(74, 10, 18, .88)); border-bottom: 1px solid var(--glass-line); padding: 12px 16px 10px; display: block; color: var(--on-dark); }
header h1 { color: var(--gold); font-size: 30px; font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: .01em; }
header h1::before { content: none; }
.topbar { display: flex; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; }
.logo { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--gold); box-shadow: 0 0 0 3px rgba(242, 196, 90, .25), 0 6px 16px rgba(0, 0, 0, .35); flex: 0 0 auto; }
.titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#sync { font-size: 15px; color: var(--on-dark); }
#sync.ok { color: var(--on-dark); }
#sync.off { color: #fecaca; }
.who { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; color: var(--on-dark); }
.roundbtns { display: flex; align-items: center; gap: 8px; position: relative; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); color: var(--on-dark); display: grid; place-items: center; cursor: pointer; position: relative; padding: 0; }
.round:hover { background: rgba(255, 255, 255, .16); }
.round .ic { width: 22px; height: 22px; }
.round .dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 0 2px var(--page-1); }
.sep { width: 1px; height: 28px; background: var(--glass-line); }
.rolebadge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 10px; background: linear-gradient(180deg, #ffe39a, var(--gold) 55%, var(--gold-2)); color: var(--gold-ink); font-weight: 700; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.rolebadge .ic { width: 18px; height: 18px; }
.acct { position: absolute; right: 0; top: 52px; z-index: 30; min-width: 210px; background: var(--card); color: var(--ink); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.acct.hidden { display: none; }
.acct-name { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-weight: 600; }
.acct-name small { color: var(--muted); font-weight: 400; }
.acct-name .ic { width: 18px; height: 18px; }
.acct button { text-align: left; background: none; border: 0; padding: 10px; border-radius: 8px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
.acct button:hover { background: var(--bg); }
.acct button.danger { color: var(--danger); }

nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; max-width: 1200px; margin: 12px auto 0; }
nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 6px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--on-dark); font-size: 15px; font-weight: 600; position: relative; }
nav button:hover { color: var(--on-dark); background: rgba(255, 255, 255, .14); }
nav button .ic { width: 24px; height: 24px; }
nav button.on { background: linear-gradient(180deg, #fff0cc, var(--gold) 60%, var(--gold-2)); color: var(--brand-ink); border-color: transparent; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
nav .navbadge { position: absolute; top: 6px; right: 8px; margin: 0; background: #e11d48; }

main > section > .row label, main > section > h2, main > section > p.muted, .legend { color: var(--on-dark-muted); }

/* stat cards */
.stats.live { grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats.live { grid-template-columns: repeat(4, 1fr); } }
.scard { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; color: #fff; border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 8px 20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .15); min-height: 104px; }
.scard .sico { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); }
.scard .sico .ic { width: 28px; height: 28px; }
.scard .sbody { display: flex; flex-direction: column; min-width: 0; z-index: 1; flex: 1; }
.scard .sbody span { font-size: 15px; }
.scard b { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scard .sbg { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; opacity: .14; }
.sbar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .2); margin-top: 8px; overflow: hidden; }
.sbar i { display: block; height: 100%; background: #4ade80; border-radius: 99px; }
.s-free { background: linear-gradient(135deg, #a3182a, #6d0d18); }
.s-busy { background: linear-gradient(135deg, #b0560b, #8a4206); } /* white label >= 4.5:1 */
.s-resv { background: linear-gradient(135deg, #8d3fb3, #5b2380); }
.s-due  { background: linear-gradient(135deg, #12805c, #0b5a40); }

/* legend */
.tlegend { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 8px 16px; padding: 10px 16px; margin: 4px 0 16px; border-radius: 99px; border: 1px solid var(--glass-line); background: rgba(0, 0, 0, .18); color: var(--on-dark); font-size: 15px; }
.tlegend span { display: inline-flex; align-items: center; gap: 8px; }
.tlegend i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.tlegend .free { background: #22c55e; } .tlegend .busy { background: #fbbf24; } .tlegend .resv { background: #f43f5e; } .tlegend .checked { background: #fb923c; }

/* table cards */
.tables { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tbl { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 0; border-radius: 16px; background: var(--cream); border: 3px solid #f0c27a; box-shadow: 0 6px 14px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .6); color: var(--ink); }
.tbl:hover { border-color: var(--gold); }
.thead { display: flex; align-items: center; gap: 10px; }
.thead b { font-size: 20px; font-weight: 700; margin: 0; }
.tico { width: 30px; height: 30px; color: var(--brand); }
.pill { align-self: center; display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 99px; font-size: 14px; font-weight: 600; background: #ecfdf3; color: #166534; max-width: 100%; text-align: center; }
.pill i { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; flex: 0 0 auto; }
.tbl.busy .pill { background: #fff7e0; color: #854d0e; } .tbl.busy .pill i { background: #eab308; }
.tbl.resv .pill { background: #ffe4e8; color: #9f1239; } .tbl.resv .pill i { background: #e11d48; }
.tbl.checked .pill, .tbl.wait .pill { background: #ffedd5; color: #9a3412; } .tbl.checked .pill i, .tbl.wait .pill i { background: #f97316; }
.tbl.busy, .tbl.checked, .tbl.resv, .tbl.wait { background: var(--cream); }
.tbl.busy { border-color: #f5c84c; } .tbl.resv { border-color: #f4a3b4; } .tbl.checked, .tbl.wait { border-color: #fdba74; }
.tbl small { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.tact { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; border-radius: 12px; border: 0; color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; background: linear-gradient(180deg, #1a7f4b, #126b3d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 2px 4px rgba(0, 0, 0, .2); }
.tact .ic { width: 22px; height: 22px; }
.tact:active { transform: translateY(1px); }
.tact.view { background: linear-gradient(180deg, #b4410c, #9a3412); }
.tact.pay { background: linear-gradient(180deg, #a14a05, #8a3f05); }

/* table sheet and login on the maroon page */
.modal { background: rgba(30, 4, 8, .6); }
#login { background: radial-gradient(120% 80% at 50% 0%, var(--page-2), var(--page-1) 70%); }
#login form { border: 3px solid #f0c27a; background: var(--cream); }
.jump { background: linear-gradient(180deg, #1a7f4b, #126b3d); }

@media (max-width: 760px) {
  header { padding: 10px 12px 8px; }
  header h1 { font-size: 24px; }
  .logo { width: 52px; height: 52px; }
  .round { width: 40px; height: 40px; }
  .rolebadge { font-size: 13px; padding: 4px 10px; }
  nav { grid-template-columns: repeat(5, minmax(68px, 1fr)); overflow-x: auto; gap: 6px; width: auto; }
  nav button { min-height: 58px; font-size: 13px; padding: 6px 4px; }
  .scard { padding: 12px; gap: 10px; min-height: 92px; }
  .scard .sico { width: 44px; height: 44px; } .scard .sico .ic { width: 22px; height: 22px; }
  .scard b { font-size: 26px; }
  .scard .sbody span { font-size: 13px; }
  .scard .sbg { width: 48px; height: 48px; }
  .tables { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tbl { padding: 9px; gap: 6px; border-width: 2px; }
  .thead { gap: 6px; } .thead b { font-size: 16px; } .tico { width: 24px; height: 24px; }
  .pill { font-size: 12px; padding: 3px 9px; }
  .tact { min-height: 40px; font-size: 15px; gap: 6px; }
  .tact .ic { width: 18px; height: 18px; }
  .tlegend { font-size: 13px; border-radius: 14px; }
}
@media (max-width: 380px) { .tables { grid-template-columns: repeat(2, 1fr); } }
.ic { flex: 0 0 auto; }
/* header round buttons beat the generic .who button rule */
.who .round { width: 44px; height: 44px; border-radius: 50%; padding: 0; border: 1px solid var(--glass-line); background: var(--glass); color: var(--on-dark); font-size: 0; }
.who .round:hover { background: rgba(255, 255, 255, .16); border-color: var(--glass-line); }
/* grids: let columns shrink below their content so phones never scroll sideways */
.stats.live { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .stats.live { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tables { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tbl, .scard { min-width: 0; }
.scard b { font-size: clamp(20px, 6vw, 34px); }
@media (max-width: 760px) {
  .who .round { width: 40px; height: 40px; }
  .tables { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  nav button span { font-size: 12px; white-space: nowrap; }
  .scard b { font-size: clamp(18px, 6.2vw, 26px); }
  .scard .sbg { display: none; }
}
@media (max-width: 380px) { .tables { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* staff have no bell: drop the divider with it */
#bellBtn.hidden + .sep { display: none; }
/* money like ฿12,345.00 must fit the half-width card on phones */
@media (max-width: 480px) {
  .scard { gap: 8px; padding: 12px 10px; }
  .scard .sico { width: 36px; height: 36px; border-width: 1.5px; } .scard .sico .ic { width: 18px; height: 18px; }
  .scard b { font-size: clamp(15px, 5vw, 24px); }
}
