/* ============ Beach Kitchen — responsive UI ============ */
:root {
  --teal: #0e8a8a;
  --teal-dark: #0a6b6b;
  --sand: #fdf6ec;
  --ink: #1f2d33;
  --muted: #6b7a80;
  --line: #e4e0d8;
  --danger: #d64545;
  --success: #2e9e5b;
  --warning: #e8a13c;
  --shadow: 0 2px 10px rgba(20, 40, 50, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--sand);
  color: var(--ink);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  color: #fff; padding: 10px 18px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand-icon { margin-right: 4px; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topnav a {
  color: rgba(255,255,255,.85); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; font-size: .92rem;
}
.topnav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.topnav a.nav-customer { background: rgba(255,255,255,.18); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.userbox small { opacity: .75; }

.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 90px; }

/* ---------- generic ---------- */
h1 { margin: 0 0 6px; font-size: 1.5rem; }
h2.section-title { font-size: 1.05rem; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.empty { padding: 20px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.nowrap { white-space: nowrap; }

.btn {
  display: inline-block; border: 0; border-radius: 9px; cursor: pointer;
  padding: 9px 16px; font-size: .92rem; font-weight: 600; text-decoration: none;
  background: #e9e4da; color: var(--ink); transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--teal); color: #fff; }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.warning { background: var(--warning); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.big { padding: 13px 20px; font-size: 1rem; width: 100%; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.tiny { padding: 3px 9px; font-size: .78rem; border-radius: 7px; }

.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--teal); color: #fff; font-size: .85rem; font-weight: 700;
}
.badge.alert { background: var(--danger); }
.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.blink-dot { color: var(--danger); animation: blink 1s infinite; font-size: 1.2rem; }

.messages { max-width: 1200px; margin: 12px auto 0; padding: 0 16px; }
.message { padding: 10px 14px; border-radius: 9px; margin-bottom: 8px; background: #e6f4ec; color: #1e6b40; font-size: .9rem; }
.message-error { background: #fbe7e7; color: var(--danger); }
.alert { padding: 10px 14px; border-radius: 9px; font-size: .9rem; margin-bottom: 12px; }
.alert-danger { background: #fbe7e7; color: var(--danger); }
.alert-success { background: #e6f4ec; color: #1e6b40; }

.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 5px; font-weight: 600; font-size: .9rem; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: .95rem; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14,138,138,.35); border-color: var(--teal); }

/* ---------- order cards ---------- */
.grid-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.order-card {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.order-card.flash { animation: flashBg 1.1s ease-in-out 3; border-left-color: var(--warning); }
@keyframes flashBg { 0%, 100% { background: #fff; } 50% { background: #fff3d6; } }
.order-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.order-number { font-size: 1.05rem; }
.status { margin-left: auto; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef2f3; color: var(--muted); }
.status-pending { background: #fde2e2; color: var(--danger); }
.status-accepted { background: #fff0d9; color: #a06a00; }
.status-preparing { background: #e0e9ff; color: #2b5bb5; }
.status-ready { background: #dff3e6; color: var(--success); }
.status-delivered { background: #e6f4ec; color: #1e6b40; }
.status-rejected, .status-cancelled { background: #eee; color: #999; }
.time { color: var(--muted); font-size: .85rem; }
.meta { font-size: .9rem; margin: 2px 0; }
.order-items { list-style: none; margin: 10px 0; padding: 0; }
.order-items li { display: flex; gap: 6px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.order-items .qty { font-weight: 700; color: var(--teal); min-width: 30px; }
.order-items .note { color: #a06a00; font-size: .83rem; }
.order-items .line-total { margin-left: auto; font-weight: 600; }
.instructions { background: #fff8e6; border-radius: 8px; padding: 8px 10px; font-size: .88rem; margin: 8px 0; }
.order-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.order-foot .total { font-size: 1.1rem; font-weight: 700; }
.inline-forms { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- customer menu ---------- */
.menu-hero { text-align: center; padding: 10px 0 18px; }
.search { max-width: 420px; margin: 12px auto 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.chip-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 16px; cursor: pointer; font-size: .9rem;
}
.chip-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dish { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.dish img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #eee; }
.dish-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dish-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.dish-desc { font-size: .85rem; color: var(--muted); flex: 1; }
.dish-price { font-size: 1.05rem; font-weight: 700; color: var(--teal); }
.dish-price s { color: #b0a294; font-weight: 400; margin-right: 6px; font-size: .85rem; }
.promo-tag { background: var(--warning); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.dish .btn { margin-top: 4px; }

/* cart */
.cart-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: var(--teal); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 22px; font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(14,138,138,.4);
}
.cart-fab span { background: #fff; color: var(--teal); border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 95; display: none; }
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: -380px; width: min(380px, 100vw);
  height: 100vh; height: 100dvh; /* dvh = dynamic viewport height (mobile Safari) */
  z-index: 96;
  background: #fff; display: flex; flex-direction: column; transition: right .25s ease;
  box-shadow: -6px 0 30px rgba(0,0,0,.15);
}
.cart-drawer.open { right: 0; }
.cart-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 1.1rem; }
.cart-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cart-items { padding: 12px 16px; }
.cart-sticky-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 16px;
  padding-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cart-sticky-footer .cart-total { font-size: 1.05rem; white-space: nowrap; }
.place-order-btn { flex-shrink: 0; }
.cart-item { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.cart-item .row { display: flex; align-items: center; gap: 8px; }
.cart-item .name { font-weight: 600; }
.cart-item .price { margin-left: auto; font-weight: 600; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; }
.cart-item input[type="text"] { margin-top: 6px; font-size: .85rem; padding: 7px 10px; }
.cart-item .remove { color: var(--danger); background: none; border: 0; cursor: pointer; font-size: .8rem; }
.cart-footer { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.05rem; }

.order-done { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.order-done-card { background: #fff; border-radius: 16px; padding: 28px; max-width: 420px; width: 100%; text-align: center; display: grid; gap: 12px; }
.big-check { font-size: 3rem; }
.done-number { font-size: 2rem; font-weight: 800; color: var(--teal); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #faf7f1; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; }
.promo-price { color: var(--danger); }

/* category chips on admin page */
.category-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; display: flex; gap: 8px; align-items: center; }
.chip-actions { display: flex; gap: 4px; align-items: center; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: auto; }
.inline-form input[type="text"] { width: 180px; }
.inline-form input[type="number"] { width: 70px; }

/* ---------- forms / modal ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 620px; box-shadow: var(--shadow); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 16px; }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: min(420px, 100%); display: grid; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.check { display: flex !important; align-items: center; gap: 8px; }
.check input { width: auto !important; }
.preview-img { max-width: 180px; border-radius: 10px; margin-top: 8px; }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi { background: #fff; border-radius: 12px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--teal); }
.kpi-label { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.popular { display: grid; gap: 8px; }
.popular-row { display: grid; grid-template-columns: 180px 1fr 90px; gap: 10px; align-items: center; background: #fff; padding: 8px 12px; border-radius: 9px; font-size: .9rem; }
.popular-qty { text-align: right; font-weight: 600; }
.bar { background: #eee; border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--teal), #35b5b5); height: 100%; border-radius: 999px; }
.chart { display: flex; gap: 10px; align-items: flex-end; height: 190px; background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.chart-bar { width: 100%; max-width: 52px; background: linear-gradient(180deg, #35b5b5, var(--teal)); border-radius: 6px 6px 0 0; min-height: 3px; }
.chart-label { font-size: .75rem; color: var(--muted); }
.chart-value { font-size: .72rem; font-weight: 700; }

/* ---------- staff ---------- */
.role-tag { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef2f3; }
.role-admin { background: #f3e2ff; color: #7a2ea6; }
.role-cashier { background: #e0e9ff; color: #2b5bb5; }
.role-chef { background: #fff0d9; color: #a06a00; }
.role-delivery { background: #dff3e6; color: var(--success); }

/* ---------- login ---------- */
.login-wrap { display: flex; justify-content: center; padding: 30px 0; }
.login-card { background: #fff; border-radius: 16px; padding: 30px; width: min(400px, 100%); box-shadow: var(--shadow); display: grid; gap: 12px; text-align: center; }
.login-logo { font-size: 2.6rem; }

/* ---------- sound activation banner ---------- */
.sound-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-90px);
  background: #22333a; color: #fff; padding: 10px 22px; border-radius: 999px;
  z-index: 210; transition: transform .3s ease; font-size: .9rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer;
}
.sound-banner.show { transform: translateX(-50%) translateY(0); }

/* ---------- billing / discounts / promo ---------- */
.bill-controls { display: grid; gap: 8px; margin: 10px 0; }
.bill-row label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; }
.bill-row select, .bill-row input { padding: 7px 9px; font-size: .88rem; }
.bill-preview {
  background: #f7f4ee; border: 1px dashed var(--line);
  border-radius: 9px; padding: 9px 11px; margin: 8px 0;
}
.bp-lines { display: grid; gap: 4px; font-size: .85rem; }
.bp-line { display: flex; justify-content: space-between; gap: 8px; }
.bp-line.bp-discount, .cs-discount { color: var(--success); }
.bp-line.bp-grand {
  font-weight: 800; border-top: 1px solid var(--line);
  padding-top: 4px; font-size: .95rem;
}
.bill-snapshot {
  margin-top: 10px; background: #f7f4ee; border: 1px dashed var(--line);
  border-radius: 9px; padding: 9px 11px; display: grid; gap: 4px;
  font-size: .82rem;
}
.promo-row { display: flex; gap: 8px; }
.promo-row input { flex: 1; }
#promo-result { margin-top: 8px; }
.cart-summary { display: grid; gap: 3px; font-size: .85rem; margin-top: 8px; }
.cart-summary .cs-line { display: flex; justify-content: space-between; }
.settings-logo-preview { max-width: 140px; border-radius: 10px; margin-bottom: 12px; }
.discount-val { color: var(--danger); }

/* ---------- 80mm thermal bill ---------- */
.bill-page { padding: 16px 8px 40px; }
.bill-toolbar { max-width: 302px; margin: 0 auto 12px; display: flex; gap: 8px; justify-content: center; }
.bill {
  max-width: 302px; /* 80mm */
  margin: 0 auto; background: #fff; color: #000;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 13px; line-height: 1.45; padding: 14px 12px;
  box-shadow: var(--shadow);
}
.bill-logo { display: block; max-width: 110px; max-height: 60px; object-fit: contain; margin: 0 auto; }
.bill-head { text-align: center; }
.bill-name { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.bill-center { text-align: center; }
.bill-line { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.bill-sep { text-align: center; letter-spacing: -1px; margin: 6px 0; color: #222; }
.bill-items { display: grid; gap: 2px; }
.bill-item { display: flex; justify-content: space-between; gap: 8px; }
.bill-item-name { word-break: break-word; }
.bill-item-note { padding-left: 16px; font-size: 11px; color: #222; word-break: break-word; }
.bill-item-price { white-space: nowrap; }
.bill-grand { font-weight: 700; font-size: 1.1rem; }
.bill-footer { text-align: center; margin-top: 8px; font-weight: 700; }
.bill a { color: #0645ad; }
@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #bill, #bill * { visibility: visible; }
  #bill { position: absolute; left: 0; top: 0; width: 80mm; margin: 0; box-shadow: none; }
  .no-print { display: none !important; }
}

/* ---------- customer menu footer ---------- */
.menu-footer {
  margin-top: 34px; padding: 22px 16px; background: #fff;
  border-radius: 14px; box-shadow: var(--shadow);
  display: grid; gap: 8px; justify-items: center; text-align: center;
}
.menu-footer-logo { max-width: 110px; max-height: 70px; object-fit: contain; }
.menu-footer-name { font-weight: 800; font-size: 1.1rem; }

/* ---------- order type badge ---------- */
.order-type {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.order-type-dine_in { background: #e3f2f5; color: #0a6b6b; }
.order-type-takeaway { background: #fdf0dc; color: #9a6a12; }
.order-type-delivery { background: #e8f3e5; color: #2e7d32; }

/* ---------- order type picker (customer cart) ---------- */
.order-type-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.order-type-picker label {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.order-type-picker label:hover { border-color: var(--teal); }
.order-type-picker input[type="radio"] { accent-color: var(--teal); margin: 0; }
.order-type-picker label:has(input:checked) {
  border-color: var(--teal);
  background: #e9f6f6;
}

/* ---------- reports: per-type sub value ---------- */
.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
  background: #22333a; color: #fff; padding: 12px 22px; border-radius: 999px;
  z-index: 200; opacity: 0; transition: all .3s ease; pointer-events: none;
  max-width: 90vw; text-align: center; font-size: .92rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- filter bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input[type="date"], .filter-bar select { width: auto; }

/* ---------- timeline ---------- */
.timeline { list-style: none; display: flex; gap: 0; padding: 0; margin: 20px 0; flex-wrap: wrap; }
.timeline li { flex: 1; min-width: 90px; text-align: center; position: relative; font-size: .85rem; color: var(--muted); padding-top: 26px; }
.timeline li span {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: #ddd; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
}
.timeline li.active span { background: var(--teal); }
.timeline li.done span { background: var(--success); }
.timeline li.active { color: var(--teal); font-weight: 700; }
.timeline li.done { color: var(--success); }
.track-wrap { max-width: 640px; margin: 0 auto; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  .topbar { gap: 8px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .userbox { margin-left: auto; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .grid-orders { grid-template-columns: 1fr; }
  .popular-row { grid-template-columns: 110px 1fr 70px; }
  .page-head h1 { font-size: 1.25rem; }
}
/* Header logo image */
.brand-logo {
  height: 44px;
  width: auto;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 8px;
}
/* Keep the logout form inline in the header */
.logout-form {
  display: inline;
  margin: 0;
}

/* ---------- delivery location (customer cart) ---------- */
.loc-msg {
  margin-top: 6px;
  font-size: 0.8rem;
}
.loc-ok { color: #2e7d32; }
.loc-fail { color: #b26a00; }

/* ---------- cart note under the total ---------- */
.cart-note {
  margin-top: 4px;
  font-size: 0.75rem;
}

/* ---------- payment badges on order cards ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.paid-badge { background: #e8f3e5; color: #2e7d32; }
.unpaid-badge { background: #fdf0dc; color: #9a6a12; }
.addon-badge { background: #e3f2f5; color: #0a6b6b; }

/* ---------- add-on tickets / to-serve ---------- */
.addon-ticket {
  border-left: 4px solid var(--teal);
}
.addon-round-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 6px 0 2px;
  color: var(--teal);
}
.pay-method-select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ---------- tracking page: add-on menu ---------- */
.addon-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.addon-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.addon-name { font-weight: 600; font-size: 0.85rem; }
.addon-price { color: var(--muted); font-size: 0.8rem; }
.addon-cart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.85rem;
}
.addon-cart-row input {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ---------- cashier add-items modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.addon-item-list {
  flex: 1; overflow-y: auto; padding: 10px 16px; min-height: 200px;
}
.addon-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem;
}
.addon-pick-row .ap-name { flex: 1; font-weight: 600; }
.addon-pick-row .ap-price { color: var(--muted); white-space: nowrap; }
.addon-pick-row .ap-qty { display: flex; align-items: center; gap: 6px; }
.addon-pick-row .ap-qty span { min-width: 20px; text-align: center; font-weight: 600; }
.addon-pick-row .ap-note {
  flex: 1; min-width: 80px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 0.8rem;
}
.modal-foot {
  padding: 12px 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.addon-total { font-size: 0.95rem; }
.modal-actions { display: flex; gap: 8px; }
.addon-cat-heading {
  font-weight: 700; font-size: 0.8rem; color: var(--teal);
  padding: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.03em;
}
.addon-pick-row.selected {
  background: #e9f6f6; border-radius: 8px; padding: 4px 6px;
}
.addon-pick-row.kb-highlight {
  background: #fff3cd; border: 2px solid var(--teal); border-radius: 8px; padding: 4px 6px;
}
.addon-pick-row .hl {
  background: #ffe082; border-radius: 3px; padding: 0 1px; font-weight: 700;
}
.ap-code {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: #e3f2f5; color: #0a6b6b; font-size: 0.72rem; font-weight: 700;
  margin-left: 4px;
}
/* ---------- order type picker: fix radio size + compact phone layout ---------- */
/* Stop the general "full-width input" rule from stretching the radio buttons */
.order-type-picker input[type="radio"] {
  width: auto; height: auto; flex: 0 0 auto; padding: 0; border: 0;
}

@media (max-width: 480px) {
  /* Full-width cart drawer on phones */
  .cart-drawer { width: 100vw; right: -100vw; }
  .cart-drawer.open { right: 0; }

  /* Keep the 3 options side by side: radio on top, icon + name below */
  .order-type-picker { flex-wrap: nowrap; gap: 6px; }
  .order-type-picker label {
    min-width: 0; flex-direction: column; gap: 4px;
    padding: 8px 4px; font-size: 0.8rem; text-align: center; white-space: nowrap;
  }
}

/* ---------- tracking page: item status badges ---------- */
.item-status {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; margin-left: 6px;
}
.item-status.st-ok { background: #e8f3e5; color: #2e7d32; }
.item-status.st-busy { background: #fdf0dc; color: #9a6a12; }
.item-status.st-warn { background: #fde8e8; color: #b26a00; }

/* ---------- tracking page: pending add-on box ---------- */
.pending-box {
  margin-top: 10px; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 10px; background: #fafafa;
}
.pending-box ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- menu add-on mode banner ---------- */
.addon-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; margin-bottom: 10px;
  background: #e9f6f6; border: 2px solid var(--teal); border-radius: 12px;
  font-size: 0.95rem;
}
.addon-banner strong { color: var(--teal); }

/* ---------- order card head: number on one line, badges wrap underneath ---------- */
.order-head { flex-wrap: wrap; }
.order-number { white-space: nowrap; }
.order-type { white-space: nowrap; }

/* ---------- staff list: Pickup / Counter role badge ---------- */
.role-pickup { background: #d4eff5; color: #0e6b7a; }

/* ---------- inventory: low stock / movement badges ---------- */
.low-stock-row { background: #fff8e6; }
.stock-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.stock-low { background: #fde2e2; color: var(--danger); }
.stock-ok { background: #e8f3e5; color: #2e7d32; }
.stock-out { color: var(--danger); font-weight: 700; }
.stock-in { color: #2e7d32; font-weight: 700; }
.mov-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #eef2f3; color: var(--muted); }
.mov-purchase { background: #dff3e6; color: #2e7d32; }
.mov-sale { background: #e0e9ff; color: #2b5bb5; }
.mov-kitchen_issue { background: #fff0d9; color: #a06a00; }
.mov-kitchen_return { background: #e3f2f5; color: #0a6b6b; }
.mov-adjustment { background: #f3e2ff; color: #7a2ea6; }
.mov-wastage { background: #fde2e2; color: var(--danger); }
.mov-sale_reversal { background: #fdf0dc; color: #9a6a12; }
.perm-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-top: 10px; }
.perm-box legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.qty-input { width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.big-stat { font-size: 1.6rem; font-weight: 800; color: var(--teal); }
.nav-badge { margin-left: 6px; font-size: .7rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- inventory nav dropdown (?? Inventory ?) ---------- */
.nav-drop { position: relative; display: inline-block; }
.nav-dropbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; cursor: pointer;
  color: rgba(255,255,255,.85);
  padding: 6px 12px; border-radius: 8px; font-size: .92rem;
  font-family: inherit;
}
.nav-dropbtn:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-dropbtn .nav-caret { font-size: .7em; transition: transform .15s ease; }
.nav-drop.open .nav-dropbtn { background: rgba(255,255,255,.2); color: #fff; }
.nav-drop.open .nav-dropbtn .nav-caret { transform: rotate(180deg); }
.nav-dropmenu {
  display: none; position: fixed; z-index: 60;
  min-width: 200px; background: #fff; border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18);
  padding: 6px; flex-direction: column;
}
.nav-drop.open .nav-dropmenu { display: flex; }
.nav-drop .nav-dropmenu a {
  color: #1f2937; text-decoration: none; padding: 9px 12px; border-radius: 8px;
  font-size: .92rem; white-space: nowrap;
}
.nav-drop .nav-dropmenu a:hover { background: #eef4f6; color: var(--teal); }

/* ---------- OPENING (opening balance) movement badge ---------- */
.mov-opening { background: #e7eefb; color: #2f5597; }

/* ---------- read-only stock quantity on the item edit form ---------- */
input.qty-readonly { background: #f3f5f6; color: var(--muted); cursor: not-allowed; }

/* ---------- desktop ≥1366px: header stays on ONE line ----------
   Logo + every nav link (incl. the 📦 Inventory dropdown and Customer
   Menu) + the user box (name, role, Logout) share a single row,
   vertically centred. Below 1366px the original wrapping / mobile
   scroll behaviour is untouched. */
@media (min-width: 1366px) and (max-width: 1599.98px) {
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .brand { font-size: .95rem; white-space: nowrap; flex-shrink: 0; }
  .brand-logo { height: 34px; }
  .topnav { flex-wrap: nowrap; gap: 2px; min-width: 0; }
  .topnav a { padding: 5px 6px; font-size: .78rem; white-space: nowrap; }
  .nav-dropbtn { padding: 5px 6px; font-size: .78rem; white-space: nowrap; }
  .userbox {
    font-size: .78rem; gap: 6px;
    white-space: nowrap; flex-shrink: 0;
  }
  .userbox .btn.small { padding: 4px 8px; font-size: .76rem; }
}
/* Roomier on wide screens (1600px+). */
@media (min-width: 1600px) {
  .topbar { flex-wrap: nowrap; gap: 12px; padding: 8px 16px; }
  .brand { font-size: 1.1rem; white-space: nowrap; flex-shrink: 0; }
  .brand-logo { height: 40px; }
  .topnav { flex-wrap: nowrap; gap: 3px; min-width: 0; }
  .topnav a { padding: 6px 10px; font-size: .88rem; white-space: nowrap; }
  .nav-dropbtn { padding: 6px 10px; font-size: .88rem; white-space: nowrap; }
  .userbox {
    font-size: .88rem; gap: 10px;
    white-space: nowrap; flex-shrink: 0;
  }
  .userbox .btn.small { padding: 5px 11px; font-size: .84rem; }
}

/* ---------- laptop 1200–1365px: header stays on ONE line ----------
   Windows display scaling often leaves the browser viewport ~1200–1365px
   (e.g. ~1280px), below the 1366px tier above. In this range only, the
   paddings/fonts shrink one step further and the role text
   "(Admin / Manager)" is hidden for the admin user box — the username
   and Logout stay visible — so the full admin header still shares a
   single, vertically centred row down to 1200px.
   ≥1366px keeps the two tiers above; below 1200px the original
   wrapping / phone layout is untouched. */
@media (min-width: 1200px) and (max-width: 1365.98px) {
  .topbar { flex-wrap: nowrap; gap: 6px; padding: 8px 10px; }
  .brand { font-size: .88rem; white-space: nowrap; flex-shrink: 0; }
  .brand-logo { height: 30px; }
  .topnav { flex-wrap: nowrap; gap: 1px; min-width: 0; }
  .topnav a { padding: 5px 5px; font-size: .74rem; white-space: nowrap; }
  .nav-dropbtn { padding: 5px 5px; font-size: .74rem; white-space: nowrap; }
  .userbox {
    font-size: .74rem; gap: 5px;
    white-space: nowrap; flex-shrink: 0;
  }
  .userbox-admin small { display: none; } /* role hidden below 1366px only */
  .userbox .btn.small { padding: 4px 7px; font-size: .72rem; }
}

/* ---------- stock item combobox (purchase / request / return forms) ---------- */
.stock-cb { position: relative; }
.stock-cb-input { width: 100%; max-width: 340px; }
.stock-item-select-hidden { display: none; }
.stock-cb-list {
  position: fixed; z-index: 80; display: none;
  max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid rgba(0,0,0,.14); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.2);
  min-width: 240px; padding: 4px;
}
.stock-cb-list.open { display: block; }
.stock-cb-row { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.stock-cb-row:hover { background: #eef4f6; }
.sc-name { font-weight: 600; color: #1f2937; }
.sc-meta { font-size: .78rem; color: var(--muted); }
.hl { background: #fff3bf; border-radius: 3px; padding: 0 1px; }
.stock-cb-create { padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--teal); font-weight: 600; }
.stock-cb-create:hover { background: #eef4f6; }
.stock-cb-msg { padding: 10px; color: var(--muted); font-size: .85rem; }
.stock-cb-create-form { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.stock-cb-create-form .qc-name { flex: 1 1 100%; }
.stock-cb-create-form input[type="text"],
.stock-cb-create-form input[type="number"],
.stock-cb-create-form select { width: auto; }

/* ---------- quick-create panel (purchase “➕ Create new item”) ---------- */
.stock-cb-create-panel {
  position: fixed; z-index: 95;
  background: #fff; border: 1px solid rgba(0,0,0,.14); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.2); padding: 10px 12px; gap: 8px;
  display: flex; flex-wrap: wrap; align-items: center;
}
.stock-cb-create-panel .stock-cb-create-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0;
  min-width: 250px;
}
.stock-cb-create-panel .qc-name { flex: 1 1 150px; min-width: 130px; }
.stock-cb-create-panel .qc-cat { flex: 1 1 140px; min-width: 110px; }
.stock-cb-create-panel .qc-reorder { width: 88px; }
.stock-cb-create-panel button.btn.tiny { margin: 0; }
.stock-cb-create-panel .stock-cb-msg {
  order: 1 1 100%; color: #b00020; font-size: .85rem; padding-top: 4px;
}

/* ---------- quick-create modal (fallback “➕ New stock item”) ---------- */
.stock-cb-create-panel.modal {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, 90vw); margin: 0;
}
.stock-cb-create-panel.modal .stock-cb-create-form { min-width: auto; width: 100%; }

.stock-cb-highlight { background: #eef4f6; outline: 2px solid var(--teal); outline-offset: -2px; }

/* ---------- quantity cell: unit label right next to the input ---------- */
.qty-cell { display: flex; align-items: center; gap: 6px; }
.line-unit { color: var(--muted); font-size: .85rem; margin-left: 4px; }
td.right { text-align: right; }

/* ---------- voided purchase rows ---------- */
tr.voided { opacity: .6; text-decoration: line-through; }
tr.voided td { color: #6b7280; }
tr.voided .badge.alert { background: #b00020; }

/* ---------- item list actions ---------- */
td.nowrap .btn.tiny.danger { margin-left: 4px; }
