/* POS Kasir — tampilan HP. Tema default Biru & Gelap, ada tema Terang + ukuran huruf Besar. */
:root {
  --bg: #0B1220; --panel: #121C30; --panel2: #18243D; --line: #24324F;
  --text: #EAF0FF; --muted: #93A4C7; --accent: #2F6BFF; --accent2: #1D4ED8;
  --gold: #E3B341; --ok: #22C55E; --warn: #F59E0B; --bad: #EF4444;
  --okbg: rgba(34,197,94,.14); --warnbg: rgba(245,158,11,.16); --badbg: rgba(239,68,68,.15);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --r: 16px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #F3F6FC; --panel: #FFFFFF; --panel2: #EEF2FA; --line: #DCE3F0;
  --text: #13203A; --muted: #5B6B8C; --accent: #2563EB; --accent2: #1D4ED8;
  --gold: #B7861B; --okbg: rgba(34,197,94,.12); --warnbg: rgba(245,158,11,.15); --badbg: rgba(239,68,68,.12);
  --shadow: 0 8px 24px rgba(20,40,90,.12);
  color-scheme: light;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-font="big"] { font-size: 19px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.okc { color: var(--ok); } .badc { color: var(--bad); } .warnc { color: var(--warn); }

.boot { height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--muted); }
.boot-logo { font-size: 3.2rem; }

/* ---------- layout ---------- */
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 14px 16px 10px; display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: 1.3rem; margin: 0; flex: 1; font-weight: 750; letter-spacing: .2px; }
.top .sub { font-size: .8rem; color: var(--muted); font-weight: 500; display: block; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: .78rem; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pill.off .dot { background: var(--warn); }
.content { flex: 1; padding: 0 16px 120px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav button { background: none; border: 0; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .78rem; font-weight: 600; border-radius: 12px; }
.nav button .ic { font-size: 1.45rem; line-height: 1.2; }
.nav button.on { color: var(--text); background: var(--panel2); }
.nav button.on .lbl { color: var(--accent); }
html[data-theme="dark"] .nav button.on .lbl, html:not([data-theme]) .nav button.on .lbl { color: #8FB0FF; }

/* ---------- cards & form ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 650; margin-bottom: 6px; font-size: .95rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.in { width: 100%; background: var(--panel2); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 1.05rem; outline: none; }
.in:focus { border-color: var(--accent); }
.in.big { font-size: 1.6rem; font-weight: 750; text-align: center; padding: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.btn { border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 1rem; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.big { padding: 16px 18px; font-size: 1.08rem; width: 100%; }
.btn-ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn-ok { background: var(--ok); color: #05210F; }
.btn-gold { background: var(--gold); color: #1B1405; }
.btn-bad { background: var(--badbg); color: var(--bad); border: 1px solid rgba(239,68,68,.35); }
.btn[disabled] { opacity: .5; }
.icon-btn { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); font-size: 1.35rem; display: grid; place-items: center; }

/* ---------- search ---------- */
.search { position: relative; display: flex; gap: 8px; margin-bottom: 10px; }
.search .in { padding-left: 44px; }
.search .mag { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .6; pointer-events: none; }
.scan-btn { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 0 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; font-size: .88rem; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- product list ---------- */
.plist { display: grid; gap: 10px; }
.prod { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; position: relative; }
.prod:active { background: var(--panel2); }
.thumb { width: 60px; height: 60px; flex: 0 0 60px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: #fff; background: #334; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod .info { flex: 1; min-width: 0; }
.prod .name { font-weight: 700; font-size: 1rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .price { font-weight: 800; color: var(--gold); margin-top: 3px; }
.prod .meta { font-size: .8rem; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.tag.low { background: var(--warnbg); color: var(--warn); }
.tag.out { background: var(--badbg); color: var(--bad); }
.tag.ok { background: var(--okbg); color: var(--ok); }
.prod.out { opacity: .55; }
.add-badge { min-width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; padding: 0 8px; }
.add-badge.has { background: var(--ok); color: #05210F; font-size: 1.05rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }

/* ---------- cart bar ---------- */
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 7; display: flex; align-items: center; gap: 12px; background: var(--ok); color: #05210F; border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 750; border: 0; text-align: left; }
.cartbar .cnt { background: rgba(0,0,0,.15); border-radius: 10px; padding: 6px 10px; font-size: .9rem; }
.cartbar .tot { flex: 1; font-size: 1.15rem; }
.cartbar .go { font-size: 1.05rem; }

/* ---------- sheet (panel bawah) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fade .15s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 94vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { margin: 0 0 4px; font-size: 1.3rem; }
.sheet .lead { color: var(--muted); margin: 0 0 16px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.cart-item { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item .nm { font-weight: 700; }
.cart-item .sm { font-size: .85rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-size: 1.3rem; font-weight: 800; }
.qty .q { min-width: 40px; text-align: center; font-weight: 800; font-size: 1.1rem; background: none; border: 0; }
.total-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-align: center; margin: 14px 0; }
.total-box .lbl { color: var(--muted); font-weight: 600; }
.total-box .val { font-size: 2.1rem; font-weight: 850; color: var(--gold); letter-spacing: .3px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.seg button { padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 750; font-size: 1.02rem; }
.seg button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.quick button { padding: 13px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-weight: 700; }
.change { border-radius: var(--r); padding: 14px; text-align: center; margin-bottom: 14px; }
.change.ok { background: var(--okbg); color: var(--ok); }
.change.bad { background: var(--badbg); color: var(--bad); }
.change .val { font-size: 1.8rem; font-weight: 850; }
.qris-img { width: 100%; max-width: 340px; display: block; margin: 0 auto 12px; border-radius: 14px; background: #fff; padding: 10px; }
.success { text-align: center; padding: 10px 0 4px; }
.success .check { width: 86px; height: 86px; border-radius: 50%; background: var(--ok); color: #05210F; font-size: 3rem; display: grid; place-items: center; margin: 6px auto 12px; animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.1); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- laporan ---------- */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat .lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat .val { font-size: 1.35rem; font-weight: 850; margin-top: 4px; }
.stat.wide { grid-column: span 2; }
.stat.wide .val { font-size: 1.9rem; color: var(--gold); }
.txrow { display: flex; gap: 10px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.txrow .a { flex: 1; min-width: 0; }
.txrow .b { text-align: right; font-weight: 800; }
.section-title { font-weight: 750; margin: 18px 0 10px; font-size: 1.02rem; }
.bar { height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---------- menu Lainnya ---------- */
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; text-align: left; }
.menu-item .ic { font-size: 1.4rem; width: 30px; text-align: center; }
.menu-item .t { flex: 1; font-weight: 650; }
.menu-item .d { display: block; font-size: .8rem; color: var(--muted); font-weight: 500; margin-top: 2px; }
.menu-item .chev { color: var(--muted); }

/* ---------- login & setup ---------- */
.hero { text-align: center; padding: 34px 20px 16px; }
.hero .logo { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 14px; background: linear-gradient(160deg, #2F6BFF, #0B1F4D); display: grid; place-items: center; font-size: 2.6rem; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: 1.55rem; }
.hero p { margin: 0; color: var(--muted); }
.users { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.user-card { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 10px; text-align: center; }
.user-card.on { border-color: var(--accent); background: var(--panel2); }
.avatar { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; }
.user-card .nm { font-weight: 700; }
.user-card .rl { font-size: .78rem; color: var(--muted); }
.brand { text-align: center; color: var(--gold); font-size: .78rem; padding: 18px 0 8px; letter-spacing: .5px; }

/* ---------- kamera ---------- */
.cam { position: fixed; inset: 0; z-index: 40; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 10%; right: 10%; top: 30%; height: 30%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); overflow: hidden; }
.cam.photo .cam-frame { top: 18%; height: 50%; left: 6%; right: 6%; }
.cam-line { position: absolute; left: 6%; right: 6%; height: 2px; background: var(--bad); top: 50%; animation: scan 1.6s ease-in-out infinite alternate; }
.cam.photo .cam-line { display: none; }
@keyframes scan { from { top: 12%; } to { top: 88%; } }
.cam-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(22px + env(safe-area-inset-top)) 20px 10px; text-align: center; color: #fff; font-weight: 700; font-size: 1.1rem; }
.cam-top .muted { color: #cbd5e1; font-weight: 500; font-size: .9rem; margin-top: 6px; }
.cam-bottom { position: absolute; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 92vw; padding: 12px 16px; border-radius: 14px; background: #1F2A44; color: #fff; font-weight: 600; box-shadow: var(--shadow); animation: up .2s; border-left: 5px solid var(--accent); }
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }

.fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 7; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 750; padding: 15px 20px; box-shadow: var(--shadow); font-size: 1.02rem; }
.photo-box { display: flex; gap: 12px; align-items: center; }
.photo-box .thumb { width: 84px; height: 84px; flex-basis: 84px; border-radius: 16px; font-size: 2rem; }
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper .in { text-align: center; font-weight: 750; }
.stepper button { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-size: 1.4rem; font-weight: 800; }
.cost-box { border: 2px dashed var(--gold); border-radius: 14px; padding: 12px; margin-bottom: 14px; background: rgba(227,179,65,.08); }
.receipt { background: #fff; color: #111; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; padding: 14px; border-radius: 12px; white-space: pre-wrap; line-height: 1.45; margin-bottom: 12px; }
