:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e2e5e9;
  --line-strong: #cfd4da;
  --text: #16191d;
  --text-2: #4a525c;
  --muted: #7a828c;
  --navy: #13294b;
  --navy-2: #1d3a66;
  --navy-soft: #e8edf5;
  --green: #1d6b46;
  --green-soft: #e7f2ec;
  --amber: #1d4e89;      /* dulu kuning: kini biru aksen untuk pemberitahuan (keputusan Bapak 14 Nov: warna uang hanya merah & hijau) */
  --amber-soft: #e8eef8;
  --red: #a4262c;
  --red-soft: #fbecec;
  --radius: 6px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 32px 28px 24px; }
.brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand-mark .logo { width: 38px; height: 38px; flex: none; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; }
.brand-mark .logo svg, .side .brand .logo svg { width: 100%; height: 100%; display: block; }
.brand-mark .t1 { font-weight: 600; font-size: 15px; }
.brand-mark .t2 { font-size: 12px; color: var(--muted); }
.login-card h1 { font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.powered { text-align: center; font-size: 11px; color: var(--muted); margin-top: 20px; letter-spacing: .2px; }

/* ===== Layout ===== */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d3e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; gap: 10px; align-items: center; }
.side .brand .logo { width: 32px; height: 32px; flex: none; border-radius: 7px; background: #fff; color: var(--navy); display: grid; place-items: center; }
.side .brand .t1 { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.side .brand .t2 { font-size: 11px; color: #8fa0bb; }
.side nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.side .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: #7487a5; padding: 14px 10px 6px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 5px; color: #c9d3e3; text-decoration: none; font-size: 13.5px; cursor: pointer; }
.side a.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.nav.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
.side a.nav svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.side a.nav .badge { margin-left: auto; background: #3f72c4; color: #fff; font-size: 11px; padding: 0 6px; border-radius: 9px; line-height: 18px; }
.side .foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #7487a5; }
/* Tombol ciutkan menu (komputer) */
.ciut-btn { display: flex; align-items: center; gap: 10px; margin: 0 10px 8px; padding: 8px 10px; border: 0; border-radius: 5px; background: none; color: #8fa0bb; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.ciut-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.ciut-btn svg { width: 16px; height: 16px; flex: none; transition: transform .2s; }
/* Menu diciutkan: hanya ikon, lebar 64px */
.shell { transition: grid-template-columns .2s ease; }
.shell.ciut { grid-template-columns: 64px 1fr; }
.shell.ciut .side .brand { padding: 16px 0; justify-content: center; }
.shell.ciut .side .brand-teks, .shell.ciut .side .lbl, .shell.ciut .side .foot { display: none; }
.shell.ciut .side nav { padding: 10px 8px; }
.shell.ciut .side .grp { font-size: 0; padding: 0; margin: 10px 6px; border-top: 1px solid rgba(255,255,255,.1); }
.shell.ciut .side a.nav { justify-content: center; padding: 10px 0; position: relative; }
.shell.ciut .side a.nav svg { width: 18px; height: 18px; }
.shell.ciut .side a.nav .badge { position: absolute; top: 3px; right: 6px; font-size: 10px; padding: 0 4px; line-height: 15px; }
.shell.ciut .ciut-btn { justify-content: center; margin: 0 8px 12px; }
.shell.ciut .ciut-btn svg { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: inline-flex; }
.topbar .desa-pick { display: flex; align-items: center; gap: 8px; }
.topbar .desa-pick label { font-size: 12px; color: var(--muted); }
.topbar .desa-pick select { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 30px 6px 10px; background: var(--surface); font-weight: 500; min-width: 220px; }
.topbar .spacer { flex: 1; }
.topbar .who { text-align: right; line-height: 1.2; }
.topbar .who .n { font-weight: 500; font-size: 13px; }
.topbar .who .r { font-size: 11.5px; color: var(--muted); }
.content { padding: 24px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); text-decoration: none; cursor: pointer; }
.crumb a:hover { color: var(--navy-2); text-decoration: underline; }

/* ===== Buttons & inputs ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: var(--radius); cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: #b9c0c8; }
.btn:focus-visible, .inp:focus-visible { outline: 2px solid #7aa2d6; outline-offset: 1px; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #e5b9bb; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--navy-soft); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 7px 10px; background: var(--surface); min-height: 34px; }
.inp:focus { border-color: #7aa2d6; outline: none; box-shadow: 0 0 0 3px rgba(29,58,102,.10); }
.inp.num { text-align: right; }
.inp[readonly] { background: var(--surface-2); color: var(--text-2); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field small { color: var(--muted); font-size: 11.5px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* ===== Panels, KPI, tables ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-h .note { color: var(--muted); font-size: 12.5px; }
/* Kotak pencarian di tabel */
.panel-h .brk { flex-basis: 100%; height: 0; }
.cari-box { position: relative; display: inline-flex; align-items: center; flex: 0 1 300px; min-width: 200px; }
.cari-box svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.cari-box .inp { padding-left: 34px; padding-right: 10px; }
.cari-box .cari-n { position: absolute; left: 0; top: 100%; margin-top: 3px; font-size: 11.5px; color: var(--navy-2); white-space: nowrap; }
.cari-box .cari-n:empty { display: none; }
.cari-box:has(.cari-n:not(:empty)) { margin-bottom: 16px; }
.filters .cari-box .inp { width: 100%; min-width: 0; }
.tbl .ulang { display: none; }
.tbl.mencari .ulang { display: inline; color: var(--muted); }
.panel-h .r { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-b { padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.kpi { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.kpi .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi.alert .v { color: var(--amber); }
.kpi.merah .v { color: var(--red); }
.kpi.hijau .v { color: var(--green); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tr.click { cursor: pointer; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl tr.sub td { color: var(--text-2); }
.tbl tr.batal td { color: var(--muted); text-decoration: line-through; }
.tbl tr.grp td { background: var(--surface-2); font-weight: 600; }
.tbl.compact td { padding: 6px 10px; }
.tbl .inp { min-height: 30px; padding: 5px 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.tag { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; }
.tag.navy { background: var(--navy-soft); color: var(--navy-2); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.gray { background: #eef0f2; color: var(--text-2); }
.neg { color: var(--red); }
.tbl tr.retur td, .tbl tr.retur td a { color: var(--red); }
.ubah-harga { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; text-decoration: underline dotted; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; }
.ubah-harga:hover { background: var(--navy-soft); }
.ubah-harga .tag { font-size: 10.5px; padding: 0 5px; }
.pos { color: var(--green); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--navy); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .inp { width: auto; min-width: 160px; }
.banner { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border: 1px solid #c9d6ea; background: var(--amber-soft); color: #1a3a66; border-radius: 8px; margin-bottom: 18px; font-size: 13px; }
.banner.hijau { border-color: #b9dcc8; background: var(--green-soft); color: #14532d; }
.banner .r { margin-left: auto; }
.info-line { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.info-line dt { color: var(--muted); }
.info-line dd { margin: 0; }

/* ===== Modal ===== */
.modal-back { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 8px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.modal.wide { max-width: 980px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; background: var(--surface-2); border-radius: 0 0 8px 8px; flex-wrap: wrap; }
.modal-f .l { margin-right: auto; font-size: 13px; color: var(--text-2); }
.sumline { display: flex; justify-content: flex-end; gap: 28px; padding: 12px 4px 0; font-size: 13px; flex-wrap: wrap; }
.sumline b { font-variant-numeric: tabular-nums; }
.hint { font-size: 12px; color: var(--muted); }

/* Isian barang dengan saran */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.10); max-height: 240px; overflow-y: auto; margin-top: 2px; }
.ac-list div { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.ac-list div span { color: var(--muted); font-size: 12px; }
.ac-list div.on, .ac-list div:hover { background: var(--navy-soft); }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1b2330; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.powered-in { font-size: 11px; color: var(--muted); padding: 18px 24px 24px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ===== Layar kecil (HP) ===== */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .side-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .topbar { padding: 0 12px; gap: 8px; }
  .shell.ciut { grid-template-columns: 1fr; }
  .ciut-btn { display: none; }
  .shell.ciut .side .brand-teks, .shell.ciut .side .lbl, .shell.ciut .side .foot { display: revert; }
  .shell.ciut .side .brand { padding: 18px 18px 16px; justify-content: flex-start; }
  .shell.ciut .side nav { padding: 12px 10px; }
  .shell.ciut .side .grp { font-size: 10.5px; padding: 14px 10px 6px; margin: 0; border: 0; }
  .shell.ciut .side a.nav { justify-content: flex-start; padding: 8px 10px; }
  .shell.ciut .side a.nav .badge { position: static; }
  .topbar .desa-pick label, .topbar .who .r { display: none; }
  .topbar .desa-pick select { min-width: 0; max-width: 52vw; }
  .content { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .info-line { grid-template-columns: 1fr; gap: 2px; }
  .info-line dd { margin-bottom: 8px; }
  .modal-back { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; }
  .kpi .v { font-size: 18px; }
  .tbl td, .tbl th { white-space: nowrap; }
  .topbar .who { display: none; }
  .banner { flex-wrap: wrap; }
}
@media (min-width: 901px) { .side-back { display: none; } }

/* Kotak ringkasan yang bisa diklik → halaman rincian */
a.kpi.link { color: inherit; text-decoration: none; cursor: pointer; transition: background .15s ease; display: block; }
a.kpi.link:hover { background: var(--surface-2); }
a.kpi.link:focus-visible { outline: 2px solid var(--navy-2); outline-offset: -2px; }
.kpi .go { font-size: 12px; color: var(--navy-2); font-weight: 500; margin-top: 6px; opacity: .8; }
.kpi .v { white-space: nowrap; }
a.kpi.link:hover .go { opacity: 1; }
.kecil { font-size: 12px; }
.tbl tr.subtotal td { background: #fbfcfd; border-top: 1px solid var(--line-strong); }
.tbl th.nm, .tbl td.nm { min-width: 220px; }
.tbl td.num .btn { font-weight: 500; }

/* Tampilan HP terkunci (tidak zoom masuk/keluar): huruf isian 16px agar iPhone tidak membesar otomatis,
   ketuk dua kali tidak memperbesar, halaman tidak lebih lebar dari layar */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
html, body { overflow-x: hidden; max-width: 100%; }
@media (max-width: 900px), (pointer: coarse) {
  input, select, textarea, .inp, select.inp, textarea.inp, .tbl .inp, .topbar .desa-pick select { font-size: 16px; }
}

/* Tombol Muat ulang + kabar "Ada versi baru" */
.btn-muat { position: relative; }
.btn-muat.ada-baru::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #c9a55c; box-shadow: 0 0 0 2px var(--surface); }
.pembaruan { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 150; display: flex; align-items: center; gap: 16px; background: #13294b; color: #fff; padding: 12px 14px 12px 18px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.22); width: max-content; max-width: calc(100vw - 32px); font-size: 13.5px; }
.pembaruan .pb-aksi { display: flex; gap: 8px; flex-shrink: 0; }
.pembaruan .btn { border-color: rgba(255,255,255,.35); background: transparent; color: #fff; }
.pembaruan .btn.primary { background: #fff; color: #13294b; border-color: #fff; }
.pembaruan .btn svg { stroke: currentColor; }
@media (max-width: 900px) {
  .btn-muat .lbl { display: none; }
  .topbar .btn.sm { min-height: 38px; }
  .btn-muat { min-width: 38px; justify-content: center; }
  .topbar .desa-pick { min-width: 0; flex: 1 1 auto; }
  .topbar .desa-pick select { width: 100%; }
  .pembaruan { flex-direction: column; align-items: stretch; gap: 10px; bottom: 12px; width: calc(100vw - 32px); }
  .pembaruan .pb-aksi { justify-content: flex-end; }
}

/* Tanggal ditulis jelas, peringatan angka, draf, bantuan, ringkas pemilik (14 Nov) */
.tgl-jelas { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.cek-angka { display: block; font-size: 11.5px; color: #b42318; margin-top: 3px; white-space: normal; line-height: 1.35; }
.inp.janggal { border-color: #d92d20; background: #fff6f5; }
.baris-cek td { padding-top: 0 !important; border-top: 0 !important; }
.banner.draf { background: #fff8e6; border-color: #f1d79b; color: #6b4e00; margin-bottom: 12px; }
.bantuan { margin: 0; padding-left: 18px; line-height: 1.6; }
.bantuan li { margin-bottom: 8px; }
@media (max-width: 900px) {
  .btn-bantu .lbl { display: none; }
  .btn-bantu { min-width: 38px; justify-content: center; }
  .tbl-uang td:nth-child(2) { white-space: normal; min-width: 120px; }
  .tbl-uang td:nth-child(4) { min-width: 0; width: 110px; }
  .tbl-uang .inp { min-width: 0; width: 100%; }
  .kpis.pemilik { grid-template-columns: 1fr 1fr; }
  .kpis.pemilik .kpi .v { font-size: 17px; }
}

/* Pemilih toko (hanya muncul bila pemakai boleh lebih dari satu toko) */
.topbar .toko-pick select { min-width: 170px; }
@media (max-width: 900px) {
  /* HP: pemilih Toko & Desa turun ke baris kedua supaya namanya terbaca penuh */
  .topbar.punya-toko { height: auto; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; row-gap: 8px; }
  .topbar.punya-toko .spacer { display: block; flex: 1; }
  .topbar.punya-toko .desa-pick { order: 10; flex: 0 0 calc(50% - 4px); min-width: 0; }
  .topbar.punya-toko .desa-pick select { width: 100%; max-width: none; min-width: 0; }
}

/* ===== KSO Madani: formulir nota (baris barang) ===== */
.nb-head, .nb-row { display: grid; grid-template-columns: 84px minmax(180px, 1fr) 130px 130px 120px 34px; gap: 8px; align-items: center; }
.nb-head { margin-top: 18px; padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); }
.nb-head span:nth-child(1), .nb-head span:nth-child(3), .nb-head span:nth-child(4), .nb-head span:nth-child(5) { text-align: right; }
.nb-row { padding: 6px 0; border-bottom: 1px solid #eef0f2; }
.nb-row label { display: block; margin: 0; }
.nb-row label > span, .nb-row .nb-t > span { display: none; }
.nb-row .nb-t { text-align: right; font-variant-numeric: tabular-nums; }
.nb-row.retur .nb-t b, .nb-row.retur [data-k=qty] { color: var(--red); }
.nb-row .nb-x { padding: 4px; justify-content: center; }
.l-btn { margin-right: 0; }
.modal-f .l { color: var(--red); }
@media (max-width: 900px) {
  .nb-head { display: none; }
  .nb-row { grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 0; position: relative; }
  .nb-row label > span, .nb-row .nb-t > span { display: block; font-size: 11.5px; color: var(--text-2); font-weight: 500; margin-bottom: 3px; }
  .nb-row .nb-n { grid-column: 1 / -1; order: -1; padding-right: 40px; }
  .nb-row .nb-x { position: absolute; top: 30px; right: 0; }
  .nb-row .nb-t { text-align: left; align-self: end; padding-bottom: 6px; }
  .nb-row .nb-t b { font-size: 15px; }
  .modal-f { position: sticky; bottom: 0; }
  .modal-f .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 900px) {
  /* Rincian nota di HP: nama barang boleh turun baris supaya kolom Total tetap terlihat */
  .modal .tbl.compact td, .modal .tbl.compact th { padding: 6px 6px; }
  .modal .tbl.compact td:nth-child(2) { white-space: normal; min-width: 110px; }
  .modal .tbl.compact .nm { min-width: 110px; }
}

/* Isi jendela tidak boleh melebar keluar (penyebab kolom pilihan menjorok, 17 Nov) */
.modal .grid > *, .modal .field, .modal .inp { min-width: 0; max-width: 100%; }
.banner > span { min-width: 0; }
/* Ringkasan tagihan bulanan */
.kotak-ring { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 4px 14px; }
.ring-tg > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ring-tg > div:last-child { border-bottom: 0; }
.ring-tg span { color: var(--text-2); }
.ring-tg b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ring-tg .akhir b { color: var(--red); font-size: 14px; }
