/* Ladle POS. One small stylesheet on top of Bootstrap 5. System fonts only: no web-font download on slow links. */
:root {
  --ink: #10262b; --ink-2: #1b3a40; --teal: #0e7c7b; --teal-d: #0a5f5e; --turmeric: #f0a202; --chili: #d64933;
  --bg: #eef2f1; --surface: #ffffff; --line: #d9e1df; --text: #16282c; --muted: #5d7276; --slip: #fffef9;
  --radius: 10px; --tap: 48px;
  --bs-primary: var(--teal); --bs-primary-rgb: 14, 124, 123; --bs-link-color: var(--teal-d); --bs-link-hover-color: var(--ink);
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--line);
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0d1a1d; --surface: #14262a; --line: #27403f; --text: #e4eeee; --muted: #93a9ab; --slip: #182c30; --teal: #22a7a5; --teal-d: #4cc3c0;
  --bs-body-bg: var(--bg); --bs-body-color: var(--text); --bs-border-color: var(--line); --bs-link-color: #6fd0cd; color-scheme: dark;
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .modal-content, :root[data-theme="dark"] .dropdown-menu, :root[data-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: var(--text); background-color: var(--surface); color: var(--text); }
:root[data-theme="dark"] .form-control, :root[data-theme="dark"] .form-select { background-color: #0f1f22; color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .btn-outline-secondary { --bs-btn-color: #b6c9ca; --bs-btn-border-color: var(--line); }
:root[data-theme="dark"] .dropdown-item { color: var(--text); }
:root[data-theme="dark"] .dropdown-item:hover { background: var(--ink-2); }
body { background: var(--bg); font-variant-numeric: tabular-nums; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-d); --bs-btn-hover-border-color: var(--teal-d); --bs-btn-active-bg: var(--teal-d); --bs-btn-disabled-bg: var(--teal); }
.btn-warning { --bs-btn-bg: var(--turmeric); --bs-btn-border-color: var(--turmeric); --bs-btn-color: #241a00; --bs-btn-hover-bg: #d99000; --bs-btn-hover-border-color: #d99000; --bs-btn-hover-color: #241a00; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }
.credit { text-align: center; font-size: .72rem; color: var(--muted); padding: .75rem 1rem 1rem; }
.num { text-align: right; white-space: nowrap; }

/* ---------- sign-in ---------- */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; background: linear-gradient(160deg, var(--ink) 0 38%, var(--bg) 38%); padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px; padding: 2rem; box-shadow: 0 12px 40px rgba(16, 38, 43, .22); }
.auth-card.auth-wide { max-width: 520px; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.code-input { text-align: center; letter-spacing: .3em; font-weight: 600; }
.secret-key { font: 600 1.15rem ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: .6rem .8rem; border-radius: 8px; margin: .4rem 0; word-break: break-all; }
.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.recovery code { background: var(--bg); padding: .5rem; border-radius: 6px; text-align: center; font-size: 1rem; color: var(--text); }
.auth-body .credit { color: #b7c9c8; }

/* ---------- admin shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: 0 0 232px; background: var(--ink); color: #cfe0df; display: flex; flex-direction: column; overflow-y: auto; }
.side-brand { font-weight: 800; font-size: 1.15rem; padding: 1.1rem 1.25rem; color: #fff; letter-spacing: .01em; }
.side-nav { padding: 0 .6rem 1.5rem; }
.side-group { font-size: .78rem; font-weight: 600; color: #7fa3a2; margin: 1rem .65rem .3rem; }
.side-link { display: block; padding: .5rem .75rem; border-radius: 8px; color: #cfe0df; text-decoration: none; font-size: .93rem; }
.side-link:hover { background: var(--ink-2); color: #fff; }
.side-link.active { background: var(--teal); color: #fff; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.outlet-switch { min-width: 180px; }
.content { flex: 1; padding: 1.25rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.card { border-radius: var(--radius); border-color: var(--line); background: var(--surface); }
.stat { padding: 1rem 1.1rem; }
.stat .v { font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.stat .k { color: var(--muted); font-size: .85rem; }
.table > :not(caption) > * > * { padding: .55rem .7rem; vertical-align: middle; }
.table thead th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sortable { cursor: pointer; user-select: none; }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 2000; }
.toast-msg { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: 340px; font-size: .92rem; }
.toast-msg.err { background: var(--chili); }
.notif-menu { width: 340px; max-width: 92vw; }
.notif-list { max-height: 60vh; overflow: auto; }
.notif-item { padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .9rem; display: block; color: inherit; text-decoration: none; }
.notif-item.unread { background: rgba(240, 162, 2, .12); }
.chip { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.chip.ok { background: rgba(14, 124, 123, .14); border-color: transparent; color: var(--teal-d); }
.chip.warn { background: rgba(240, 162, 2, .2); border-color: transparent; color: #8a5b00; }
.chip.bad { background: rgba(214, 73, 51, .16); border-color: transparent; color: var(--chili); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; }
.bars .b { flex: 1; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b:hover { background: var(--turmeric); }
.bar-lbl { display: flex; gap: 4px; font-size: .68rem; color: var(--muted); }
.bar-lbl span { flex: 1; text-align: center; overflow: hidden; }
.field-err { color: var(--chili); font-size: .8rem; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.logline { font: .78rem ui-monospace, Menlo, Consolas, monospace; word-break: break-all; max-width: 520px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; }
.pos-top { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--ink); color: #fff; flex-wrap: wrap; }
.pos-top .brand { font-weight: 800; margin-right: .4rem; }
.pos-top .form-control, .pos-top .form-select { min-height: 42px; }
.seg { display: inline-flex; background: var(--ink-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; color: #cfe0df; padding: .45rem .9rem; border-radius: 7px; min-height: 38px; font-weight: 600; }
.seg button.on { background: var(--turmeric); color: #241a00; }
.net-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: #cfe0df; }
.net-dot i { width: 10px; height: 10px; border-radius: 50%; background: #3ccf91; display: inline-block; }
.net-dot.off i { background: var(--chili); }
.pos-body { display: grid; grid-template-columns: 150px 1fr 380px; min-height: 0; }
.pos-cats { overflow-y: auto; padding: .6rem; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: .4rem; }
.cat-btn { border: 1px solid var(--line); background: var(--bg); color: var(--text); text-align: left; padding: .7rem .75rem; border-radius: 9px; min-height: var(--tap); font-weight: 600; font-size: .92rem; }
.cat-btn.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.pos-grid { overflow-y: auto; padding: .8rem; align-content: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.item { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 0; text-align: left; overflow: hidden; min-height: 116px; display: flex; flex-direction: column; color: var(--text); }
.item:active { transform: scale(.98); }
.item .pic { height: 64px; background: var(--bg) center/cover no-repeat; }
.item .meta { padding: .5rem .6rem .6rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.item .nm { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.item .pr { color: var(--teal-d); font-weight: 700; margin-top: auto; }
.item .veg { position: absolute; top: 6px; left: 6px; width: 14px; height: 14px; border: 2px solid #2e9d5a; background: #fff; border-radius: 3px; }
.item .veg::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #2e9d5a; }
.item .veg.nv { border-color: var(--chili); } .item .veg.nv::after { background: var(--chili); }
.item.out { opacity: .45; }
.item.out::after { content: "Out of stock"; position: absolute; inset: auto 0 0 0; text-align: center; background: var(--chili); color: #fff; font-size: .72rem; padding: 2px; }
.item .badge-n { position: absolute; top: 6px; right: 6px; background: var(--turmeric); color: #241a00; font-weight: 700; border-radius: 999px; min-width: 24px; text-align: center; font-size: .78rem; padding: 1px 6px; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--surface) 37%, var(--line) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--radius); min-height: 116px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* The ticket is styled as a paper slip: torn top edge, dotted leaders between name and price. */
.ticket { display: flex; flex-direction: column; min-height: 0; background: var(--slip); border-left: 1px solid var(--line); position: relative; }
.ticket-head { padding: .7rem .9rem .5rem; border-bottom: 2px dashed var(--line); display: flex; flex-direction: column; gap: .35rem; }
.ticket-head .ono { font-weight: 800; font-size: 1.05rem; }
.ticket-lines { flex: 1; overflow-y: auto; padding: .4rem .9rem; }
.t-empty { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }
.t-line { padding: .5rem 0; border-bottom: 1px dotted var(--line); }
.t-line.sent .t-name { color: var(--muted); }
.t-row { display: flex; align-items: baseline; gap: .4rem; }
.t-name { font-weight: 600; flex: 0 1 auto; }
.t-leader { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-3px); min-width: 12px; }
.t-price { font-weight: 700; }
.t-sub { font-size: .78rem; color: var(--muted); }
.t-ctl { display: flex; align-items: center; gap: .3rem; margin-top: .3rem; }
.q-btn { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 1.2rem; font-weight: 700; color: var(--text); line-height: 1; }
.q-btn:active { background: var(--bg); }
.q-val { min-width: 32px; text-align: center; font-weight: 700; }
.t-link { border: 0; background: none; color: var(--teal-d); font-size: .82rem; padding: .4rem .5rem; text-decoration: underline; }
.ticket-sum { padding: .5rem .9rem; border-top: 2px dashed var(--line); font-size: .92rem; }
.sum-row { display: flex; justify-content: space-between; padding: 1px 0; }
.sum-row.total { font-size: 1.35rem; font-weight: 800; padding-top: .25rem; }
.ticket-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: .5rem; padding: .6rem .9rem .8rem; }
.ticket-actions .btn { min-height: 54px; font-weight: 700; }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; pointer-events: none; background: radial-gradient(circle at 6px 0, transparent 5px, var(--bg) 5.5px) repeat-x; background-size: 12px 8px; }
.ticket::before { top: 0; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.pay-methods .btn { min-height: var(--tap); }
.modal-content { border-radius: 14px; }
.opt-row { display: flex; align-items: center; gap: .5rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); min-height: var(--tap); }
.opt-row label { flex: 1; margin: 0; }
.key-hint { font-size: .68rem; opacity: .7; margin-left: .25rem; }
.pos .credit { position: absolute; left: 0; bottom: 0; width: 150px; padding: .3rem; font-size: .62rem; }
.cust-list { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; width: calc(100% - 1.8rem); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.cust-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .7rem; color: var(--text); }
.cust-list button:hover { background: var(--bg); }
@media (max-width: 991px) {
  .pos-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .pos-cats { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: .4rem; }
  .cat-btn { white-space: nowrap; min-height: 42px; }
  .ticket { max-height: 46vh; border-left: 0; border-top: 1px solid var(--line); }
  .pos .credit { display: none; }
}

/* ---------- tables ---------- */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .8rem; }
.tbl { border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: .8rem; min-height: 104px; text-align: left; color: var(--text); display: flex; flex-direction: column; gap: .2rem; position: relative; }
.tbl .tn { font-weight: 800; font-size: 1.15rem; }
.tbl .ts { font-size: .78rem; color: var(--muted); }
.tbl.available { border-color: #8fd0c4; }
.tbl.occupied { border-color: var(--turmeric); background: rgba(240, 162, 2, .12); }
.tbl.billing { border-color: var(--chili); background: rgba(214, 73, 51, .1); }
.tbl.reserved { border-color: #7d93c9; background: rgba(125, 147, 201, .14); }
.tbl.cleaning { border-style: dashed; opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- kitchen display ---------- */
.kds { min-height: 100vh; background: #0b171a; color: #e8f1f0; display: flex; flex-direction: column; }
.kds-top { display: flex; gap: .7rem; align-items: center; padding: .6rem 1rem; background: var(--ink); flex-wrap: wrap; }
.kds-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; padding: .8rem; flex: 1; align-items: start; }
.kds-col h2 { font-size: 1rem; font-weight: 700; margin: 0 0 .6rem; display: flex; justify-content: space-between; }
.kcard { background: #16292d; border-radius: 12px; border-left: 8px solid var(--teal); margin-bottom: .7rem; overflow: hidden; }
.kcard.age-warn { border-left-color: var(--turmeric); } .kcard.age-late { border-left-color: var(--chili); }
.kcard.prio { box-shadow: 0 0 0 2px var(--turmeric); }
.kcard-h { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem .8rem; gap: .5rem; }
.kcard-h .who { font-weight: 800; font-size: 1.1rem; }
.kcard-h .timer { font-weight: 800; font-variant-numeric: tabular-nums; }
.kcard ul { list-style: none; margin: 0; padding: 0 .8rem .5rem; }
.kcard li { padding: .25rem 0; border-top: 1px dashed #2b4247; font-size: 1.05rem; }
.kcard li b { display: inline-block; min-width: 2ch; color: var(--turmeric); }
.kcard li.x { text-decoration: line-through; opacity: .5; }
.kcard li small { display: block; color: #9fb6b8; }
.kcard-a { display: grid; grid-template-columns: 1fr auto; gap: .4rem; padding: .5rem .8rem .8rem; }
.kcard-a .btn { min-height: 46px; font-weight: 700; }
.kds .btn-outline-light { --bs-btn-border-color: #3b565b; }
@media (max-width: 900px) { .kds-cols { grid-template-columns: 1fr; } }

/* ---------- public site ---------- */
.web { max-width: 980px; margin: 0 auto; padding: 1rem; }
.web-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.web-item { display: flex; gap: .7rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; }
.web-item .pic { width: 72px; height: 72px; border-radius: 10px; background: var(--bg) center/cover; flex: none; }
.web-cart { position: sticky; bottom: 0; background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center; }
.stepper { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 1rem 0; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 90px; text-align: center; padding: .6rem .3rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: .85rem; }
.stepper li.done { background: rgba(14, 124, 123, .16); border-color: var(--teal); font-weight: 700; }
