:root {
  --brand: #EE6A1F;
  --brand-dark: #C9520F;
  --accent: #FFC23D;
  --bg: #FBF5EE;
  --card: #FFFFFF;
  --line: #EEDFD0;
  --text: #2B1D14;
  --muted: #8A7666;
  --green: #2E9B5F;
  --red: #D64545;
  --blue: #2F6FD6;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Poppins, system-ui, sans-serif; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); margin: 2px 0 0; font-size: 13px; }
.error { color: var(--red); margin: 0; }

.logo { font-weight: 700; letter-spacing: .06em; background: #111; color: #fff; border-radius: 10px; padding: 10px 14px; display: inline-flex; flex-direction: column; line-height: 1.05; font-size: 18px; }
.logo span { font-size: 10px; letter-spacing: .32em; font-weight: 500; }
.logo.small { font-size: 13px; padding: 7px 10px; border-radius: 8px; }
.logo.small span { font-size: 7px; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.big { padding: 13px 18px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; width: min(380px, 100%); display: grid; gap: 14px; box-shadow: 0 10px 30px rgba(120,70,30,.08); }
.login-card h1 { margin: 6px 0 0; font-size: 22px; }
.login-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login-card input { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px; color: var(--text); background: #fff; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.outlet { font-weight: 600; }
.outlet select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; font-weight: 600; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 12px; min-width: 20px; padding: 0 6px; line-height: 20px; text-align: center; }
.badge.soft { background: var(--accent); color: var(--text); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.toggle input { accent-color: var(--brand); width: 18px; height: 18px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.live { color: var(--green); font-size: 13px; font-weight: 500; }
.live.off { color: var(--red); }

.new-alert { background: var(--brand); color: #fff; text-align: center; padding: 10px 16px; font-weight: 600; animation: pulse 1.2s ease-in-out infinite; cursor: pointer; }
@keyframes pulse { 50% { background: var(--brand-dark); } }
.offline-bar { text-align: center; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
.offline-bar.off { background: #3A2A1F; color: #FFE7C2; }
.offline-bar.sending { background: var(--accent); color: var(--text); }
.offline-bar.bad { background: var(--red); color: #fff; }
.off-tag { display: inline-block; font-size: 11px; font-weight: 600; background: #3A2A1F; color: #FFE7C2; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.offline-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); list-style: none; }
.offline-list { margin: 0; padding: 0; }
.offline-list .err { grid-column: 1 / -1; color: var(--red); font-size: 13px; }
.offline-list .acts { display: flex; gap: 6px; }

/* Board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 16px 40px; align-items: start; }
.col h2 { font-size: 15px; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.col h2 span { color: var(--muted); font-weight: 500; }
.cards { display: grid; gap: 12px; }
.empty { color: var(--muted); font-size: 13px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.card.is-new { border: 2px solid var(--brand); box-shadow: 0 6px 18px rgba(238,106,31,.18); }
.card.late { border-color: var(--red); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order-no { font-size: 22px; font-weight: 700; line-height: 1.1; }
.who { font-size: 14px; color: var(--muted); }
.pill { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.pill.pickup { background: #FFF0D6; color: #8A5A00; }
.pill.delivery { background: #E3EDFF; color: #1F4FA8; }
.age { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.card.late .age { color: var(--red); font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lines li { display: grid; grid-template-columns: 34px 1fr; gap: 4px; }
.qty { font-weight: 700; }
.opts { display: block; font-size: 13px; color: var(--muted); }
.note { background: #FFF6E0; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.warn { background: #FDE8E8; color: #8E2222; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.rider { font-size: 13px; color: #1F4FA8; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.total { font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Panels */
.panel { padding: 16px 16px 40px; max-width: 1200px; margin: 0 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.panel-head input[type=search], .panel-head input[type=date] { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; }
.panel-head input[type=date] { font-size: 16px; padding: 4px 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; text-align: left; display: grid; gap: 6px; position: relative; }
.item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 10px; }
.item .name { font-weight: 500; font-size: 14px; line-height: 1.25; }
.item .cat { font-size: 12px; color: var(--muted); }
.item .state { font-size: 12px; font-weight: 600; color: var(--green); }
.item.sold { background: #F4EEE8; }
.item.sold img { filter: grayscale(1); opacity: .45; }
.item.sold .state { color: var(--red); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.attention { border-color: var(--accent); background: #FFF8E6; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.orders-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders-table th, .orders-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.orders-table th { font-size: 12px; color: var(--muted); font-weight: 500; }
.orders-table tr:last-child td { border-bottom: 0; }
.orders-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.orders-table tr.cancelled td { color: var(--muted); text-decoration: line-through; }
.orders-table tr.cancelled td:last-child, .orders-table tr.cancelled td:nth-child(6) { text-decoration: none; }
.orders-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); cursor: pointer; }
.status { font-size: 12px; font-weight: 600; text-transform: capitalize; }

dialog { border: 0; border-radius: 18px; padding: 22px; width: min(420px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(30,20,10,.4); }
dialog h3 { margin: 0 0 8px; }
dialog .actions { justify-content: flex-end; margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 20; max-width: calc(100% - 32px); }

/* ───── Till ───── */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: calc(100vh - var(--top, 58px)); height: calc(100dvh - var(--top, 58px)); position: relative; }
.pos-menu { overflow-y: auto; padding: 12px 14px 30px; }
.pos-top { display: flex; gap: 10px; margin-bottom: 10px; }
.pos-top input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.pos-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.pos-cats .chip { white-space: nowrap; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.pos-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; cursor: pointer; text-align: left; display: grid; gap: 4px; align-content: start; touch-action: manipulation; }
.pos-item:active { transform: scale(.97); border-color: var(--brand); }
.pos-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 10px; }
.pos-item .name { font-weight: 500; font-size: 13px; line-height: 1.25; min-height: 2.5em; }
.pos-item .cat { font-size: 11px; color: var(--muted); }
.pos-item .price { font-weight: 600; color: var(--brand-dark); font-size: 14px; }
.pos-item.sold { opacity: .5; cursor: not-allowed; }
.pos-item.sold img { filter: grayscale(1); }
.pos-item.sold .price { color: var(--red); }

.pos-cart { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px; gap: 10px; min-height: 0; }
.pos-cart-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button, .seg label { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg button.on, .seg label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg.wide { display: flex; } .seg.wide > * { flex: 1; justify-content: center; }
.pos-input { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; font-size: 15px; }
.pos-input.small { width: 76px; }
.pos-input.big { font-size: 24px; font-weight: 600; padding: 10px 12px; }
.pos-cart-head select.pos-input { width: auto; flex: 1; }
.pos-member .member-add { width: 100%; border-style: dashed; color: var(--muted); font-size: 13px; }
.member-on { display: flex; gap: 6px; align-items: center; background: #FFF6E0; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.member-on > div { flex: 1; }
.member-on .btn { padding: 5px 9px; font-size: 13px; }
.pos-lines { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; min-height: 80px; display: grid; align-content: start; gap: 2px; }
.pos-lines li { display: grid; grid-template-columns: 1fr auto 56px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.pos-lines li.empty { display: block; border: 1px dashed var(--line); }
.l-name { font-weight: 500; font-size: 14px; display: block; }
.l-opts { font-size: 12px; color: var(--muted); display: block; }
.l-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; cursor: pointer; }
.stepper b { min-width: 24px; text-align: center; }
.stepper.small button { width: 30px; height: 30px; font-size: 16px; }
.pos-totals { display: grid; gap: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.pos-totals > div { display: flex; justify-content: space-between; gap: 8px; }
.pos-totals .grand { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 3px; }
.pos-totals .muted { font-size: 13px; }
.link { border: 0; background: none; color: var(--brand-dark); text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0 4px; }
.pos-cart-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pos-cart-actions .btn { padding: 8px 6px; font-size: 13px; }
.btn.charge { font-size: 18px; padding: 16px; }
.pos-closed { position: absolute; inset: 0; background: rgba(251,245,238,.92); display: grid; place-items: center; z-index: 3; padding: 16px; }
.pos-closed label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pos-closed input { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 20px; }

/* Popups */
.modal { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.modal-foot .stepper { margin-right: auto; }
.modal-foot.center { justify-content: center; }
.modal-foot .btn.big { width: 100%; }
.modal .pos-input { margin-top: 4px; }
.opt-group { margin-top: 12px; }
.opt-label { font-size: 13px; color: var(--muted); margin: 12px 0 6px; display: block; }
.opt-group .opt-label { margin-top: 0; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-chips .chip { padding: 8px 14px; }
.opt-chips .chip.active small { color: #fff; }
.chip small { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row .grow { flex: 1; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.stack { display: grid; gap: 8px; }
.stack label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pay-due { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.pay-due > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.pay-due b { font-size: 30px; }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.pay-methods button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 4px; font-weight: 600; cursor: pointer; }
.pay-methods button.on { background: var(--text); color: #fff; border-color: var(--text); }
.pay-change { margin-top: 10px; font-size: 18px; color: var(--green); }
.pay-change b { font-size: 28px; }
.pay-change.hide { visibility: hidden; }
.done { text-align: center; }
.done-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 34px; display: grid; place-items: center; margin: 6px auto 10px; }
.done h3 { margin: 0; }

/* Shift, sales, admin */
.panel.wide { max-width: 1400px; }
.section { margin: 22px 0 10px; font-size: 16px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.box h3 { margin: 0 0 10px; font-size: 15px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.bar { display: grid; grid-template-columns: 110px 1fr 70px; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.bar i { display: block; height: 10px; background: var(--brand); border-radius: 99px; min-width: 2px; }
.bar b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 4px 0; border-top: 1px solid var(--line); }
.moves { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.moves li { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px solid var(--line); }
.ok { color: var(--green); }
.warn-text { color: var(--red); }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.radio input { accent-color: var(--brand); width: 18px; height: 18px; margin-top: 3px; }
#printer-box .row { margin-top: 8px; align-items: center; }
.pad { padding: 12px 14px; margin: 0; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.range input[type=date] { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; }
.stat.big b { font-size: 26px; color: var(--brand-dark); }
.top { margin: 0; padding-left: 20px; font-size: 14px; }
.top li { display: grid; grid-template-columns: 1fr 36px 60px; gap: 6px; padding: 3px 0; }
.top li b, .top li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.hours .h { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.hours i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.hours span { font-size: 10px; color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.row-actions { white-space: nowrap; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 22px; }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.settings label.toggle { display: flex; color: var(--text); font-size: 14px; }
.settings input:not([type=checkbox]) { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 15px; color: var(--text); }
.settings .full { grid-column: 1 / -1; }
.price-input { width: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.orders-table tr.muted-row td { color: var(--muted); }
.pill.dine_in { background: #E6F4EA; color: #1E6B3A; }
.pill.takeaway { background: #F1E8FF; color: #5A3A9A; }

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .tools { margin-left: 0; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--line); }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
}

/* Kitchen ticket (80 mm thermal printer) */
.ticket { display: none; }
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body > *:not(#ticket) { display: none !important; }
  dialog { display: none !important; }
  html, body { background: #fff; }
  .ticket { display: block; width: 72mm; font: 12px/1.35 "Courier New", monospace; color: #000; }
  .ticket h1 { font-size: 20px; margin: 0; text-align: center; }
  .ticket .t-center { text-align: center; }
  .ticket .t-big { font-size: 16px; font-weight: 700; }
  .ticket hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  .ticket .t-line { display: flex; gap: 6px; font-weight: 700; font-size: 14px; }
  .ticket .t-opt { padding-left: 26px; }
  .ticket .t-row { display: flex; justify-content: space-between; gap: 6px; }
  .ticket .t-bold { font-weight: 700; font-size: 13px; }
  .ticket .t-huge { font-size: 24px; font-weight: 700; }
  .ticket .t-line { display: block; }
}
.seg label input { position: absolute; opacity: 0; pointer-events: none; }

/* AI insights (owner) */
.ins-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ins-scope { width: auto; min-width: 180px; }
.ins-busy { background: #FFF4EA; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
#ins-report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
#ins-report > .empty { border: 0; }
.ins-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.ins-head h3 { margin: 0; font-size: 17px; }
.ins-stats { display: flex; gap: 18px; }
.ins-stats div { display: grid; text-align: right; }
.ins-stats b { font-size: 19px; }
.ins-stats span { font-size: 12px; color: var(--muted); }
.ins-stats em { font-style: normal; font-weight: 600; }
.ins-stats em.up { color: var(--green); } .ins-stats em.down { color: var(--red); }
.ins-summary { font-size: 15px; line-height: 1.55; margin: 14px 0 0; padding: 12px 14px; background: #FFF8F1; border-radius: 10px; }
.ins-list { display: grid; gap: 8px; }
.ins-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ins-item p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; }
.kind-chip { flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; min-width: 82px; text-align: center; }
.kind-chip.good { background: #E3F4EA; color: var(--green); }
.kind-chip.watch { background: #FBE6E6; color: var(--red); }
.kind-chip.opportunity { background: #FFEBDD; color: var(--brand-dark); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.promo { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.promo h4 { margin: 0; font-size: 16px; }
.promo p { margin: 0; font-size: 14px; line-height: 1.45; }
.promo .offer { font-weight: 500; }
.promo .why { color: var(--muted); }
.promo .vline { font-size: 13px; background: #FFF4EA; padding: 6px 8px; border-radius: 8px; }
.promo .btn { margin-top: auto; }
.done-tag { margin-top: auto; font-size: 13px; color: var(--green); font-weight: 600; }
.small { font-size: 12px; }
#ins-report > p.small { margin-top: 14px; }
.ins-history { display: grid; gap: 6px; }
.ins-past { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.ins-past.active { border-color: var(--brand); }
.ins-past .muted { margin-left: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Owner back office */
#tab-dashboard.loading { opacity: .6; pointer-events: none; }
.bo-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bo-filters input[type=date] { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: #fff; font: inherit; }
.seg.small button { padding: 5px 10px; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi b { font-size: 21px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi small em { font-style: normal; font-weight: 600; }
.kpi small em.up { color: var(--green); } .kpi small em.down { color: var(--red); }
.kpi.warn { border-color: #F2C48D; background: #FFF8EE; }
.kpi.bad b { color: var(--red); }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.mini-kpis .kpi { padding: 10px 12px; } .mini-kpis .kpi b { font-size: 18px; }
#tab-dashboard .box { margin-bottom: 12px; }
.box-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.box-head h3 { margin: 0 !important; }
.box-head > :last-child { margin-left: auto; }
.box-head .seg { margin-left: auto; } .box-head .seg + .btn { margin-left: 0; }
.bo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bo-grid .box { margin-bottom: 0 !important; } .bo-grid { margin-bottom: 12px; }
.bo-sub { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.trend { display: flex; align-items: stretch; gap: 2px; height: 190px; padding-top: 8px; }
.tcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; outline: none; }
.tcol i { display: block; height: var(--h); min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.tcol span { font-size: 11px; color: var(--muted); height: 16px; margin-top: 4px; white-space: nowrap; overflow: visible; }
.tcol .tip { display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%); background: #2B1D14; color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; z-index: 2; pointer-events: none; }
.tcol .tip b { display: block; font-size: 13px; }
.tcol:hover .tip, .tcol:focus .tip { display: block; }
.tcol:hover i, .tcol:focus i { background: var(--brand-dark); }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { display: block; height: 12px; width: var(--w); min-width: 2px; background: var(--brand); border-radius: 0 4px 4px 0; }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 600; }
td.neg { color: var(--red); font-weight: 600; } td.gain { color: var(--green); font-weight: 600; }
tr.row-bad td { background: #FFF5F5; }
.table-wrap.short { max-height: 320px; overflow-y: auto; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.tag.void { background: #FBE6E6; color: var(--red); } .tag.discount { background: #FFEBDD; color: var(--brand-dark); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } .bo-grid { grid-template-columns: 1fr; } }
.bo-members .mini-kpis { grid-template-columns: repeat(4, 1fr); }
.bo-members h3 { margin: 0 0 10px; }
@media (max-width: 900px) { .bo-members .mini-kpis { grid-template-columns: repeat(2, 1fr); } }
.more { padding: 8px 12px; margin: 0; }

/* Back office app */
.bo-badge { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; background: #2B1D14; color: #fff; padding: 5px 10px; border-radius: 99px; }
body.bo .login-card h1 { margin-top: 6px; }
.demo-logins { display: grid; gap: 8px; }
.demo-logins .btn { width: 100%; }

/* ── Promotions (back office cards, Promotions tab, POS) ── */
.promo-facts { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.promo-facts li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.promo-facts span { color: var(--muted); }
.est { border-radius: 10px; padding: 10px 12px; background: #F3FAF5; border: 1px solid #CDE9D6; display: grid; gap: 6px; }
.est.neg { background: #FDF1F1; border-color: #F1CFCF; }
.est-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.est-main b { font-size: 19px; color: var(--green); white-space: nowrap; }
.est.neg .est-main b { color: var(--red); }
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 0; font-size: 12.5px; }
.est-grid div { display: flex; justify-content: space-between; gap: 6px; }
.est-grid dt { color: var(--muted); } .est-grid dd { margin: 0; font-weight: 600; white-space: nowrap; }
.est-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.est-note.est-warn { color: #8A5A00; }
.est.compact .est-grid { grid-template-columns: 1fr; }
.est.compact .est-main { flex-direction: column; gap: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; text-align: left; text-decoration: underline; }
.empty .linkish { color: var(--brand-dark); }
.outlet-pick { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.outlet-pick legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
#modal .est { margin-top: 4px; }
.promo-list { display: grid; gap: 12px; }
.promo-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.promo-row.ended, .promo-row.finished { opacity: .75; }
.promo-row-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.promo-row h3 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.promo-row-head p { margin: 2px 0 0; font-size: 14px; }
.promo-actions { display: flex; gap: 6px; }
.btn.danger { color: var(--red); }
.status-chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; background: #EEE; color: var(--muted); }
.status-chip.active { background: #E3F4EA; color: var(--green); }
.status-chip.paused { background: #FFF1D6; color: #8A5A00; }
.status-chip.scheduled { background: #FFEBDD; color: var(--brand-dark); }
.promo-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.promo-results div { background: #FFF8F1; border-radius: 10px; padding: 8px 10px; display: grid; }
.promo-results b { font-size: 18px; }
.promo-results span { font-size: 12px; color: var(--muted); }
.promo-results .gain, td .gain { color: var(--green); } .promo-results .neg, td .neg { color: var(--red); }
.pos-item { position: relative; }
.promo-tag { position: absolute; top: 6px; left: 6px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; letter-spacing: .03em; }
.promo-line { color: var(--brand-dark); font-weight: 500; }

/* ── Segmented pickers and the tab bar: one line each, scroll sideways on a phone ── */
.seg { background: var(--card); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.seg button, .seg label { white-space: nowrap; flex: none; }
.seg button.on, .seg label:has(input:checked) { background: var(--text); color: #fff; box-shadow: none; }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { white-space: nowrap; flex: none; }
.bo-filters input[type=date] { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--card); font: inherit; font-size: 14px; color: var(--text); }
@media (max-width: 700px) {
  body.bo .topbar { padding: 10px 16px 8px; gap: 10px; }
  body.bo .topbar .tabs { order: 3; width: 100%; }
  body.bo .topbar .tools { margin-left: auto; gap: 10px; }
  body.bo .topbar .bo-badge { font-size: 11px; padding: 5px 10px; }
  body.bo #who { display: none; }
  .bo-filters { width: 100%; }
  .bo-filters .seg { display: flex; width: 100%; }
  .bo-filters .seg button { flex: 1 1 auto; justify-content: center; padding: 7px 6px; font-size: 12.5px; }
  body.bo .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  body.bo .tab { padding: 7px 11px; font-size: 14px; }
  body.bo .range .ins-scope { width: 100%; }
  body.bo .range input[type=date] { flex: 1 1 40%; min-width: 0; font: inherit; font-size: 14px; }
  body.bo .range .chip { flex: 1 1 auto; text-align: center; }
  .bo-filters input[type=date] { flex: 1; min-width: 0; }
}

/* Sales: category filter (All items / All beverages / Hot Beverages …) */
.cat-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cat-filter .chip { padding: 5px 12px; font-size: 13px; }
.cat-filter .chip.soft { background: #FFEBDD; border-color: var(--brand); color: var(--brand-dark); }
.cat-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
@media (max-width: 700px) { .cat-filter .muted.small { width: 100%; } .cat-sep { display: none; } }

/* ── Back office: tab bar on its own row (11 tabs), and the operations tabs ── */
body.bo .topbar .tabs { order: 3; width: 100%; }
#tab-profit.loading { opacity: .6; pointer-events: none; }
#tab-profit .box, #tab-inventory .box, #tab-staff .box, #tab-outlets .box { margin-bottom: 12px; }
.note-bar { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; background: #FFF8EE; border: 1px solid #F2C48D; color: var(--text); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.note-bar.warn { background: #FFF1E6; border-color: var(--brand); cursor: pointer; }
.note-bar u { color: var(--brand-dark); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.row-btns { white-space: nowrap; display: flex; gap: 4px; justify-content: flex-end; }
.modal label, .modal .toggle { display: grid; gap: 2px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.modal .toggle { display: flex; color: var(--text); font-size: 14px; }
.modal .seg.wide { margin-top: 10px; }
.modal textarea.pos-input { font: inherit; resize: vertical; }
.modal .error { margin-top: 10px; font-size: 14px; }

/* Profit */
.pl-trend .tcol > i.sales { background: #F7D2B8; position: relative; display: flex; align-items: flex-end; }
.pl-trend .tcol > i.sales > i.profit { display: block; width: 100%; height: var(--h); background: var(--green); border-radius: 4px 4px 0 0; }
.pl-trend .tcol:hover > i.sales { background: #F1BC97; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 2px 0 8px; vertical-align: -1px; }
.key.sales { background: #F7D2B8; } .key.profit { background: var(--green); }
.table-wrap.short.tall { max-height: 560px; }

/* Stock */
.stock-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.stock-tag.ok { background: #E3F4EA; color: var(--green); }
.stock-tag.low { background: #FFF1D6; color: #8A5A00; }
.stock-tag.out { background: #FBE6E6; color: var(--red); }
.recipe-lines { display: grid; gap: 6px; margin: 8px 0; }
.recipe-line { display: grid; grid-template-columns: 1fr 90px auto; gap: 6px; align-items: center; }
.recipe-line .pos-input { margin: 0 !important; }
.recipe-cost { margin: 12px 0 0; font-size: 15px; } .recipe-cost b { font-size: 18px; }

/* Staff */
.rules { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; margin-bottom: 6px; }
.rules label:not(.toggle) { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.rules select.pos-input { width: auto; }
.role { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #F2ECE6; }
.role.supervisor { background: #FFEBDD; color: var(--brand-dark); } .role.manager { background: #2B1D14; color: #fff; }
.role-help { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Outlets */
.outlet-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 14px; }
.outlet-card p { margin: 0 0 8px; }
.flags { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
tr.row-own td { background: #FFF6EE; }

/* Customers */
.cu-filters { margin-bottom: 6px; }
.cu-filters input[type=search] { border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; background: #fff; font: inherit; font-size: 14px; }
.seg button small { opacity: .7; font-size: 11.5px; }
.seg-tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: #F2ECE6; color: var(--muted); white-space: nowrap; }
.seg-tag.lapsed { background: #FBE6E6; color: var(--red); } .seg-tag.regular { background: #E3F4EA; color: var(--green); }
.seg-tag.new { background: #FFEBDD; color: var(--brand-dark); }
.inline-select { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; background: #fff; }
.send-bar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; box-shadow: 0 -4px 14px rgba(120,70,30,.06); }

/* Activity */
.tag[class*="act-"] { background: #F2ECE6; color: var(--text); }
.tag.act-added { background: #E3F4EA; color: var(--green); } .tag.act-removed, .tag.act-waste { background: #FBE6E6; color: var(--red); }
.tag.act-changed { background: #FFEBDD; color: var(--brand-dark); }
table.activity td { vertical-align: top; }

/* Nightly report */
.report-box { margin-bottom: 22px; }
.report-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings.slim { margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.report-preview { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; background: #F3FAF5; border: 1px solid #CDE9D6; border-radius: 12px; padding: 12px 14px; margin: 4px 0 0; }

@media (max-width: 700px) {
  .report-grid2 { grid-template-columns: 1fr; }
  .rules { flex-direction: column; align-items: flex-start; }
  .send-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .cu-filters input[type=search] { width: 100%; }
  .row-btns { flex-direction: column; }
  .panel-head > .btn { width: 100%; }
}
.settings input:not([type=checkbox]) { width: 100%; min-width: 0; box-sizing: border-box; }
.settings.slim { grid-template-columns: 1fr 1fr; }
.orders-table th:first-child:has(#cu-all) { width: 36px; }
@media (max-width: 700px) { .settings.slim { grid-template-columns: 1fr; } }
.orders-table td.num, .orders-table th.num { white-space: nowrap; }
@media (max-width: 700px) {
  #tab-customers td, #tab-customers th, #tab-staff td, #tab-staff th, #tab-outlets td, .stock-table td, .stock-table th { white-space: nowrap; }
}

/* ── POS: staff PIN pad and who is on the till ── */
.till-staff { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.till-staff small { color: var(--brand-dark); font-weight: 500; }
.who-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pin-lock { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.pin-dialog { width: min(380px, calc(100% - 24px)); padding: 20px; }
.pin-card { display: grid; justify-items: center; gap: 6px; text-align: center; width: min(340px, 100%); outline: none; }
.pin-lock .pin-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; box-shadow: 0 10px 30px rgba(120,70,30,.08); }
.pin-card h2 { margin: 8px 0 0; font-size: 22px; }
.pin-card .muted { margin: 0; }
.pin-dots { display: flex; gap: 12px; margin: 14px 0 2px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots i.opt { border-style: dashed; opacity: .5; }
.pin-dots i.on { background: var(--brand); opacity: 1; border-style: solid; }
.pin-err { min-height: 20px; font-size: 14px; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.pin-keys button { height: 62px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 24px; font-weight: 600; cursor: pointer; color: var(--text); }
.pin-keys button:active { background: #FFEBDD; }
.pin-keys button.ok { background: var(--brand); border-color: var(--brand); color: #fff; font-size: 18px; }
.pin-keys button:disabled { opacity: .45; cursor: default; }
.pin-card .btn.ghost { margin-top: 8px; }
