@font-face { font-family: "KhmerLimon"; src: url("/fonts/New_limons1.ttf") format("truetype"); }
.limon { font-family: "KhmerLimon", sans-serif; }

/* ============================================================
   LAYOUT-3 DESIGN SYSTEM — Food Delivery (dark theme)
   Adapted for rkeeper web pos (cashier app)
   ============================================================ */

:root {
  --bg-primary: #f6f4f1;
  --bg-secondary: #efeae4;
  --bg-card: #ffffff;
  --bg-card-hover: #f4efe9;
  --accent: #C86240;
  --accent-hover: #b35430;
  --text-primary: #241e1a;
  --text-secondary: #5c554e;
  --text-muted: #8f877f;
  --border: #e4ded6;
  --line: #e4ded6;
  --green: #17a34a;
  --red: #dc2626;
  --amber: #d97706;
  --chili: #C86240;
  --chili-dark: #a85232;
  --ink: #241e1a;
  --muted: #8f877f;
  --bg: #f6f4f1;
  --card: #ffffff;
  --font-heading: 'Playfair Display SC', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --anim-fast: 150ms;
  --anim-med: 250ms;
  --anim-slow: 400ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, select { font: inherit; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--bg-primary); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ============================================================
   LOGIN
   ============================================================ */
#login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); }
.login-wrap { width: min(420px, calc(100vw - 32px)); background: var(--bg-card); border-radius: 22px; padding: 32px 28px 24px; text-align: center;
  box-shadow: 0 24px 70px rgba(20,16,12,.28); border: 1px solid var(--border); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.login-logo-img { height: 40px; width: auto; border-radius: 10px; object-fit: contain; }
.login-brand b { font-size: 22px; letter-spacing: .02em; color: var(--accent); font-family: var(--font-heading); }
.login-sub { color: var(--text-muted); margin: 8px 0 22px; font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.login-form label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.login-form input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary); font-size: 22px; font-weight: 700; letter-spacing: .08em; outline: none;
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.btn-login {
  margin-top: 8px; min-height: 48px; border: 0; border-radius: 14px; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.btn-login:active { transform: scale(.98); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 4px; }
.pk { height: 56px; border-radius: 14px; background: var(--bg-secondary); border: 1px solid var(--border); font-size: 22px; font-weight: 700; color: var(--text-primary); }
.pk:active { transform: scale(.96); border-color: var(--accent); }
.err { min-height: 20px; color: var(--red); font-size: 13px; margin: 10px 0 4px; }
.login-staff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; max-height: 220px; overflow: auto; text-align: left; }
.staff-chip {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; font: inherit;
}
.staff-chip b { font-size: 13px; }
.staff-chip span { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
.staff-chip:hover { border-color: var(--accent); }

/* ============================================================
   SHELL
   ============================================================ */
#app { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
#app.cart-open { grid-template-columns: 1fr; }
.side { order: 3; display: none !important; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.slogo { font-size: 26px; }
.brand b { font-size: 17px; letter-spacing: .02em; color: var(--accent); font-family: var(--font-heading); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nitem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; font-weight: 700; font-size: 14.5px; color: var(--text-muted); }
.nitem i { font-style: normal; font-size: 17px; width: 22px; text-align: center; }
.nitem:hover { background: var(--bg-card-hover); }
.nitem.active { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(200,98,64,.35); }
.nitem.active .ic { background: rgba(255,255,255,.25); color: #fff; }
.nitem .ic { display: inline-grid; place-items: center; width: 24px; height: 20px; border-radius: 6px; background: var(--bg-secondary); color: var(--text-muted); font-size: 10px; font-weight: 900; letter-spacing: .03em; font-style: normal; }
.subnav { margin: 2px 0 4px 40px; display: flex; flex-direction: column; gap: 2px; }
.subnav a { font-size: 13px; color: var(--text-muted); padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.subnav a:hover, .subnav a.on { color: var(--accent); }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.uchip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; font-weight: 700; font-size: 13.5px; }
.uav { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.logout2 { width: 100%; padding: 10px; border-radius: 11px; background: rgba(200,98,64,.12); color: var(--accent); font-weight: 700; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar2 { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--bg-card); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.tb-logo { height: 34px; width: auto; border-radius: 9px; object-fit: contain; }
.tb-back { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); font-weight: 700; font-size: 13.5px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); display: grid; place-items: center; flex-shrink: 0; }
.logout-top { display: flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3); color: var(--red); font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.iconbtn:active, .tb-back:active, .logout-top:active { transform: scale(.95); }
.tb-title2 { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; }
.tb-title2 b { font-size: 18px; color: var(--text-primary); font-family: var(--font-heading); letter-spacing: .02em; }
.tb-title2 span { font-size: 12.5px; color: var(--text-muted); }
.chip { font-size: 12px; font-weight: 700; color: var(--accent); background: rgba(200,98,64,.12); border: 1px solid rgba(200,98,64,.25); padding: 6px 12px; border-radius: 999px; }
.tchip { font-size: 12.5px; font-weight: 800; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary); padding: 7px 12px; border-radius: 999px; }
.cust { padding: 9px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); outline: none; width: 170px; font-size: 13px; }
.ghost-btn { padding: 9px 13px; border-radius: 11px; background: var(--bg-secondary); border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; color: var(--text-secondary); }
.ghost-btn.danger { color: var(--red); border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); }
.ghost-btn:active { transform: scale(.96); }

.ottabs { display: flex; background: var(--bg-secondary); padding: 3px; border-radius: 999px; gap: 2px; }
.ottabs button { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-muted); }
.ottabs button.active { background: var(--accent); color: #fff; }

/* ============================================================
   TABLES
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 22px 6px; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1; max-width: 340px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); outline: none; font-size: 14px; }
.toolbar input[type="search"]:focus { border-color: var(--accent); }
.fchips { display: flex; gap: 4px; background: var(--bg-secondary); border: 1px solid var(--border); padding: 4px; border-radius: 999px; }
.fchip { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 12.5px; color: var(--text-muted); transition: all .15s; white-space: nowrap; }
.fchip:hover { color: var(--text-secondary); }
.fchip.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(200,98,64,.3); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; background: var(--bg-card); border: 1px solid var(--border); padding: 7px 14px; border-radius: 999px; margin-left: auto; }
.legend i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.open { background: var(--green); } .dot.closed { background: #5a5550; }
.dot.bill { background: var(--amber); }
.viewtoggle { display: flex; gap: 4px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.viewtoggle button { width: 42px; height: 34px; border-radius: 9px; font-size: 15px; color: var(--text-muted); }
.viewtoggle button.active { background: var(--accent); color: #fff; }
.halltabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px 0; }
.halltabs .cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; padding: 14px 18px 90px; }
.tcard { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px; min-height: 106px; transition: transform .07s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tcard:hover { box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.tcard:active { transform: scale(.97); }
.tname { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.tcode { font-size: 11.5px; color: var(--text-muted); }
.tstat { font-size: 12.5px; font-weight: 800; color: var(--text-muted); margin-top: auto; letter-spacing: .02em; }
.tcard.open .tstat { color: var(--green); }
.tcard.billed .tstat { color: var(--amber); }
.tmeta { font-size: 11.5px; color: var(--text-muted); }
.tcard.open { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.06); }
.tcard.billed { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.06); }
.tcard.billed .tstat, .tcard.billed .tname { color: var(--amber); }
.tcard.open .tstat { color: var(--green); }

/* hall plan */
.planwrap { overflow: auto; padding: 12px 18px 90px; }
.planhall { position: relative; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
#layoutView .card.wide { display: flex; flex-direction: column; max-height: 100vh; max-height: 100dvh; }
.lp-header { flex-shrink: 0; }
#lpStage { position: relative; flex: 1; min-height: 0; overflow: auto; }
#lpStage img { max-width: 100%; display: block; }
.ptable { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--bg-card); border: 2px solid var(--border); border-radius: 12px; transition: transform .07s; line-height: 1.05; padding: 0; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ptable:active { transform: scale(.93); }
.ptable .pt { font-weight: 800; font-size: 12px; color: var(--text-primary); max-width: 95%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptable .pemo { font-size: 14px; line-height: 1; opacity: .85; }
.ptable .ptot { font-size: 10.5px; font-weight: 800; }
.ptable.open { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.1); }
.ptable.billed { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.1); }
.ptable.billed .pt, .ptable.billed .ptot { color: var(--amber); }
.ptable.open .pt { color: var(--text-primary); }
.ptable.open .ptot { color: var(--accent); }

/* ============================================================
   ORDER SCREEN (menu panel + order panel) — LAYOUT-3 STYLE
   ============================================================ */
#app.in-order { grid-template-columns: 1fr; }
#app.in-order .topbar2, #app.in-order .side { display: none; }
#app.in-order .main { height: 100vh; height: 100dvh; }
#orderView { flex: 1; min-height: 0; display: flex; }

/* LEFT: menu panel */
.menu-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-primary); }
.menu-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bg-primary); border-bottom: 1px solid var(--border); z-index: 10; }
.menu-back { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border); font-size: 17px; color: var(--text-secondary); display: grid; place-items: center; flex-shrink: 0; }
.menu-back:active { transform: scale(.94); }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-secondary); border-radius: 999px; padding: 9px 16px; border: 1px solid var(--border); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { border: none; background: transparent; font-size: 13.5px; outline: none; width: 100%; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box svg { flex-shrink: 0; color: var(--text-muted); }
.category-bar { display: flex; gap: 6px; padding: 13px 22px 4px; overflow-x: auto; scrollbar-width: none; background: var(--bg-primary); }
.category-bar::-webkit-scrollbar { display: none; }
#cats .cat { white-space: nowrap; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); font-size: 13px; font-weight: 600; color: var(--text-muted); }
#cats .cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.product-grid-scroll { flex: 1; overflow-y: auto; padding: 16px 22px 30px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.product-card { background: var(--bg-card); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: pointer; transition: all .15s; border: 2px solid transparent; }
.product-card:active { transform: scale(.97); }
.product-card .img-wrap { position: relative; width: 100%; height: 140px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .img-wrap::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
  pointer-events: none; z-index: 1;
}
.product-card .img-wrap img { position: relative; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.product-card .img-wrap .placeholder { font-size: 44px; z-index: 0; }
.product-card .info { padding: 12px 14px; border-top: 1px solid var(--border); }
.product-card .info .name { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; color: var(--text-primary); }
.product-card .info .meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.product-card .info .bottom { display: flex; align-items: center; justify-content: space-between; }
.product-card .info .price { font-size: 16px; font-weight: 700; color: var(--accent); }
.add-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--green); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.qty-ctl { display: flex; align-items: center; gap: 6px; background: var(--green); border-radius: 24px; padding: 2px 4px; }
.qty-ctl button { width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: #fff; font-size: 16px; font-weight: 700; }
.qty-ctl .qty { color: #fff; font-weight: 700; font-size: 14px; min-width: 16px; text-align: center; }

/* RIGHT: order panel */
.order-panel { width: 400px; background: var(--bg-card); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: -4px 0 20px rgba(0,0,0,.3); }
.order-header { padding: 16px 22px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oh-left { display: flex; flex-direction: column; gap: 8px; }
.table-badge { background: var(--green); color: #fff; padding: 6px 14px; border-radius: 24px; font-weight: 700; font-size: 14px; align-self: flex-start; flex-shrink: 0; }
.meta-row { font-size: 13px; color: var(--text-muted); display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
.meta-row span { display: flex; align-items: center; gap: 4px; }
.covers-stepper { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-secondary); border: 1.5px solid var(--border); border-radius: 8px; padding: 2px 4px; flex-shrink: 0; }
.cov-step { width: 28px; height: 28px; border-radius: 7px; background: transparent; border: none; font-size: 16px; font-weight: 800; color: var(--accent); display: grid; place-items: center; cursor: pointer; }
.cov-step:active { background: rgba(200,98,64,.15); }
.cov-num { font-size: 14px; font-weight: 900; min-width: 18px; text-align: center; color: var(--text-primary); }
.cov-label { font-size: 12px; color: var(--text-muted); padding-right: 4px; }
#orderView .ottabs { align-self: flex-start; }
#orderView .cust { width: calc(100% - 44px); margin: 4px 22px 0; }
.order-items { flex: 1; overflow-y: auto; padding: 6px 20px 8px; }
#orderView .ckempty { color: var(--text-muted); font-size: 12.5px; padding: 8px 2px; }
#orderView .ckline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
#orderView .ckline .nm { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
#orderView .ckline em { font-style: normal; color: var(--text-muted); }
#orderView .ckline .lp { font-weight: 700; color: var(--accent); }
#orderView .ckline .qt { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
#orderView .ckline .qt button { width: 28px; height: 28px; border-radius: 9px; background: rgba(200,98,64,.12); color: var(--accent); font-weight: 900; font-size: 15px; }
.order-summary { border-top: 1px solid var(--border); padding: 12px 20px; display: flex; flex-direction: column; gap: 4px; }
.order-summary .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.order-summary .row b, .order-summary .row span:last-child { font-weight: 700; color: var(--text-primary); }
.order-summary .row.total { font-size: 17px; font-weight: 900; color: var(--text-primary); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.order-summary .row.total span:last-child { color: var(--accent); font-size: 19px; }
.order-actions { padding: 8px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.btn-primary { width: 100%; padding: 15px; border-radius: 12px; background: var(--green); color: #fff; font-size: 15.5px; font-weight: 800; box-shadow: 0 8px 22px rgba(34,197,94,.3); transition: transform .08s, opacity .15s, box-shadow .2s; }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-primary:not(:disabled):active { transform: scale(.97); }
/* dirty state: unsaved items in the cart */
  .btn-primary.dirty { background: var(--chili, #e23744); box-shadow: 0 8px 22px rgba(226,55,68,.3); }
@keyframes dirtyPulse { 0%, 100% { box-shadow: 0 8px 22px rgba(226,55,68,.3); } 50% { box-shadow: 0 8px 22px rgba(226,55,68,.55); } }
.btn-outline { padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font-size: 13.5px; font-weight: 600; }
.btn-outline.ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); color: var(--green); }
.btn-outline.ok:disabled { opacity: .45; }
.btn-outline:active { background: var(--bg-card-hover); }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn-outline { flex: 1; }
.btn-danger { border-color: rgba(239,68,68,.3); color: var(--red); background: rgba(239,68,68,.08); }
#orderView .railpanel { display: flex; flex-direction: column; gap: 6px; }
#orderView .railpanel select, #orderView .railpanel input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; background: var(--bg-secondary); color: var(--text-primary); }
#orderView .railpanel button { padding: 11px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }
#orderView .railpanel button:disabled { opacity: .45; }
#orderView .pmrow { display: flex; gap: 6px; }
#orderView .pmrow .pm { flex: 1; background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }
#orderView .pmrow .pm.active { background: var(--accent); color: #fff; border-color: transparent; }
#orderView .ex-chip { display: inline-block; font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 999px; margin: 2px 0 6px; }
#orderView .ex-chip.open { color: var(--green); background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); }
#orderView .ex-chip.closed { color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--border); }
#orderView .exlist { max-height: 140px; overflow-y: auto; }
#orderView .exline { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--text-secondary); border-bottom: 1px dashed var(--border); }
#orderView .exsum { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
#orderView .exsum span { display: flex; justify-content: space-between; }
#orderView .exsum b { color: var(--text-primary); font-weight: 600; }

@media (max-width: 1100px) { .order-panel { width: 340px; } }
/* MOBILE: cart becomes a floating drawer.
   Tablet (≥820px) keeps the fixed side panel (rules below are scoped to <820px only). */
.cart-fab {
  position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 85; display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 12px; border: none; border-radius: 999px;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 10px 30px rgba(34,197,94,.45); cursor: pointer;
}
.cart-fab:active { transform: scale(.96); }
.cart-fab b { letter-spacing: .01em; }
.cart-fab span {
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: rgba(255,255,255,.24); font-size: 13px; font-weight: 900;
  display: grid; place-items: center;
}
.cart-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 84; opacity: 0; transition: opacity .25s ease; }
#orderView.cart-open .cart-backdrop { opacity: 1; }
/* close button only exists while the cart is a drawer */
.cart-close {
  display: none; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 900; cursor: pointer; flex-shrink: 0;
}
.cart-close:active { transform: scale(.92); }

/* phone sheet rules live at end of file */

/* ============================================================
   TABLE CONTROLS MODAL — LAYOUT-3 STYLE
   ============================================================ */
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(680px, 100%); max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--bg-card); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); border: 1px solid var(--border); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.mh-title { display: flex; flex-direction: column; gap: 2px; }
.mh-title b { font-size: 19px; color: var(--text-primary); font-family: var(--font-heading); }
.mh-title span { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.modal-x { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border); font-size: 16px; color: var(--text-muted); display: grid; place-items: center; }
.tt-back { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-secondary); border: 1px solid var(--border); font-size: 18px; color: var(--text-primary); display: grid; place-items: center; cursor: pointer; margin-right: 8px; flex-shrink: 0; }
.tt-back:active { transform: scale(.94); }
.tt-dots { display: flex; gap: 8px; margin-right: 12px; }
.tt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); transition: background .2s; }
.tt-dot.active { background: var(--accent); }
.tt-step { flex: 1; overflow-y: auto; }
.tt-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 24px; }
.tt-action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; border-radius: 18px; background: var(--bg-secondary); border: 2px solid var(--border); cursor: pointer; text-align: center; transition: border-color .15s, transform .1s; }
.tt-action:hover { border-color: var(--accent); }
.tt-action:active { transform: scale(.97); }
.tt-action-icon { font-size: 36px; line-height: 1; }
.tt-action-name { font-size: 16px; font-weight: 900; color: var(--text-primary); }
.tt-action-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.tt-config { display: grid; grid-template-columns: minmax(320px, 1fr) 1fr; min-height: 0; overflow: hidden; }
.tt-sect { font-size: 12.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding: 8px 18px 8px; }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 0 18px 6px; max-height: 32vh; max-height: 32dvh; overflow-y: auto; }
.tt-tbl { display: flex; flex-direction: column; gap: 3px; padding: 12px 10px; border-radius: 14px; background: var(--bg-secondary); border: 2px solid var(--border); text-align: center; }
.tt-tbl .tn { font-size: 18px; font-weight: 900; color: var(--text-primary); }
.tt-tbl .ts { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.tt-tbl.free { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.06); }
.tt-tbl.free .ts { color: var(--green); }
.tt-tbl.open { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.06); }
.tt-tbl.open .ts { color: var(--green); }
.tt-tbl.sel { border-color: var(--accent); background: rgba(200,98,64,.1); box-shadow: 0 0 0 3px rgba(200,98,64,.2); }
.tt-tbl:active { transform: scale(.97); }
.tt-items { flex: 1; overflow-y: auto; padding: 2px 18px 10px; display: flex; flex-direction: column; }
.tt-item { display: flex; align-items: center; gap: 10px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.tt-item .ck { width: 26px; height: 26px; accent-color: var(--accent); }
.tt-item .nm { flex: 1; font-size: 14.5px; font-weight: 800; color: var(--text-primary); }
.tt-item .price { color: var(--text-primary); font-weight: 900; min-width: 70px; text-align: right; }
.tt-qty { display: flex; align-items: center; gap: 8px; }
.tt-qty button { width: 38px; height: 38px; border-radius: 11px; background: rgba(200,98,64,.12); color: var(--accent); font-size: 19px; font-weight: 900; }
.tt-qty span { min-width: 26px; text-align: center; font-weight: 900; font-size: 15px; color: var(--text-primary); }
.tt-item.disabled { opacity: .45; }
.tt-empty { color: var(--text-muted); font-size: 13.5px; padding: 14px 6px; }
.tt-pax-wrap { padding: 4px 18px 10px; }
.tt-pax-row { display: flex; align-items: center; gap: 22px; }
.tt-pax-num { font-size: 30px; font-weight: 900; min-width: 44px; text-align: center; color: var(--accent); }
.tt-confirm { padding: 24px; }
.tt-confirm-header { margin-bottom: 16px; }
.tt-confirm-action { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.tt-confirm-card { background: var(--bg-secondary); border-radius: 14px; padding: 16px 18px; border: 1px solid var(--border); }
.tt-confirm-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; color: var(--text-primary); }
.tt-confirm-row + .tt-confirm-row { border-top: 1px solid var(--border); }
.tt-confirm-strong { font-weight: 900; }
.tt-confirm-items { margin-top: 16px; }
.tt-confirm-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; color: var(--text-primary); }
.tt-confirm-line + .tt-confirm-line { border-top: 1px solid var(--border); }
.tt-confirm-subtotal { font-weight: 800; padding-top: 10px; margin-top: 6px; border-top: 1.5px solid var(--border) !important; }
.modal-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg-card); display: flex; gap: 10px; }
.modal-foot .tt-go { flex: 1; }
.modal-foot .tt-go:disabled { opacity: .4; cursor: not-allowed; }

.qa-btn.outline { background: var(--bg-secondary); color: var(--text-primary); border: 1.5px solid var(--border); font-weight: 800; box-shadow: none; }
.qa-btn.wide { width: 100%; }
.qa-btn .ic { font-size: 22px; }
.qa-btn:active { transform: scale(.98); }

.pv-sect { font-size: 12.5px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding: 10px 18px 6px; }
.pv-list { flex: 1; overflow-y: auto; padding: 2px 18px 8px; display: flex; flex-direction: column; max-height: 40vh; }
.pv-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 12px; border-radius: 12px; background: var(--bg-secondary); border: 1.5px solid var(--border); font-size: 14.5px; font-weight: 700; text-align: left; margin-bottom: 8px; color: var(--text-primary); }
.pv-row .ck { font-size: 20px; color: var(--text-muted); min-width: 24px; text-align: center; }
.pv-row .pv-nm { flex: 1; }
.pv-row em { font-style: normal; color: var(--text-muted); font-size: 13px; }
.pv-row .pv-pr { font-weight: 900; color: var(--accent); }
.pv-row.sel { border-color: var(--accent); background: rgba(200,98,64,.1); box-shadow: 0 0 0 3px rgba(200,98,64,.15); }
.pv-row.sel .ck { color: var(--accent); }
.pv-row:active { transform: scale(.98); }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 2px 18px 8px; overflow-y: auto; max-height: 26vh; }
.pv-reason { padding: 13px 10px; border-radius: 12px; background: var(--bg-secondary); border: 1.5px solid var(--border); font-size: 13px; font-weight: 700; text-align: center; color: var(--text-primary); }
.pv-reason.sel { border-color: var(--accent); background: rgba(200,98,64,.1); color: var(--accent); }
.pv-reason:active { transform: scale(.97); }
.pv-empty { color: var(--text-muted); font-size: 13.5px; padding: 18px 6px; text-align: center; }
.tt-go.void { background: var(--red); box-shadow: 0 12px 30px rgba(239,68,68,.35); }

.tt-go { width: 100%; padding: 18px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 900; box-shadow: 0 12px 30px rgba(200,98,64,.35); }
.tt-go:disabled { opacity: .45; box-shadow: none; }
.tt-go:active { transform: scale(.98); }

.existing { padding: 14px 18px 2px; }
.loading { color: var(--text-muted); font-size: 13px; }
.ex-chip { display: inline-block; font-size: 12.5px; font-weight: 800; padding: 7px 12px; border-radius: 999px; margin-bottom: 8px; }
.ex-chip.open { color: var(--green); background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); }
.ex-chip.closed { color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--border); }
.exlist { max-height: 160px; overflow-y: auto; }
.exline { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; font-size: 13.5px; color: var(--text-secondary); border-bottom: 1px dashed var(--border); }
.exline em { font-style: normal; color: var(--text-muted); }
.exline b { font-weight: 700; color: var(--text-primary); }
.exsum { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.exsum span { display: flex; justify-content: space-between; }
.exsum b { color: var(--text-primary); font-weight: 600; }
.exsum .disc b { color: var(--red); }
.exsum .net { border-top: 1px dashed var(--border); margin-top: 5px; padding-top: 7px; font-size: 14px; font-weight: 800; color: var(--text-primary); }
.exsum .net b { color: var(--accent); font-size: 16px; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px; position: sticky; top: 62px; background: var(--bg-primary); z-index: 10; }
.cat { white-space: nowrap; padding: 10px 16px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; color: var(--text-muted); }
.cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; padding: 4px 18px 30px; }
.fc { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-align: left; transition: transform .07s, box-shadow .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); position: relative; }
.fc:hover { box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.fc:active { transform: scale(.98); }
.fc-img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--bg-secondary); overflow: hidden; }
.fc-img img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }
.fc-noimg { position: relative; width: 100%; height: 100%; z-index: 0; display: grid; place-items: center; }
.fc-noimg span {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 999px; padding: 4px 10px;
}
.fc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.fc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fc-name { font-size: 15px; font-weight: 800; line-height: 1.2; color: var(--text-primary); flex: 1; }
.pill { align-self: flex-start; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.pill.veg { color: var(--green); background: rgba(34,197,94,.1); }
.pill.nonveg { color: var(--red); background: rgba(239,68,68,.1); }
.pill.grilled { color: var(--amber); background: rgba(245,158,11,.1); }
.pill.neutral { color: var(--text-muted); background: var(--bg-secondary); }
.fc-desc { font-size: 11px; color: var(--text-muted); }
.fc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-price { color: var(--accent); font-weight: 900; font-size: 16px; }
.fc-add { width: 34px; height: 34px; border-radius: 50%; background: var(--green); border: none; color: #fff; font-weight: 800; font-size: 20px; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(34,197,94,.35); flex-shrink: 0; transition: transform .1s; }
.fc-add:active { transform: scale(.9); }
.fc-step { display: flex; align-items: center; gap: 7px; background: var(--green); border-radius: 24px; padding: 2px 5px; }
.fc-step button { width: 28px; height: 28px; border-radius: 50%; background: transparent; color: #fff; font-size: 17px; font-weight: 800; display: grid; place-items: center; }
.fc-step b { min-width: 16px; text-align: center; font-weight: 900; color: #fff; font-size: 13px; }

/* CART COLUMN */
.cartcol { background: var(--bg-card); border-left: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: sticky; top: 0; }
.cc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.cc-head h2 { font-size: 17px; color: var(--text-primary); }
.ccount { color: var(--text-muted); font-size: 12.5px; font-weight: 600; margin-left: 6px; }
.x { font-size: 18px; color: var(--text-muted); padding: 4px 8px; }
.drawer-tabs { display: flex; gap: 8px; padding: 4px 18px 10px; }
.dtab { flex: 1; padding: 9px; border-radius: 11px; background: var(--bg-secondary); font-weight: 800; color: var(--text-muted); font-size: 13px; }
.dtab.active { background: var(--accent); color: #fff; }
.drawer-body { flex: 1; overflow-y: auto; padding: 2px 18px 8px; }
.cline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ci { flex: 1; min-width: 0; }
.cnm { font-weight: 700; font-size: 13.5px; line-height: 1.25; color: var(--text-primary); }
.ccat { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.cp { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.step { display: flex; align-items: center; gap: 7px; }
.step button { width: 30px; height: 30px; border-radius: 9px; background: rgba(200,98,64,.12); color: var(--accent); font-size: 17px; font-weight: 800; }
.step span { min-width: 20px; text-align: center; font-weight: 800; font-size: 13px; color: var(--text-primary); }
.cl { min-width: 58px; text-align: right; font-weight: 800; color: var(--accent); }
.mini-row { display: flex; gap: 8px; padding: 6px 18px; }
.mini-row select { flex: 1; padding: 9px 10px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border); outline: none; color: var(--text-primary); }
.mini-row button { padding: 9px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: 12.5px; }
.mini-row button:disabled { opacity: .45; }
.payrow input { flex: 1; padding: 10px 12px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--border); font-weight: 700; outline: none; color: var(--text-primary); }
.payrow button { background: var(--green); }
.cc-ftr { padding: 10px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.sumrows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.sumrows .srow { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.sumrows .srow b { color: var(--text-primary); font-weight: 700; }
.sumrows .srow.disc b { color: var(--red); }
.dr-total { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 900; padding: 8px 0 10px; border-top: 1px dashed var(--border); }
.dr-total span:last-child { color: var(--accent); font-size: 20px; }
.pmrow { display: flex; gap: 6px; margin-bottom: 10px; }
.pm { flex: 1; padding: 9px 4px; border-radius: 10px; background: var(--bg-secondary); font-weight: 700; font-size: 11.5px; color: var(--text-muted); border: 1.5px solid var(--border); }
.pm.active { border-color: var(--accent); color: var(--accent); background: rgba(200,98,64,.1); }
.placeorder { width: 100%; padding: 15px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 15.5px; font-weight: 900; box-shadow: 0 10px 24px rgba(200,98,64,.35); }
.placeorder:disabled { opacity: .5; }
.placeorder:active { transform: scale(.98); }

/* mobile / narrow */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 40; }
@media (max-width: 1180px) {
  #app { grid-template-columns: 1fr; }
  .cartcol { position: fixed; right: 0; top: 0; bottom: 0; z-index: 50; width: min(380px, 100vw);
    transform: translateX(105%); transition: transform .22s ease; box-shadow: -20px 0 50px rgba(0,0,0,.3);
    background: var(--bg-card); }
  .cartcol.open { transform: none; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .side { position: fixed; right: 0; top: 0; bottom: 0; z-index: 60; width: 230px; transform: translateX(105%); transition: transform .2s; background: var(--bg-card); }.nav-toggle { display: none; }.side.open { transform: none; }
}
#cartRail { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 45;
  display: flex; align-items: stretch; gap: 10px; padding: 10px 12px;
  background: var(--accent); color: #fff; border-radius: 16px; box-shadow: 0 14px 34px rgba(200,98,64,.45); }
.rail-l { flex: 1; display: flex; flex-direction: column; line-height: 1.15; padding-left: 6px; }
.rail-l b { font-size: 15px; } .rail-l span { font-size: 12.5px; opacity: .92; }
.rail-r { align-self: center; background: #fff; color: var(--accent); font-weight: 900; padding: 11px 16px; border-radius: 12px; font-size: 13.5px; }
#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 99; background: #e5f7ec; color: #157a3b; border: 1px solid #b5e3c6; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(90,60,40,.18); animation: toastIn .25s ease; }
#toast.err { background: #fdeeee; color: #c21616; border-color: #f3c4c7; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.lpchip { position:absolute; transform:translate(-50%,-50%); background:var(--bg-card); border:2px solid var(--border); color:var(--text-secondary); border-radius:10px; padding:6px 10px; font-weight:800; cursor:grab; box-shadow:0 2px 8px rgba(0,0,0,.12); touch-action:none; }
.lpchip.open { border-color:var(--accent); color:var(--accent); background:rgba(200,98,64,.06); }
.lpchip:active { cursor:grabbing; }
.tmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; padding: 14px 22px 44px; align-items: stretch; }
.tcard.sm, .tcard.md, .tcard.lg { width: auto; min-height: 118px; }
.tcard { position: relative; overflow: hidden; }
.tcard .tnum { font-size: 24px; font-weight: 900; color: var(--text-primary); line-height: 1.1; }
.tcard .tcap { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.tcard.free { border-color: var(--border); background: var(--bg-card); }
.tcard.free .tstat { color: var(--text-muted); }
.tcard.open { border-color: rgba(34,197,94,.35); background: linear-gradient(160deg, rgba(34,197,94,.1), rgba(34,197,94,.02) 55%), var(--bg-card); }
.tcard.open .tstat { color: var(--green); }
.tcard.billed { border-color: rgba(245,158,11,.4); background: linear-gradient(160deg, rgba(245,158,11,.12), rgba(245,158,11,.02) 55%), var(--bg-card); }
.tcard.billed .tstat, .tcard.billed .tname { color: var(--amber); }
/* NEW badge + pulse: a QR/second order just landed on this table */
.tcard .tnew { position: absolute; top: 10px; right: 10px; background: var(--green); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(34,197,94,.45); }
.tcard.pulse { animation: tablePulse 1.6s ease-in-out 3; }
  @keyframes tablePulse { 0%,100%{box-shadow:0 1px 2px rgba(0,0,0,.3)} 50%{box-shadow:0 0 0 4px rgba(200,98,64,.25)} }
.tcard .tstat { font-size: 12.5px; font-weight: 800; margin-top: auto; letter-spacing: .02em; display: flex; align-items: center; gap: 6px; }
.tcard .tstat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.tcard .tmeta { font-size: 11px; color: var(--text-muted); }
.tnum { font-size: 20px; font-weight: 900; color: var(--text-primary); }
.tcap { font-size: 11px; color: var(--text-muted); font-weight: 700; }

/* ============================================================
    SKELETON
   ============================================================ */
.skeleton { background: #e9e3db; border-radius: 8px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 33%, rgba(255,255,255,.85) 50%, transparent 67%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton.metric { height: 64px; border-radius: 16px; }
.skeleton.row { height: 40px; border-radius: 8px; }
.skeleton.text { height: 16px; width: 60%; border-radius: 4px; }
.skeleton.badge { height: 28px; width: 72px; border-radius: 999px; }
#sendConfirm { padding: 14px 22px; background: rgba(34,197,94,.1); border: 2px solid rgba(34,197,94,.3); border-radius: 12px; margin: 8px 22px; text-align: center; animation: popIn .3s cubic-bezier(.2,1.4,.4,1); }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* smooth view switches: sections fade/slide in instead of popping */
.pageview:not(.hidden), #orderView:not(.hidden), #tablesView:not(.hidden) { animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#sendConfirm .sc-icon { font-size: 28px; margin-bottom: 4px; }
#sendConfirm .sc-title { font-weight: 700; color: var(--green); }
#sendConfirm .sc-sub { font-size: 12px; color: var(--text-muted); margin: 4px 0 10px; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.confirm-card { width: min(380px, 100%); background: var(--bg-card); border-radius: 20px; padding: 24px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); border: 1px solid var(--border); }
.confirm-card .cc-icon { font-size: 40px; margin-bottom: 8px; }
.confirm-card .cc-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; color: var(--text-primary); }
.confirm-card .cc-msg { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.4; }
.confirm-card .cc-actions { display: flex; gap: 10px; }
.confirm-card .cc-actions button { flex: 1; padding: 12px; border-radius: 12px; font-weight: 800; font-size: 14px; }
.cc-cancel { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary); }
.cc-cancel:active { background: var(--bg-card-hover); }
.cc-confirm { background: var(--accent); color: #fff; border: none; }
.cc-confirm:active { background: var(--accent-hover); }
.cc-confirm.danger { background: var(--red); }
#offlineBanner { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--red); color: #fff; text-align: center; padding: 8px; font-weight: 800; font-size: 13px; display: none; }
#offlineBanner.show { display: block; }

/* ============================================================
   TOUCH TARGETS
   ============================================================ */
.pv-row, .pv-reason, .tt-tbl, .qa-step, .fc, .pk, .tcard { min-height: 44px; }
.pv-row { min-height: 52px; }
.pk { height: 56px; }
.tcard { min-height: 96px; }
.qa-step { min-height: 48px; }
@media (pointer: coarse) {
  .tcard { min-height: 110px; }
  .pk { height: 64px; }
  .pv-row { min-height: 60px; }
}

/* ============================================================
   DESIGN SYSTEM — shared tokens, animations, utilities
   ============================================================ */

/* --- focus visible --- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- skeleton loader --- */
.skeleton { background: #e9e3db; border-radius: 8px; position: relative; overflow: hidden; }
.skeleton.text { height: 14px; width: 60%; border-radius: 4px; }
.skeleton.title { height: 20px; width: 40%; border-radius: 6px; }
.skeleton.block { height: 80px; border-radius: 12px; }
.skeleton.card { height: 180px; border-radius: 16px; }
.skeleton.row { height: 48px; border-radius: 10px; }
.skeleton.badge { height: 28px; width: 80px; border-radius: 999px; }

/* --- empty state --- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: .6; }
.empty-state .empty-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-state .empty-desc { font-size: 14px; color: var(--text-muted); max-width: 320px; margin: 0 auto; line-height: 1.5; }
.empty-state .empty-action { margin-top: 20px; }

/* --- toast notification --- */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #e5f7ec; color: #157a3b; border: 1px solid #b5e3c6; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: 0 10px 30px rgba(90,60,40,.18); animation: toastIn .25s ease-out; max-width: 340px; font-size: 13px; }
.toast.err { background: #fdeeee; color: #c21616; border-color: #f3c4c7; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* --- animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.anim-fade-in { animation: fadeIn var(--anim-med) ease-out both; }
.anim-fade-up { animation: fadeInUp var(--anim-med) ease-out both; }
.anim-scale-in { animation: scaleIn var(--anim-med) var(--ease-out) both; }
/* menu grid: one-time staggered entrance on initial load only */
#items.anim-stagger > .fc { animation: fadeInUp var(--anim-med) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
#items.anim-stagger > .fc:nth-child(n + 12) { animation-delay: 420ms; }
@keyframes popIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
/* floating cart badge spring pop */
#cartFabCount.pop { animation: popIn .3s var(--ease-spring); }

/* --- scrollbar polish --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5cec5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c2b9ae; }

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .tcard.pulse, .btn-primary.dirty { animation: none !important; }
}
/* ---- web bill printer settings ---- */

/* ============================================================
   TABLE OPERATIONS MODAL — wizard redesign (split / move / merge)
   ============================================================ */
#tblModal .modal-card { width: min(1120px, calc(100vw - 24px)); border-radius: 24px; }
#tblModal .modal-head { padding: 18px 22px 12px; display: flex; align-items: center; gap: 12px; }
#tblModal .tt-dots { display: none; }
#tblModal .tt-actions { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
#tblModal .tt-action { grid-template-columns: 52px 1fr auto; text-align: left; min-height: 82px; }
#tblModal .tt-action::after { content: "›"; color: var(--text-muted); font-size: 26px; font-weight: 700; }
#tblModal .mh-title { flex: 1; }
#tblModal .mh-title b { font-size: 21px; }
#tblModal .mh-title span { font-size: 14px; }
#tblModal .tt-config { flex: 1; min-height: 0; overflow: hidden; border-top: 1px solid var(--border); }
#tblModal .tt-col { display: flex; flex-direction: column; min-height: 0; padding: 10px 22px 18px; }
#tblModal .tt-col-a { border-right: 1px solid var(--border); }
#tblModal .tt-sect { padding: 12px 2px 10px; font-size: 12.5px; letter-spacing: .08em; }
#tblModal .tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; padding: 0; flex: 1; min-height: 130px; max-height: none; overflow-y: auto; align-content: start; }
#tblModal .tt-tbl { gap: 4px; padding: 16px 12px; border-radius: 16px; }
#tblModal .tt-tbl .tn { font-size: 21px; }
#tblModal .tt-tbl .ts { font-size: 12px; }
#tblModal .tt-items { flex: 1; padding: 0; overflow-y: auto; }
#tblModal .tt-item { padding: 14px 8px; gap: 12px; }
#tblModal .tt-item .nm { font-size: 15px; }
#tblModal .tt-item .ck { width: 22px; height: 22px; }
#tblModal .tt-qty button { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
#tblModal .tt-qty span { font-size: 17px; min-width: 30px; }
#tblModal .tt-item .price { font-size: 15px; }
#tblModal .modal-foot { padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); gap: 12px; }
#tblModal .modal-foot .tt-go { flex: 1 1 0; padding: 17px; border-radius: 14px; font-size: 16px; }

@media (max-width: 920px) {
  #tblModal .tt-config { grid-template-columns: 1fr; overflow-y: auto; }
  #tblModal .tt-col-a { border-right: none; border-bottom: 1px solid var(--border); }
  #tblModal .tt-grid { max-height: 250px; }
  #tblModal .tt-items { max-height: 300px; }
  #tblModal .tt-actions { grid-template-columns: 1fr; }
}

/* ============================================================
   SETTINGS — WEB BILL PRINTER
   ============================================================ */
.pp-toggle {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 4px 14px; user-select: none;
}
.pp-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pp-switch {
  width: 46px; height: 26px; border-radius: 999px; flex-shrink: 0;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  position: relative; transition: all .18s;
}
.pp-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: all .18s;
}
.pp-toggle.on .pp-switch { background: var(--accent); border-color: var(--accent); }
.pp-toggle.on .pp-switch::after { left: 22px; }
.pp-toggle b { font-size: 14.5px; color: var(--text-primary); }
.pp-toggle em { display: block; font-style: normal; font-size: 12px; color: var(--text-muted); }
.pp-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pp-mode {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 12px; cursor: pointer;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
}
.pp-mode.on { border-color: var(--accent); color: var(--accent); background: rgba(200,98,64,.08); }
.pp-mode input { position: absolute; opacity: 0; }
.pp-fields input[type="text"], .pp-fields input[type="number"], .pp-fields select {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-primary); outline: none; font-size: 13.5px;
  max-width: 260px; width: 100%;
}
.pp-fields input:focus, .pp-fields select:focus { border-color: var(--accent); }
.pp-blocks { border-top: 1px dashed var(--border); padding-top: 12px; }

/* ============================================================
   ANDROID / SMALL-SCREEN POLISH
   ============================================================ */
.tcard { overflow: visible; }
.tb-title2 { min-width: 0; flex: 1 1 auto; }
.tb-title2 b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title2 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ckline .nm, #orderView .ckline .nm, .tt-item .nm, .pn, .tnm { word-break: break-word; }
.setrow { gap: 12px; }
.setrow b { max-width: 55%; text-align: right; word-break: break-word; }
.exsum span { flex-wrap: wrap; gap: 0 8px; }
.qt { flex-shrink: 0; }
.order-actions .btn-row { flex-wrap: wrap; }
.qty-ctl { flex-shrink: 0; }

@media (max-width: 560px) {
  .tb-logo { display: none; }
  .topbar2 { padding: 10px 12px; gap: 8px; }
  .logout-top span { display: none; }
  .logout-top { padding: 10px 13px; }
  .iconbtn { width: 38px; height: 38px; }
  .toolbar { padding: 12px 12px 4px; gap: 8px; }
  .toolbar input[type="search"] { max-width: none; }
  .fchip { padding: 8px 12px; font-size: 12px; }
  .legend { display: none; }
  .halltabs { padding: 10px 12px 0; }
  .tmap { padding: 10px 12px 24px; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); }
  .pageview { padding: 12px 12px 24px; }
  .product-grid-scroll { padding: 10px 12px 20px; }
  .product-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .fc-name { font-size: 13px; }
  .category-bar { padding: 10px 12px 4px; }
  .menu-top { padding: 8px 12px; gap: 8px; }
  .menu-back { width: 34px; height: 34px; }
  .order-items { padding: 6px 14px 10px; }
  .order-summary { padding: 10px 14px; }
  .order-actions { padding: 6px 14px calc(14px + env(safe-area-inset-bottom)); }
  .order-header { padding: 12px 14px 8px; }
}

/* ============================================================
   CART VIEW — compact bottom controls, more items visible
   ============================================================ */
#orderView .order-header { padding: 12px 22px 8px; }
#orderView .order-items { flex: 1; min-height: 0; padding: 6px 20px 10px; }
#orderView .ckline { padding: 8px 0; }
#orderView .ckempty { padding: 6px 2px; }
#orderView .order-summary { padding: 6px 22px 2px; gap: 2px; }
#orderView .order-summary .row { font-size: 13px; }
#orderView .order-summary .row.total { font-size: 17px; padding-top: 7px; margin-top: 2px; }
#orderView .order-actions { padding: 4px 22px calc(10px + env(safe-area-inset-bottom)); gap: 6px; }
#orderView .btn-primary { padding: 11px 14px; font-size: 15px; border-radius: 10px; }
#orderView .btn-row { gap: 6px; }
#orderView .btn-row .btn-outline { padding: 10px 12px; font-size: 13px; border-radius: 10px; }
#orderView .btn-outline.btn-danger { padding: 9px 12px; font-size: 12.5px; }
#orderView .table-badge { padding: 5px 12px; font-size: 13px; }

/* ============================================================
   CART VIEW — unified list, color-coded left borders
   ============================================================ */
#orderItems .ckline {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px 10px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
#orderItems .ckline:last-child { border-bottom: none; }
#orderItems .ckline .nm { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
#orderItems .ckline .lp { font-weight: 700; color: var(--text-primary); min-width: 60px; text-align: right; }
/* existing items — green left border, muted */
#orderItems .ck-existing {
  border-left: 3px solid var(--green);
  background: rgba(34,197,94,.03);
}
#orderItems .ck-existing .nm { color: var(--text-secondary); font-weight: 500; }
#orderItems .ck-existing .xq { font-size: 13px; font-weight: 800; color: var(--text-muted); min-width: 30px; text-align: center; }
#orderItems .ck-existing .lp { color: var(--text-muted); font-weight: 600; }
/* new items — orange left border */
#orderItems .ck-new {
  border-left: 3px solid var(--accent);
  background: rgba(200,98,64,.04);
}
#orderItems .ck-new .nm { font-weight: 700; }
#orderItems .ck-new .lp { color: var(--accent); font-weight: 800; }
/* divider between existing and new */
.ck-divider {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; margin-top: 4px;
}
.ck-divider::before, .ck-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.ck-divider span {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); flex-shrink: 0;
}
.ckempty { color: var(--text-muted); font-size: 13px; padding: 16px 4px; font-style: italic; }
/* existing check summary card */
#existingBox { padding-bottom: 4px; }
#existingBox + #orderItems { border-top: 1px solid var(--border); }

/* ============================================================
   MENU EXPLORE — groups (level 1) + sub-group pills (level 2)
   follows the customer layout-3 navigation pattern
   ============================================================ */
#orderView .category-bar .cat { display: inline-flex; align-items: center; gap: 8px; }
#orderView .cat .cat-n {
  font-size: 10.5px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); color: var(--text-muted);
}
#orderView .cat.active .cat-n { background: rgba(255,255,255,.28); color: #fff; }

.fu-subs {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 22px 2px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.fu-subs::-webkit-scrollbar { display: none; }
.fu-sub-pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 15px; border-radius: 999px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--text-secondary); font-weight: 700; font-size: 13px;
  transition: all .15s;
}
.fu-sub-pill:active { transform: scale(.96); }
.fu-sub-pill span {
  font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px;
  background: var(--bg-secondary); color: var(--text-muted);
}
.fu-sub-pill.active {
  background: rgba(200,98,64,.1); border-color: var(--accent); color: var(--accent);
}
.fu-sub-pill.active span { background: var(--accent); color: #fff; }

@media (max-width: 560px) {
  .fu-subs { padding: 8px 12px 2px; gap: 6px; }
  .fu-sub-pill { padding: 8px 12px; font-size: 12.5px; }
}

/* ============================================================
    CART ITEMS — clean, minimal, text-only rows
    columns: name | qty control | price(right)
    ============================================================ */
#orderItems .ckline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 64px;
  align-items: center;
  column-gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
#orderItems .ckline:last-child { border-bottom: none; }
#orderItems .ckline .nm {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  line-height: 1.3; min-width: 0; word-break: break-word;
}
#orderItems .ckline .lp { text-align: right; font-size: 13.5px; font-weight: 800; white-space: nowrap; }
/* qty stepper, centered in its own column */
#orderItems .ck-mid {
  display: inline-flex; align-items: center; gap: 2px; justify-content: center;
}
#orderItems .ck-mid button {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 15px; font-weight: 800;
  display: grid; place-items: center;
}
#orderItems .ck-mid button:active { transform: scale(.92); background: var(--bg-card-hover); }
#orderItems .ck-mid .qnum { min-width: 22px; text-align: center; font-size: 13.5px; font-weight: 800; color: var(--text-primary); }
#orderItems .ck-mid.xq { font-size: 13.5px; font-weight: 800; color: var(--text-muted); }
/* new items */
#orderItems .ck-new { }
#orderItems .ck-new .nm { font-weight: 700; }
#orderItems .ck-new .lp { color: var(--accent); }
/* existing items */
#orderItems .ck-existing .nm { color: var(--text-secondary); font-weight: 500; }
#orderItems .ck-existing .xq { justify-self: end; font-size: 13px; font-weight: 700; color: var(--text-muted); text-align: right; }
#orderItems .ck-existing .lp { color: var(--text-muted); font-weight: 700; }
/* divider */
.ck-divider {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 4px; margin-top: 4px;
}
.ck-divider::before, .ck-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.ck-divider span {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); flex-shrink: 0;
}
.ckempty { color: var(--text-muted); font-size: 13px; padding: 18px 4px; font-style: italic; }

/* ============================================================
   ORDER NOTE, KITCHEN STATUS, MODIFIER PICKER
   ============================================================ */
/* note bar under the header */
.note-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px 2px;
}
.note-bar input {
  flex: 1; min-width: 0; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 13px; outline: none;
}
.note-bar input:focus { border-color: var(--accent); }
.note-bar button {
  flex-shrink: 0; padding: 9px 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 12.5px;
}
.note-bar button:disabled { opacity: .45; }
.note-bar button:active { transform: scale(.95); }

/* header meta: open time + kitchen state */
.ck-line-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 18px; flex-wrap: wrap; }
.ck-open { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.ck-open.long { color: var(--amber); }
.kds-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 900; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px;
}
.kds-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kds-chip.k-sent { color: var(--amber); background: rgba(217,119,6,.12); }
.kds-chip.k-cook { color: var(--accent); background: rgba(200,98,64,.14); }
.kds-chip.k-cook::before { animation: kpulse 1s ease-in-out infinite; }
.kds-chip.k-done { color: var(--green); background: rgba(23,163,74,.12); }
.kds-chip.k-other { color: var(--text-muted); background: var(--bg-secondary); }
@keyframes kpulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
.kds-row {
  display: inline-block; font-style: normal;
  font-size: 9.5px; font-weight: 900; letter-spacing: .04em;
  padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}
.kds-row.k-sent { color: var(--amber); background: rgba(217,119,6,.1); }
.kds-row.k-cook { color: var(--accent); background: rgba(200,98,64,.12); }
.kds-row.k-done { color: var(--green); background: rgba(23,163,74,.1); }
.kds-row.k-other { color: var(--text-muted); background: var(--bg-secondary); }

/* mods summary under a new item name */
#orderItems .ck-mods {
  display: block; width: 100%; text-align: left; margin-top: 3px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: rgba(200,98,64,.08); border: 1px dashed rgba(200,98,64,.35);
  border-radius: 8px; padding: 3px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* modifier picker modal */
.mod-card { width: min(620px, calc(100vw - 24px)); border-radius: 22px; }
.mod-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 14px; }
.mod-group { margin: 6px 0 16px; }
.mod-g-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.mod-g-title span { font-size: 11px; color: var(--text-muted); opacity: .8; font-weight: 700; text-transform: none; letter-spacing: 0; }
.mod-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mod-opt {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  font-weight: 700; font-size: 14px; color: var(--text-primary);
  transition: all .12s;
}
.mod-opt:active { transform: scale(.97); }
.mod-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mod-opt::before {
  content: ""; width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--bg-card);
}
.mod-opt.on { border-color: var(--accent); background: rgba(200,98,64,.08); }
.mod-opt.on::before { background: var(--accent); border-color: var(--accent); }
.mod-opt.on::after {
  content: "✓"; position: absolute; left: 17px; top: 9px; color: #fff;
  font-size: 11px; font-weight: 900; pointer-events: none;
}

/* ============================================================
   CUSTOMIZE CHIP ON DISH CARDS
   modifier picker is opt-in: + always adds instantly, the chip
   opens the picker. Shown only for dishes known to have options.
   ============================================================ */
.fc-mods-row { margin-top: 2px; }
.fc-mods {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; padding: 5px 10px; border-radius: 999px;
  background: rgba(200,98,64,.08); border: 1px dashed rgba(200,98,64,.4);
  color: var(--accent); font-size: 11.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .12s, transform .1s;
}
.fc-mods:active { transform: scale(.96); background: rgba(200,98,64,.14); }
.fc-mods::before { content: "⚙"; font-style: normal; flex-shrink: 0; }
.fc-mods:active::before { transform: rotate(20deg); }


/* POS look — Admin → Mobile Order (single split layout) */
html[data-pos-theme="warm"] {
  --bg-primary: #f7efe3; --bg-secondary: #efe4d4; --bg-card: #fff8ee;
  --text-primary: #2a1c12; --text-secondary: #6a5340; --text-muted: #8a7360;
  --border: #e4d4c0; --card: #fff8ee;
}
html[data-pos-theme="dark"] {
  --bg-primary: #161310; --bg-secondary: #221c18; --bg-card: #1e1915;
  --text-primary: #f4ece3; --text-secondary: #cbbba8; --text-muted: #8a7b6c;
  --border: #3a322b; --card: #1e1915;
}
html[data-pos-font="classic"] {
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: Georgia, "Times New Roman", serif;
}
html[data-pos-font="rounded"] {
  --font-heading: Nunito, "Segoe UI Rounded", system-ui, sans-serif;
  --font-body: Nunito, "Segoe UI Rounded", system-ui, sans-serif;
}
html[data-pos-font="mono"] {
  --font-heading: ui-monospace, Consolas, "Courier New", monospace;
  --font-body: ui-monospace, Consolas, "Courier New", monospace;
}
html[data-pos-font="classic"] body,
html[data-pos-font="rounded"] body,
html[data-pos-font="mono"] body { font-family: var(--font-body); }

/* Phone: same layout, check becomes a bottom sheet automatically */
@media (max-width: 820px) {
  #orderView { flex-direction: column; }
  .menu-panel { flex: 1 1 100%; min-height: 0; }
  .order-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: min(72vh, 580px);
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22,.8,.2,1);
    border-left: none; border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    z-index: 90;
  }
  #orderView.cart-open .order-panel { transform: translateY(0); box-shadow: 0 -16px 40px rgba(0,0,0,.35); }
  .cart-close { display: inline-grid; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .product-grid-scroll { padding-bottom: 96px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fc-add { width: 40px; height: 40px; font-size: 22px; }
  .category-bar { padding: 10px 12px 4px; }
  .menu-top { padding: 8px 10px; }
}

html[data-pos-theme="blue"] {
  --bg-primary: #eaf0fb; --bg-secondary: #dce6f6; --bg-card: #ffffff;
  --text-primary: #1a2744; --text-secondary: #4a5a78; --text-muted: #7a879c;
  --border: #c9d6ea; --card: #ffffff;
  --accent: #3b6fd9; --chili: #3b6fd9; --green: #3b6fd9;
}

/* floor map v2 */
#tablesView { padding: 0 0 24px; }
.floor { margin: 10px 16px 0; background: color-mix(in srgb, var(--bg-card) 88%, transparent); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 10px 40px rgba(20,16,12,.06); }
.floor .toolbar { padding: 14px 16px 4px; }
.halltabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 4px; }
.htab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); font-weight: 800; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.htab em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 7px; border-radius: 999px; }
.htab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.htab.active em { background: rgba(255,255,255,.22); color: #fff; }
.tmap { display: grid; grid-template-columns: repeat(auto-fill, 128px);
  grid-auto-rows: 96px;
  justify-content: start; gap: 12px; padding: 12px 16px 22px; }
.tcard { min-height: 118px; border-radius: 18px; padding: 14px 14px 12px; box-shadow: 0 8px 18px rgba(24,18,14,.05); }
.tcard .tnum { font-size: 20px; letter-spacing: .02em; }
.tcard .tstat { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; }

/* live dining floor */
#tablesView { padding: 0; min-height: 0; flex: 1; display: flex; }
.room { display: grid; grid-template-columns: 210px 1fr; gap: 0; flex: 1; min-height: calc(100dvh - 72px); }
.room-side { padding: 16px 14px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 70%, #1a1612 8%); display: flex; flex-direction: column; gap: 12px; }
.occ { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.occ-n { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.occ-n b { display: block; font-size: 22px; color: #22c55e; letter-spacing: 0; text-transform: none; }
.occ-n.bill b { color: #f59e0b; }
.occ-n.free b { color: var(--text-muted); }
.occ-sum { grid-column: 1 / -1; font-size: 18px; font-weight: 900; padding: 8px 4px; }
.halltabs { display: flex; flex-direction: column; gap: 8px; overflow: auto; padding: 0; }
.htab { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; box-sizing: border-box; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); text-align: left; }
.htab b { font-size: 13px; }
.htab span { font-size: 11px; font-weight: 800; color: var(--text-muted); min-width: 44px; text-align: right; flex: none; }
.htab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.htab.active span { color: #fff; }
.view-tog { margin-top: auto; padding: 12px; border-radius: 14px; border: 1px dashed var(--border); font-weight: 800; }
.room-main { display: flex; flex-direction: column; min-width: 0; }
.room-main .toolbar { padding: 12px 16px 0; }
.stage.floor {
  display: grid;
  grid-template-columns: repeat(auto-fill, 128px);
  grid-auto-rows: 96px;
  gap: 10px;
  justify-content: start;
  align-content: start;
  flex: 1;
  margin: 12px 16px 16px;
  padding: 12px;
  min-height: 0;
  border-radius: 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.stage.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 12px 16px 24px; }
.plate { position: relative; width: 128px; height: 96px; min-width: 128px; min-height: 96px; max-width: 128px; border-radius: 16px; border: 0; background: transparent; padding: 0; flex: none; }
.plate-core { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; width: 128px; height: 96px; min-height: 96px; box-sizing: border-box; padding: 12px; border-radius: 16px; background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,.06); text-align: left; }
.plate.open .plate-core { border-color: #22c55e; background: #ecfdf3; }
.plate.billed .plate-core { border-color: #f59e0b; background: #fff7ed; }
.plate-core b { font-size: 15px; font-weight: 900; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-core em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.plate.hit .plate-core { outline: 3px solid var(--accent); }
.seat { display: none; }
.trow { display: flex; justify-content: space-between; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); font-weight: 800; }
.trow.open { border-color: #22c55e; }
.trow.billed { border-color: #f59e0b; }
@media (max-width: 900px) {
  .room { grid-template-columns: 1fr; min-height: 0; }
  .room-side { flex-direction: row; flex-wrap: wrap; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; gap: 8px; }
  .occ { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .occ-n { padding: 8px; }
  .occ-n b { font-size: 16px; }
  .occ-sum { grid-column: auto; font-size: 14px; padding: 8px; display: flex; align-items: center; }
  .halltabs { flex-direction: row; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .htab { width: auto; flex: 0 0 auto; padding: 10px 12px; }
  .view-tog { margin-top: 0; padding: 10px 12px; }
  .room-main .toolbar { padding: 10px 12px 0; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input[type="search"] { max-width: none; width: 100%; }
  .stage.floor { margin: 10px 12px 16px; padding: 10px; grid-template-columns: repeat(auto-fill, 128px); grid-auto-rows: 96px; gap: 8px; }
  .plate, .plate-core { width: 128px; height: 96px; min-width: 128px; min-height: 96px; max-width: 128px; }
  .plate-core { padding: 10px; }
  .plate-core b { font-size: 13px; }
}
@media (max-width: 480px) {
  .occ { grid-template-columns: repeat(2, 1fr); }
  .stage.floor { grid-template-columns: repeat(auto-fill, 128px); }
  .stage.list { grid-template-columns: 1fr; padding: 10px 12px 20px; }
}

/* side v3 */
.room-side .halltabs { order: 0; }
.room-side .fchips { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; background: transparent; border: 0; padding: 0; border-radius: 0; width: 100%; }
.room-side .fchip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; min-height: 58px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.room-side .fchip b { font-size: 15px; font-weight: 900; letter-spacing: 0; text-transform: none; color: var(--text-primary); }
.room-side .fchip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.room-side .fchip.active b { color: #fff; }
@media (max-width: 900px) {
  .room-side .fchips { width: 100%; }
}

/* service board */
#tablesView { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; }
.board { display: flex; flex-direction: column; flex: 1; min-height: calc(100dvh - 72px); }
.board-halls.halltabs { display: flex; flex-direction: row; gap: 8px; padding: 12px 16px 8px; overflow-x: auto; }
.board-halls .htab { width: auto; min-width: 140px; border-radius: 16px; }
.board-lanes { display: grid; grid-template-columns: 1.15fr .95fr .95fr; gap: 12px; flex: 1; min-height: 0; padding: 0 16px 16px; }
.lane { display: flex; flex-direction: column; min-height: 0; border-radius: 20px; border: 1px solid var(--border); background: color-mix(in srgb, var(--bg-card) 80%, transparent); overflow: hidden; }
.lane header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--text-muted); }
.lane header b { font-size: 16px; letter-spacing: 0; color: var(--text-primary); }
.lane.free header { background: rgba(100,100,100,.08); }
.lane.open header { background: rgba(34,197,94,.12); color: #15803d; }
.lane.billed header { background: rgba(245,158,11,.14); color: #b45309; }
.lane-body { display: grid; grid-template-columns: repeat(auto-fill, 88px); grid-auto-rows: 72px; gap: 8px; align-content: start; justify-content: start; padding: 12px; overflow: auto; flex: 1; }
.lane-empty { grid-column: 1 / -1; margin: 18px 4px; color: var(--text-muted); font-weight: 700; }
.ticket { position: relative; width: 88px; height: 72px; min-width: 88px; min-height: 72px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-card); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 8px 10px; text-align: left; }
.ticket b { font-size: 14px; font-weight: 900; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--text-muted); }
.ticket i { font-style: normal; position: absolute; top: 6px; right: 8px; font-size: 10px; font-weight: 800; color: var(--text-muted); }
.ticket.free { background: #f4f1ec; }
.ticket.open { background: #ecfdf3; border-color: #86efac; }
.ticket.billed { background: #fff7ed; border-color: #fdba74; }
@media (max-width: 900px) {
  .board-lanes { grid-template-columns: 1fr; padding: 0 10px 12px; }
  .lane { min-height: 180px; }
  .lane-body { grid-template-columns: repeat(auto-fill, 88px); }
  .board-halls .htab { min-width: 120px; }
}

/* restore original table map */
#tablesView { display: block; flex: unset; min-height: 0; padding: 0; }
#tablesView .toolbar { display: flex; }
#tablesView .halltabs { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; padding: 12px 18px 0; }
#tablesView .halltabs .cat { white-space: nowrap; padding: 10px 16px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; color: var(--text-muted); width: auto; }
#tablesView .halltabs .cat.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#tablesView .tmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; padding: 14px 22px 44px; }
#tablesView .tcard { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; width: auto; height: auto; min-width: 0; max-width: none; min-height: 106px; border-radius: 16px; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); }
@media (max-width: 900px) {
  #tablesView .tmap { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); padding: 10px 12px 24px; }
}

#tablesView .tcard.open { background: #dcfce7 !important; border-color: #22c55e !important; }
#tablesView .tcard.open .tnum, #tablesView .tcard.open .tstat { color: #15803d !important; }
#tablesView .tcard.billed { background: #ffedd5 !important; border-color: #f59e0b !important; }
#tablesView .tcard.billed .tnum, #tablesView .tcard.billed .tstat { color: #c2410c !important; }

.ops-fab {
  position: fixed; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 85; display: none; align-items: center; padding: 12px 18px;
  border: none; border-radius: 999px; background: var(--bg-card); color: var(--text-primary);
  font-size: 14px; font-weight: 800; border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,.18); cursor: pointer;
}
.ops-sheet { display: none; }
@media (max-width: 820px) {
  .ops-fab { display: inline-flex; }
  .ops-fab.hidden { display: none !important; }
  .order-panel .btn-row { display: none; }
  .ops-sheet {
    display: flex; flex-direction: column; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
    background: var(--bg-card); border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(110%); transition: transform .28s cubic-bezier(.22,.8,.2,1);
  }
  .ops-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
  .ops-head .cart-close { display: inline-grid; }
  .ops-btns { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .ops-btns .btn-outline { width: 100%; min-height: 48px; }
  #orderView.ops-open .ops-sheet { transform: translateY(0); }
  #orderView.ops-open .cart-backdrop { opacity: 1; }
}
