/* ครัวแม่ · ระบบร้านก๋วยเตี๋ยว — stylesheet */
:root {
  --brand: #9b2226;
  --brand-600: #841c20;
  --brand-50: #fbeeee;
  --accent: #e09f3e;
  --ink: #231f1c;
  --ink-2: #5b524b;
  --ink-3: #8a7f76;
  --line: #e8e1d8;
  --line-2: #d8cfc4;
  --surface: #ffffff;
  --bg: #f6f2ec;
  --bg-2: #efe9e1;
  --ok: #1f7a4d;
  --ok-50: #e5f4ec;
  --warn: #a15c00;
  --warn-50: #fdf1dc;
  --bad: #b3261e;
  --bad-50: #fdeceb;
  --info: #2d5d8a;
  --info-50: #e7eff8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(35, 31, 28, .06), 0 4px 16px rgba(35, 31, 28, .06);
  --shadow-lg: 0 10px 40px rgba(35, 31, 28, .18);
  --font: "IBM Plex Sans Thai", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.flow { flex-wrap: wrap; }
.row > button, .row > .btn { flex: none; white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 12px;
  min-height: 46px; padding: 10px 18px; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; touch-action: manipulation; transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
button:hover, .btn:hover { background: var(--brand-600); }
button:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-within {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.btn-2 { background: var(--bg-2); color: var(--ink); }
.btn-2:hover { background: var(--line); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #17603c; }
.btn-danger { background: var(--bad-50); color: var(--bad); }
.btn-danger:hover { background: #f8d7d4; }
.btn-sm { min-height: 36px; padding: 6px 12px; border-radius: 10px; font-size: .9rem; }
.btn-icon { min-width: 46px; padding: 0; }
.wide { width: 100%; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .95rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); min-height: 46px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--brand); }
.hint { font-size: .85rem; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
.error-text { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 8px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }

/* Chips (radio/checkbox pills) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0; font-weight: 500; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; user-select: none; }
.chip span small { color: var(--ink-3); font-weight: 500; }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 600; }
.chip input:checked + span small { color: var(--brand); }

.seg { display: inline-flex; background: var(--bg-2); padding: 4px; border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--ink-2); min-height: 38px; padding: 6px 14px; border-radius: 9px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Pills & notices ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.warn { background: var(--warn-50); color: var(--warn); }
.pill.bad { background: var(--bad-50); color: var(--bad); }
.pill.info { background: var(--info-50); color: var(--info); }
.pill.brand { background: var(--brand-50); color: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.notice { padding: 12px 16px; border-radius: 12px; margin: 12px 0; background: var(--bg-2); }
.notice.ok { background: var(--ok-50); color: var(--ok); }
.notice.warn { background: var(--warn-50); color: var(--warn); }
.notice.bad { background: var(--bad-50); color: var(--bad); }

/* ---------- App header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1400px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.brand-logo svg { width: 24px; height: 24px; }
.brand b { display: block; font-size: 1.15rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--ink-3); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* ---------- Customer ---------- */
.catbar { position: sticky; top: 64px; z-index: 15; background: var(--bg); padding: 10px 0; margin: -20px 0 8px; }
.catbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.catbar .chips::-webkit-scrollbar { display: none; }
.catbar button { flex: none; min-height: 40px; border-radius: 99px; background: var(--surface); color: var(--ink-2); border: 1.5px solid var(--line); padding: 6px 16px; }
.catbar button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.menu-section { scroll-margin-top: 130px; margin-bottom: 26px; }
.menu-section > h2 { margin: 6px 0 12px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.menu-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left; padding: 0; color: var(--ink); font-weight: 400; min-height: 0; border: 0; position: relative; }
.menu-card:hover { background: var(--surface); box-shadow: 0 2px 4px rgba(35,31,28,.08), 0 10px 26px rgba(35,31,28,.12); }
.menu-card .ph, .menu-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-2); }
.ph { display: grid; place-items: center; color: var(--brand); background: linear-gradient(135deg, var(--brand-50), var(--bg-2)); opacity: 1; }
.ph svg { width: 34%; max-width: 64px; height: auto; opacity: .55; }
.menu-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; width: 100%; }
.menu-card h3 { font-size: 1.02rem; }
.menu-card .desc { color: var(--ink-3); font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-card .foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--brand); font-size: 1.1rem; white-space: nowrap; }
.add-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.3rem; line-height: 1; flex: none; }
.menu-card.soldout { opacity: .6; cursor: not-allowed; }
.menu-card.soldout img { filter: grayscale(1); }
.soldout-tag { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.in-cart-tag { position: absolute; top: 10px; right: 10px; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; }

.cart { position: sticky; top: 84px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 104px); }
.cart-head { padding: 16px 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.cart-lines { overflow-y: auto; padding: 0 18px; flex: 1; }
.cart-line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .info { flex: 1; min-width: 0; cursor: pointer; }
.cart-line .info b { display: block; }
.cart-line .meta { font-size: .85rem; color: var(--ink-2); }
.cart-line .note { font-size: .85rem; color: var(--warn); }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border-radius: 12px; align-self: center; flex: none; }
.qty button { min-height: 36px; min-width: 36px; padding: 0; background: transparent; color: var(--ink); font-size: 1.2rem; }
.qty button:hover { background: var(--line); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }
.cart-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 1.25rem; margin: 10px 0 12px; }
.empty { text-align: center; color: var(--ink-3); padding: 34px 12px; }
.empty .big { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.closed-banner { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; }

.cartbar { display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; box-shadow: var(--shadow-lg); border-radius: 16px; min-height: 58px; justify-content: space-between; padding: 10px 18px; }
.cartbar .count { background: rgba(255,255,255,.2); border-radius: 99px; padding: 2px 10px; }

/* Pick dialog */
.pick-hero { margin: -24px -24px 14px; position: relative; }
.pick-hero img, .pick-hero .ph { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
.pick-hero .close-x { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.92); color: var(--ink); border-radius: 50%; min-height: 40px; width: 40px; padding: 0; }
.opt-title { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; font-weight: 700; }
.opt-title small { font-weight: 500; color: var(--ink-3); }
.sticky-foot { position: sticky; bottom: -24px; background: var(--surface); margin: 16px -24px -24px; padding: 14px 24px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }

/* Tracking */
.queue-big { font-size: 4.5rem; font-weight: 800; line-height: 1; color: var(--brand); letter-spacing: -.02em; }
.track-card { text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0; }
.steps div { padding: 10px 4px; border-radius: 10px; background: var(--bg-2); color: var(--ink-3); font-size: .85rem; font-weight: 600; }
.steps div.on { background: var(--brand); color: #fff; }
.steps div.done { background: var(--brand-50); color: var(--brand); }
.ready-flash { background: var(--ok); color: #fff; border-radius: 14px; padding: 14px; font-size: 1.2rem; font-weight: 700; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(31,122,77,.18); } }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: inline-block; margin-top: 12px; }
.qr-box svg { width: 200px; height: 200px; display: block; }
.pp-head { background: #113566; color: #fff; font-weight: 700; border-radius: 8px; padding: 4px 10px; font-size: .85rem; letter-spacing: .04em; }
.line-items { text-align: left; border-top: 1px dashed var(--line-2); margin-top: 14px; padding-top: 10px; }
.line-items > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: .92rem; }

/* ---------- Map / delivery ---------- */
.map-wrap { position: relative; margin: 6px -4px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
#map { height: min(56vh, 460px); background: var(--bg-2); }
.map-pin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -34px 0 0 -17px; z-index: 500; pointer-events: none;
  background: var(--brand); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.map-pin::after { content: ""; position: absolute; left: 11px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.map-info { margin-top: 10px; min-height: 2.6em; }
.map-info b { color: var(--ink); }
.shop-marker { font-size: 22px; line-height: 30px; text-align: center; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.dv-card { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: .92rem; }
.dv-card b { display: block; }
.sum-row { display: flex; justify-content: space-between; font-size: .95rem; color: var(--ink-2); margin-top: 6px; }
.hint-bar { background: var(--ok-50); color: var(--ok); border-radius: 10px; padding: 6px 10px; font-size: .85rem; margin-top: 8px; font-weight: 600; }
.hint-bar.warn { background: var(--warn-50); color: var(--warn); }
.o-dv { background: var(--info-50); border-radius: 10px; padding: 8px 10px; margin-top: 10px; font-size: .92rem; }
.o-dv a { font-weight: 700; }
.tier-row { display: grid; grid-template-columns: auto auto 46px; justify-content: start; gap: 8px 18px; margin-bottom: 8px; align-items: center; }

/* ---------- Dialog & toast ---------- */
dialog { border: 0; border-radius: 20px; padding: 24px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; }
dialog::backdrop { background: rgba(28, 20, 16, .55); }
dialog.wide-dialog { width: min(760px, calc(100vw - 24px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 20px; }
.dlg-actions > * { flex: 1; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise .18s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); font-weight: 500; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }
#toast.ok { background: var(--ok); }

/* ---------- Login ---------- */
.login-card { max-width: 400px; margin: 8vh auto; background: var(--surface); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 6px 0 4px; }
.login-card input { font-size: 1.3rem; text-align: center; letter-spacing: .15em; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.keypad button { min-height: 58px; font-size: 1.4rem; background: var(--bg-2); color: var(--ink); }
.keypad button:hover { background: var(--line); }

/* ---------- Kitchen ---------- */
.k-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.k-summary .pill { font-size: .9rem; padding: 6px 12px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--bg-2); border-radius: var(--radius); padding: 12px; min-height: 60vh; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 700; }
.col-head .count { background: var(--surface); border-radius: 99px; padding: 0 10px; font-size: .9rem; }
.col > .order + .order { margin-top: 12px; }
.order { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; border-left: 6px solid var(--accent); }
.order.st-cooking { border-left-color: var(--info); }
.order.st-ready { border-left-color: var(--ok); }
.order.st-done { border-left-color: var(--line-2); }
.order.st-cancelled { border-left-color: var(--line-2); opacity: .7; }
.order.fresh { animation: fresh 1.2s ease-out 3; }
@keyframes fresh { 0% { box-shadow: 0 0 0 0 rgba(224,159,62,.8); } 100% { box-shadow: 0 0 0 14px rgba(224,159,62,0); } }
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.order .qn { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.order .qn small { font-size: .8rem; font-weight: 600; color: var(--ink-3); display: block; margin-bottom: 2px; }
.order .badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.age { font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.age.late { color: var(--bad); }
.age.slow { color: var(--warn); }
.o-items { margin: 10px 0; }
.o-item { padding: 8px 0; border-top: 1px solid var(--line); }
.o-item b { font-size: 1.08rem; }
.o-item .meta { color: var(--ink-2); font-size: .92rem; }
.o-item .note { display: inline-block; margin-top: 4px; background: var(--warn-50); color: var(--warn); font-weight: 700; padding: 2px 8px; border-radius: 6px; font-size: .9rem; }
.o-actions { display: flex; gap: 8px; }
.o-actions .primary { flex: 1; }
.col-tabs { display: none; margin-bottom: 12px; }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.side-nav button { justify-content: flex-start; background: transparent; color: var(--ink-2); font-weight: 600; }
.side-nav button:hover { background: var(--bg-2); }
.side-nav button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.kpi .value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink-3); font-size: .8rem; }
.kpi.hero .value { color: var(--brand); font-size: 2rem; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--brand); }
.chart .bar-hit:hover + .bar, .chart .bar.hl { fill: var(--brand-600); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .85rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-tip.show { opacity: 1; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .8rem; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.menu-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-row img, .menu-row .ph { width: 64px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; font-size: 1.2rem; }
.menu-row .tools { display: flex; gap: 6px; align-items: center; }
.addon-row { display: grid; grid-template-columns: 1fr 110px 46px; gap: 8px; margin-bottom: 8px; }
.img-pick { display: flex; gap: 14px; align-items: center; }
.img-pick img, .img-pick .ph { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; flex: none; }
.table-qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.table-qr { border: 1px dashed var(--line-2); border-radius: 14px; padding: 16px; text-align: center; break-inside: avoid; background: #fff; }
.table-qr svg { width: 150px; height: 150px; margin: 8px auto; display: block; }
.table-qr .t { font-size: 1.5rem; font-weight: 800; }

/* ---------- Display (TV) ---------- */
body.page-display { background: #15110f; color: #f6efe6; overflow: hidden; }
.tv { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 2.2vw 3vw; gap: 2vw; }
.tv-head { display: flex; align-items: center; justify-content: space-between; }
.tv-head h1 { font-size: 3vw; }
.tv-head .clock { font-size: 2.6vw; font-weight: 700; font-variant-numeric: tabular-nums; color: #d9c9b6; }
.tv-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: 2.4vw; min-height: 0; }
.tv-col { background: #231c19; border-radius: 2vw; padding: 2vw; min-height: 0; overflow: hidden; }
.tv-col h2 { font-size: 2.2vw; margin-bottom: 1.6vw; display: flex; align-items: center; gap: 1vw; }
.tv-col.ready { background: #0f3b27; }
.tv-nums { display: flex; flex-wrap: wrap; gap: 1.2vw; align-content: flex-start; }
.tv-nums span { font-size: 4vw; font-weight: 800; background: #342a25; border-radius: 1.2vw; min-width: 9vw; padding: .4vw 1.2vw; text-align: center; font-variant-numeric: tabular-nums; }
.tv-col.ready .tv-nums span { font-size: 6.5vw; background: #145236; min-width: 14vw; color: #fff; }
.tv-col.ready .tv-nums span.new { background: #f2b33d; color: #1d1409; animation: tvpop 1s ease-in-out 6; }
@keyframes tvpop { 50% { transform: scale(1.08); } }
.tv-foot { display: flex; justify-content: space-between; align-items: center; color: #a8998b; font-size: 1.3vw; }
.tv-foot button { background: #342a25; font-size: 1.1vw; min-height: 0; padding: .6vw 1.2vw; }
.tv-empty { color: #7d6f64; font-size: 2vw; }

/* ---------- Installer ---------- */
.install { max-width: 640px; margin: 5vh auto; background: var(--surface); padding: 28px; border-radius: 20px; box-shadow: var(--shadow); }
.install h2 { margin: 26px 0 6px; font-size: 1.1rem; }
.brand-mark { display: inline-block; background: var(--brand); color: #fff; font-weight: 700; padding: 4px 12px; border-radius: 10px; margin-bottom: 10px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 4px 0; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--bad); font-weight: 700; } .checks .warn { color: var(--warn); }
.install-form button { margin-top: 22px; }
.install .steps { display: block; padding-left: 20px; }
.install .steps li { margin: 8px 0; }
pre.code { background: var(--ink); color: #f6efe6; padding: 14px; border-radius: 12px; overflow-x: auto; font-size: .85rem; }

/* ---------- Print (receipts, QR sheets) ---------- */
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
}
.receipt { font-family: var(--font); color: #000; font-size: 12px; line-height: 1.4; padding: 2mm 3mm; }
.receipt .c { text-align: center; }
.receipt h1 { font-size: 16px; }
.receipt .q { font-size: 30px; font-weight: 800; margin: 4px 0; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .l { display: flex; justify-content: space-between; gap: 8px; }
.receipt .s { font-size: 11px; padding-left: 10px; }
.receipt .tot { font-size: 15px; font-weight: 800; }
.receipt svg { width: 34mm; height: 34mm; margin: 4px auto; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .shop { grid-template-columns: minmax(0, 1fr) 320px; }
  .board { gap: 10px; }
}
@media (max-width: 900px) {
  .shop { display: block; }
  .shop > .cart { display: none; }
  .cartbar { display: flex; }
  body.page-customer .wrap { padding-bottom: 96px; }
  .admin-layout { display: block; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
  .side-nav button { flex: none; }
  .board { display: block; }
  .board .col { display: none; min-height: 0; }
  .board .col.on { display: block; }
  .col-tabs { display: flex; }
  .col-head { display: none; }
}
@media (max-width: 560px) {
  .seg button { padding: 6px 10px; font-size: .9rem; }
  .wrap { padding: 14px; }
  .topbar-in { padding: 8px 14px; gap: 10px; }
  .brand small { display: none; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .menu-card .body { padding: 10px; }
  .menu-card h3 { font-size: .95rem; }
  .menu-card .desc { display: none; }
  .price { font-size: 1rem; }
  .add-dot { width: 30px; height: 30px; }
  .grid2 { grid-template-columns: 1fr; }
  dialog { padding: 20px; }
  .pick-hero { margin: -20px -20px 12px; }
  .sticky-foot { margin: 16px -20px -20px; padding: 12px 20px 16px; bottom: -20px; }
  .queue-big { font-size: 3.6rem; }
  .catbar { top: 56px; }
  .kpi .value { font-size: 1.3rem; }
  .menu-row { flex-wrap: wrap; }
  .menu-row .tools { width: 100%; justify-content: flex-end; }
  .topbar .actions .btn-label { display: none; }
  .topbar .actions { gap: 6px; flex-wrap: nowrap; }
  .topbar .actions .btn-sm { padding: 6px 10px; }
}
