/* Munch Hub POS — brand: orange #E8891C, black #141414, red #B5121B, menu yellow #FFD84D */
:root {
  --orange: #E8891C; --orange-d: #C86F0C; --red: #B5121B; --black: #141414; --yellow: #FFD84D; --yellow-l: #FFF3C4;
  --bg: #FFF8E9; --panel: #FFFFFF; --ink: #1d1a16; --muted: #7a6f62; --line: #eadfca; --ok: #1E8E3E; --warn: #D97706; --bad: #C0392B;
  --shadow: 0 2px 10px rgba(60, 40, 10, .08); --r: 12px;
  font-family: "Segoe UI", "Poppins", system-ui, -apple-system, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 14px; overflow: hidden; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.muted { color: var(--muted); }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.col { display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #f1e8d6; color: #6b5a3f; }
.pill.ok { background: #dff3e4; color: var(--ok); } .pill.bad { background: #fbe3e0; color: var(--bad); } .pill.warn { background: #fdf0d5; color: var(--warn); } .pill.or { background: #ffe8cc; color: var(--orange-d); }

/* ---------- buttons / fields ---------- */
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; background: #efe6d4; color: var(--ink); transition: transform .05s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); } .btn:active { transform: scale(.98); }
.btn.primary { background: var(--orange); color: #fff; } .btn.dark { background: var(--black); color: #fff; }
.btn.danger { background: var(--red); color: #fff; } .btn.ok { background: var(--ok); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; } .btn.lg { padding: 16px 22px; font-size: 18px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fld input, .fld select, .fld textarea, input.inp, select.inp { border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; outline: none; }
.fld input:focus, .fld select:focus, .fld textarea:focus, input.inp:focus { border-color: var(--orange); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chk { display: flex; gap: 8px; align-items: center; font-weight: 600; }

/* ---------- top bar ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; background: var(--black); color: #fff; padding: 0 14px; height: 58px; flex-shrink: 0; border-bottom: 4px solid var(--orange); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 46px; width: 46px; object-fit: cover; border-radius: 50%; background: #fff; }
.brand b { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 26px; color: var(--orange); letter-spacing: .5px; text-shadow: 1px 1px 0 #000; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav button i { font-style: normal; margin-right: 5px; }
.topbar .status > * { white-space: nowrap; }
.nav button { white-space: nowrap; background: transparent; color: #d9cfbf; border: 0; padding: 9px 14px; border-radius: 9px; font-weight: 700; }
.nav button.active { background: var(--orange); color: #fff; } .nav button:hover:not(.active) { background: #2a2622; }
.topbar .status { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #777; margin-right: 5px; }
.dot.on { background: #34d058; } .dot.off { background: #e0533f; } .dot.idle { background: #c9a74a; }
.topbar .user { background: #2a2622; padding: 6px 12px; border-radius: 9px; font-weight: 600; }
.clock { font-variant-numeric: tabular-nums; color: var(--yellow); font-weight: 700; }
main { flex: 1; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; overflow: auto; padding: 16px; }
.view.pos { padding: 0; overflow: hidden; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #ffe48a 0, var(--yellow) 35%, #f5b82e 100%); }
.login .card { background: #fff; border-radius: 22px; padding: 28px 34px; box-shadow: 0 20px 60px rgba(80, 40, 0, .25); width: 380px; text-align: center; }
.login img { width: 190px; margin: -10px auto 0; display: block; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 16px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--orange); display: inline-block; }
.pin-dots i.f { background: var(--orange); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; font-size: 22px; font-weight: 700; border: 0; border-radius: 14px; background: #fff4dc; color: var(--ink); }
.keypad button:active { background: var(--orange); color: #fff; }
.login .err { color: var(--bad); min-height: 20px; font-weight: 600; }
.login .hint { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---------- POS ---------- */
.pos-wrap { display: grid; grid-template-columns: 170px 1fr 400px; height: 100%; }
.cats { background: #201c18; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cats button { border: 0; border-radius: 11px; padding: 12px 10px; text-align: left; font-weight: 700; color: #fff; background: #332d27; display: flex; gap: 8px; align-items: center; font-size: 14px; border-left: 6px solid var(--c, var(--orange)); }
.cats button.active { background: var(--c, var(--orange)); }
.cats button .ic { font-size: 20px; }
.items-pane { display: flex; flex-direction: column; overflow: hidden; background: var(--yellow-l); }
.items-head { display: flex; gap: 10px; padding: 10px 12px; align-items: center; background: var(--yellow); }
.items-head input { flex: 1; border: 0; border-radius: 10px; padding: 11px 14px; font-size: 15px; }
.items-grid { flex: 1; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.item-card { position: relative; background: #fff; border: 0; border-radius: 14px; padding: 12px 12px 10px; text-align: left; box-shadow: var(--shadow); border-top: 5px solid var(--c, var(--orange)); min-height: 96px; display: flex; flex-direction: column; gap: 4px; }
.item-card:active { transform: scale(.97); }
.item-card .nm { font-weight: 800; font-size: 14.5px; line-height: 1.2; }
.item-card .ds { font-size: 11.5px; color: var(--muted); line-height: 1.25; max-height: 30px; overflow: hidden; }
.item-card .pr { margin-top: auto; font-weight: 800; color: var(--red); font-size: 15px; }
.item-card .vb { position: absolute; top: 8px; right: 8px; font-size: 10px; background: var(--yellow); padding: 1px 6px; border-radius: 6px; font-weight: 800; }
.item-card .vb + .nm { padding-right: 54px; } /* keep the long names clear of the "3 sizes" badge */
.item-card.deal { background: linear-gradient(160deg, #fff 60%, #ffe9c6); }

.cart { display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line); overflow: hidden; }
.cart-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; background: #f3ead8; border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 8px; font-weight: 700; color: #6b5a3f; }
.seg button.active { background: var(--black); color: #fff; }
.cust { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .cust input { border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.cust input.full { grid-column: 1 / 3; }
.lines { flex: 1; overflow-y: auto; padding: 6px 10px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.line .ln { font-weight: 700; } .line .lv { color: var(--orange-d); font-weight: 700; font-size: 12px; }
.line .la { font-size: 12px; color: var(--muted); grid-column: 1 / 3; }
.line .lt { font-weight: 800; text-align: right; }
.line .qty { display: flex; align-items: center; gap: 6px; grid-column: 1 / 3; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f3ead8; font-weight: 800; font-size: 16px; }
.qty b { min-width: 22px; text-align: center; }
.qty .lnk { width: auto; background: none; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.empty .big { font-size: 46px; }
.totals { padding: 10px 14px; border-top: 2px solid var(--line); background: #fffaf0; }
.totals .tr { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-size: 24px; font-weight: 900; color: var(--black); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px 10px 0; }
.paybar { padding: 10px; }
.paybar .btn { width: 100%; font-size: 20px; padding: 16px; background: var(--red); color: #fff; border-radius: 14px; }
.token-badge { background: var(--black); color: var(--yellow); padding: 3px 10px; border-radius: 8px; font-weight: 800; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20, 14, 6, .55); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 18px; width: 520px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal.wide { width: 900px; } .modal.xwide { width: 1100px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; font-size: 18px; } .modal-head .x { border: 0; background: #f3ead8; width: 32px; height: 32px; border-radius: 9px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; text-align: left; font-weight: 700; }
.opt.sel { border-color: var(--orange); background: #fff1de; }
.opt small { display: block; color: var(--red); font-weight: 800; margin-top: 2px; font-size: 14px; }
.addon-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.addon-row .grow { font-weight: 600; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pay-total { background: var(--black); color: #fff; border-radius: 14px; padding: 14px; text-align: center; }
.pay-total b { display: block; font-size: 34px; color: var(--yellow); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick button { padding: 14px 4px; border-radius: 11px; border: 0; background: #fff4dc; font-weight: 800; font-size: 15px; }
.change { font-size: 26px; font-weight: 900; text-align: center; padding: 10px; border-radius: 12px; background: #e7f6ea; color: var(--ok); }
.change.neg { background: #fbe3e0; color: var(--bad); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--black); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .4s; border-left: 5px solid var(--ok); }
.toast.err { border-left-color: var(--bad); } .toast.out { opacity: 0; }

/* ---------- generic panels / tables ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; } .page-head .sp { flex: 1; }
.card { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 .sub { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.cards { display: grid; gap: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: #fff; }
.tbl td { padding: 8px; border-bottom: 1px solid #f2ebdd; } .tbl tr:hover td { background: #fffaf0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.void td { color: #aaa; text-decoration: line-through; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: #efe6d4; padding: 8px 14px; border-radius: 9px; font-weight: 700; }
.tabs button.active { background: var(--black); color: var(--yellow); }
.split { display: grid; grid-template-columns: 260px 1fr; gap: 14px; height: calc(100% - 50px); }
.list { overflow-y: auto; }
.list .li { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.list .li.active { background: var(--orange); color: #fff; } .list .li:hover:not(.active) { background: #f6eedf; }
.list .li.off { opacity: .45; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* ---------- analytics ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: 12px; padding: 13px 14px; box-shadow: var(--shadow); border-top: 4px solid var(--orange); }
.kpi .l { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 24px; font-weight: 900; margin: 3px 0; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; font-weight: 700; } .d.up { color: var(--ok); } .d.down { color: var(--bad); } .d.flat { color: var(--muted); }
.an-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.s12 { grid-column: span 12; } .s8 { grid-column: span 8; } .s7 { grid-column: span 7; } .s6 { grid-column: span 6; } .s5 { grid-column: span 5; } .s4 { grid-column: span 4; }
.chart-box { position: relative; height: 260px; } .chart-box.tall { height: 340px; }
.heat { display: grid; gap: 2px; font-size: 11px; }
.heat div { padding: 6px 2px; text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; }
.heat .hd { font-weight: 700; color: var(--muted); }
.insight { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 12px; border-radius: 12px; background: #fffaf0; border: 1px solid var(--line); margin-bottom: 8px; align-items: start; }
.insight .ic { font-size: 22px; } .insight h4 { font-size: 14.5px; margin-bottom: 3px; } .insight p { margin: 0; color: #5a5047; font-size: 13px; line-height: 1.45; }
.insight .imp { font-weight: 900; color: var(--ok); white-space: nowrap; text-align: right; } .insight .imp small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.insight.risk { background: #fff4f2; border-color: #f3cfc9; } .insight.risk .imp { color: var(--bad); }
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quad > div { border-radius: 10px; padding: 10px; font-size: 12.5px; min-height: 120px; }
.quad h4 { font-size: 13px; margin-bottom: 4px; } .quad ul { margin: 0; padding-left: 16px; }
.q-star { background: #e7f6ea; } .q-plow { background: #fff4dc; } .q-puz { background: #e8f0fb; } .q-dog { background: #fbe9e7; }
.bar-in { height: 8px; border-radius: 4px; background: var(--orange); }
.demo-banner { background: repeating-linear-gradient(45deg, #fff3c4, #fff3c4 10px, #ffe9a0 10px, #ffe9a0 20px); border: 1px solid #f0c64a; padding: 8px 12px; border-radius: 10px; font-weight: 700; margin-bottom: 12px; }

@media (max-width: 1600px) { .brand b { display: none; } .nav { margin-left: 2px; } }
@media (max-width: 1400px) { .nav button { padding: 9px 9px; } #st-clock { display: none; } }
@media (max-width: 1200px) { .nav button span { display: none; } .nav button i { margin: 0; font-size: 18px; } #st-sync { font-size: 0; } #st-sync .dot { margin: 0; } }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, 1fr); } .pos-wrap { grid-template-columns: 140px 1fr 360px; } }
@media print { body * { visibility: hidden; } }
