/* POS Gerai KDKMP
   Arah desain: perangkat kerja kasir & pembukuan, netral profesional.
   - Navy (#17233b) di navigasi: memberi bingkai tetap yang tenang, layar kerja tetap terang.
   - Biru (#1f4e8c) untuk aksi umum; hijau (#17794a) KHUSUS tombol Bayar agar mata langsung menemukannya.
   - Huruf sistem (Segoe UI di Windows kasir): tanpa unduhan font, angka tabular untuk nominal.
   - Bayangan hanya untuk dialog & toast (lapisan di atas halaman). Radius 6px kontrol, 8px panel.
   - Gerak: hover/pressed dan kilasan singkat saat barang masuk keranjang (umpan balik scan). */

:root {
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #f8fafc; --border: #e2e8f0; --border-strong: #cbd5e1;
  --text: #0f172a; --muted: #475569; --primary: #1d4ed8; --primary-hover: #1e40af; --primary-ink: #ffffff; --primary-soft: #eff6ff;
  --pay: #16904f; --pay-hover: #127841; --pay-ink: #ffffff;
  --danger: #dc2626; --danger-soft: #fef2f2; --warn: #b45309; --warn-soft: #fffbeb; --ok: #15803d; --ok-soft: #f0fdf4;
  --nav-bg: #0f172a; --nav-text: #cbd5e1; --nav-label: #64748b; --nav-active: #ffffff; --nav-active-bg: #1e293b; --nav-hover: #1e293b;
  --focus: #2563eb;
  --r-sm: 8px; --r-md: 12px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-pop: 0 20px 40px -12px rgba(15, 23, 42, .25), 0 4px 12px rgba(15, 23, 42, .1);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --top-h: 58px; --side-w: 228px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1120; --surface: #111827; --surface-2: #1e293b; --border: #1e293b; --border-strong: #334155;
  --text: #f1f5f9; --muted: #94a3b8; --primary: #60a5fa; --primary-hover: #93c5fd; --primary-ink: #0f172a; --primary-soft: #1e293b;
  --pay: #22c55e; --pay-hover: #16a34a; --pay-ink: #052e16;
  --danger: #f87171; --danger-soft: #450a0a; --warn: #fbbf24; --warn-soft: #451a03; --ok: #4ade80; --ok-soft: #052e16;
  --nav-bg: #090d16; --nav-text: #cbd5e1; --nav-label: #64748b; --nav-active-bg: #1e293b; --nav-hover: #162032;
  --focus: #60a5fa;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-pop: 0 20px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; margin-top: 1rem; }
p { margin: 0 0 .6rem; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
a[href], button:not(:disabled), select, summary, label[for], input[type=checkbox], input[type=radio], [role=tab] { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .88em; }
.num { text-align: right; white-space: nowrap; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.error-text { color: var(--danger); }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.gap { gap: .6rem; } .gap-sm { gap: .35rem; }
.grow { flex: 1 1 200px; }
.align-end { align-self: flex-end; }
kbd { font: 600 .7rem var(--mono); padding: 1px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .75; margin-left: .35rem; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding: .45rem .95rem; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn-sm { min-height: 34px; padding: .25rem .65rem; font-size: .88rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="dark"] .btn-danger { color: #1a0605; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
.btn-block { width: 100%; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; font-size: 1.4rem; line-height: 1; }
.btn-icon:hover { background: var(--surface-2); border-color: var(--border); }
.btn-icon.xs { width: 28px; height: 28px; font-size: .95rem; border-color: var(--border); background: var(--surface); border-radius: 6px; }
.btn-icon.xs.danger { color: var(--danger); }
.btn-icon.xs.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-link { background: none; border: 0; color: var(--primary); text-decoration: underline; padding: .3rem .2rem; min-height: 32px; }
.btn-link.danger { color: var(--danger); }
.btn-link.sm { font-size: .82rem; }
.push-left { margin-right: auto; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; min-width: 0; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text); }
.field .req { color: var(--danger); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  min-height: 40px; padding: .45rem .65rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); width: 100%; }
input[type=file] { min-height: 40px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.hint { color: var(--muted); font-size: .8rem; }
.check { display: flex; align-items: center; gap: .55rem; min-height: 40px; margin-bottom: .5rem; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.input-sm { min-height: 36px !important; padding: .3rem .5rem !important; width: 110px !important; }
.input-xl { font-size: 1.6rem; font-weight: 650; text-align: right; min-height: 56px !important; }
input.num { text-align: right; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-2.top { align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.span-2 { grid-column: span 2; }
.field.inline { margin: 0; }
.w-sm { width: 110px; } .w-md { width: 170px; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.seg label { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem .85rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 550; }
.seg input { accent-color: var(--primary); width: 18px; height: 18px; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.seg label:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* ---------- layar awal & loading ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); }
.boot-card { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 2.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); text-align: center; }
.boot-logo { border-radius: 12px; }
.boot-card strong { font-size: 1.05rem; }
.boot-card span { color: var(--muted); font-size: .9rem; }
.boot-spin, .loading::before { width: 22px; height: 22px; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: .65rem; padding: 2rem 0; color: var(--muted); }
.loading::before { content: ""; width: 18px; height: 18px; flex-shrink: 0; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 20% 15%, var(--primary-soft) 0%, transparent 55%), var(--bg); }
.auth-shell { width: min(880px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); overflow: hidden; }
.auth-hero { background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 100%); color: #f8fafc; padding: 2.25rem 2rem; display: flex; flex-direction: column; gap: 1.35rem; border-right: 1px solid rgba(255,255,255,.08); }
.auth-hero-brand { display: flex; align-items: center; gap: .9rem; }
.auth-hero-brand img { border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.28); flex-shrink: 0; }
.auth-eyebrow { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #93c5fd; margin-bottom: .15rem; }
.auth-hero-brand h2 { margin: 0; font-size: 1.35rem; font-weight: 800; color: #ffffff; letter-spacing: -.01em; }
.auth-hero-desc { margin: 0; font-size: .92rem; line-height: 1.5; color: #cbd5e1; }
.auth-list { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-direction: column; gap: .95rem; }
.auth-list li { display: flex; align-items: flex-start; gap: .75rem; }
.auth-li-ico { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.14); color: #93c5fd; display: grid; place-items: center; flex-shrink: 0; }
.auth-list strong { display: block; font-size: .9rem; font-weight: 700; color: #ffffff; line-height: 1.25; }
.auth-list small { display: block; font-size: .8rem; color: #cbd5e1; line-height: 1.35; margin-top: .15rem; }
.auth-hero-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.auth-guide-link { display: inline-flex; align-items: center; gap: .45rem; color: #e2e8f0; text-decoration: none; font-size: .88rem; font-weight: 600; padding: .4rem .65rem; border-radius: var(--r-sm); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); transition: background .15s, color .15s; }
.auth-guide-link:hover { background: rgba(255,255,255,.16); color: #ffffff; }
.auth-card { width: 100%; background: var(--surface); padding: 2rem; display: flex; flex-direction: column; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1.25rem; }
.auth-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 650; padding: .22rem .6rem; border-radius: 99px; border: 1px solid transparent; }
.auth-status.online { background: var(--ok-soft); color: var(--ok); }
.auth-status.local { background: var(--warn-soft); color: var(--warn); }
.auth-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.auth-theme-btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: var(--r-sm); }
.auth-mobile-brand { display: none; align-items: center; gap: .6rem; margin-bottom: .75rem; font-weight: 750; font-size: 1rem; color: var(--text); }
.auth-mobile-brand img { border-radius: 8px; }
.auth-card h1 { margin-bottom: .2rem; font-size: 1.45rem; }
.auth-sub { margin-bottom: 1.15rem; }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { padding-right: 2.6rem; width: 100%; }
.pw-btn { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-btn:hover { color: var(--text); background: var(--surface-2); }
.pw-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-foot { margin-top: 1.1rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.auth-mobile-guide { display: none; color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-mobile-guide:hover { text-decoration: underline; }
.setup { width: min(880px, 100%); }
.setup .lead { color: var(--muted); margin-bottom: 1.25rem; }
.setup-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.setup-alt { background: var(--surface-2); }

/* ---------- kerangka ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; padding: 0 1.1rem; background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); z-index: 10; }
.menu-btn { display: none; color: var(--text); }
.brand-wrap { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { color: var(--text); font-weight: 750; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.brand-sub { font-size: .74rem; color: var(--muted); }
.top-status { flex: 1; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600; padding: .28rem .7rem; border-radius: var(--r-sm); text-decoration: none; min-height: 32px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-ok { color: var(--ok); background: var(--ok-soft); }
.status-ok::before { background: var(--ok); }
.status-off { color: var(--warn); background: var(--warn-soft); }
.status-off::before { background: var(--warn); }
.top-right { display: flex; align-items: center; gap: .6rem; }
.clock { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.who-wrap { display: flex; align-items: center; gap: .45rem; padding: 0 .3rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: .85rem; display: grid; place-items: center; flex-shrink: 0; }
.who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; color: var(--text); font-size: .86rem; }
.who small { color: var(--muted); font-size: .74rem; }
.sidebar { background: var(--nav-bg); color: var(--nav-text); overflow-y: auto; padding: .6rem .65rem 1.5rem; }
.nav-group { margin-top: 1rem; display: flex; flex-direction: column; gap: 3px; }
.nav-group:first-child { margin-top: .25rem; }
.nav-label { font-size: .72rem; color: var(--nav-label); font-weight: 650; padding: 0 .7rem .25rem; }
.sidebar a { display: flex; align-items: center; gap: .65rem; min-height: 40px; padding: .45rem .75rem; border-radius: var(--r-sm); color: var(--nav-text); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; transition: background .14s, color .14s, border-color .14s; }
.sidebar a .nav-ico { flex-shrink: 0; opacity: .78; }
.sidebar a:hover .nav-ico, .sidebar a.active .nav-ico { opacity: 1; }
.sidebar a:hover { background: var(--nav-hover); color: #fff; }
.sidebar a.active { background: var(--nav-active-bg); color: var(--nav-active); font-weight: 650; border-left-color: #60a5fa; }
.sidebar a:focus-visible { outline-color: #8bb4f0; outline-offset: -2px; }
.scrim { display: none; }
main { overflow-y: auto; min-width: 0; }
main:focus { outline: none; }
.page { padding: 1.25rem 1.5rem 3rem; max-width: 1280px; }
.page.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .1rem; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem 1.35rem; margin-bottom: 1rem; box-shadow: var(--shadow-card); }
.panel h2 + .grid-2, .panel h2 + .grid-3 { margin-top: .5rem; }
.panel > h2:not(:first-child) { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.note-panel { background: var(--primary-soft); border-color: transparent; }
.note-panel ol { margin: 0; padding-left: 1.2rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.toolbar .field.inline label { font-size: .78rem; color: var(--muted); }
.toolbar .range { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.toolbar .range select,
.toolbar .range input[type="date"] { width: auto; flex: 0 0 auto; }
.empty { padding: 1.75rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.empty.small { padding: 1rem; }
.error-box { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--r-sm); padding: .6rem .8rem; }
.empty.error-box { border-style: solid; }
.tag { display: inline-block; font-size: .72rem; font-weight: 650; padding: 1px 6px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); vertical-align: middle; }
.tag-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.stock { font-weight: 600; }
.stock.low { color: var(--warn); }
.stock.out { color: var(--danger); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.plain-list.dense li { padding: .35rem 0; }
.plain-list li:last-child { border-bottom: 0; }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl thead th { background: var(--surface-2); font-size: .78rem; font-weight: 650; color: var(--muted); position: sticky; top: 0; white-space: nowrap; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl.compact th, .tbl.compact td { padding: .35rem .5rem; }
.tbl.compact th[scope=row] { font-weight: 500; color: var(--muted); }
.tbl tr.strong th, .tbl tr.strong td { font-weight: 700; color: var(--text); }

/* ---------- tab ---------- */
.tabs { display: inline-flex; gap: .25rem; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: .3rem; margin-bottom: 1rem; }
.tabs button { min-height: 36px; padding: .35rem .85rem; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-weight: 600; font-size: .88rem; transition: background .12s, color .12s, box-shadow .12s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpis > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: .8rem 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow-card); }
.kpis span { font-size: .8rem; color: var(--muted); }
.kpis strong { font-size: 1.2rem; margin-top: .15rem; }
.today { display: grid; grid-template-columns: 1.3fr 2fr; gap: 1rem; margin-bottom: 1rem; }
.today-main { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); color: #fff; border-radius: var(--r-md); padding: 1.35rem 1.5rem; display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--shadow-card); }
.today-main span { color: #cbd5e1; font-size: .9rem; }
.today-main strong { font-size: 2.25rem; font-weight: 750; letter-spacing: -.02em; }
.today-main small { color: #94a3b8; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.today-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.today-side > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.1rem; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-card); }
.today-side span { font-size: .8rem; color: var(--muted); }
.today-side strong { font-size: 1.25rem; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 0 1rem; align-items: start; }
.dash-grid .span-2 { grid-column: auto; }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .bar { fill: var(--primary); opacity: .45; }
.chart .bar.hl { opacity: 1; }
.chart-labels { display: flex; }
.chart-labels span { flex: 1; text-align: center; font-size: .74rem; color: var(--muted); display: flex; flex-direction: column; padding-top: .3rem; }
.chart-labels strong { color: var(--text); font-size: .76rem; font-weight: 600; }

/* ---------- KASIR (gaya minimarket / Accurate POS modern) ---------- */
.main-wide { overflow: hidden; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; height: calc(100vh - var(--top-h)); }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 1rem 1.1rem; gap: .75rem; overflow: hidden; background: var(--bg); }
.pos-top { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.pos-search { position: relative; flex: 1 1 240px; }
.view-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.view-switch .btn { border: 0; min-height: 32px; padding: .2rem .65rem; background: transparent; color: var(--muted); }
.view-switch .btn.on { background: var(--primary); color: var(--primary-ink); }
.pgrid.as-list { display: flex; flex-direction: column; gap: 4px; }
.plist-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto 7rem; gap: .75rem; align-items: center; min-height: 44px; padding: .45rem .8rem; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); text-align: left; transition: border-color .12s, background .12s; }
.plist-row:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.plist-row:disabled { opacity: .52; }
.plist-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist-price { text-align: right; color: var(--primary); font-weight: 700; }
.pos-search .search-ico { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#pos-q.k-input { min-height: 48px; padding-left: 2.65rem; padding-right: 3.2rem; font-size: 1rem; border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); }
#pos-q.k-input:focus-visible { border-color: var(--primary); }
.pos-search kbd { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 2px; flex-shrink: 0; }
.chip { min-height: 36px; padding: .3rem .85rem; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); white-space: nowrap; font-weight: 600; font-size: .85rem; color: var(--muted); transition: background .12s, border-color .12s, color .12s; }
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: .7rem; overflow-y: auto; align-content: start; padding: 2px 2px 1rem; flex: 1; }
.ptile { display: flex; flex-direction: column; text-align: left; gap: .35rem; min-height: 112px; padding: .75rem .85rem; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); transition: border-color .14s, transform .08s, box-shadow .14s; }
.ptile:hover:not(:disabled) { border-color: var(--primary); box-shadow: 0 4px 12px rgba(29, 78, 216, .12); transform: translateY(-1px); }
.ptile:active:not(:disabled) { transform: scale(.985); }
.ptile:disabled { opacity: .52; }
.ptile-top { display: flex; justify-content: space-between; align-items: center; gap: .35rem; width: 100%; }
.ptile-cat { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.ptile-stock { font-size: .72rem; font-weight: 650; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.ptile-stock.low { background: var(--warn-soft); color: var(--warn); }
.ptile-stock.out { background: var(--danger-soft); color: var(--danger); }
.ptile-name { font-weight: 650; font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.ptile-bot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: .35rem; width: 100%; flex-wrap: wrap; }
.ptile-sku { font-size: .72rem; color: var(--muted); font-family: var(--mono); }
.ptile-price { font-size: 1.02rem; font-weight: 750; color: var(--primary); }
.grid-note { grid-column: 1 / -1; text-align: center; }

.pos-right { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--border); }
.cart-head { display: flex; gap: .5rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.cust-btn { flex: 1; justify-content: flex-start; overflow: hidden; }
.cust-btn strong { overflow: hidden; text-overflow: ellipsis; }
.cust-btn kbd { margin-left: auto; }
.cart-lines { flex: 1; overflow-y: auto; }
.cart-empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.cart-empty svg { opacity: .45; margin-bottom: .25rem; }
.cline { display: flex; flex-direction: column; gap: .35rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border); transition: background .1s; cursor: pointer; }
.cline:hover { background: var(--surface-2); }
.cline.sel { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.cline.flash { animation: flash .55s ease-out; }
@keyframes flash { from { background: #dbeafe; } to { background: var(--primary-soft); } }
[data-theme="dark"] .cline.flash { animation-name: flash-dark; }
@keyframes flash-dark { from { background: #1e3a8a; } to { background: var(--primary-soft); } }
.cl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.cl-name { font-weight: 650; font-size: .94rem; line-height: 1.25; }
.cl-total { font-weight: 750; font-size: .95rem; white-space: nowrap; }
.cl-bot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cl-price { font-size: .8rem; color: var(--muted); }
.cl-controls { display: flex; align-items: center; gap: .3rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.step-btn { width: 28px; height: 28px; border: 0; background: transparent; font-weight: 700; font-size: 1rem; line-height: 1; color: var(--text); }
.step-btn:hover { background: var(--surface-2); }
.step-qty { min-width: 34px; height: 28px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: transparent; font-weight: 700; font-size: .88rem; padding: 0 .35rem; }
.step-qty:hover { background: var(--primary-soft); }
.cart-foot { border-top: 1px solid var(--border); background: var(--surface-2); padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .6rem; }
.cart-sum { display: flex; flex-direction: column; gap: .2rem; }
.sum-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.sum-row span:last-child { color: var(--text); font-weight: 600; }
.cart-tools-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .45rem; }
.btn-pay { min-height: 58px; border-radius: var(--r-md); border: 0; background: linear-gradient(180deg, #1ea861 0%, var(--pay) 100%); color: var(--pay-ink); display: flex; align-items: center; justify-content: space-between; padding: 0 1.15rem; font-size: 1.15rem; font-weight: 750; box-shadow: 0 2px 6px rgba(22, 144, 79, .28); transition: transform .1s, filter .15s, box-shadow .15s; }
.btn-pay kbd { border-color: currentColor; font-size: .75rem; opacity: .85; }
.btn-pay strong { font-size: 1.4rem; font-family: var(--mono); }
.btn-pay:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 4px 12px rgba(22, 144, 79, .36); }
.btn-pay:active:not(:disabled) { transform: translateY(1px); }
.btn-pay:disabled { opacity: .45; box-shadow: none; }
.btn-pay-sm { background: var(--pay); border-color: var(--pay); color: var(--pay-ink); min-height: 46px; padding-inline: 1.2rem; }
.btn-pay-sm:hover:not(:disabled) { background: var(--pay-hover); }
.cart-jump { display: none; }
.search-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-sm); }
.srow { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto 6.5rem; gap: .75rem; align-items: center; min-height: 46px; padding: .4rem .75rem; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; }
.srow:hover, .srow.hl { background: var(--primary-soft); }
.srow.hl { box-shadow: inset 4px 0 0 var(--primary); }
.srow .mono { color: var(--muted); }
.srow .num { text-align: right; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.pay-due { background: #0b1220; color: #a9b8cd; padding: .7rem 1rem; border-radius: var(--r-md); }
.pay-due strong { font: 700 2.2rem var(--mono); color: #6ff0a3; }
.pay-in label { font-weight: 650; white-space: nowrap; }
.pay-in input { max-width: 60%; }
.pay-change { padding: .7rem 1rem; border-radius: var(--r-md); background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.pay-change strong { font: 700 1.8rem var(--mono); }
.pay-change strong.neg { color: var(--danger); }
.done-grid { display: grid; gap: .5rem; margin-bottom: 1rem; }
.done-grid > div { display: flex; justify-content: space-between; align-items: baseline; padding: .5rem .9rem; border-radius: var(--r-sm); background: var(--surface-2); }
.done-grid strong { font: 700 1.2rem var(--mono); }
.done-grid .done-change { background: #0b1220; color: #a9b8cd; padding: .8rem 1rem; }
.done-grid .done-change strong { font-size: 2.3rem; color: #6ff0a3; }
.receipt-details summary { min-height: 40px; display: flex; align-items: center; font-weight: 600; color: var(--primary); }

/* Halaman kasir layar penuh: menu samping disembunyikan, dibuka lewat tombol menu. */
.shell.kasir-mode { grid-template-columns: 1fr; }
.kasir-mode .menu-btn { display: inline-flex; }
.kasir-mode .sidebar { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(280px, 85vw); z-index: 50; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
.kasir-mode .sidebar.open { transform: none; visibility: visible; }
.kasir-mode .scrim:not([hidden]) { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(10,16,28,.45); z-index: 40; }
.pick-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-sm); }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; text-align: left; padding: .6rem .75rem; min-height: 52px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); width: 100%; }
.pick-row:last-child { border-bottom: 0; }
button.pick-row:hover { background: var(--primary-soft); }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 .75rem; }
.diff-box { display: flex; justify-content: space-between; align-items: baseline; padding: .7rem .9rem; border-radius: var(--r-sm); margin-bottom: .75rem; background: var(--surface-2); color: var(--text); font-weight: 500; }
.diff-box { background: var(--surface-2); color: var(--text); font-weight: 500; }
.close-box { background: var(--surface-2); border-radius: var(--r-md); padding: 1rem; }
.totals-box { margin: .75rem 0 0 auto; max-width: 340px; }
.totals-box > div { display: flex; justify-content: space-between; padding: .15rem 0; }
.totals-box .strong { font-weight: 750; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .35rem; }
.margin-info { font-size: .88rem; color: var(--muted); min-height: 1.3em; }
.item-entry { margin-bottom: .5rem; }
.sticky-foot { position: sticky; bottom: 0; margin-top: 1rem; box-shadow: 0 -1px 0 var(--border); }

/* ---------- dialog ---------- */
.dlg { border: 1px solid var(--border); padding: 0; border-radius: var(--r-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); }
.dlg[open] { animation: dlg-in .16s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.dlg::backdrop { background: rgba(10, 16, 28, .52); backdrop-filter: blur(3px); }
.dlg-sm { width: min(420px, calc(100vw - 1.5rem)); }
.dlg-lg { width: min(820px, calc(100vw - 1.5rem)); }
.dlg-pay { width: min(520px, calc(100vw - 1.5rem)); }
.dlg-receipt { width: min(440px, calc(100vw - 1.5rem)); }
.dlg-form { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem .8rem 1.2rem; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; font-size: 1.1rem; }
.dlg-body { padding: 1rem 1.2rem; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding: .75rem 1.2rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md); }

/* ---------- toast ---------- */
.toasts { position: fixed; top: calc(var(--top-h) + .6rem); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; z-index: 1000; width: max-content; max-width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.toast { padding: .7rem 1rem; border-radius: var(--r-sm); background: #1d2738; color: #fff; box-shadow: var(--shadow-pop); font-size: .9rem; transition: opacity .25s, transform .25s; }
.toast-success { background: #11603a; }
.toast-error { background: #9b1c13; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- struk ---------- */
.receipt-preview { background: #f8fafc; color: #000; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1rem .75rem; display: flex; justify-content: center; }
.receipt { font: 12px/1.42 var(--font); font-variant-numeric: tabular-nums; color: #111; background: #fff; padding: 14px 12px; width: 320px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.receipt.w58 { width: 256px; font-size: 11.5px; padding: 12px 10px; }
.receipt .r-center { text-align: center; }
.receipt .r-head { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 4px; }
.receipt .r-logo { margin-bottom: 3px; }
.receipt .r-store { font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.receipt .r-sub { font-size: 11px; color: #333; line-height: 1.3; }
.receipt .r-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #222; }
.receipt .r-right { text-align: right; }
.receipt .r-inv { font-family: var(--mono); font-size: 10.5px; font-weight: 600; margin-top: 1px; }
.receipt .r-line { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.receipt .r-line span:last-child { text-align: right; white-space: nowrap; }
.receipt .r-sep { border-top: 1.5px dotted #555; margin: 7px 0; }
.receipt .r-sep-thin { border-top: 1px solid #bbb; margin: 4px 0; }
.receipt .r-item { margin-bottom: 5px; }
.receipt .r-iname { font-weight: 700; color: #000; }
.receipt .r-idet { padding-left: 10px; font-size: 11px; color: #333; }
.receipt .r-total { font-weight: 800; font-size: 14px; color: #000; padding: 2px 0; }
.receipt .r-change { font-weight: 700; }
.receipt .r-save { text-align: center; font-size: 11px; font-weight: 700; border: 1px dashed #333; padding: 3px 6px; margin-top: 5px; }
.receipt .r-void { font-weight: 800; font-size: 13px; margin-top: 6px; border: 1.5px solid #000; padding: 3px; }
.receipt .r-foot { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; }
.receipt .r-barcode { width: 72%; height: 22px; fill: #000; margin-top: 2px; }
.receipt .r-small { font-size: 10px; color: #444; font-family: var(--mono); }
.ptile-ws { font-size: .72rem; color: var(--ok); font-weight: 600; }
.shelf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shelf-tag { border: 1.5px solid #111; padding: 8px 10px; border-radius: 4px; page-break-inside: avoid; color: #000; background: #fff; }
.shelf-tag .st-name { font-weight: 700; font-size: 11.5px; line-height: 1.2; margin-bottom: 3px; }
.shelf-tag .st-price { font-size: 16px; font-weight: 800; }
.shelf-tag .st-price small { font-size: 10px; font-weight: 500; }
.shelf-tag .st-sub { font-size: 9.5px; color: #333; }
.shelf-tag .st-code { display: flex; flex-direction: column; align-items: center; margin-top: 4px; font: 9px var(--mono); }
.shelf-tag .r-barcode { width: 85%; height: 18px; fill: #000; }
#print-area { display: none; }

/* ---------- responsif ---------- */
@media (max-width: 1100px) {
  .today { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(280px, 85vw); z-index: 50; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(10,16,28,.45); z-index: 40; }
  .clock { display: none; }
  .main-wide { overflow-y: auto; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-left { overflow: visible; }
  .pgrid { overflow: visible; }
  .pos-right { border-left: 0; border-top: 1px solid var(--border); scroll-margin-top: var(--top-h); }
  .cart-lines { overflow: visible; }
  .cart-jump { display: flex; position: sticky; bottom: 0; justify-content: center; align-items: center; min-height: 52px; background: var(--pay); color: var(--pay-ink); font-weight: 650; text-decoration: none; z-index: 5; }
  .setup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; width: min(440px, 100%); }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-mobile-guide { display: inline-block; }
  .auth-card { padding: 1.5rem; }
}
@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: 0 .5rem; }
  .brand-name { max-width: 130px; }
  .who-wrap, .top-status { display: none; }
  .page { padding: 1rem .85rem 3rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .today-side { grid-template-columns: 1fr 1fr; }
  .today-side > div:last-child { grid-column: span 2; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srow { grid-template-columns: minmax(0, 1fr) auto; }
  .srow .mono { display: none; }
  .pay-in { flex-direction: column; align-items: stretch; gap: .25rem; }
  .pay-in input { max-width: none; }
  .toolbar > * { flex: 1 1 100%; }
  .toolbar .range input[type="date"], .toolbar .range select { flex: 1 1 40%; }
  .w-sm, .w-md { width: calc(50% - .3rem); }
  .item-entry .btn { width: 100%; }
  /* tabel berubah jadi kartu agar tidak menggulir ke samping */
  .table-wrap { border: 0; background: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tfoot { display: block; }
  .tbl tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: .5rem; padding: .35rem .25rem; }
  .tbl tbody tr:hover { background: var(--surface); }
  .tbl td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .6rem; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; font-weight: 600; }
  .tbl td.actions { justify-content: flex-end; flex-wrap: wrap; }
  .tbl td.actions::before { content: none; }
  .tbl tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .tbl tfoot td { background: none; }
  .tbl tfoot td:empty { display: none; }
  .tbl.compact tr { display: flex; justify-content: space-between; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; }
  .tbl.compact th, .tbl.compact td { border: 0; }
  .input-sm { width: 120px !important; }
  .dlg-foot .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- cetak ---------- */
@media print {
  body.printing-receipt > *:not(#print-area), body.printing-report > *:not(#print-area) { display: none !important; }
  body.printing-receipt dialog, body.printing-report dialog { display: none !important; }
  #print-area { display: block !important; }
  body { background: #fff; color: #000; }
  body.printing-receipt #print-area .receipt { width: 100%; font-size: 11px; }
  .print-report { font: 11px/1.35 var(--font); color: #000; }
  .print-report h2 { font-size: 15px; margin: 0; }
  .print-report h3 { font-size: 13px; margin: 2px 0 10px; }
  .print-report .tbl { font-size: 10.5px; }
  .print-report .tbl th, .print-report .tbl td { padding: 3px 6px; border-bottom: 1px solid #bbb; color: #000; background: none !important; }
  .print-report .table-wrap { border: 0; overflow: visible; }
  .print-report .kpis { display: flex; gap: 12px; }
  .print-report .kpis > div { border: 1px solid #bbb; padding: 4px 8px; }
  .print-report button { display: none; }
}
