:root {
  --jual: #047857;  --jual-l: #E3F5EE;   /* penjualan: hijau daun */
  --beli: #1D4ED8;  --beli-l: #E4ECFD;   /* pembelian: biru */
  --piutang: #EA580C; --piutang-l: #FFEDE2;
  --hutang: #7C3AED;  --hutang-l: #F0E9FE;
  --kuning: #F5B000; --kuning-d: #8A5A00;
  --red: #DC2626; --green: #15803D;
  --accent: var(--jual); --accent-l: var(--jual-l);
  --bg: #F2F4F3; --paper: #fff; --text: #1C2321; --muted: #66706D; --line: #E1E6E4;
  --r: 14px; --r-sm: 9px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px; --w: 760px; --side: 0px;
  --shadow: 0 1px 2px rgba(20,40,35,.06), 0 2px 10px rgba(20,40,35,.05);
}
body.mode-beli { --accent: var(--beli); --accent-l: var(--beli-l); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.money, .num, input[type=number] { font-variant-numeric: tabular-nums; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--kuning); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; }
.red { color: var(--red); } .green { color: var(--green); } .orange { color: var(--piutang); } .violet { color: var(--hutang); }
a { color: inherit; }

/* ---------- appbar ---------- */
.shell { margin-left: var(--side); min-width: 0; }
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px;
  min-height: 58px; padding: env(safe-area-inset-top, 0px) 8px 0 18px; background: var(--accent); color: #fff;
  transition: background .2s;
}
.appbar h1 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btnBack { margin-left: -10px; }
#appbarActions { display: flex; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.15); }
main { max-width: var(--w); margin: 0 auto; padding: 12px 12px 110px; outline: none; }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card > h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 800; }
.list { background: var(--paper); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow); }
.li {
  display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer; color: inherit; text-decoration: none;
}
.li:last-child { border-bottom: 0; }
.li:hover { background: #F7F9F8; }
.grow { flex: 1; min-width: 0; }
.t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s { font-size: 13px; color: var(--muted); }
.amt { font-weight: 800; text-align: right; white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* avatar inisial */
.av { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.b-lunas { background: #DCF5E5; color: var(--green); }
.b-belum { background: var(--piutang-l); color: var(--piutang); }
.b-hutang { background: var(--hutang-l); color: var(--hutang); }
.b-minus { background: #FDE3E3; color: var(--red); }
.b-tipis { background: #FFF3CF; color: var(--kuning-d); }
.b-ok { background: var(--jual-l); color: var(--jual); }
.b-jual { background: var(--jual-l); color: var(--jual); }
.b-beli { background: var(--beli-l); color: var(--beli); }
.tag-new { padding: 1px 7px; border-radius: 6px; background: #FFF3CF; color: var(--kuning-d); font-size: 11px; font-weight: 800; }

/* daftar nota */
.trx { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trx:last-child { border-bottom: 0; }
.trx:hover { background: #F7F9F8; }
.trx .kname { font-weight: 800; font-size: 16px; }
.trx .kname[data-k]:not([data-k=""]):hover { text-decoration: underline; color: var(--accent); }
.trx .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.trx .st { font-size: 14px; margin-top: 2px; }
.trx .ico { color: #B3BDB9; display: flex; gap: 2px; padding-top: 4px; }
.trx .ico svg { width: 17px; height: 17px; }
.trx .ico .on { color: var(--accent); }
.footsum {
  position: fixed; z-index: 20; left: var(--side); right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center; pointer-events: none;
}
.footsum > div {
  width: 100%; max-width: var(--w); padding: 8px 16px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted); backdrop-filter: blur(6px);
}
.footsum b { color: var(--text); }

/* segmen jual/beli */
.seg { display: flex; padding: 4px; margin-bottom: 10px; background: #E3E8E6; border-radius: 12px; }
.seg button { flex: 1; padding: 9px; border: 0; border-radius: 9px; background: none; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--accent); box-shadow: var(--shadow); }
.seg button[data-j=jual].on { color: var(--jual); }
.seg button[data-j=beli].on { color: var(--beli); }

/* ringkasan / tile */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { padding: 12px 14px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.tile .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile .v { font-size: 19px; font-weight: 800; }
.tile.wide { grid-column: 1 / -1; }
.tile.big .v { font-size: 26px; }
.tile.c-jual { background: var(--jual); color: #fff; } .tile.c-jual .k { color: rgba(255,255,255,.8); }
.tile.c-beli { background: var(--beli); color: #fff; } .tile.c-beli .k { color: rgba(255,255,255,.8); }
.tile.c-piutang { background: var(--piutang-l); } .tile.c-piutang .v { color: var(--piutang); }
.tile.c-hutang { background: var(--hutang-l); } .tile.c-hutang .v { color: var(--hutang); }
.tile .btn { margin-top: 8px; padding: 7px 12px; font-size: 13px; }

/* filter */
.search { position: relative; margin-bottom: 10px; }
.search input { padding-left: 40px; background: var(--paper); border-color: transparent; box-shadow: var(--shadow); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.range { display: flex; gap: 8px; margin-bottom: 10px; }
.range input { flex: 1; min-width: 0; }

/* ---------- form ---------- */
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
label > input, label > select, label > textarea, label > .ac { margin-top: 4px; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff;
  font-size: 15px; font-weight: 600; color: var(--text);
}
input::placeholder, textarea::placeholder { color: #A5AFAB; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-l); }
textarea { min-height: 64px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 > * { min-width: 0; }
.hint { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--paper); color: var(--text); font-weight: 800; font-size: 14.5px; cursor: pointer; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-acc { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary { background: var(--kuning); border-color: var(--kuning); color: #2B1D00; }
.btn-piutang { background: var(--piutang); border-color: var(--piutang); color: #fff; }
.btn-hutang { background: var(--hutang); border-color: var(--hutang); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-danger { color: var(--red); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

.fab {
  position: fixed; z-index: 25; right: max(16px, calc((100vw - var(--side) - var(--w)) / 2 + 16px));
  bottom: calc(var(--nav-h) + 50px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 60px; height: 60px; border: 0; border-radius: 20px;
  background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.22); cursor: pointer;
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.6; }
.fab.nofoot { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }

/* ---------- autocomplete ---------- */
.ac { position: relative; }
.ac-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.ac-it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.ac-it:last-child { border-bottom: 0; }
.ac-it.on, .ac-it:hover { background: var(--accent-l); }
.ac-it .av { width: 32px; height: 32px; font-size: 12px; }
.ac-it .t { font-size: 14.5px; }

/* ---------- form nota ---------- */
.mode-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kinfo { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; font-size: 13px; font-weight: 600; }
.kinfo a { color: var(--accent); font-weight: 800; }
.entry { position: sticky; top: 58px; z-index: 15; border: 2px solid var(--accent); }
.entry-row { display: grid; grid-template-columns: 1fr 1fr 1.6fr 52px; gap: 8px; margin-top: 8px; }
.entry-row input { padding: 10px; text-align: center; }
.entry-row .harga { text-align: right; }
.entry-row button { border: 0; border-radius: var(--r-sm); background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.entry-row button svg { width: 26px; height: 26px; stroke-width: 2.6; }
.mini-lbl { display: grid; grid-template-columns: 1fr 1fr 1.6fr 52px; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 6px; text-align: center; }
.einfo { font-size: 12.5px; margin-top: 6px; color: var(--muted); min-height: 1em; }
.einfo b { color: var(--text); }

.it { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.it:last-child { border-bottom: 0; }
.it-h { display: flex; align-items: center; gap: 8px; }
.it-n { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; font-weight: 800; font-size: 15px; cursor: pointer; }
.it-n:hover { color: var(--accent); }
.it-x { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: #F4F6F5; color: var(--muted); cursor: pointer; }
.it-x svg { width: 16px; height: 16px; }
.it-b { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.it-b input { padding: 6px 8px; border-width: 1px; font-size: 14.5px; }
.it-b .q { width: 70px; text-align: center; }
.it-b .h { width: 110px; text-align: right; border: 1.5px dashed var(--accent); background: var(--accent-l); color: var(--accent); font-weight: 800; }
.it-b .h:focus { border-style: solid; background: #fff; color: var(--text); }
.it-p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.it-p:empty { display: none; }
.it-tetap { padding: 3px 10px; border: 0; border-radius: 99px; background: var(--kuning); color: #2B1D00; font: 700 12px var(--font); cursor: pointer; }
.it-tetap:disabled { opacity: .5; }
.it-b .sat { font-size: 13px; font-weight: 700; color: var(--muted); }
.it-b .sub { margin-left: auto; font-weight: 800; white-space: nowrap; }
.it-d { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.it-w { font-size: 12.5px; font-weight: 700; color: var(--piutang); margin-top: 3px; }

.tot-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; }
.tot-line input, .tot-line select { width: 150px; flex: none; padding: 7px 10px; text-align: right; }
.tot-line select { text-align: left; width: auto; }
.tot-line .flex1 { flex: 1; width: auto; text-align: left; }
.tot-line.grand { margin-top: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent); color: #fff; font-size: 22px; font-weight: 800; }
.tot-line.res { font-size: 17px; font-weight: 800; }
.savebar {
  position: fixed; z-index: 26; left: var(--side); right: 0; bottom: 0; display: flex; justify-content: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper); box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.savebar > div { display: flex; align-items: center; gap: 8px; width: 100%; max-width: var(--w); }
.savebar .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.savebar .v { font-size: 20px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.savebar .btn { white-space: nowrap; }
.sb-s { display: none; }
.savebar .btn { padding: 12px 16px; }
.savebar .sp { margin-left: auto; }

/* ---------- detail nota ---------- */
.nota-head { padding: 16px; border-radius: var(--r); background: var(--accent); color: #fff; margin-bottom: 12px; }
.nota-head .row { display: flex; align-items: center; gap: 12px; }
.nota-head .kn { font-size: 18px; font-weight: 800; color: #fff; text-decoration: none; }
.nota-head .kn:hover { text-decoration: underline; }
.nota-head .s { color: rgba(255,255,255,.82); }
.nota-head .big { font-size: 28px; font-weight: 800; margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.kv span:first-child { color: var(--muted); }
.line-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.line-row:last-child { border-bottom: 0; }

/* ---------- kontak detail ---------- */
.k-hero { display: flex; gap: 14px; align-items: center; }
.k-hero h2 { margin: 0; font-size: 20px; }
.k-act { display: flex; gap: 8px; margin-top: 12px; }
.k-act .btn { flex: 1; }

/* ---------- menu (laporan & setting) ---------- */
.menu .li { padding: 14px; }
.mi { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; }
.mi svg { width: 22px; height: 22px; }
.mi.c1 { background: var(--jual-l); color: var(--jual); }
.mi.c2 { background: var(--beli-l); color: var(--beli); }
.mi.c3 { background: var(--piutang-l); color: var(--piutang); }
.mi.c4 { background: var(--hutang-l); color: var(--hutang); }
.mi.c5 { background: #FFF3CF; color: var(--kuning-d); }
.mi.c6 { background: #DFF4F8; color: #0E7490; }
.mi.c7 { background: #FCE7F1; color: #BE185D; }
.mi.c8 { background: #ECEFEE; color: #46504D; }
.chev { color: #B3BDB9; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #F7F9F8; }
.scroll-x { overflow-x: auto; }
.chart-box { position: relative; height: 230px; }
.bar-h { height: 8px; border-radius: 4px; background: var(--accent); margin-top: 4px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,30,25,.45); animation: fade .15s; }
.sheet { width: 100%; max-width: var(--w); max-height: 92vh; display: flex; flex-direction: column; background: var(--paper); border-radius: 20px 20px 0 0; animation: up .2s ease-out; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 8px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 17px; }
.sheet-head .icon-btn { color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 14px 18px; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
.preview { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-l); margin-bottom: 12px; font-weight: 800; }
.pin-in { font-size: 28px; letter-spacing: .4em; text-align: center; }
@keyframes up { from { transform: translateY(40px); opacity: .7; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 800px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; max-height: 86vh; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-wrap { animation: none; } }

/* ---------- login: latar rak supermarket bergerak ---------- */
.login-page { position: relative; min-height: 100vh; min-height: 100dvh; margin: 0; padding: 0; overflow: hidden; background: #053B2E; }
.lg-bg { position: fixed; inset: -4vh 0; display: flex; flex-direction: column; justify-content: space-between; transform: perspective(1400px) rotateX(4deg) scale(1.08); }
.lg-rak { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  background: linear-gradient(180deg, #0A5744 0%, #0C6650 70%, #094B3B 100%); }
.lg-strip { display: flex; align-items: flex-end; gap: 16px; width: max-content; padding: 0 14px; }
.lg-papan { height: 13px; flex: none; background: linear-gradient(180deg, #E7C58E, #B98A4B 60%, #7C5527); box-shadow: 0 7px 14px rgba(0,0,0,.35); }
.lg-papan::after { content: ''; display: block; height: 5px; margin-top: 13px; background: repeating-linear-gradient(90deg, #fff 0 26px, transparent 26px 38px); opacity: .22; }
.lg-strip .grp { display: flex; align-items: flex-end; gap: 3px; }
.lg-strip .p { position: relative; display: block; flex: none; width: 34px; height: 54px; border-radius: 5px; background: var(--c);
  box-shadow: inset -7px 0 0 rgba(0,0,0,.13), inset 0 -4px 0 rgba(0,0,0,.1); }
.lg-strip .p::after { content: ''; position: absolute; left: 14%; right: 14%; top: 34%; height: 30%; border-radius: 3px; background: rgba(255,255,255,.82); }
.lg-strip .p.box { width: 40px; height: 62px; }
.lg-strip .p.btl { width: 24px; height: 60px; border-radius: 9px 9px 5px 5px; margin-top: 14px; }
.lg-strip .p.btl::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 10px; height: 14px; margin-left: -5px; border-radius: 3px 3px 0 0; background: var(--c); box-shadow: 0 -4px 0 #F8FAF9; }
.lg-strip .p.can { width: 30px; height: 38px; border-radius: 7px / 5px; }
.lg-strip .p.can::after { top: 22%; height: 46%; left: 0; right: 0; border-radius: 0; }
.lg-strip .p.sak { width: 52px; height: 46px; border-radius: 12px 12px 7px 7px; }
.lg-strip .p.sak::after { left: 22%; right: 22%; top: 28%; height: 38%; border-radius: 50%; }
.lg-strip .p.jar { width: 32px; height: 44px; border-radius: 6px 6px 9px 9px; }
.lg-strip .p.jar::before { content: ''; position: absolute; left: 3px; right: 3px; top: -5px; height: 7px; border-radius: 3px; background: #F8FAF9; }
.lg-strip .p.bks { width: 30px; height: 46px; border-radius: 3px; clip-path: polygon(0 6%, 12% 0, 25% 6%, 38% 0, 50% 6%, 62% 0, 75% 6%, 88% 0, 100% 6%, 100% 100%, 0 100%); }
.lg-veil { position: fixed; inset: 0; background: radial-gradient(120% 90% at 50% 45%, rgba(3,40,31,.55) 0%, rgba(3,34,27,.86) 60%, rgba(2,24,19,.95) 100%); }
.lg-wrap { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 18px; }
.login-card { width: 100%; max-width: 388px; padding: 28px 24px 18px; border: 1px solid rgba(255,255,255,.55); border-radius: 24px;
  background: rgba(255,255,255,.93); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 2px 0 rgba(255,255,255,.6) inset; animation: lgMasuk .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lgMasuk { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.lg-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.lg-brand h1 { margin: 0; font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; }
.lg-brand p { margin: 3px 0 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.login-logo { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 17px; background: linear-gradient(140deg, #FFD34D, #F5B000);
  color: #2B1D00; font-weight: 800; font-size: 27px; box-shadow: 0 8px 18px rgba(245,176,0,.4); }
.login-card > label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lg-in { position: relative; margin-bottom: 14px; }
.lg-in > svg { position: absolute; left: 13px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lg-in input { width: 100%; padding: 13px 46px 13px 42px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; font-size: 16px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
.lg-in input:focus { outline: none; border-color: var(--jual); box-shadow: 0 0 0 4px rgba(4,120,87,.15); }
.lg-eye { position: absolute; right: 5px; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; transform: translateY(-50%);
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.lg-eye:hover, .lg-eye.on { color: var(--jual); background: var(--jual-l); }
.lg-eye svg { width: 21px; height: 21px; }
.lg-eye .e-off, .lg-eye.on .e-on { display: none; }
.lg-eye.on .e-off { display: block; }
.lg-caps { margin: -8px 0 12px; font-size: 12.5px; font-weight: 700; color: var(--kuning-d); }
.lg-go { position: relative; margin-top: 6px; padding: 14px; border-radius: 13px; font-size: 16px; }
.lg-spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: lgPutar .7s linear infinite; }
@keyframes lgPutar { to { transform: rotate(360deg); } }
.login-card.sibuk .lg-go-t { opacity: .75; } .login-card.sibuk .lg-spin { display: inline-block; margin-left: 10px; vertical-align: -3px; }
.login-card.sukses .lg-go { background: #16A34A; border-color: #16A34A; }
.login-card.goyang { animation: lgGoyang .42s; }
@keyframes lgGoyang { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.lg-foot { margin-top: 16px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.lg-toast { position: fixed; z-index: 5; left: 50%; top: max(18px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 28px);
  padding: 12px 18px 12px 12px; border-radius: 16px; background: #fff; color: var(--text); font-weight: 700; font-size: 14.5px; overflow: hidden; cursor: pointer;
  box-shadow: 0 16px 40px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, -140%); transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .25s; }
.lg-toast.show { opacity: 1; transform: translate(-50%, 0); }
.lg-toast .ti { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; color: #fff; }
.lg-toast .ti svg { width: 19px; height: 19px; stroke-width: 2.6; }
.lg-toast.ok .ti { background: #16A34A; } .lg-toast.err .ti { background: #DC2626; } .lg-toast.warn .ti { background: #D97706; }
.lg-toast .tp { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; animation: lgSisa linear forwards; }
.lg-toast.ok .tp { background: #16A34A; } .lg-toast.err .tp { background: #DC2626; } .lg-toast.warn .tp { background: #D97706; }
@keyframes lgSisa { to { transform: scaleX(0); } }
.lg-strip .p { animation: lgTaruh .6s cubic-bezier(.25,1.4,.5,1) var(--d, 0ms) both; }
@keyframes lgTaruh { 0% { opacity: 0; transform: translateY(-60px) rotate(-6deg); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
body.lg-diam .lg-strip .p { animation: none; }         /* sudah pernah tampil di sesi ini: rak langsung tertata */
@media (max-width: 520px) { .lg-strip { transform: scale(.82); transform-origin: bottom left; gap: 12px; } }
@media (prefers-reduced-motion: reduce) { .lg-strip .p, .login-card, .login-card.goyang { animation: none; } .lg-toast { transition: none; } }
.alert { padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-sm); background: #FDE3E3; color: var(--red); font-size: 14px; font-weight: 700; }

@media (max-width: 400px) {
  .entry-row, .mini-lbl { grid-template-columns: 0.9fr 1fr 1.5fr 46px; gap: 6px; }
  .it-b .h { width: 92px; }
  .tot-line input { width: 120px; }
  .savebar .btn { padding: 12px 12px; }
  .savebar .v { font-size: 18px; }
  .sb-l { display: none; } .sb-s { display: inline; }
}


/* =========================================================
   NAVIGASI: bottom nav (HP) / sidebar (tablet & komputer)
   ========================================================= */
.sidenav {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding: 6px 4px env(safe-area-inset-bottom, 0px);
  background: var(--paper); box-shadow: 0 -1px 0 var(--line);
}
.sidenav a {
  position: relative; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 12px;
}
.sidenav a:not(.mob) { display: none; }
.sidenav a svg { padding: 3px 14px; width: 52px; height: 30px; border-radius: 15px; transition: background .15s; }
.sidenav a.on { color: var(--accent); font-weight: 800; }
.sidenav a.on svg { background: var(--accent-l); stroke-width: 2.3; }
.sidenav .brand, .sidenav .side-user { display: none; }
.nb { position: absolute; top: 3px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font: 800 11px/18px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--paper); }
.nb.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; background: var(--kuning); }
body.no-nav { padding-bottom: 0; }
body.no-nav .sidenav { display: none; }

@media (min-width: 768px) {
  :root { --side: 236px; --w: 1080px; }
  body, body.no-nav { padding-bottom: 0; }
  body.no-nav .sidenav { display: flex; }
  .sidenav {
    inset: 0 auto 0 0; width: var(--side); height: auto; flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 0 12px 12px; box-shadow: 1px 0 0 var(--line); overflow-y: auto;
  }
  .sidenav .brand { display: flex; align-items: center; gap: 10px; padding: 16px 6px 18px; }
  .brand-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--kuning); color: #2B1D00; font-weight: 800; font-size: 18px; flex: none; }
  .brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
  .sidenav a, .sidenav a:not(.mob) {
    display: flex; flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; font-size: 14px; border-radius: 12px;
  }
  .sidenav a.only-mob { display: none; }
  .sidenav a svg { width: 22px; height: 22px; padding: 0; border-radius: 0; }
  .sidenav a:hover { background: #F1F4F3; }
  .sidenav a.on { background: var(--accent-l); }
  .sidenav a.on svg { background: none; }
  .nb { position: static; margin-left: auto; box-shadow: none; }
  .nb.dot { margin-top: 0; }
  .sidenav .side-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line); }
  .side-user .av { width: 36px; height: 36px; font-size: 13px; }
  .side-user .t { font-size: 14px; }
  .fab { bottom: 28px; } .fab.nofoot { bottom: 28px; }
  .footsum { bottom: 0; }
  #view.has-foot { padding-bottom: 70px; }
  main { padding: 20px 24px 120px; }
  .appbar { padding-left: 24px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tiles .tile.wide { grid-column: span 3; }
}
@media (min-width: 768px) and (max-width: 1023px) { :root { --side: 210px; } }
@media (min-width: 1100px) {
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
}
/* daftar nota/item dua kolom di layar lebar */
@media (min-width: 1200px) {
  .list.grid-lg { display: grid; grid-template-columns: 1fr 1fr; }
  .list.grid-lg > * { border-right: 1px solid var(--line); }
}

/* form nota: dua kolom di layar lebar */
@media (min-width: 1100px) {
  .fgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
  .fside { position: sticky; top: 74px; }
  .entry { top: 66px; }
}

/* =========================================================
   NOTIFIKASI: toast kartu putih + dialog konfirmasi di tengah layar
   ========================================================= */
#toasts {
  position: fixed; z-index: 70; top: calc(66px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none;
}
@media (min-width: 768px) { #toasts { left: auto; right: 20px; transform: none; top: 70px; align-items: flex-end; width: 380px; } }
.tst {
  --c: #10B981; --cl: #E7F8F1;
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 14px 12px;
  border-radius: 16px; background: rgba(255,255,255,.97); color: var(--text); border: 1px solid rgba(20,40,35,.07);
  box-shadow: 0 2px 6px rgba(20,40,35,.06), 0 14px 34px rgba(20,40,35,.16);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); pointer-events: auto; cursor: pointer;
  animation: tIn .34s cubic-bezier(.2, 1.25, .4, 1) both;
}
.tst::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tst.out { animation: tOut .2s ease-in forwards; }
.tst .ti { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex: none; background: var(--cl); color: var(--c); }
.tst .ti svg { width: 18px; height: 18px; stroke-width: 2.6; }
.tst .tm { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.35; }
.tst .tp { position: absolute; left: 4px; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .55; transform-origin: left; animation: tBar linear forwards; }
.tst.err  { --c: #DC2626; --cl: #FDECEC; }
.tst.warn { --c: #D97706; --cl: #FFF4DB; }
.tst.info { --c: #2563EB; --cl: #E6EEFE; }
@keyframes tIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes tOut { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes tBar { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .tst, .tst.out { animation: none; } .tst .tp { display: none; } }

.sheet-wrap { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg-wrap { align-items: center; padding: 20px; }
.dlg { width: 100%; max-width: 380px; padding: 26px 22px 18px; border-radius: 24px; background: var(--paper); text-align: center;
  box-shadow: 0 24px 60px rgba(10,25,20,.3); animation: dlgIn .22s cubic-bezier(.2, 1.2, .4, 1); }
.dlg h2 { margin: 14px 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.dlg p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.dlg-ic { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 20px; background: var(--accent-l); color: var(--accent); }
.dlg-ic svg { width: 28px; height: 28px; }
.dlg-ic.danger { background: #FDECEC; color: var(--red); }
.dlg-ic.warn { background: #FFF4DB; color: #B45309; }
.dlg-btn { display: flex; gap: 10px; }
.dlg-btn .btn { flex: 1; padding: 12px 10px; border-radius: 13px; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
@keyframes dlgIn { from { opacity: 0; transform: scale(.92) translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .dlg { animation: none; } }

/* =========================================================
   DASHBOARD
   ========================================================= */
.hello h2 { margin: 4px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.hello p { margin: 0 0 16px; color: var(--muted); }
.dtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (min-width: 900px) { .dtiles { grid-template-columns: repeat(3, 1fr); } }
.dt { display: flex; align-items: center; gap: 12px; padding: 16px 14px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; min-width: 0; transition: transform .12s, box-shadow .12s; }
.dt:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,40,35,.1); }
.dt .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; }
.dt .ic svg { width: 22px; height: 22px; }
.dt .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dt .v { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .dt .v { font-size: 21px; } .dt { padding: 18px; } }
@media (max-width: 520px) {
  .dt { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .dt .ic { width: 36px; height: 36px; } .dt .ic svg { width: 19px; height: 19px; }
  .dt .v { font-size: 17px; }
}
/* v5.15: angka di kartu tidak dipotong "...": ukuran huruf dikecilkan otomatis sampai muat (pasAngka di app.js) */
.dt > div { flex: 1; } .dt .v, .tile .v { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.ic.g { background: #DCF5E5; color: #15803D; } .ic.b { background: #E0EAFE; color: #2563EB; }
.ic.o { background: #FFEDD5; color: #EA580C; } .ic.r { background: #FEE2E2; color: #DC2626; }
.ic.t { background: #D5F2EF; color: #0F766E; } .ic.v { background: #EDE5FE; color: #7C3AED; } .ic.y { background: #FFF3CF; color: #A16207; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 6px 2px 10px; }
.sec-h h3 { margin: 0; font-size: 18px; font-weight: 800; }
.sec-h .cnt { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; }
.sec-h .cnt.y { background: var(--kuning); color: #2B1D00; }
.sec-h a { margin-left: auto; font-size: 13.5px; font-weight: 800; color: var(--accent); text-decoration: none; }
.wcard { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.wcard .wi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.wcard .wi.y { background: #FFF3CF; color: #B45309; } .wcard .wi.r { background: #FEE2E2; color: #DC2626; } .wcard .wi.o { background: #FFEDD5; color: #EA580C; }
.wcard .t { white-space: normal; }
.wcard .lk { padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-weight: 800; cursor: pointer; text-decoration: none; }
.alert-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #EA580C, #F59E0B); box-shadow: 0 8px 22px rgba(234,88,12,.25); }
.alert-card.ok { background: linear-gradient(120deg, #047857, #10B981); box-shadow: 0 8px 22px rgba(4,120,87,.22); }
.alert-card .grow b { display: block; font-size: 15.5px; }
.alert-card .grow span { font-size: 13px; opacity: .92; }
.alert-card .btn { background: #fff; border-color: #fff; color: #9A3412; white-space: nowrap; }
.alert-card.ok .btn { color: var(--jual); }
.fab-x { width: auto; height: 56px; padding: 0 22px 0 18px; gap: 8px; display: flex; align-items: center; border-radius: 18px;
  background: #F97316; font-weight: 800; font-size: 17px; }
.fab-x svg { width: 24px; height: 24px; }
.act-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: 0; }
.role { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.role-owner { background: #FFF3CF; color: #8A5A00; } .role-admin { background: var(--beli-l); color: var(--beli); } .role-kasir { background: var(--jual-l); color: var(--jual); }

/* =========================================================
   STOCK OPNAME & SELISIH
   ========================================================= */
.op-head { padding: 16px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #0F766E, #059669); margin-bottom: 12px; }
.op-head.draft { background: linear-gradient(120deg, #B45309, #F59E0B); }
.op-head h2 { margin: 0; font-size: 19px; }
.op-head .s { color: rgba(255,255,255,.88); }
.prog { height: 8px; border-radius: 4px; background: rgba(255,255,255,.3); margin-top: 10px; overflow: hidden; }
.prog i { display: block; height: 100%; background: #fff; border-radius: 4px; transition: width .3s; }
.op { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.op:last-child { border-bottom: 0; }
.op .nm { font-weight: 800; }
.op .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.op .n { padding: 6px 8px; border-radius: 10px; background: #F4F6F5; text-align: center; min-width: 0; }
.op .n .k { font-size: 11px; font-weight: 700; color: var(--muted); }
.op .n .v { font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.op button.n { border: 0; cursor: pointer; font: inherit; }
.op button.n.jual { background: var(--jual-l); } .op button.n.jual .v { color: var(--jual); text-decoration: underline dotted; }
.op button.n.beli { background: var(--beli-l); } .op button.n.beli .v { color: var(--beli); text-decoration: underline dotted; }
.op .in { display: flex; align-items: center; gap: 8px; }
.op .in input { width: 120px; flex: none; text-align: center; font-size: 17px; font-weight: 800; }
.op .in .ok { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--green); cursor: pointer; display: grid; place-items: center; flex: none; }
.op .sel { margin-left: auto; font-weight: 800; text-align: right; }
.op.filled { background: #FBFDFC; }
.op.diff { background: #FFF8F1; }
.op.diff .in input { border-color: var(--piutang); }
@media (min-width: 900px) {
  .op { grid-template-columns: minmax(150px, 1.2fr) minmax(300px, 2fr) minmax(310px, auto); align-items: center; }
  .op .in input { width: 104px; }
  .op .sel { white-space: nowrap; min-width: 92px; }
}
.sel-card { padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sel-card:last-child { border-bottom: 0; }
.sel-card:hover { background: #F7F9F8; }
.st-baru { background: #FEE2E2; color: var(--red); } .st-dicek { background: #FFF3CF; color: #8A5A00; } .st-selesai { background: #DCF5E5; color: var(--green); }

/* kas kecil */
.kk-hero { padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #7C3AED, #A855F7); margin-bottom: 12px; }
.kk-hero .k { font-size: 13px; opacity: .88; } .kk-hero .v { font-size: 30px; font-weight: 800; }
.kk-hero .btn-row { margin-top: 12px; } .kk-hero .btn { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
.kk-hero .btn.w { background: #fff; color: #6D28D9; }
.daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.daynav input { flex: 1; text-align: center; }
.daynav .icon-btn { background: var(--paper); box-shadow: var(--shadow); color: var(--text); }

/* menu grid (HP) */
.mgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mg { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: inherit; position: relative; }
.mg .t { white-space: normal; }
.mg .nb { position: absolute; top: 12px; right: 12px; left: auto; }
@media (min-width: 1200px) { .dtiles { grid-template-columns: repeat(4, 1fr); } }
.daynav .icon-btn:disabled { opacity: .4; }

/* =========================================================
   VERSI 4: Kepada Yth, barcode, cetak/ekspor, backup Google Drive
   ========================================================= */
.lbl { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.inp-act { display: flex; align-items: center; gap: 8px; }
.inp-act > input, .inp-act > .grow { flex: 1; min-width: 0; }
label > .inp-act { margin-top: 4px; }
.wa-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: #25D366; color: #fff; text-decoration: none; }
.wa-btn svg { width: 24px; height: 24px; }
.wa-btn.off { background: #D5DBD9; pointer-events: none; }
.scan-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1.5px solid var(--accent); border-radius: var(--r-sm); background: var(--accent-l); color: var(--accent); cursor: pointer; }
.scan-btn svg { width: 24px; height: 24px; }
.scan-btn:hover { background: var(--accent); color: #fff; }

/* langkah 1: Kepada Yth */
.kp { max-width: 620px; margin: 0 auto; }
.kp-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; margin-bottom: 12px; border: 0; border-radius: var(--r-sm);
  background: #E3E8E6; color: var(--text); font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; }
.kp-more:hover { background: #D9DFDD; }
.kp-more #kMoreIc { display: grid; color: var(--accent); }
.kp-ring { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: right; }
.kp .seg { margin-bottom: 12px; }
.kp .seg button.on { background: var(--accent); color: #fff; }
.kp-sum { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.kp-sum .grow { display: flex; flex-direction: column; }
.kp-sum .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.kp-sum .t { font-size: 17px; font-weight: 800; }
.kp-sum:hover .t { color: var(--accent); }
.kp-ed { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--accent-l); color: var(--accent); }
.kp-ed svg { width: 18px; height: 18px; }
.kp-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.badge.b-w { background: rgba(255,255,255,.22); color: #fff; }
.wa-in { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 9px; border-radius: 99px; background: #fff; color: #128C4A; font-weight: 800; font-size: 12px; text-decoration: none; }
.wa-in svg { width: 14px; height: 14px; }

/* baris barang tanpa harga (kasir di nota pembelian) */
.entry-row.nh, .mini-lbl.nh { grid-template-columns: 1fr 1.4fr 52px; }

/* tombol print / pdf / excel */
.xbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 10px; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow); }
.xbar-l { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; }
.xbar-l label { margin: 0; white-space: nowrap; }
.xbar-l select { flex: 1; min-width: 0; padding: 7px 10px; font-size: 14px; }
.xbar .btn { padding: 8px 12px; font-size: 13.5px; flex: 1 1 auto; }

/* scan barcode */
.scan-box { position: relative; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; overflow: hidden; border-radius: var(--r); background: #111; margin-bottom: 8px; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box i { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #EF4444; box-shadow: 0 0 8px #EF4444; animation: scan 1.6s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateY(-46px); } to { transform: translateY(46px); } }
@media (prefers-reduced-motion: reduce) { .scan-box i { animation: none; } }

/* backup Google Drive */
.switch-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 15.5px; color: var(--text); cursor: pointer; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: #C3CCC8; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--kuning); outline-offset: 2px; }
.bk-akun { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; border-bottom: 1.5px solid var(--line); margin-bottom: 6px; }
.bk-swap { background: var(--text); color: #fff; width: 38px; height: 38px; }
.bk-swap:hover { background: var(--accent); }
.bk-jam { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bk-jam input[type=checkbox] { width: 22px; height: 22px; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.bk-jam input[type=time] { width: 140px; }
.bk-hapus { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; font-weight: 600; }
.bk-hapus input { width: 76px; text-align: center; padding: 8px; }
.bk-det > summary { font-weight: 800; font-size: 14.5px; cursor: pointer; }
.bk-det[open] > summary { margin-bottom: 4px; }
.bk-steps { margin: 10px 0 14px; padding-left: 20px; font-size: 13.5px; }
.bk-steps li { margin-bottom: 8px; }

/* tanggal nota otomatis, import excel */
.tgl-auto { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 12px; border-radius: var(--r-sm); background: #F4F6F5; color: var(--muted); }
.tgl-auto svg { width: 20px; height: 20px; }
.tgl-auto b { display: block; color: var(--text); font-size: 15px; }
.tgl-auto span { font-size: 12.5px; }
.im-err { margin-top: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: #FDECEC; color: #991B1B; font-size: 13px; max-height: 190px; overflow-y: auto; }
.im-err div + div { margin-top: 3px; }

/* =========================================================
   VERSI 4.2: dropdown saat diklik, stok di bawah jumlah, daftar bertahap
   ========================================================= */
.ac-list { max-height: min(330px, 46vh); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ac-new { background: #FFF9E8; color: var(--kuning-d); position: sticky; top: 0; z-index: 1; }
.ac-new .t { white-space: normal; }
.ac-plus { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--kuning); color: #2B1D00; flex: none; }
.ac-plus svg { width: 18px; height: 18px; stroke-width: 2.6; }
.e-stok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 12.5px; color: var(--muted); min-height: 4px; }
.e-stok:empty { margin-top: 0; }
.e-stok b { color: var(--text); } .e-stok b.red { color: var(--red); }
.it-s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.it-s b { color: var(--text); } .it-s b.red { color: var(--red); }
.sm-btn { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; padding: 3px 10px 3px 7px; border: 1px solid var(--accent); border-radius: 99px;
  background: var(--accent-l); color: var(--accent); font: 800 12px var(--font); cursor: pointer; }
.sm-btn svg { width: 14px; height: 14px; stroke-width: 2.6; }
.lagi { margin: -4px 0 12px; }
.memuat { padding: 28px; text-align: center; color: var(--muted); }
.masked { -webkit-text-security: disc; text-security: disc; }
.op-kunci { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.op-kunci .grow { min-width: 180px; }
.ac-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.alert-card { flex-wrap: wrap; } .alert-card .grow { min-width: 160px; }
/* tombol simpan di halaman yang masih menampilkan menu bawah (mis. stock opname di HP) duduk di atas menu, tidak tertutup */
@media (max-width: 767px) { body:not(.no-nav) .savebar { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; } }

/* ============ v4.3: printer Bluetooth ============ */
.prn-st { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 12px; border-radius: 16px; background: #ECEFEE; color: var(--text); }
.prn-st .pi { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: #fff; color: var(--muted); }
.prn-st .pi svg { width: 26px; height: 26px; }
.prn-st b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.prn-st span { font-size: 13px; color: var(--muted); }
.prn-st.on { background: linear-gradient(120deg, #1D4ED8, #3B82F6); color: #fff; box-shadow: 0 8px 22px rgba(29,78,216,.22); }
.prn-st.on .pi { background: rgba(255,255,255,.2); color: #fff; }
.prn-st.on span { color: #fff; opacity: .92; }
.prn-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); }
.prn-opt input { width: 20px; height: 20px; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--accent); }
.prn-opt .t { font-weight: 800; font-size: 15px; }
.prn-opt .s { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.prn-opt.on { border-color: var(--accent); background: var(--accent-l); }
.prn-opt.off { cursor: default; background: #F6F8F7; }
.prn-opt.off .t { color: var(--muted); }
.btn-bt { border-color: #1D4ED8; color: #1D4ED8; }
.prn-ajak { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1.5px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.prn-ajak span { flex: 1; }
.prn-ajak svg { width: 18px; height: 18px; flex: none; }

/* ============ v4.4: popup cetak (tanpa tab baru) ============ */
#cetakPop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px;
  background: rgba(15,23,20,.55); animation: cpIn .15s ease-out; }
@keyframes cpIn { from { opacity: 0; } }
.cp-box { display: flex; flex-direction: column; min-width: min(100%, 340px); max-width: 100%; max-height: 100%; overflow: hidden;
  background: #E8ECEA; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.cp-bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; background: var(--paper); border-bottom: 1.5px solid var(--line); }
.cp-modes { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; font-size: 15px; }
.cp-modes b { padding: 0 4px; }
.cp-modes button { padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 9px; background: none; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; cursor: pointer; }
.cp-modes button.on { border-color: var(--accent); background: var(--accent-l); color: var(--accent); }
.cp-bar .btn { padding: 8px 14px; }
.cp-body { flex: 1; min-height: 120px; overflow: auto; -webkit-overflow-scrolling: touch; }
.cp-info { padding: 36px 20px; text-align: center; font-weight: 600; color: var(--muted); }
.cp-kaki { padding: 7px 12px; background: var(--paper); border-top: 1.5px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
@media print {
  body.cetak-on { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  body.cetak-on > *:not(#cetakPop) { display: none !important; }
  #cetakPop { position: static !important; display: block !important; padding: 0 !important; background: none !important; animation: none !important; }
  #cetakPop .cp-box { display: block !important; min-width: 0; max-width: none; max-height: none; overflow: visible; background: none; border-radius: 0; box-shadow: none; }
  #cetakPop .cp-body { overflow: visible !important; min-height: 0; }
  #cetakPop .cp-bar, #cetakPop .cp-kaki { display: none !important; }
}

/* ============ v5 ============ */
/* tab Penjualan | Pembelian | Kas */
.seg3 button { padding: 9px 4px; font-size: 14px; }
.seg button[data-j=kas].on { color: var(--hutang); }
/* tulisan piutang / hutang yang bisa diketuk */
.hp-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border: 0; border-radius: 99px; font: 700 13px var(--font); cursor: pointer; vertical-align: baseline; }
.hp-btn svg { width: 14px; height: 14px; stroke-width: 2.6; }
.hp-btn.p { background: var(--piutang-l); color: var(--piutang); } .hp-btn.h { background: var(--hutang-l); color: var(--hutang); }
.hp-btn.w { background: rgba(255,255,255,.2); color: #fff; font-size: 14.5px; padding: 4px 6px 4px 12px; }
.hp-btn:hover { filter: brightness(.96); }
.kinfo .hp-btn { margin-right: 4px; }
/* baris yang bisa diketuk */
.klik { cursor: pointer; } .line-row.klik:hover, .act-row.klik:hover { background: #F7F9F8; }
.wcard.klik:hover { box-shadow: 0 0 0 2px var(--accent-l), var(--shadow); } .wcard > svg.chev { color: var(--muted); }
.op .nm.klik { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.li.statis { cursor: default; } .li.statis:hover { background: none; }
div.li[role=button] { cursor: pointer; }
.mini-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 9px; border-radius: 99px; background: var(--accent-l); color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.mini-link svg { width: 13px; height: 13px; }
.ir-kepala { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.ir-kepala b { display: block; font-size: 16px; } .ir-kepala .s { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
/* TOTAL yang bisa diketuk untuk diskon, PPN, biaya lain */
.tot-btn { width: 100%; border: 0; cursor: pointer; font-family: var(--font); text-align: left; }
.tot-btn small, .tot-btn2 small { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; opacity: .9; letter-spacing: 0; }
.tot-btn small svg, .tot-btn2 small svg { width: 12px; height: 12px; }
.tot-btn:hover { filter: brightness(1.06); }
.tot-btn2 { width: 100%; padding: 6px 8px; margin: 4px -8px; border: 0; border-radius: 10px; background: none; font: 800 18px var(--font); color: var(--text); align-items: center; text-align: left; }
button.tot-btn2 { width: calc(100% + 16px); background: var(--accent-l); cursor: pointer; }
button.tot-btn2:hover { filter: brightness(.97); } .tot-btn2 small { color: var(--accent); }
.ts-persen { display: flex; align-items: center; gap: 6px; font-weight: 700; } .ts-persen input { width: 76px; padding: 8px; text-align: right; }
.ts-ring { margin-top: 6px; padding-top: 10px; border-top: 1.5px dashed var(--line); }
/* harga berjenjang di kartu item */
.jj-row { display: grid; grid-template-columns: 1fr 1.4fr 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.jj-h { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.jj-0 span { padding: 9px 12px; border-radius: var(--r-sm); background: #F1F4F3; font-weight: 700; color: var(--muted); }
/* preferensi: saklar fitur */
.pf-sw { align-items: flex-start; margin-bottom: 14px; } .pf-sw .s { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.pf-sw .switch { margin-top: 2px; } .pf-sw input:disabled + i { opacity: .45; }
/* hak akses per pengguna */
.ak-kepala { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .ak-kepala h3 { margin: 0; font-size: 15px; }
.ak-list { display: grid; gap: 6px; }
.ak-it { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); }
.ak-it input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.ak-it b { display: block; font-size: 14.5px; } .ak-it .s { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ak-it:has(input:checked) { border-color: var(--accent); background: var(--accent-l); }
.ak-it.off { cursor: default; opacity: .7; }
.ak-saring { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
/* bagian Beranda yang bisa diciutkan */
.bg { margin-bottom: 6px; }
.bg-tgl { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: var(--paper); box-shadow: var(--shadow); color: var(--muted); cursor: pointer; flex: none; }
.bg-tgl svg { width: 18px; height: 18px; transform: rotate(90deg); transition: transform .18s; }
.bg.ciut .bg-tgl svg { transform: rotate(0deg); }
.bg.ciut .bg-isi { display: none; }
.bg.ciut .sec-h { margin-bottom: 14px; opacity: .8; }
/* jam tutup buku */
.tutup-bar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: #7F1D1D; color: #fff; font-size: 13.5px; }
.tutup-bar svg { width: 18px; height: 18px; flex: none; } .tutup-bar span { flex: 1; } .tutup-bar a { color: #fff; font-weight: 800; white-space: nowrap; }
body.buku-tutup .fab, body.buku-tutup .savebar #sbSave, body.buku-tutup .savebar #sbPrint { display: none; }
/* layar penuh & menu samping ciut */
.appbar #btnFs { margin-left: 2px; }
.side-tgl { display: none; }
@media (min-width: 768px) {
  .sidenav .brand { position: relative; }
  .side-tgl { display: grid; margin-left: auto; width: 34px; height: 34px; color: var(--muted); }
  .side-tgl svg { width: 20px; height: 20px; }
  body.side-mini { --side: 68px; }
  body.side-mini .sidenav { padding: 0 8px 12px; overflow-x: hidden; }
  body.side-mini .sidenav .brand { flex-direction: column; gap: 8px; padding: 14px 0 12px; }
  body.side-mini .brand-name, body.side-mini .sidenav a > span, body.side-mini .side-user .grow { display: none; }
  body.side-mini .side-tgl { margin: 0; }
  body.side-mini .sidenav a, body.side-mini .sidenav a:not(.mob) { justify-content: center; padding: 12px 0; position: relative; }
  body.side-mini .sidenav a.only-mob { display: none; }
  body.side-mini .sidenav .nb { position: absolute; top: 6px; right: 8px; margin: 0; }
  body.side-mini .sidenav .side-user { flex-direction: column; padding: 10px 0 0; }
}
@media (min-width: 768px) and (max-width: 1023px) { body.side-mini { --side: 68px; } }
:fullscreen { background: var(--bg); } :fullscreen body { min-height: 100vh; }
.tot-btn > span:first-child { min-width: 0; } .tot-btn > span:last-child { white-space: nowrap; }
.chip:disabled { opacity: .45; cursor: not-allowed; }

/* =========================================================
   v5.1: mode offline, keluar otomatis, penguat password, kas per kasir, Turnstile
   ========================================================= */
.off-bar { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13.5px; color: #fff; background: #1D4ED8; }
.off-bar.mati { background: #B45309; }
.off-bar.gagal { background: #B91C1C; }
.off-bar svg { width: 18px; height: 18px; flex: none; }
.off-bar span { flex: 1; }
.off-bar a { padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,.2); color: #fff; font-weight: 800; white-space: nowrap; text-decoration: none; }
.off-hal { max-width: 520px; margin: 9vh auto 0; padding: 26px 20px; text-align: center; }
.off-hal h2 { margin: 14px 0 6px; font-size: 21px; font-weight: 800; }
.off-hal p { margin: 0 0 18px; color: var(--muted); }
.off-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: #FFF4DB; color: #B45309; }
.off-ic svg { width: 32px; height: 32px; }
.off-kartu { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.off-kartu .off-ic { width: 48px; height: 48px; border-radius: 15px; flex: none; }
.off-kartu .off-ic svg { width: 24px; height: 24px; }
.off-kartu.on .off-ic { background: var(--jual-l); color: var(--jual); }
.off-kartu .grow { flex: 1; min-width: 200px; }
.off-kartu .grow b { font-size: 16px; }
.off-kartu .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
/* selama offline tombol yang butuh server diredupkan */
body.offline #aEdit, body.offline #aDel { display: none; }

.keluar-ov { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px; background: rgba(15,30,26,.62); backdrop-filter: blur(3px); }
.ko-box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 340px; padding: 26px 24px; border-radius: 20px; background: #fff; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.ko-box b { font-size: 16.5px; } .ko-box span { font-size: 13.5px; color: var(--muted); }
.ko-spin { width: 38px; height: 38px; margin-bottom: 6px; border: 4px solid var(--jual-l); border-top-color: var(--jual); border-radius: 50%; animation: koPutar .8s linear infinite; }
@keyframes koPutar { to { transform: rotate(360deg); } }

/* kotak password dengan tombol mata */
.pw-in { position: relative; display: block; }
.pw-in input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; transform: translateY(-50%);
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye.on { color: var(--jual); background: var(--jual-l); }
.pw-eye svg { width: 21px; height: 21px; }
/* garis kekuatan password */
.pw-meter { margin: -4px 0 14px; --pw: #CBD5D1; }
.pw-meter[data-k="lemah"] { --pw: #DC2626; } .pw-meter[data-k="sedang"] { --pw: #D97706; } .pw-meter[data-k="kuat"] { --pw: #15803D; }
.pw-bar { height: 9px; border-radius: 99px; background: #E4E9E7; overflow: hidden; }
.pw-bar i { display: block; width: 0; height: 100%; border-radius: 99px; background: var(--pw); transition: width .25s ease, background-color .25s; }
.pw-ket { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pw-ket b { color: var(--pw); font-weight: 800; }
.pw-syarat { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.pw-syarat li { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pw-syarat li svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: #E4E9E7; color: transparent; stroke-width: 3.2; }
.pw-syarat li.ok { color: var(--text); }
.pw-syarat li.ok svg { background: #DCF5E5; color: #15803D; }

/* beranda: saldo kas tiap kasir */
.kk-list { padding: 4px 14px; }
.kk-list .act-row { align-items: center; color: inherit; text-decoration: none; }
.kk-list .act-row > svg { width: 18px; height: 18px; color: var(--muted); }
.kk-list .act-row .t { font-weight: 800; } .kk-list .act-row .s { font-size: 12.5px; color: var(--muted); }
.kk-list .act-row:hover { background: #F7FAF9; }
.kk-tot { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0 9px; border-top: 2px solid var(--line); font-weight: 700; }
.kk-tot b { font-size: 16px; }

/* Turnstile */
.ts-kepala { display: flex; align-items: flex-end; gap: 10px; }
.ts-uji { display: grid; place-items: center; min-height: 72px; margin: 10px 0; }
.lg-ts { display: grid; place-items: center; min-height: 68px; margin: 0 0 14px; }
.lg-ts-ket { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; }
.lg-ts-ket.err { color: var(--red); }
.lg-hint { margin: -6px 0 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ko-spin { animation-duration: 2.4s; } .pw-bar i { transition: none; } }

/* =========================================================
   v5.3: lonceng notifikasi, ringkasan setelah masuk, cetak langsung
   ========================================================= */
.bell { position: relative; }
.bell svg { width: 23px; height: 23px; transform-origin: 50% 8%; }
.bell-n { position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; border: 2px solid var(--accent);
  display: grid; place-items: center; font: 800 11px/1 var(--font); font-style: normal; color: #fff; background: #EF4444; box-sizing: border-box; }
.bell[data-tingkat="kuning"] .bell-n { background: #F59E0B; color: #2B1D00; }
.bell[data-tingkat="biru"] .bell-n { background: #3B82F6; }
.bell.baru svg { animation: belGoyang 2.6s ease-in-out infinite; }
.bell.baru .bell-n { box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: belDenyut 2.6s ease-out infinite; }
@keyframes belGoyang { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 86% { transform: rotate(8deg); } 92% { transform: rotate(-4deg); } }
@keyframes belDenyut { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 60%, 100% { box-shadow: 0 0 0 9px rgba(255,255,255,0); } }

#notifPanel { position: fixed; z-index: 75; top: calc(62px + env(safe-area-inset-top, 0px)); right: 10px; width: min(400px, calc(100vw - 20px));
  max-height: min(72vh, 640px); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--paper);
  box-shadow: 0 22px 60px rgba(15,30,26,.28), 0 2px 8px rgba(15,30,26,.12); animation: npnMasuk .18s ease-out; }
@keyframes npnMasuk { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.npn-kepala { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 16px; border-bottom: 1px solid var(--line); }
.npn-kepala b { font-size: 16.5px; } .npn-n { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.npn-kepala .icon-btn { color: var(--muted); width: 36px; height: 36px; } .npn-kepala .icon-btn:hover { background: var(--bg); }
.npn-isi { overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.npn-it { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 10px; border: 0; border-radius: 13px; background: none; text-align: left; cursor: pointer; }
.npn-it:hover, .npn-it:focus-visible { background: #F4F7F6; }
.npn-it > svg { width: 18px; height: 18px; margin-top: 10px; color: var(--muted); }
.npn-it b { display: block; font-size: 14.5px; } .npn-it .s { display: block; font-size: 12.8px; color: var(--muted); margin-top: 1px; }
.npn-daftar { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; padding: 6px 9px; border-radius: 9px; background: var(--bg); font-size: 12.5px; font-weight: 600; }
.npn-daftar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-baru { margin-left: 4px; padding: 1px 7px; border-radius: 99px; font: 800 10.5px/1.5 var(--font); font-style: normal; color: #fff; background: #EF4444; vertical-align: 2px; }
.npn-kosong { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; text-align: center; }
.npn-kosong span:last-child { font-size: 13px; color: var(--muted); }
.npn-kaki { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.np-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--cl, #E6EEFE); color: var(--c, #2563EB); }
.np-ic svg { width: 20px; height: 20px; stroke-width: 2.2; }
.t-merah { --c: #DC2626; --cl: #FDECEC; } .t-kuning { --c: #B45309; --cl: #FFF4DB; } .t-biru { --c: #2563EB; --cl: #E6EEFE; } .t-ok { --c: #15803D; --cl: #DCF5E5; }

/* ringkasan kanan bawah setelah masuk */
#notifPop { position: fixed; z-index: 72; right: 12px; left: 12px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column-reverse; align-items: stretch; gap: 10px; pointer-events: none; }
@media (min-width: 768px) { #notifPop { left: auto; right: 22px; bottom: 22px; width: 370px; } }
.np-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 40px 15px 13px; overflow: hidden; pointer-events: auto;
  border-radius: 16px; background: rgba(255,255,255,.97); border: 1px solid rgba(15,30,26,.06); backdrop-filter: blur(6px);
  box-shadow: 0 16px 40px rgba(15,30,26,.22), 0 2px 6px rgba(15,30,26,.08); animation: npMasuk .42s cubic-bezier(.2,.9,.3,1.2); }
.np-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.np-card.keluar { animation: npKeluar .26s ease-in forwards; }
@keyframes npMasuk { from { opacity: 0; transform: translateX(60px) scale(.96); } }
@keyframes npKeluar { to { opacity: 0; transform: translateX(70px); } }
.np-isi { flex: 1; min-width: 0; }
.np-isi b { display: block; font-size: 14.5px; line-height: 1.3; } .np-isi > span { display: block; margin-top: 2px; font-size: 12.8px; color: var(--muted); }
.np-lihat { display: inline-flex; align-items: center; gap: 2px; margin-top: 7px; padding: 5px 10px 5px 12px; border: 0; border-radius: 99px;
  background: var(--cl); color: var(--c); font: 800 12.5px var(--font); cursor: pointer; }
.np-lihat svg { width: 15px; height: 15px; }
.np-x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.np-x:hover { background: var(--bg); } .np-x svg { width: 16px; height: 16px; }
.np-bar { position: absolute; left: 4px; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .5; transform-origin: left; animation: tBar linear forwards; }
.np-card:hover .np-bar { animation-play-state: paused; }

/* cetak langsung tanpa pratinjau aplikasi */
@media screen {
  #cetakPop.cp-diam { background: none !important; pointer-events: none; align-items: flex-end; }
  #cetakPop.cp-diam .cp-box { position: fixed; left: -12000px; top: 0; opacity: 0; }
  .cp-pil { display: flex; align-items: center; gap: 9px; margin-bottom: calc(var(--nav-h) + 16px); padding: 11px 18px; border-radius: 99px;
    background: #1C2321; color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
  .cp-pil svg { width: 19px; height: 19px; }
}
@media print {
  #cetakPop.cp-diam .cp-box { position: static !important; left: auto !important; opacity: 1 !important; }
  .cp-pil { display: none !important; }
}
.pr-lgs { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.pr-lgs p { margin: 4px 0 10px; color: var(--muted); }
.pr-lgs-it { padding: 9px 11px; margin-top: 6px; border-radius: 10px; background: var(--paper); border: 1.5px solid transparent; }
.pr-lgs-it.on { border-color: var(--accent); }
.pr-lgs-it > b { display: block; margin-bottom: 2px; } .pr-lgs-it > span { color: var(--text); }
.pr-lgs details { margin-top: 6px; } .pr-lgs summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.pr-lgs ol { margin: 6px 0 0; padding-left: 20px; } .pr-lgs li { margin-bottom: 5px; }
.pr-lgs code { padding: 1px 5px; border-radius: 5px; background: var(--bg); font-size: 12.5px; }
.pr-kode { display: block; margin: 5px 0; padding: 7px 9px !important; overflow-x: auto; white-space: nowrap; user-select: all; }
@media (prefers-reduced-motion: reduce) { .bell.baru svg, .bell.baru .bell-n { animation: none; } .np-card, .np-card.keluar, #notifPanel { animation-duration: .01s; } }

@media (max-width: 599px) {
  .np-card { padding: 10px 36px 12px 11px; gap: 10px; border-radius: 14px; }
  .np-card .np-ic { width: 34px; height: 34px; }
  .np-isi > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .np-lihat { margin-top: 5px; }
  #notifPanel { right: 8px; left: 8px; width: auto; max-height: calc(100vh - 150px); }
}

/* =========================================================
   v5.4: popup atur struk (tata letak struk sebelum dicetak)
   ========================================================= */
#strukPop { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(15,30,26,.55); backdrop-filter: blur(2px); animation: spLatar .15s ease-out; }
@keyframes spLatar { from { opacity: 0; } }
.sp-box { display: flex; flex-direction: column; width: min(920px, 100%); max-height: 100%; overflow: hidden; border-radius: 20px; background: var(--paper);
  box-shadow: 0 24px 70px rgba(0,0,0,.3); animation: spMasuk .2s ease-out; }
@keyframes spMasuk { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.sp-kepala { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 18px; border-bottom: 1px solid var(--line); }
.sp-kepala b { display: block; font-size: 17px; } .sp-kepala .grow span { display: block; font-size: 12.5px; color: var(--muted); }
.sp-kepala .icon-btn { color: var(--muted); } .sp-kepala .icon-btn:hover { background: var(--bg); }
.sp-isi { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; }
.sp-pratinjau { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 14px; overflow: auto; background: #E9EDEB;
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 14px 14px; }
.sp-kertas { position: relative; max-width: 100%; padding: 16px 14px 26px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.sp-kertas::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 12px;
  background: linear-gradient(-45deg, transparent 6px, #fff 0) 0 0/12px 12px repeat-x, linear-gradient(45deg, transparent 6px, #fff 0) 0 0/12px 12px repeat-x; }
.sp-kertas pre { margin: 0; overflow-x: auto; font: 600 13px/1.38 "Courier New", Courier, "Liberation Mono", monospace; color: #111; white-space: pre; }
.sp-ket { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.sp-atur { padding: 16px 18px; overflow-y: auto; }
.sp-atur .lbl { margin-top: 14px; }
.sp-sw { margin: 0; }
.sp-cap button:disabled { opacity: .45; cursor: not-allowed; }
.sp-ketcepat { margin: 2px 0 8px; }
.sp-biaya-ro { padding: 10px 12px; border-radius: 10px; background: var(--bg); font-weight: 600; }
.sp-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--accent-l); }
.sp-total span { font-weight: 700; color: var(--accent); } .sp-total b { font-size: 21px; color: var(--accent); }
.sp-kaki { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--paper); }
.sp-pilih { display: flex; gap: 6px; flex: 1; min-width: 240px; overflow-x: auto; }
.sp-pilih button { display: inline-flex; align-items: center; gap: 5px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: none;
  font-size: 13.5px; font-weight: 700; color: var(--muted); white-space: nowrap; cursor: pointer; }
.sp-pilih button svg { width: 17px; height: 17px; }
.sp-pilih button.on { border-color: var(--accent); background: var(--accent-l); color: var(--accent); }
.sp-tombol { display: flex; gap: 8px; margin-left: auto; }
.sp-tombol .btn-acc { min-width: 200px; }
body.struk-on { overflow: hidden; }
body.struk-on #notifPop { display: none; }
@media (max-width: 759px) {
  #strukPop { padding: 0; align-items: stretch; }
  .sp-box { border-radius: 0; width: 100%; height: 100%; max-height: none; }
  .sp-isi { display: flex; flex-direction: column; overflow-y: auto; }
  .sp-pratinjau { flex: none; max-height: 46vh; padding: 14px 10px 18px; }
  .sp-atur { overflow: visible; }
  .sp-kertas pre { font-size: 12px; }
  .sp-kaki { flex-direction: column; align-items: stretch; }
  .sp-pilih { min-width: 0; }
  .sp-tombol { margin-left: 0; } .sp-tombol .btn { flex: 1; } .sp-tombol .btn-acc { min-width: 0; flex: 2; }
}
.sp-sw .grow .s { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--muted); }

/* v5.5: logo toko di halaman masuk dan menu samping */
.login-logo.img, .brand-logo.img { padding: 0; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.login-logo.img img, .brand-logo.img img, .hello-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.login-logo.img { width: 64px; height: 64px; border-radius: 50%; }
.brand-logo.img { border-radius: 50%; }
.hello { display: flex; align-items: center; gap: 14px; }
.hello-logo { flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.logo-atur { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-pratinjau { display: grid; place-items: center; flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: #fff; border: 1.5px dashed var(--line);
  font-size: 34px; font-weight: 800; color: var(--muted); }
.logo-pratinjau img { width: 100%; height: 100%; object-fit: contain; }
.logo-pratinjau.ada { border-style: solid; }

/* v5.6: tulisan COPY / LUNAS besar, miring, di tengah struk - tanda air tipis di belakang tulisan */
.sp-kertas { position: relative; } .sp-kertas pre { position: relative; z-index: 1; background: transparent; }
.sp-stempel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-24deg); pointer-events: none; padding: .08em .35em;
  border: .09em double currentColor; border-radius: .14em; font: 900 54px/1 Arial, "Helvetica Neue", sans-serif; letter-spacing: .12em; opacity: .2; z-index: 0; }
.sp-stempel.s-copy { color: #DC2626; } .sp-stempel.s-lunas { color: #15803D; }
@media (max-width: 759px) { .sp-stempel { font-size: 42px; } }

/* v5.9: catatan nota di popup atur struk */
.sp-catn textarea { min-height: 54px; }
#spTeks i { font-style: italic; font-weight: 400; color: #555; }

/* v5.14: tombol riwayat di form item berwarna (penjualan hijau, pembelian biru) */
.btn.btn-rw-jual { background: var(--jual); border-color: var(--jual); color: #fff; }
.btn.btn-rw-beli { background: var(--beli); border-color: var(--beli); color: #fff; }
.btn.btn-rw-jual:hover { background: #036447; } .btn.btn-rw-beli:hover { background: #1A43BE; }
.btn.btn-rw-jual svg, .btn.btn-rw-beli svg { stroke: currentColor; }

/* v5.17: kirim nota / bukti pengeluaran sebagai gambar atau PDF */
.seg.seg2 { grid-template-columns: 1fr 1fr; }
.kf-pratinjau { margin: 12px 0 8px; padding: 12px; border-radius: var(--r-sm); background: repeating-linear-gradient(45deg, #EEF2F0 0 8px, #F6F8F7 8px 16px);
  max-height: 46vh; overflow: auto; text-align: center; }
.kf-pratinjau img { width: 100%; max-width: 300px; box-shadow: 0 4px 14px rgba(0,0,0,.14); background: #fff; }
.btn.btn-wa-file { background: #25D366; border-color: #25D366; color: #fff; }
.btn.btn-wa-file:hover { background: #1FB958; }

/* v5.18: popup atur struk sedikit lebih ringkas; pilihan kertas / printer Bluetooth selalu terlihat (baris sendiri, boleh turun) */
.sp-box { width: min(860px, 100%); }
.sp-kepala { padding-top: 12px; padding-bottom: 10px; }
.sp-pratinjau { padding: 14px 12px; }
.sp-kertas pre { font-size: 12px; }
.sp-atur { padding: 12px 16px; font-size: 14px; }
.sp-atur .lbl { margin-top: 10px; }
.sp-atur input, .sp-atur textarea { padding-top: 9px; padding-bottom: 9px; }
.sp-total { margin-top: 10px; padding: 9px 12px; } .sp-total b { font-size: 18px; }
.sp-kaki { gap: 8px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sp-pilih { flex: 1 1 100%; flex-wrap: wrap; overflow: visible; min-width: 0; }
.sp-pilih button { padding: 7px 10px; font-size: 13px; }
.sp-pilih button[data-k="bt"] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sp-tombol { margin-left: auto; } .sp-tombol .btn { padding-top: 10px; padding-bottom: 10px; } .sp-tombol .btn-acc { min-width: 170px; }

/* v5.18: popup Pembayaran, nota penjualan belum dibayar */
.by-sisa { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; padding: 12px 14px; border-radius: 12px; background: #FFF1E6; }
.by-sisa span { display: block; font-weight: 700; } .by-sisa small { display: block; font-size: 12px; color: var(--muted); }
.by-sisa b { font-size: 22px; color: var(--piutang); }
.by-info { margin: -6px 2px 12px; font-size: 13px; color: var(--muted); }
.by-info.ok { color: var(--green); font-weight: 700; } .by-info.kurang { color: var(--piutang); font-weight: 700; }
.btn.by-lunas { border-color: var(--green); color: var(--green); }
.trx.trx-blm { background: #FFF4EA; box-shadow: inset 4px 0 0 var(--piutang); }
.trx.trx-blm:hover { background: #FFECDB; }
.trx .ico { flex-direction: column; align-items: flex-end; gap: 6px; }
.btn.by-btn { padding: 6px 12px; font-size: 13px; border-color: var(--piutang); background: var(--piutang); color: #fff; white-space: nowrap; }
.btn.by-btn svg { width: 16px; height: 16px; }
.btn.by-btn:hover { background: #C2410C; }

/* v5.18: popup atur struk lebih ringkas, pilihan kertas satu baris (tombol printer Bluetooth selalu terlihat) */
.sp-box { width: min(860px, 100%); }
.sp-kepala { padding: 8px 6px 8px 16px; } .sp-kepala b { font-size: 16px; }
.sp-pratinjau { padding: 14px 10px; }
.sp-kertas { padding: 12px 10px 20px; }
.sp-kertas pre { font-size: 11.5px; line-height: 1.32; }
.sp-atur { padding: 10px 14px; font-size: 13.5px; }
.sp-kaki { gap: 6px 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
.sp-pilih { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 6px; align-items: center; padding-bottom: 2px; scrollbar-width: thin; }
.sp-pilih button { flex: none; align-self: center; height: 34px; padding: 0 10px; font-size: 12.5px; }
.sp-pilih button svg { width: 15px; height: 15px; flex: none; }
.sp-pilih button[data-k="bt"] { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: #1D4ED8; border-color: #BFD0FA; }
.sp-pilih button[data-k="bt"].on { background: #E4ECFD; border-color: #1D4ED8; }
.sp-tombol .btn { padding-top: 9px; padding-bottom: 9px; font-size: 14px; } .sp-tombol .btn-acc { min-width: 160px; }
@media (max-width: 759px) {
  .sp-pratinjau { max-height: 38vh; }
  .sp-kaki { flex-direction: column; align-items: stretch; }
  .sp-tombol .btn-acc { min-width: 0; }
}
@media (max-width: 759px) {
  .sp-pilih { flex-wrap: wrap; overflow: visible; }
  .sp-pilih button { height: 32px; padding: 0 9px; }
  .sp-pilih button[data-k="bt"] { max-width: 100%; }
}
@media (max-width: 759px) {
  .sp-kaki { flex-wrap: nowrap; }
  .sp-pilih { flex: none; }
  .sp-tombol { flex: none; }
}
@media (max-width: 759px) {
  .sp-tombol { margin-left: 0; width: 100%; }
  .sp-tombol .btn { flex: 1; white-space: nowrap; } .sp-tombol .btn-acc { flex: 1.6; }
}
/* v5.25: keterangan jumlah bayar sebesar angka sisa pembayaran */
.by-info.ok, .by-info.kurang { margin: -2px 2px 14px; font-size: 22px; font-weight: 700; line-height: 1.25; }

