/* theme.css — design tokens + base styles for the MVP.
   Carried from the wireframe's dark-gold identity so the MVP stays visually
   consistent with what investors have already seen. Real customer-facing
   screens reuse these tokens (doctrine #4: modular). */
/* Design tokens — carried verbatim from the wireframe so the MVP wears the
   exact dark-gold "glass" identity investors have already seen. The aliases at
   the foot (--radius, --danger, --accent-cyan) keep the MVP's existing
   selectors resolving unchanged. */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(234, 179, 8, 0.4);
  --accent-gold: #eab308;
  --accent-gold-dim: rgba(234, 179, 8, 0.15);
  --accent-green: #22c55e;
  --accent-green-dim: rgba(34, 197, 94, 0.15);
  --accent-red: #ef4444;
  --accent-red-dim: rgba(239, 68, 68, 0.15);
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-orange: #f97316;
  --accent-orange-dim: rgba(249, 115, 22, 0.15);
  --accent-purple: #a855f7;
  --accent-teal: #14b8a6;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #9aa7bb; /* lifted again (X2): #7c8aa0 was only ~4.6:1 on the gate gradient; this clears WCAG AA (>6:1) on every surface — readable on a cheap screen in township sunlight */
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow-gold: 0 0 20px rgba(234, 179, 8, 0.15);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  /* --- aliases the MVP's existing selectors reference --- */
  --radius: 12px;
  --accent-cyan: #7dd3fc;
  --danger: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* The [hidden] attribute must always win, even over class display rules like
   .gate { display:grid } — otherwise a "hidden" gate stays visible and blocks
   the unlocked app (same-specificity author rule beats the UA [hidden] rule). */
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; -webkit-font-smoothing: antialiased; }
/* Ambient gold/blue wash behind everything — the wireframe's signature depth. */
body::before {
  content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(234, 179, 8, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}
button { font-family: inherit; }

/* Login gate — step 1 mobile number, step 2 PIN.
   Wears the wireframe's login treatment: a frosted-glass card floating on the
   ambient wash, a gradient logo chip with a soft gold glow, and a tactile pad. */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 25%, #15203a 0%, var(--bg-primary) 60%); z-index: 10; }
/* backdrop-filter is the priciest effect here; on a 2GB Android each blurred
   layer is re-sampled on every scroll frame. So it stays only on the few chrome
   surfaces (gate card, topbar, nav) at a lighter 12px radius — the repeated
   tiles/panels keep just the translucent fill, no blur (X1). */
.gate-card { width: 100%; max-width: 320px; text-align: center; padding: 40px 28px; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.login-step { display: flex; flex-direction: column; align-items: center; }
.phone-input { width: 100%; box-sizing: border-box; height: 52px; text-align: center; font-size: 20px; letter-spacing: 1px; background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); border-radius: var(--radius-md); margin-bottom: 16px; transition: var(--transition-fast); }
.phone-input::placeholder { color: var(--text-muted); }
.phone-input:focus { outline: none; border-color: var(--accent-gold); box-shadow: var(--shadow-glow-gold); }
.login-next { width: 100%; }
.who-greeting { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.login-back { margin-top: 18px; }
/* DEV ONLY — remove with the #devLogin block before public. */
.dev-login { margin-top: 26px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px dashed rgba(234,179,8,0.35); border-radius: var(--radius-sm); }
.dev-label { font-size: 9px; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
/* Gradient logo chip + gradient wordmark, mirroring the wireframe login. */
.brand { font-size: 24px; font-weight: 700; letter-spacing: 0.3px; margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand::before { content: 'S'; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: var(--bg-primary); font-size: 30px; font-weight: 800; box-shadow: var(--shadow-glow-gold); -webkit-text-fill-color: var(--bg-primary); }
.gate-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; min-height: 18px; }
.gate-hint.err { color: var(--danger); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; background: transparent; border: 2px solid var(--border-glass); transition: var(--transition-fast); }
.pin-dots i.on { background: var(--accent-gold); border-color: var(--accent-gold); box-shadow: 0 0 12px rgba(234,179,8,0.35); }
/* width:100% — the parent .login-step is align-items:center, which would
   otherwise shrink the grid to min-content and leave un-tappable keys. */
.pinpad { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { height: 60px; font-size: 22px; font-weight: 600; background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); border-radius: var(--radius-md); cursor: pointer; transition: var(--transition-fast); }
.pinpad button:hover { background: var(--bg-glass-hover); border-color: var(--accent-gold); transform: scale(1.02); }
.pinpad button:active { background: var(--accent-gold-dim); transform: scale(0.97); }
.pinpad button.zero { grid-column: 2; }
.pinpad button.back { grid-column: 3; font-size: 18px; color: var(--text-muted); }
.lang-picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 24px; }
.lang-btn { background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-muted); border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition-fast); }
.lang-btn:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.15); }
.lang-btn.active { color: var(--accent-gold); border-color: rgba(234,179,8,0.4); background: var(--accent-gold-dim); }
/* Grouped navigation — frosted tab-bar; the active tab glows gold. */
.nav-tabs { display: flex; gap: var(--space-xs); padding: var(--space-xs); margin: 4px 0 var(--space-lg); flex-wrap: wrap; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); }
.nav-tab { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; min-width: 72px; background: transparent; border: 1px solid transparent; color: var(--text-muted); border-radius: var(--radius-md); padding: 12px 20px; font-size: 11px; font-weight: 600; cursor: pointer; transition: var(--transition-normal); }
.nav-tab-icon { font-size: 22px; }
.nav-tab:hover { color: var(--text-secondary); background: var(--bg-glass-hover); }
.nav-tab.active { color: var(--accent-gold); border-color: rgba(234,179,8,0.25); background: var(--accent-gold-dim); }
@media (max-width: 700px) {
    .nav-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xs); }
    .nav-tab { padding: 10px 6px; white-space: normal; flex-direction: column; gap: 4px; }
    .nav-tab-icon { font-size: 18px; }
}
.nav-section { display: flex; flex-direction: column; }
.nav-section > button { margin-bottom: 8px; }

.panel.admin { border-color: rgba(234,179,8,0.3); }
.admin-note { font-size: 11px; color: var(--accent-orange); margin-top: 10px; }

/* Expiry watch */
.exp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 6px; border: 1px solid var(--border-glass); background: var(--bg-secondary); }
.exp-name { font-weight: 600; }
.exp-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.exp-row.exp-warning { border-color: rgba(245,158,11,0.4); }
.exp-row.exp-critical { border-color: #f59e0b; background: rgba(245,158,11,0.12); }
.exp-row.exp-critical .exp-meta { color: #f59e0b; font-weight: 700; }
.exp-row.exp-expired { border-color: var(--danger); background: rgba(239,68,68,0.12); }
.exp-row.exp-expired .exp-meta { color: var(--danger); font-weight: 800; }

/* Stock on hand (B1 floor) */
.stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 6px; border: 1px solid var(--border-glass); background: var(--bg-secondary); }
.stock-name { flex: 1; font-weight: 600; }
.stock-count { font-weight: 800; color: var(--accent-gold); min-width: 36px; text-align: right; }
.stock-row.stock-low { border-color: #f59e0b; background: rgba(245,158,11,0.1); }
.stock-row.stock-low .stock-count { color: var(--accent-orange); }
.stock-flag { font-size: 11px; font-weight: 700; color: var(--accent-orange); background: var(--accent-orange-dim); padding: 3px 8px; border-radius: 100px; white-space: nowrap; }

/* Inspector — owner-only audit */
.insp-note { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.insp-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-gold); margin: 14px 0 8px; }
.insp-op { border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.insp-op-head { margin-bottom: 6px; }
.insp-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.insp-grid span:nth-child(odd) { color: var(--text-muted); }
.insp-grid .flagged { color: var(--danger); font-weight: 700; }
.insp-flag { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 5px; font-size: 13px; border-left: 3px solid var(--border-glass); background: var(--bg-secondary); }
.insp-flag.insp-void { border-left-color: #f59e0b; }
.insp-flag.insp-short { border-left-color: var(--danger); }
.insp-flag.insp-pull { border-left-color: #38bdf8; }
.insp-flag.insp-refund { border-left-color: var(--accent-purple); }
.insp-flag.insp-duress { border-left-color: var(--danger); background: rgba(239,68,68,0.1); }

/* Refund / reverse-a-sale rows */
.refund-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.refund-row b { color: var(--accent-gold); }
.refund-row .muted { font-size: 12px; margin-top: 2px; }

/* Cash out — money leaving the till */
.co-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.co-reason { background: var(--bg-secondary); border: 1px solid var(--border-glass); color: var(--text-secondary); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; cursor: pointer; }
.co-reason.active { border-color: var(--accent-gold); color: var(--accent-gold); }
.co-reason.co-duress.active { border-color: var(--danger); color: var(--danger); }
.co-safe { margin-top: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); font-size: 13px; color: var(--text-primary); }

/* VAS / airtime float wallet */
.vas-badge { font-size: 11px; color: var(--accent-gold); margin-left: 8px; font-weight: 600; }
.vas-float-main { display: flex; flex-direction: column; align-items: center; padding: 14px; border: 1px solid var(--border-glass); border-radius: var(--radius-sm); margin-bottom: 10px; }
.vas-float-main.vas-low { border-color: var(--danger); }
.vas-float-num { font-size: 30px; font-weight: 800; color: var(--accent-gold); }
.vas-float-cap { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.vas-warn { color: var(--danger); font-size: 13px; margin-bottom: 8px; text-align: center; font-weight: 600; }
.vas-stat { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; text-align: center; }
.vas-sell { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.vas-prod { background: var(--accent-gold-dim); border: 1px solid rgba(234,179,8,0.3); color: var(--text-primary); border-radius: var(--radius-sm); padding: 12px 8px; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; align-items: center; }
.vas-prod b { color: var(--accent-gold); font-size: 12px; }
.vas-topup { display: flex; gap: 8px; align-items: center; }

/* Operator-fairness view — the same ledger, the operator's lens */
.fair-banner { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 700; text-align: center; border: 1px solid var(--border-glass); }
.fair-banner.fair-clean { border-color: var(--accent-gold); color: var(--accent-gold); background: var(--accent-gold-dim); }
.fair-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.fair-row span:first-child { color: var(--text-muted); }
.fair-good { color: #22c55e; font-weight: 600; }
.fair-protect { font-size: 12px; color: var(--text-secondary); margin: 8px 0; padding: 9px 11px; border-left: 3px solid var(--accent-gold); background: var(--bg-secondary); border-radius: 4px; }
.fair-note { margin-top: 14px; font-size: 12px; color: var(--text-muted); font-style: italic; line-height: 1.5; }

/* Daily reconciliation + vendor rating */
.recon-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-gold); margin: 14px 0 8px; }
.recon-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.recon-row span:first-child { color: var(--text-muted); }
.recon-row input { width: 90px; }
.recon-row .flagged { color: var(--danger); font-weight: 700; }
#reconcileRun, #dispatchBtn { margin-top: 12px; }
.recon-verdict { padding: 11px 13px; border-radius: var(--radius-sm); margin: 12px 0; font-weight: 700; font-size: 14px; }
.recon-verdict.recon-ok { color: #22c55e; border: 1px solid rgba(34,197,94,0.4); background: rgba(34,197,94,0.1); }
.recon-verdict.recon-bad { color: var(--danger); border: 1px solid rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); }
.rate-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.rate-row span:first-child { flex: 1; }
.grade { font-weight: 800; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.grade-A, .grade-B { color: #22c55e; background: rgba(34,197,94,0.12); }
.grade-C { color: var(--accent-gold); background: var(--accent-gold-dim); }
.grade-D, .grade-F { color: var(--danger); background: rgba(239,68,68,0.12); }
.recon-remediation { margin-top: 10px; padding: 9px 11px; border-left: 3px solid var(--danger); background: var(--bg-secondary); border-radius: 4px; font-size: 13px; }
.danger { background: var(--danger); color: #fff; border: 0; border-radius: var(--radius-sm); padding: 11px 14px; font-weight: 700; cursor: pointer; }
.pay-row { display: flex; gap: 8px; }
.pay-row button { flex: 1; }

/* POS / checkout */
/* Hero CTA — gradient gold→orange, shared by the login Next button and New sale. */
.primary-lg { background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: var(--bg-primary); border: 0; border-radius: var(--radius-md); padding: 14px 18px; font-size: 16px; font-weight: 800; cursor: pointer; width: 100%; transition: var(--transition-fast); }
.primary-lg:hover { opacity: 0.92; transform: translateY(-1px); }
#newSale.primary-lg { margin-bottom: 12px; }
.pos .pos-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fk-row { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.fk { flex: 1; min-width: 80px; background: var(--accent-gold-dim); border: 1px solid rgba(234,179,8,0.3); color: var(--text-primary); border-radius: var(--radius-sm); padding: 12px 4px; font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fk-i { font-size: 20px; }
.fk b { font-size: 13px; color: var(--accent-gold); font-weight: 700; margin-top: 2px; }
/* Graphic category filter — horizontal chip row above the product grid (long-tail
   findability at 60-100 SKUs). Same chip language as the nav/lang pills. */
.cat-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.cat-chip { background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-secondary); border-radius: 100px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: var(--transition-fast); }
.cat-chip:hover { background: var(--bg-glass-hover); }
.cat-chip.active { color: var(--accent-gold); border-color: rgba(234,179,8,0.4); background: var(--accent-gold-dim); }
.pgrid-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; max-height: 140px; overflow-y: auto; }
.pgrid { background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-secondary); border-radius: 6px; padding: 8px 10px; font-size: 12px; cursor: pointer; }
.cart { border-top: 1px solid var(--border-glass); padding-top: 10px; margin-bottom: 10px; }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; flex-wrap: wrap; }
.cart-line > span:first-child { flex: 1 1 120px; }
/* Cart controls sized for a fat thumb in the 06:00 rush — ≥40px tap targets (A5). */
.qtybox { display: flex; align-items: center; gap: 6px; }
.qtybox button { width: 40px; height: 40px; font-size: 18px; background: var(--bg-secondary); border: 1px solid var(--border-glass); color: var(--text-primary); border-radius: 8px; cursor: pointer; }
.qtybox button.x { width: auto; min-width: 40px; padding: 0 10px; font-size: 13px; color: var(--accent-gold); }
.qin { width: 48px; height: 40px; background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-primary); border-radius: 8px; text-align: center; font-size: 16px; }
.rm { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 18px; min-width: 40px; min-height: 40px; }
.pos-foot { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pos-foot .total { font-size: 24px; color: var(--accent-gold); }
#payBtn, #confirmSale { width: 100%; background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: var(--bg-primary); border: 0; border-radius: var(--radius-md); padding: 14px; font-size: 16px; font-weight: 800; cursor: pointer; transition: var(--transition-fast); }
#payBtn:hover, #confirmSale:hover { opacity: 0.92; }
#payBtn:disabled { opacity: .4; }
.tender-box { margin-top: 12px; border-top: 1px solid var(--border-glass); padding-top: 12px; }
.tender-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#tenderIn { width: 100px; background: var(--bg-glass); border: 1px solid var(--border-glass); color: var(--text-primary); border-radius: 6px; padding: 8px; font-size: 16px; text-align: right; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.quick button { background: var(--bg-secondary); border: 1px solid var(--border-glass); color: var(--text-primary); border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.change { text-align: center; margin-bottom: 12px; }
.ch-label { display: block; font-size: 12px; color: var(--text-muted); }
.ch-amt { font-size: 48px; font-weight: 800; color: #22c55e; display: block; margin-top: 4px; }
.ch-short { color: var(--danger); font-weight: 600; }
.sale-done { text-align: center; padding: 20px; }
.done-tick { font-size: 40px; color: #22c55e; }
.sale-done b { display: block; font-size: 22px; margin: 6px 0; }
.undo { background: var(--accent-orange); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 12px 18px; font-weight: 700; cursor: pointer; margin: 12px 8px 0; }
#nextSale { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 12px 18px; cursor: pointer; }
.muted { color: var(--text-muted); }

/* App */
main { position: relative; z-index: 1; padding: 16px; max-width: 760px; margin: 0 auto; }
/* Topbar — frosted bar matching the wireframe's .top-bar. */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); position: relative; z-index: 100; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--bg-primary); }
.logo-text { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-badge { font-size: 10px; font-weight: 600; color: var(--accent-gold); background: var(--accent-gold-dim); padding: 2px 8px; border-radius: 100px; letter-spacing: 0.5px; text-transform: uppercase; }
h1 { font-size: 16px; margin: 0 0 4px; display: none; /* Replaced by logo */ }
.sub { color: var(--text-muted); font-size: 12px; max-width: 60ch; line-height: 1.5; display: none; /* Replaced by logo */ }
.who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.who span { font-size: 13px; color: var(--accent-gold); font-weight: 600; }
/* Cloud-sync status pill — offline/error are calm (offline-first), not alarms. */
.sync-state { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; white-space: nowrap; }
.sync-state:empty { display: none; }
.sync-state.ss-synced { color: var(--accent-green); background: var(--accent-green-dim); padding: 4px 12px; }
.sync-state.ss-syncing { color: var(--accent-gold); background: var(--accent-gold-dim); }
.sync-state.ss-offline, .sync-state.ss-error, .sync-state.ss-unconfigured { color: var(--text-muted); background: var(--bg-glass); }
.sync-state.ss-synced::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; }
/* The "live" pulse is a nice signal but it's a FOREVER-running animation — on a
   2GB Android that keeps the compositor awake and costs battery across a till-day.
   Gate it behind the OS reduce-motion preference: animate only when motion is
   welcome, otherwise show a calm static dot. (Cheap compositor props either way.) */
@media (prefers-reduced-motion: no-preference) {
  .sync-state.ss-synced::before { animation: pulse-dot 2s ease-in-out infinite; }
}
/* Mobile header: the topbar packs a logo + operator + sync pill + language +
   Admin + Lock. On a narrow phone the nowrap `.who` group overflowed off the
   right edge. Let the bar wrap — the controls drop onto their own right-aligned
   row below the logo — and let that row wrap internally so nothing is clipped. */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px 10px; }
  .logo { min-width: 0; }
  .logo-text { font-size: 16px; }
  .who { flex: 1 1 100%; justify-content: flex-end; flex-wrap: wrap; white-space: normal; gap: 6px; }
  .who #opName { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }
/* Stats — read as KPI tiles. */
.stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 130px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: var(--space-lg); }
.stat span { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-sm); }
.stat b { display: block; font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 0; color: var(--text-primary); }
.stat.gold b { color: var(--accent-gold); }
#record, #dedupe { border: 0; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; font-weight: 700; margin-right: 8px; cursor: pointer; }
#record { background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: var(--bg-primary); }
.ghost { background: var(--bg-glass); color: var(--text-secondary); border: 1px solid var(--border-glass); border-radius: var(--radius-md); padding: 11px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition-fast); }
.ghost:hover { background: var(--bg-glass-hover); color: var(--text-primary); border-color: rgba(255,255,255,0.15); }
/* Section menu triggers read as full-width rows on the operator's phone. */
.nav-section > button.ghost { width: 100%; text-align: left; }
.sm { padding: 6px 10px; font-size: 12px; border-radius: 100px; cursor: pointer; }
.nav-section > button.ghost.sm, .who .ghost.sm { width: auto; text-align: center; }
#log { margin-top: 16px; font-size: 12px; }
.row { padding: 6px 0; border-bottom: 1px solid var(--border-glass); }
code { color: var(--accent-cyan); }

/* Panels — frosted cards (the wireframe's .card). */
.panel { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 18px; margin-top: 14px; max-width: 460px; transition: var(--transition-normal); }
.panel:hover { border-color: rgba(255,255,255,0.12); }
.panel-title { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.panel-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.panel-row .rand { font-weight: 700; }
#countInput { width: 110px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 16px; text-align: right; }
#reveal { background: var(--accent-gold); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 700; cursor: pointer; }
.verdict { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); text-align: center; }
.verdict b { font-size: 26px; display: block; margin-bottom: 2px; }
.verdict.short { background: rgba(248,113,113,0.12); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.verdict.over { background: rgba(245,158,11,0.12); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.3); }
.verdict.balanced { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.breakdown { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

/* Simulated WhatsApp OTP */
.wa-bubble { background: #075e54; color: #e9ffe9; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 14px; max-width: 320px; }
.wa-bubble .wa-meta { display: block; font-size: 10px; color: #a7d7c5; margin-bottom: 4px; }
#otpInput { width: 96px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 18px; text-align: center; letter-spacing: 4px; }
#otpVerify { background: var(--accent-gold); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 700; cursor: pointer; }
#otpResult { margin-top: 12px; font-size: 13px; }
#otpResult .ok { color: #22c55e; font-weight: 600; }
#otpResult .bad { color: var(--danger); }

/* Customer tabs / credit book */
.gauge { margin-bottom: 14px; }
.gauge-bar { height: 12px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; overflow: hidden; }
.gauge-fill { height: 100%; transition: width .2s; }
.gauge-fill.g-ok { background: #22c55e; }
.gauge-fill.g-warn { background: var(--accent-orange); }
.gauge-fill.g-bad { background: var(--danger); }
.gauge-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.cust-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #1b2128; font-size: 14px; }
.tab-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.tab-actions select { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 14px; }
#tabAmount { width: 90px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 16px; text-align: right; }
#chargeTabBtn { background: var(--accent-gold); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 700; cursor: pointer; }
#tabAuth { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#tabAuth .auth-hint { font-size: 12px; color: var(--accent-orange); }
#tabAuthPin { width: 80px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); text-align: center; letter-spacing: 3px; }
/* Add-customer row + on-tab tender (C6) */
.add-cust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.add-cust input { flex: 1 1 120px; min-width: 100px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 14px; }
#tabCust { width: 140px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); font-size: 15px; }
#tabAuthRow { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
#tabSalePin { width: 90px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); text-align: center; letter-spacing: 3px; }
#confirmTab { width: 100%; margin-top: 10px; background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange)); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 13px; font-size: 16px; font-weight: 800; cursor: pointer; }
#tabSaleResult { margin-top: 10px; font-size: 13px; }
/* Refund auth (reason + owner PIN) — mirror the tab-auth treatment so it reads as
   part of the premium UI, not raw inline form controls. */
.repay-method { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px 10px; color: var(--text-primary); font-size: 14px; }
#refundAuth { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-glass); display: flex; flex-direction: column; gap: 10px; }
#refundAuth .refund-auth-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#refundAuth .auth-hint { font-size: 12px; color: var(--accent-orange); }
#refundAuthFor { font-size: 13px; }
#refundReason { flex: 1; min-width: 150px; }
#refundAuthPin { width: 90px; background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: 6px; padding: 8px; color: var(--text-primary); text-align: center; letter-spacing: 3px; }
#refundAuthConfirm { background: var(--accent-gold); color: var(--bg-primary); border: 0; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 700; cursor: pointer; }
#refundResult { margin-top: 4px; font-size: 13px; }
#tabResult { margin-top: 12px; font-size: 13px; }
#tabResult .ok { color: #22c55e; font-weight: 600; margin-bottom: 8px; }
#tabResult .bad { color: var(--danger); }
#tabResult .muted { color: var(--text-muted); }

/* ── Wide screens (tablet landscape / desktop) ────────────────────────────────
   The app is phone-first: a single narrow column that, on a wide viewport, left
   most of the screen as dead space to the right (the marked-up demo). Here the
   working column widens, and the POS "New sale" panel becomes a genuine two-pane
   checkout — product grid on the left, cart + pay on the right — so the empty
   right column is put to work. Phone layout (<960px) is untouched. */
@media (min-width: 960px) {
  main { max-width: 1080px; padding: 24px 32px; }
  /* Text/tool panels read better a little wider, still left-aligned under the nav. */
  .panel { max-width: 620px; }

  /* POS panel spans the full working width and lays its selling markup out in two
     columns. Scoped to .pos-sell so the post-sale "sale-done" block is unaffected. */
  .panel.pos { max-width: 100%; }
  .pos-sell {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    grid-template-areas:
      "head head"
      "fk   cart"
      "cat  cart"
      "grid cart"
      "foot foot"
      "pay  pay"
      "tender tender";
    column-gap: 22px;
    align-items: start;
  }
  .pos-sell .pos-head   { grid-area: head; }
  .pos-sell .fk-row     { grid-area: fk; }
  .pos-sell .cat-bar    { grid-area: cat; }
  .pos-sell .pgrid-wrap { grid-area: grid; max-height: 360px; }
  .pos-sell .cart       { grid-area: cart; border-top: 0; border-left: 1px solid var(--border-glass); padding: 0 0 0 18px; margin: 0; }
  .pos-sell .pos-foot   { grid-area: foot; }
  .pos-sell .pay-row    { grid-area: pay; }
  .pos-sell #tender     { grid-area: tender; }

  /* Product grid: real auto-fill columns that fill the width, instead of a short
     wrap-scroll strip. More SKUs visible at once on a big screen. */
  .pos-sell .pgrid-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; }
  .pos-sell .pgrid { text-align: left; }
}
