/* So & So Cafe POS — styles.
   Identity comes from the printed menu card: deep maroon, brand red, cream paper with a faint woven grid, script wordmark. */
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-style: normal; font-display: swap; src: url('../assets/fonts/montserrat-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-weight: 400; font-style: normal; font-display: swap; src: url('../assets/fonts/great-vibes-latin-400-normal.woff2') format('woff2'); }

:root {
  --maroon: #5F0B0B; --maroon-2: #801212; --red: #D90000; --red-d: #B30000; --red-l: #FCE6E3;
  --paper: #FAF1DA; --paper-2: #FFF8E6; --card: #FFFDF8; --cream: #FFF0C2;
  --ink: #27160F; --ink2: #4B352B; --muted: #8A7565; --line: #EBDDBA; --line-2: #F3E8CB;
  --green: #1E8E3E; --green-l: #DDF3E4; --amber: #B7791F; --amber-l: #FFF0C7; --blue-l: #E4ECFB;
  --r: 16px; --rail: 96px; --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-s: 0 1px 2px rgba(95, 11, 11, .06), 0 4px 14px rgba(95, 11, 11, .05);
  --shadow-m: 0 2px 4px rgba(95, 11, 11, .06), 0 16px 36px rgba(95, 11, 11, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 500 14px/1.45 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(rgba(128, 18, 18, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(128, 18, 18, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(217, 0, 0, .45); outline-offset: 2px; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.015em; color: var(--maroon); }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
.hide { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; }
.num { text-align: right; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; } .grow { flex: 1; }
.ic { width: 20px; height: 20px; flex: none; }
.wordmark { font-family: 'Great Vibes', 'Brush Script MT', cursive; font-weight: 400; color: var(--maroon); font-size: 34px; line-height: 1; letter-spacing: .01em; white-space: nowrap; }
.wordmark.xl { font-size: 52px; margin: 4px 0 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
#app { height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--rail) 1fr; height: 100%; }
.rail { background: linear-gradient(180deg, var(--maroon-2) 0%, var(--maroon) 100%); color: var(--paper-2); display: flex; flex-direction: column; align-items: center; padding: 14px 10px 12px; gap: 10px; min-height: 0; box-shadow: 2px 0 18px rgba(95, 11, 11, .25); z-index: 2; }
.rail-logo { width: 62px; height: 62px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 3px rgba(255, 240, 194, .35); }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; flex: 1; overflow-y: auto; margin-top: 10px; scrollbar-width: none; }
.rail-foot { width: 100%; padding-top: 8px; border-top: 1px solid rgba(255, 240, 194, .18); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; font-size: 11.5px; font-weight: 600; color: rgba(255, 248, 230, .72); width: 100%; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active { background: var(--paper-2); color: var(--maroon); font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.logout-item:hover { background: rgba(217, 0, 0, .5); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 62px; padding: 0 20px; background: rgba(255, 253, 248, .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; } .top-logo { display: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.top-right { display: flex; align-items: center; gap: 12px; }
.clock { font-weight: 600; color: var(--ink2); font-size: 13px; }
.net { font-size: 12px; font-weight: 700; padding: 4px 10px 4px 22px; border-radius: 999px; position: relative; } .net::before { content: ''; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: currentColor; }
.cloud { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.cloud.hide { display: none; } .cloud.ok { color: #146C2E; background: var(--green-l); } .cloud.busy { color: #8A5A00; background: var(--amber-l); } .cloud.off { color: #5a4a36; background: #EFE6CC; } .cloud.err { color: #A80000; background: var(--red-l); }
.net.on { color: var(--green); background: var(--green-l); } .net.off { color: #A80000; background: var(--red-l); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--maroon); color: var(--paper-2); display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 800; }
.logout-btn { color: var(--red-d); border-color: #F0C9C2; } .logout-btn:hover { background: var(--red-l); }
#view { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
#view.view-pos { overflow: hidden; }
.appfoot { display: flex; justify-content: center; gap: 14px; align-items: center; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(255, 253, 248, .9); border-top: 1px solid var(--line); flex: none; text-align: center; }
.tabbar { display: none; }
.view-head, .pad { width: 100%; max-width: 1480px; margin-inline: auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px 8px; }
.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pad { padding: 10px 24px 28px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 13px; font-weight: 700; font-size: 14px; border: 1.5px solid transparent; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #E80C0C, #C20000); color: #fff; box-shadow: 0 6px 16px rgba(217, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .22); } .btn.primary:hover { background: linear-gradient(180deg, #F01616, #B80000); }
.btn.dark { background: var(--maroon); color: #fff; } .btn.dark:hover { background: var(--maroon-2); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); } .btn.ghost:hover { background: var(--paper-2); border-color: #dfcb98; }
.btn.wa { background: #1FA855; color: #fff; } .btn.danger { background: #B00020; color: #fff; }
.btn.sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 11px; } .btn.sm .ic { width: 17px; height: 17px; }
.btn.icon-only { width: 46px; padding: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; } .icon-btn:hover { background: var(--line-2); }
.danger-text { color: #B00020 !important; } .wa-text { color: #1FA855; }
.link { color: var(--red); font-weight: 700; text-decoration: underline; padding: 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink2); }
.field label i { font-style: normal; font-weight: 500; color: var(--muted); }
.block-title { font-size: 14px; font-weight: 800; color: var(--maroon); }
input:not([type=checkbox]), select, textarea { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 11px 14px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #b6a592; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 0, 0, .1); }
input[readonly] { background: #f6efdb; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline { display: flex; align-items: center; gap: 8px; } .inline input, .inline select { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); margin-top: 1px; flex: none; }
.check small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #F2E7C8; border-radius: 13px; padding: 4px; gap: 2px; }
.seg button { padding: 8px 15px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; transition: background .15s; }
.seg button.on { background: #fff; color: var(--red-d); box-shadow: 0 1px 4px rgba(95, 11, 11, .18); }
.seg.full { display: flex; } .seg.full button { flex: 1; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; white-space: nowrap; flex: none; transition: background .15s, border-color .15s; }
.chip:hover { border-color: #dcc58a; } .chip small { opacity: .65; font-weight: 700; }
.chip-e { font-size: 16px; line-height: 1; }
.chip.on { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.chip.sm { padding: 5px 11px; font-size: 12px; } .chip.special { border-color: #E2B84C; background: #FFF4CE; } .chip.special.on { background: var(--maroon); border-color: var(--maroon); }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 13px; padding: 0 13px; height: 46px; flex: 1; min-width: 150px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 0, 0, .1); }
.search input { border: 0 !important; box-shadow: none !important; padding: 0; height: 100%; background: transparent; }
.search.sm { height: 42px; flex: none; width: 220px; }
.date-in { width: auto !important; height: 42px !important; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EFE6CC; color: #5a4a36; white-space: nowrap; }
.tag.new { background: var(--blue-l); color: #1E40AF; } .tag.preparing { background: var(--amber-l); color: #8A5A00; }
.tag.ready, .tag.paid { background: var(--green-l); color: #146C2E; } .tag.served, .tag.off { background: #EFE6CC; color: #5a4a36; }
.tag.cancelled, .tag.unpaid { background: var(--red-l); color: #A80000; }
.vdot { width: 15px; height: 15px; border: 1.6px solid var(--green); border-radius: 3px; display: inline-grid; place-items: center; flex: none; background: #fff; }
.vdot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.vdot.nv { border-color: #B00020; } .vdot.nv::after { background: #B00020; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--amber-l); border: 1px solid #F0D98A; padding: 11px 15px; border-radius: 14px; font-size: 13px; margin-bottom: 12px; }
.banner.warn { background: #FFF1CC; border-color: #F0CF73; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; } .empty b { color: var(--ink); font-size: 15px; } .empty p { max-width: 320px; }
.empty.big { padding: 64px 12px; } .empty.small { padding: 12px; font-size: 13px; } .empty-ico { font-size: 38px; line-height: 1.1; }
.switch { width: 46px; height: 27px; border-radius: 999px; background: #d9cfb3; position: relative; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: var(--green); } .switch.on i { transform: translateX(19px); }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }

/* ---------- tables / panels / kpis ---------- */
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-s); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 12px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; } .tbl.clickable tbody tr { cursor: pointer; } .tbl.clickable tbody tr:hover { background: var(--paper-2); }
.w-min { width: 1%; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-s); }
.panel > h3, .panel-head h3 { margin-bottom: 12px; color: var(--maroon); font-size: 16px; font-weight: 800; } .panel h3 small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .panel-head h3 { margin: 0; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.count { display: inline-block; min-width: 24px; text-align: center; padding: 1px 8px; border-radius: 999px; background: var(--cream); color: var(--maroon); font-size: 12px; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-s); }
.kpi span { font-size: 13px; font-weight: 600; color: var(--muted); } .kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .kpi small { color: var(--muted); font-size: 12.5px; }
.kpi.hero { background: linear-gradient(160deg, var(--maroon-2), var(--maroon)); border-color: var(--maroon); color: var(--paper-2); } .kpi.hero span, .kpi.hero small { color: rgba(255, 248, 230, .78); } .kpi.hero b { font-size: 32px; }
.kpis.sm { grid-template-columns: repeat(3, 1fr); } .kpis.sm .kpi b { font-size: 18px; } .kpis.sm .kpi { padding: 11px 13px; box-shadow: none; }
.hbar { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; margin: 11px 0; font-size: 13.5px; }
.hbar .hv { height: 10px; background: #F3E9CC; border-radius: 6px; overflow: hidden; } .hbar .hv i { display: block; height: 100%; background: var(--red); border-radius: 0 5px 5px 0; }
.hbar b { min-width: 72px; text-align: right; }
.chart-wrap { position: relative; } .chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap .gl { stroke: #EFE3C2; stroke-width: 1; } .chart-wrap .al { fill: var(--muted); font-size: 11px; font-weight: 600; } .chart-wrap .bar { fill: var(--red); } .chart-wrap .hit:hover { fill: rgba(217, 0, 0, .06); }
.tip { position: absolute; pointer-events: none; background: var(--maroon); color: #fff; border-radius: 11px; padding: 7px 12px; display: flex; flex-direction: column; font-size: 12px; box-shadow: var(--shadow-m); z-index: 5; } .tip b { font-size: 14px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 410px; height: 100%; }
.pos-menu { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 16px 18px 0; }
.pos-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.item-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; align-content: start; padding: 4px 2px 24px; }
.item { position: relative; display: flex; flex-direction: column; gap: 9px; align-items: stretch; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 8px 11px; transition: transform .08s, border-color .15s, box-shadow .15s; box-shadow: var(--shadow-s); }
.item:hover { border-color: #dcc58a; } .item:active { transform: scale(.97); }
.item-art { position: relative; display: grid; place-items: center; height: 72px; border-radius: 14px; }
.emo { font-size: 36px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(95, 11, 11, .15)); }
.item-name { flex: none; padding: 0 5px; font-weight: 700; font-size: 13.5px; line-height: 1.28; min-height: 35px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-row { display: flex; justify-content: space-between; align-items: center; padding: 0 5px; }
.item-price { color: var(--red-d); font-weight: 800; font-size: 15px; }
.item.off { opacity: .5; } .soldout { position: absolute; left: 14px; top: 14px; font-size: 11px; font-weight: 700; color: #fff; background: #B00020; padding: 2px 8px; border-radius: 999px; }
.badge { position: absolute; top: 6px; right: 6px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--red); color: #fff; font-size: 13px; font-weight: 800; display: none; place-items: center; padding: 0 7px; box-shadow: 0 2px 6px rgba(217, 0, 0, .4); } .badge.on { display: inline-grid; }
.badge.bump { animation: bump .28s ease-out; } @keyframes bump { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.item:has(.badge.on) { border-color: var(--red); background: var(--paper-2); box-shadow: 0 0 0 3px rgba(217, 0, 0, .1), var(--shadow-s); }
.pos-cart { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(95, 11, 11, .06); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 12px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.cart-head b { font-size: 17px; font-weight: 800; color: var(--maroon); }
.only-sheet { display: none; }
.cart-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.cart-scroll > .seg { margin-bottom: 12px; }
.block { background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 13px 13px 4px; margin-top: 12px; } .block-title { margin-bottom: 10px; }
.block:has(#cart-lines) { background: #fff; }
.cust-badge { font-size: 12.5px; color: var(--ink2); min-height: 4px; padding-bottom: 8px; } .err-text { color: #B00020; font-weight: 600; }
.line { display: grid; grid-template-columns: 1fr auto 64px; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.line:last-child { border-bottom: 0; }
.line-name { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.line-note { font-size: 12px; color: var(--muted); text-align: left; padding: 2px 0 0 23px; } .line-note:hover { color: var(--red); }
.stepper { display: flex; align-items: center; gap: 2px; background: #F5ECD2; border-radius: 12px; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; } .stepper button:active { background: #e9dbb0; } .stepper .ic { width: 16px; height: 16px; }
.stepper span { min-width: 22px; text-align: center; font-weight: 800; }
.line-amt { text-align: right; font-weight: 800; }
.cp-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 8px 11px; border-radius: 11px; margin: 4px 0 8px; }
.cp-status.ok { background: var(--green-l); color: #146C2E; } .cp-status.err { background: var(--red-l); color: #A80000; } .cp-status .ic { width: 16px; height: 16px; } .cp-status span { flex: 1; }
#cart-totals { margin-top: 14px; padding: 12px 14px 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.trow { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; color: var(--ink2); } .trow b { color: var(--ink); } .trow.neg b { color: var(--green); }
.trow.grand { font-size: 17px; font-weight: 800; padding-top: 10px; margin-top: 6px; border-top: 1.5px dashed var(--line); color: var(--maroon); } .trow.grand b { font-size: 26px; color: var(--maroon); letter-spacing: -.02em; } .trow.grand small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cart-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); }
.cart-foot .btn { height: 54px; font-size: 15px; border-radius: 15px; }
.cart-foot .btn.primary { justify-content: space-between; padding: 0 20px; font-size: 16px; } .cart-foot .btn.primary b { font-size: 20px; font-weight: 800; }
.cart-fab { display: none; }

/* ---------- orders ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.col h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 16px; font-weight: 800; color: var(--maroon); }
.col h3 i { width: 11px; height: 11px; border-radius: 50%; background: #3B6BE6; } .col.c-preparing h3 i { background: #E9A100; } .col.c-ready h3 i { background: var(--green); }
.col-empty { border: 2px dashed var(--line); border-radius: var(--r); padding: 28px 12px; text-align: center; color: var(--muted); font-weight: 600; }
.col-tabs { display: none; }
.ogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.ocard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px 10px; margin-bottom: 16px; box-shadow: var(--shadow-s); position: relative; overflow: hidden; }
.ocard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: #cfc2a0; }
.ocard.st-new::before { background: #3B6BE6; } .ocard.st-preparing::before { background: #E9A100; } .ocard.st-ready::before { background: var(--green); } .ocard.st-cancelled::before { background: var(--red); } .ocard.st-cancelled { opacity: .78; }
.ogrid .ocard { margin: 0; }
.ocard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-top: 4px; }
.otitle { display: flex; align-items: center; gap: 11px; min-width: 0; } .otitle b { display: block; font-size: 14px; } .otitle small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tok { flex: none; min-width: 48px; height: 48px; padding: 0 8px; border-radius: 14px; background: var(--maroon); color: var(--paper-2); display: grid; place-items: center; font-size: 19px; font-weight: 800; }
.oside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.age { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--green); } .age .ic { width: 15px; height: 15px; }
.age.warn { color: var(--amber); } .age.late { color: #C20000; } .age.quiet { color: var(--muted); }
.olist { list-style: none; margin: 12px 0 4px; padding: 10px 12px; background: var(--paper-2); border-radius: 12px; font-size: 13.5px; }
.olist li { display: flex; gap: 8px; padding: 3px 0; } .olist li b { min-width: 28px; color: var(--maroon); } .olist small { display: block; color: var(--muted); font-size: 12px; }
.onote { background: var(--amber-l); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; margin-top: 6px; }
.steps { display: flex; margin: 14px 0 6px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; padding: 2px 0; cursor: pointer; }
.step i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #d8cba9; background: #fff; position: relative; z-index: 1; transition: background .15s; }
.step::before { content: ''; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: #e3d6b4; } .step:first-child::before { display: none; }
.step.done i { background: var(--green); border-color: var(--green); } .step.done::before, .step.now::before { background: var(--green); }
.step.now i { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 4px rgba(217, 0, 0, .15); } .step.now { color: var(--ink); cursor: default; } .step:hover:not(:disabled) i { border-color: var(--red); }
.ocard footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.otot { font-size: 21px; font-weight: 800; color: var(--maroon); letter-spacing: -.01em; } .otot small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.oact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .oact .btn .ic { width: 16px; height: 16px; }
.osub { display: flex; gap: 2px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.osub button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: var(--ink2); } .osub button:hover { background: var(--line-2); } .osub .ic { width: 16px; height: 16px; }

/* ---------- modals / toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(40, 8, 8, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 100; opacity: 0; transition: opacity .15s; }
.modal-back.in { opacity: 1; }
.modal { background: var(--card); border-radius: 24px; width: min(560px, 100%); max-height: 94dvh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(40, 8, 8, .4); transform: translateY(14px) scale(.98); transition: transform .2s; overflow: hidden; }
.modal-back.in .modal { transform: none; }
.modal.sm { width: min(410px, 100%); } .modal.md { width: min(640px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 12px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line); } .modal-head h3 { font-size: 17px; font-weight: 800; color: var(--maroon); }
.modal-body { padding: 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; gap: 8px; padding: 12px 22px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); flex-wrap: wrap; background: var(--card); }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; background: linear-gradient(160deg, var(--maroon-2), var(--maroon)); color: var(--paper-2); padding: 14px 18px; border-radius: 16px; margin-bottom: 16px; font-weight: 600; } .pay-total b { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.pay-modal .seg { margin-bottom: 16px; } .quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pay-hint { min-height: 24px; font-weight: 700; margin-top: 6px; } .pay-hint.ok { color: var(--green); font-size: 16px; } .pay-hint.err { color: #B00020; }
.upi-box { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; } .upi-qr { width: 192px; flex: none; padding: 10px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-s); } .upi-qr svg { width: 100%; height: auto; display: block; }
.upi-meta { display: flex; flex-direction: column; gap: 4px; } .upi-meta b { font-size: 26px; color: var(--maroon); } .upi-meta span { font-weight: 700; word-break: break-all; } .upi-meta small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.upi-box.sm .upi-qr { width: 120px; }
.bill-modal .modal-body { background: #F4EAD0; }
.success { text-align: center; margin-bottom: 14px; } .tick { width: 60px; height: 60px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 0 0 8px var(--green-l); animation: pop .35s ease-out; } .tick .ic { width: 32px; height: 32px; stroke-width: 2.6; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.success p { color: var(--ink2); font-weight: 600; margin-top: 2px; } .change-due { margin-top: 10px; display: inline-block; background: var(--amber-l); padding: 9px 18px; border-radius: 12px; font-size: 16px; }
.bill-actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; } .bill-actions .btn { flex: 1 1 auto; min-width: 0; padding: 0 12px; }
.bill-modal .modal-foot { padding-left: 16px; padding-right: 16px; }
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(60px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-m); opacity: 0; transform: translateY(10px); transition: .25s; max-width: min(92vw, 480px); }
.toast.in { opacity: 1; transform: none; } .toast.err { background: #B00020; } .toast.ok { background: #146C2E; }

/* ---------- login ---------- */
#lock-root:empty { display: none; }
.lock { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
  background-color: var(--maroon); background-image: radial-gradient(circle at 20% 15%, rgba(217, 0, 0, .35), transparent 45%), radial-gradient(circle at 85% 90%, rgba(255, 240, 194, .14), transparent 40%), linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: auto, auto, 24px 24px, 24px 24px; }
.lock-card { background: var(--paper-2); border-radius: 30px; padding: 28px 30px 26px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); width: min(380px, 100%); }
.lock-logo { width: 96px; height: 96px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-m); }
.lock-sub { color: var(--muted); font-weight: 600; }
.dots { display: flex; gap: 14px; margin: 16px 0 4px; } .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--maroon); transition: background .1s; } .dots i.on { background: var(--red); border-color: var(--red); }
.lock-msg { min-height: 20px; color: #B00020; font-weight: 700; font-size: 13px; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; margin-top: 6px; } .keypad button { height: 66px; border-radius: 50%; background: #fff; font-size: 24px; font-weight: 700; box-shadow: 0 2px 5px rgba(95, 11, 11, .14); transition: background .1s, transform .08s; } .keypad button:active { background: var(--red); color: #fff; transform: scale(.94); }
.lock-foot { margin-top: 18px; font-size: 12.5px; font-weight: 600; color: rgba(255, 248, 230, .75); }
.shake { animation: shake .35s; } @keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.fatal { max-width: 460px; margin: 20vh auto; padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; }

/* ---------- receipt (screen preview + print) ---------- */
.receipt { font-family: 'Montserrat', Arial, sans-serif; font-size: 11.5px; line-height: 1.4; color: #000; background: #fff; width: 100%; font-weight: 500; }
.receipt-preview .receipt { max-width: 310px; margin: 0 auto; padding: 16px 14px; border-radius: 6px; box-shadow: var(--shadow-m); }
.r-center { text-align: center; } .r-right { text-align: right; } .r-b { font-weight: 700; } .r-big { font-size: 15px; } .r-small { font-size: 10px; line-height: 1.35; }
.r-logo { width: 30mm; max-width: 55%; display: block; margin: 0 auto 3px; }
.r-biz { font-size: 16px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.r-hr { border-top: 1px dashed #000; margin: 6px 0; } .r-hr.dbl { border-top: 2px solid #000; }
.r-row { display: flex; justify-content: space-between; gap: 8px; } .r-row > span:last-child { text-align: right; }
.r-item { margin: 4px 0; } .r-name { font-weight: 700; } .r-name small { font-weight: 500; }
.r-total { font-size: 15px; font-weight: 800; }
.r-qr { width: 36mm; max-width: 60%; margin: 8px auto 0; text-align: center; font-size: 10px; font-weight: 600; } .r-qr svg { width: 100%; height: auto; display: block; }
.r-stamp { border: 2px solid #000; text-align: center; font-weight: 800; font-size: 16px; padding: 4px; margin: 8px 0; }
.kot .kot-item { font-size: 14px; font-weight: 700; margin: 5px 0; } .kot-q { display: inline-block; min-width: 38px; }
#print-area { display: none; }

@media print {
  html, body { height: auto; background: #fff; }
  #app, #modal-root, #toast-root, #lock-root { display: none !important; }
  #print-area { display: block; }
  .paper-80 .receipt { width: 72mm; margin: 0 auto; padding: 3mm 0; }
  .paper-58 .receipt { width: 50mm; margin: 0 auto; padding: 2mm 0; font-size: 10.5px; } .paper-58 .r-biz { font-size: 14px; }
  .paper-a4 .receipt { width: 100%; max-width: 130mm; margin: 0 auto; font-size: 13px; } .paper-a4 .r-biz { font-size: 22px; } .paper-a4 .r-small { font-size: 12px; } .paper-a4 .r-logo { width: 28mm; }
  .receipt { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .pos { grid-template-columns: 1fr 360px; } .board { grid-template-columns: 1fr 1fr; } .clock { display: none; } }
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: 5dvh; z-index: 60; border-radius: 24px 24px 0 0; box-shadow: 0 -12px 44px rgba(40, 8, 8, .3); transform: translateY(105%); transition: transform .25s; border-left: 0; }
  .pos-cart.open { transform: none; } .only-sheet { display: inline-grid; }
  .cart-fab { display: flex; align-items: center; gap: 10px; position: fixed; left: calc(var(--rail) + 14px); right: 14px; bottom: calc(44px + var(--safe-b)); z-index: 40; height: 56px; border-radius: 18px; background: linear-gradient(180deg, #E80C0C, #C20000); color: #fff; padding: 0 20px; font-weight: 700; box-shadow: 0 10px 28px rgba(217, 0, 0, .45); }
  .cart-fab span { flex: 1; text-align: left; } .cart-fab b { font-weight: 800; }
  .item-grid { padding-bottom: 96px; }
  .cols2 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; } .col-tabs { display: flex; gap: 8px; margin-bottom: 12px; } .col:not(.on) { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { display: none; }
  .topbar { height: 56px; padding: 0 12px; } .top-logo { display: block; } .wordmark { font-size: 30px; } .clock, .net { display: none; } .cloud { padding: 3px 8px; font-size: 11px; }
  .user-chip span:last-child { display: none; } .user-chip { padding: 3px; }
  .tabbar { display: flex; background: linear-gradient(180deg, var(--maroon-2), var(--maroon)); padding: 6px 6px calc(6px + var(--safe-b)); overflow-x: auto; gap: 2px; scrollbar-width: none; }
  .tabbar .nav-item { min-width: 64px; flex: 1; padding: 7px 4px; }
  .cart-fab { left: 12px; right: 12px; bottom: calc(118px + var(--safe-b)); }
  .item-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .view-head { padding: 12px 14px 4px; } .pad { padding: 8px 14px 22px; } .pos-menu { padding: 12px 12px 0; }
  .two { grid-template-columns: 1fr; } .hide-sm { display: none; }
  .search.sm { width: 100%; flex: 1; } .head-tools { width: 100%; }
  .upi-box { flex-direction: column; text-align: center; } .upi-qr { width: 210px; }
  .appfoot { padding: 5px 8px; font-size: 11px; }
  #toast-root { bottom: calc(124px + var(--safe-b)); }
  .ogrid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) and (min-width: 480px) { .item-grid { grid-template-columns: repeat(3, 1fr); } }
@media (hover: none) { .item:hover, .chip:hover { border-color: var(--line); } }
