/* nota-cokelat: sistem desain prototipe Warung Zein */
:root {
  --primary: oklch(0.58 0.19 38);
  --primary-deep: oklch(0.48 0.17 38);
  --primary-foreground: oklch(0.99 0.005 70);
  --ring: oklch(0.58 0.19 38);
  --background: oklch(0.965 0.012 75);
  --surface: oklch(0.995 0.004 70);
  --surface-ink: oklch(0.24 0.025 55);
  --foreground: oklch(0.24 0.025 55);
  --muted: oklch(0.92 0.015 70);
  --muted-ink: oklch(0.48 0.03 60);
  --border: oklch(0.86 0.02 70);
  --danger: oklch(0.55 0.2 25);
  --ok: oklch(0.55 0.15 150);
  --warn: oklch(0.65 0.16 80);
  --radius: 14px;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Fraunces", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tap: 44px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 84px;
}
h1, h2, h3 { font-family: var(--font-heading); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.rp { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell-top {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface-ink); color: oklch(0.97 0.008 70);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--primary); color: var(--primary-foreground);
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 20px;
}
.brand-name { font-family: var(--font-heading); font-weight: 700; font-size: 18px; line-height: 1.1; }
.brand-sub { font-size: 11px; opacity: 0.75; }
.top-clock { margin-left: auto; text-align: right; font-size: 12px; line-height: 1.35; }
.top-clock strong { font-size: 14px; }
.offline-pill {
  display: none; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: oklch(0.7 0.16 80); color: oklch(0.3 0.05 70);
  border: none; min-height: 32px;
}
body.is-offline .offline-pill { display: inline-flex; }
.offline-toggle {
  background: transparent; border: 1px solid oklch(0.6 0.03 70); color: inherit;
  border-radius: 999px; font-size: 11px; padding: 6px 10px; min-height: 32px;
}
.shell-user {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  background: transparent; border: 1px solid oklch(0.6 0.03 70); color: inherit;
  border-radius: 999px; padding: 5px 12px 5px 5px; min-height: 36px; text-decoration: none;
}
.shell-user .avatar {
  width: 26px; height: 26px; border-radius: 999px; background: var(--primary);
  color: var(--primary-foreground); display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
}
.shell-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.shell-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; font-size: 11px; font-weight: 600; color: var(--muted-ink);
  padding: 8px 4px; border-radius: 10px; min-height: 56px; justify-content: center;
}
.shell-nav a svg { width: 22px; height: 22px; }
.shell-nav a[aria-current="page"] { color: var(--primary-deep); background: oklch(0.93 0.05 55); }
.shell-rail { display: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 16px 16px 32px; }
.page-title { font-size: 26px; margin-bottom: 2px; }
.page-desc { color: var(--muted-ink); font-size: 13px; margin-bottom: 14px; }

/* ---------- tombol & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 18px; border-radius: 12px;
  font-weight: 700; font-size: 14px; border: 1px solid transparent; text-decoration: none;
  transition: transform 120ms ease-out, background 150ms;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-deep); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--foreground); }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-big { min-height: 52px; font-size: 16px; width: 100%; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--foreground);
}
.field input:focus, .field select:focus { border-color: var(--ring); outline: 2px solid oklch(0.58 0.19 38 / 0.3); }
.field .hint { font-size: 12px; color: var(--muted-ink); margin-top: 4px; }
.searchbar {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; padding: 0 14px; min-height: 48px;
}
.searchbar input { border: none; background: none; flex: 1; min-height: 46px; font-size: 15px; font-family: inherit; color: inherit; }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { border-color: var(--ring); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; }
.chip {
  flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; min-height: 40px;
}
.chip[aria-pressed="true"] { background: var(--surface-ink); color: oklch(0.97 0.008 70); border-color: var(--surface-ink); }

/* ---------- kasir ---------- */
.kasir { display: grid; gap: 16px; }
.produk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.produk-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 8px;
  min-height: 120px; transition: border-color 150ms, transform 120ms ease-out;
}
.produk-btn:active { transform: scale(0.97); border-color: var(--primary); }
.produk-foto {
  height: 64px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: oklch(0.99 0.005 70);
}
.produk-foto.kosong {
  background: var(--muted); color: var(--muted-ink);
  font-family: var(--font-sans); font-size: 10px; font-weight: 600; text-align: center; padding: 4px;
}
.produk-nama { font-weight: 700; font-size: 13px; line-height: 1.3; }
.produk-harga { font-size: 13px; font-weight: 600; color: var(--primary-deep); }
.produk-stok { font-size: 11px; color: var(--muted-ink); }
.produk-stok.minus { color: var(--danger); font-weight: 700; }
body.is-offline .produk-foto { display: none; }
.offline-note {
  display: none; background: oklch(0.94 0.06 85); border: 1px dashed oklch(0.6 0.08 80);
  border-radius: 12px; padding: 10px 14px; font-size: 12px; margin-bottom: 10px;
}
body.is-offline .offline-note { display: block; }

/* struk nota */
.struk {
  background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 18px 18px 22px; position: relative;
}
.struk::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 12px;
  background: linear-gradient(-45deg, var(--surface) 6px, transparent 0) 0 0 / 16px 16px repeat-x,
    linear-gradient(45deg, var(--surface) 6px, transparent 0) 8px 0 / 16px 16px repeat-x;
}
.struk-head { text-align: center; margin-bottom: 10px; }
.struk-head h2 { font-size: 20px; }
.struk-head p { font-size: 11px; color: var(--muted-ink); }
.struk-rule { border: none; border-top: 2px dashed var(--border); margin: 10px 0; }
.struk-baris { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; }
.struk-baris .nm { flex: 1; }
.struk-baris .nm small { display: block; color: var(--muted-ink); font-size: 11px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--background); font-size: 16px; font-weight: 800; line-height: 1;
}
.struk-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.struk-total .angka { font-family: var(--font-mono); font-size: 26px; font-weight: 700; }
.struk-flag {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 6px; padding: 1px 7px; margin-left: 6px;
}
.struk-kosong { text-align: center; padding: 22px 8px; color: var(--muted-ink); font-size: 13px; }
.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pay-tab {
  border: 1.5px solid var(--border); background: var(--background); border-radius: 12px;
  min-height: 52px; font-weight: 800; font-size: 14px;
}
.pay-tab[aria-selected="true"] { border-color: var(--primary); background: oklch(0.95 0.05 55); color: var(--primary-deep); }
.pay-panel { display: none; }
.pay-panel.aktif { display: block; }
.nominal-cepat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.nominal-cepat button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  min-height: 44px; font-weight: 700; font-size: 13px;
}
.nominal-cepat button.pas { border-color: var(--primary); color: var(--primary-deep); }
.kembalian {
  display: flex; justify-content: space-between; align-items: baseline;
  background: oklch(0.93 0.05 150); border-radius: 12px; padding: 12px 14px; margin: 10px 0;
}
.kembalian .angka { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.kur { color: var(--danger); font-size: 12px; font-weight: 700; margin-top: 6px; display: none; }
.qris-box { border: 1.5px dashed var(--border); border-radius: 12px; padding: 14px; text-align: center; }
.qris-kode {
  width: 150px; height: 150px; margin: 8px auto; border-radius: 8px;
  background:
    conic-gradient(from 90deg at 20% 20%, var(--foreground) 25%, transparent 0) 0 0 / 30px 30px,
    conic-gradient(from 90deg at 80% 20%, var(--foreground) 25%, transparent 0) 0 0 / 30px 30px,
    conic-gradient(from 90deg at 20% 80%, var(--foreground) 25%, transparent 0) 0 0 / 30px 30px,
    var(--surface);
  border: 6px solid var(--surface); outline: 1.5px solid var(--border);
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
}
.sukses {
  display: none; text-align: center; padding: 26px 16px;
}
.sukses.aktif { display: block; }
.sukses .centang {
  width: 64px; height: 64px; border-radius: 999px; margin: 0 auto 12px;
  background: oklch(0.55 0.15 150); color: white; display: grid; place-items: center;
}
.sukses h3 { font-size: 22px; margin-bottom: 4px; }
.sukses .angka { font-family: var(--font-mono); font-size: 30px; font-weight: 700; margin: 6px 0; }

/* ---------- daftar (stok, laporan, pengguna) ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.baris-barang {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); min-height: 64px;
}
.baris-barang:last-child { border-bottom: none; }
.baris-barang .info { flex: 1; min-width: 0; }
.baris-barang .nm { font-weight: 700; font-size: 14px; }
.baris-barang .sub { font-size: 12px; color: var(--muted-ink); }
.stok-angka { font-family: var(--font-mono); font-size: 18px; font-weight: 700; min-width: 52px; text-align: right; }
.lencana {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 10px;
}
.lencana.ok { background: oklch(0.92 0.06 150); color: oklch(0.4 0.12 150); }
.lencana.tipis { background: oklch(0.93 0.07 80); color: oklch(0.45 0.12 75); }
.lencana.minus, .lencana.batal { background: oklch(0.92 0.07 25); color: oklch(0.48 0.16 25); }
.lencana.tunggu { background: oklch(0.9 0.05 250); color: oklch(0.42 0.12 250); }
.lencana.yakin-tinggi { background: oklch(0.92 0.06 150); color: oklch(0.4 0.12 150); }
.lencana.yakin-sedang { background: oklch(0.93 0.07 80); color: oklch(0.45 0.12 75); }
.lencana.yakin-rendah { background: var(--muted); color: var(--muted-ink); border: 1px dashed var(--muted-ink); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--background); font-size: 18px; font-weight: 800;
}
.angka-panel { background: var(--surface-ink); color: oklch(0.97 0.008 70); border-radius: 18px; padding: 20px; }
.angka-panel .label { font-size: 12px; opacity: 0.75; font-weight: 600; }
.angka-panel .besar { font-family: var(--font-heading); font-size: 40px; font-weight: 700; line-height: 1.1; }
.angka-panel .kecil { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.split .kotak { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.split .kotak .l { font-size: 11px; font-weight: 700; color: var(--muted-ink); }
.split .kotak .n { font-family: var(--font-mono); font-size: 17px; font-weight: 700; }
.tabel-peran { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabel-peran th, .tabel-peran td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.tabel-peran th { font-size: 11px; color: var(--muted-ink); text-transform: uppercase; letter-spacing: 0.04em; }
.cek { width: 22px; height: 22px; accent-color: var(--primary); }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 50;
  background: var(--surface-ink); color: oklch(0.97 0.008 70);
  border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600;
  display: none; text-align: center;
}
.toast.aktif { display: block; }
.tanggal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tanggal-nav button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 18px; }
.tanggal-nav strong { flex: 1; text-align: center; font-size: 15px; }
.login-wrap { max-width: 420px; margin: 6vh auto 0; }
.login-kartu { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; text-align: center; }
.login-kartu .brand-mark { width: 56px; height: 56px; font-size: 30px; margin: 0 auto 10px; }
.login-kartu h1 { font-size: 26px; }
.login-kartu form { text-align: left; margin-top: 18px; }
.tengah { text-align: center; padding: 48px 20px; }
.tengah .btn { margin-top: 16px; }
.impor-baris { display: grid; gap: 8px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.impor-atas { display: flex; align-items: center; gap: 10px; }
.impor-atas .nm { flex: 1; font-weight: 700; font-size: 14px; }
.impor-input { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.impor-input input {
  min-height: 44px; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 12px;
  font-family: inherit; font-size: 14px; width: 100%; background: var(--surface);
}

/* ---------- responsif ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .shell-nav { display: none; }
  .shell-body { display: grid; grid-template-columns: 200px 1fr; max-width: 1280px; margin: 0 auto; }
  .shell-rail {
    display: flex; flex-direction: column; gap: 4px; padding: 20px 12px;
    position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px);
  }
  .shell-rail a {
    display: flex; align-items: center; gap: 12px; text-decoration: none;
    font-weight: 700; font-size: 14px; color: var(--muted-ink);
    padding: 12px 14px; border-radius: 12px; min-height: 52px;
  }
  .shell-rail a svg { width: 22px; height: 22px; flex: none; }
  .shell-rail a[aria-current="page"] { background: var(--surface-ink); color: oklch(0.97 0.008 70); }
  .produk-grid { grid-template-columns: repeat(3, 1fr); }
  .kasir { grid-template-columns: 1fr 340px; align-items: start; }
  .struk-dock { position: sticky; top: 73px; }
  .impor-baris { grid-template-columns: 24px 1fr 220px; align-items: center; }
}
@media (min-width: 1100px) {
  .produk-grid { grid-template-columns: repeat(4, 1fr); }
}
