:root {
  --brand: #FFDD2E;
  --brand-soft: #FFF6C7;
  --brown: #8e613F;
  --ink: #2b2118;
  --on-brand: #3a2a1a;
  --muted: #7a6f65;
  --bg: #fbfaf7;
  --card: #ffffff;
  --line: #ece7df;
  --ok: #2e7d4f;
  --ok-soft: #e7f4ec;
  --bad: #c0392b;
  --bad-soft: #fbeae8;
  --radius: 14px;
  --nav-h: 62px;
  --top-h: 54px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Kerangka ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brandmark { font-weight: 800; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brandmark i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); display: inline-block; }
.who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.who button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--brown); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; font-weight: 700; background: var(--bad-soft); color: var(--bad); }
.chip.open { background: var(--ok-soft); color: var(--ok); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.sample { background: var(--brand-soft); color: var(--brown); }
.chip.sample::before { display: none; }

main { padding: 16px 16px calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.nav button { border: 0; background: none; padding: 10px 0 9px; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nav button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--ink); }
.nav button.on span { box-shadow: inset 0 -6px 0 var(--brand); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0 4px; }

/* ---------- Komponen ---------- */
h1 { font-size: 22px; margin: 4px 0 14px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

.btn { border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 800; font-size: 16px; background: var(--brand); color: var(--on-brand); width: 100%; min-height: 50px; transition: transform .05s; }
.btn:active { transform: scale(.985); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--brown); }
.btn.danger { background: var(--bad); color: #fff; }
.btn:disabled { background: #efebe4; color: #a79d92; cursor: not-allowed; }
.btn.sm { width: auto; min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }

label.f { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.in { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 13px 14px; font-size: 18px; font-weight: 700; outline: none; min-height: 50px; }
.in:focus { border-color: var(--brown); box-shadow: 0 0 0 3px var(--brand-soft); }
.in.text { font-size: 16px; font-weight: 600; }
.in.money { text-align: right; }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e613F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; margin-top: 12px; }

/* ---------- Kasir ---------- */
.search { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 10; background: var(--bg); margin-top: -4px; padding: 4px 0 10px; display: flex; gap: 8px; }
.search .in { font-size: 16px; font-weight: 600; }
.search button { border: 1px solid var(--line); background: #fff; border-radius: 12px; width: 50px; flex: none; color: var(--brown); }
.search svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prod { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.prod .nm { font-weight: 700; line-height: 1.25; }
.prod .pr { font-size: 14px; color: var(--brown); font-weight: 800; margin-top: 2px; }
.prod .st { font-size: 12px; color: var(--muted); font-weight: 600; }
.prod.out { opacity: .5; }
.prod.low .st { color: var(--bad); }
.add { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--brand); color: var(--on-brand); font-size: 24px; font-weight: 800; flex: none; }
.add:disabled { background: #efebe4; color: #a79d92; }
.step { display: flex; align-items: center; gap: 4px; flex: none; }
.step button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 20px; font-weight: 800; color: var(--brown); }
.step b { min-width: 30px; text-align: center; font-size: 17px; }

.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 19; max-width: 616px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 8px 24px rgba(43,33,24,.25); }
.cartbar .sum { font-size: 13px; color: #d9cfc4; font-weight: 600; }
.cartbar .tot { font-size: 18px; font-weight: 800; }
.cartbar .btn { width: auto; padding: 10px 18px; min-height: 44px; }

/* ---------- Lembar (checkout) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(43,33,24,.45); display: flex; align-items: flex-end; justify-content: center; }
.panel { background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.panel h1 { margin-top: 0; }
.close { border: 0; background: #fff; border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; font-size: 18px; color: var(--muted); }
.lines { font-size: 14px; }
.lines .ln { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.lines .ln:last-child { border-bottom: 0; }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.method { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 10px; font-weight: 800; font-size: 15px; min-height: 52px; text-align: center; }
.method.on { border-color: var(--brown); background: var(--brand-soft); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; color: var(--brown); }
.quick button.on { background: var(--brand-soft); border-color: var(--brown); }
.hint { font-size: 13px; margin-top: 8px; font-weight: 700; }
.hint.ok { color: var(--ok); } .hint.bad { color: var(--bad); } .hint.mut { color: var(--muted); font-weight: 600; }
.done { text-align: center; padding: 10px 0 4px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 12px; }
.done .tick svg { width: 38px; height: 38px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.queue { display: inline-block; background: var(--brand); color: var(--on-brand); border-radius: 12px; padding: 4px 14px; font-weight: 800; font-size: 14px; margin-top: 8px; }

/* ---------- Shift & riwayat ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 800; }
.kv.total { font-size: 17px; }
.kv .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.expect { background: var(--brand-soft); border-radius: 12px; padding: 14px; margin-top: 12px; }
.expect .big { color: var(--ink); }
.variance { border-radius: 12px; padding: 12px 14px; font-weight: 800; margin-top: 12px; }
.variance.ok { background: var(--ok-soft); color: var(--ok); }
.variance.bad { background: var(--bad-soft); color: var(--bad); }
.hist { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 8px; }
.hist .t { font-weight: 800; }
.hist .m { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.ord { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ord:last-child { border-bottom: 0; }
.ord .it { color: var(--muted); font-size: 12px; margin-top: 3px; }
.back { border: 0; background: none; color: var(--brown); font-weight: 800; padding: 6px 0 12px; font-size: 15px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-weight: 600; }

/* ---------- Masuk ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
.login .logo { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.login .logo i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); margin-right: 10px; }
.pin { letter-spacing: .5em; text-align: center; }

.toast { position: fixed; left: 50%; top: calc(var(--top-h) + env(safe-area-inset-top) + 10px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; max-width: 90vw; }
.toast.bad { background: var(--bad); }

@media (min-width: 700px) {
  .sheet { align-items: center; }
  .panel { border-radius: 22px; }
}


.acc { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; }
.acc .hint { flex-basis: 100%; }
