/* Sistem Macaronis: gaya tampilan. Bentuk mengikuti demo yang disetujui Sandy (docs/acuan/demo-v8.html); warna disamakan dengan logo dan
   kop surat Macaronis (petrol #006A91, teal #009E86) sejak 26 Okt 2026.
   Dirancang dari layar HP dulu: satu kolom, menu jadi laci. Di layar lebar menu menetap di samping.
   Tanpa gaya inline (CSP style-src 'self'). Huruf disajikan sendiri dari /huruf, tidak ada yang diambil dari luar. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/huruf/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #EEF4F7; --surface: #FFFFFF; --ink: #0F2433; --muted: #566A77; --line: #D3DFE6;
  --accent: #006A91; --accent-ink: #FFFFFF; --accent-soft: #DCEDF5; --teal: #009E86;
  --ok: #1C7441; --ok-soft: #DCF0E3; --warn: #8A5A00; --warn-soft: #FAEACB; --bad: #AE241C; --bad-soft: #FAE0DD;
  --f-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-angka: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;
  --kertas: #FFFFFF; --tinta: #17202B; --garis-kertas: #C8CED6;
  --bayang: 0 1px 2px rgba(15, 36, 51, .06), 0 8px 24px rgba(15, 36, 51, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 15.5px; line-height: 1.5; margin: 0; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button[disabled] { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.angka { font-family: var(--f-angka); font-variant-numeric: tabular-nums; }
.redup { color: var(--muted); }

/* ---------- kerangka: menu samping + kepala + isi ---------- */
.kerangka { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.samping { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 10px 12px; }
/* merek: logo Macaronis mendatar + nama PT kecil. Aplikasi selalu bertema terang (tanpa tema gelap). */
.merek { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 2px 8px 14px; }
.merek img { display: block; width: 100%; max-width: 190px; height: auto; }
.merek span { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); line-height: 1.2; }
.masuk-kartu .merek { padding: 0 0 16px; gap: 6px; }
.masuk-kartu .merek img { max-width: 250px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-grup { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg, .tb svg, .tombol-ikon svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .hitung { margin-left: auto; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 8px; font-size: .76rem; font-weight: 700; }
.samping-bawah { border-top: 1px solid var(--line); margin-top: 12px; padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
.samping-bawah .siapa { min-width: 0; flex: 1; }
.samping-bawah b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.samping-bawah span { display: block; font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versi { font-size: .7rem; color: var(--muted); padding: 8px 8px 0; }
.tirai { position: fixed; inset: 0; background: rgba(8, 21, 29, .5); z-index: 25; }

.utama { min-width: 0; display: flex; flex-direction: column; }
.atas-bar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.atas-judul { min-width: 0; flex: 1; }
.atas-judul .eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atas-judul h1 { font-size: clamp(1.2rem, 4.6vw, 1.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atas-alat { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tombol-ikon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0; font-weight: 700; font-size: .78rem; }
.tombol-menu { display: none; }
.contoh { font-size: .74rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
/* Isi halaman memakai seluruh lebar layar (tidak dibatasi di tengah), supaya tabel berkolom banyak tidak terpotong. */
.isi-halaman { width: 100%; padding: 18px 20px 64px; display: flex; flex-direction: column; gap: 22px; }
.isi-halaman > * { min-width: 0; }

@media (max-width: 56rem) {
  .kerangka { grid-template-columns: minmax(0, 1fr); }
  .samping { position: fixed; inset: 0 auto 0 0; width: min(17.5rem, 86vw); transform: translateX(-104%); transition: transform .18s ease; z-index: 30; box-shadow: var(--bayang); }
  .samping.buka { transform: none; }
  .tombol-menu { display: grid; }
  .contoh { display: none; }
}
@media (prefers-reduced-motion: reduce) { .samping { transition: none; } }

/* ---------- blok, kartu angka, tombol ---------- */
.blok { display: flex; flex-direction: column; gap: 10px; }
.blok > * { min-width: 0; }
h2 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; }
.judul-baris { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ket { color: var(--muted); font-size: .9rem; max-width: 80ch; }
.label { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kartu-baris { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 10px; }
.kartu { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; color: inherit; }
a.kartu:hover { border-color: var(--accent); }
.kartu b { font-family: var(--f-angka); font-size: 1.18rem; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kartu span:last-child { font-size: .8rem; color: var(--muted); }
.kartu.k-warn b { color: var(--warn); }

.tb { border-radius: 8px; padding: 9px 14px; font-weight: 700; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.tb-utama { background: var(--accent); color: var(--accent-ink); }
.tb-garis { background: transparent; border-color: var(--line); color: var(--ink); }
.tb-bahaya { background: var(--bad); color: #fff; }
.tb-besar { padding: 12px 16px; width: 100%; }
.tb-kecil { padding: 6px 11px; font-size: .84rem; }

.pesan { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.galat { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.catatan { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
.kosong { color: var(--muted); font-size: .92rem; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; }

/* ---------- isian ---------- */
form.isi, .isi-kotak { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; }
form.isi > *, .isi-kotak > * { min-width: 0; }
.kolom { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lebar { grid-column: 1 / -1; }
.kolom > span, .kolom > label { font-size: .82rem; font-weight: 700; }
.kolom input:not([type="checkbox"]):not([type="file"]), .kolom select, .kolom textarea, .bilah input, .bilah select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-height: 42px;
}
.kolom input[type="file"] { font-size: .85rem; max-width: 100%; }
.kolom small, .bantu { font-size: .82rem; color: var(--muted); font-weight: 400; }
.centang { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.centang input { width: 18px; height: 18px; accent-color: var(--accent); }
.aksi-form { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.pilih-dua { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 10px; }
input.kecil { width: 5.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 7px; text-align: right; font-family: var(--f-angka); font-size: .86rem; }
input.kecil.lebar-uang { width: 7.4rem; }
/* Di dalam tabel (penggajian punya tujuh kolom isian) kotak uangnya lebih ramping supaya semua kolom muat di laptop. */
td input.kecil.lebar-uang { width: 6rem; padding-inline: 5px; }
table.susun td input.kecil { width: 100%; max-width: 9rem; text-align: left; }
select.kecil { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 7px; font-size: .86rem; }
.bilah { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bilah > * { flex: 1 1 9rem; min-width: 0; }
.bilah > .tb { flex: 0 0 auto; }
/* Deretan tombol saring boleh menyempit lalu turun baris, supaya di HP tidak keluar dari layar. */
.bilah > .saring { flex: 0 1 auto; }
.saring { display: flex; flex-wrap: wrap; gap: 6px; }
.saring button { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: .84rem; }
.saring button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- daftar dan kartu pesanan ---------- */
.daftar { display: flex; flex-direction: column; gap: 8px; }
.nota { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.nota > * { min-width: 0; }
a.nota { text-decoration: none; color: inherit; }
a.nota:hover { border-color: var(--accent); }
.nota-atas { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.nota-judul { display: flex; flex-direction: column; min-width: 0; }
.nota-judul span { color: var(--muted); font-size: .86rem; }
.nota-jumlah { font-family: var(--f-angka); font-weight: 600; white-space: nowrap; }
.nota-info { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.chip { background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 2px 9px; font-weight: 600; }
.chip-kat { background: var(--bg); border: 1px solid var(--line); }
.pil { border-radius: 999px; padding: 2px 9px; font-weight: 700; font-size: .8rem; white-space: nowrap; display: inline-block; }
.pil-ok { background: var(--ok-soft); color: var(--ok); }
.pil-warn { background: var(--warn-soft); color: var(--warn); }
.pil-bad { background: var(--bad-soft); color: var(--bad); }
.nota-aksi { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.saldo { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 8px 14px; }
.saldo div { display: flex; flex-direction: column; min-width: 0; }
.saldo span { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.saldo b { font-family: var(--f-angka); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.saldo b.t-warn, .t-warn { color: var(--warn); }
.saldo .pil { align-self: flex-start; }
.nota.jumlah-semua { border-color: var(--ink); }
.nota.batal { opacity: .7; }
.rantai { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.rantai li { border-top: 4px solid var(--line); padding-top: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .03em; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rantai li.lewat { border-top-color: var(--accent); color: var(--ink); }
.rantai li.kini { border-top-color: var(--warn); color: var(--warn); }
.riwayat { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.foto { background: var(--bg); border-radius: 8px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.foto img { max-width: 100%; max-height: 460px; border-radius: 4px; }
.foto-kecil { display: flex; flex-wrap: wrap; gap: 8px; }
.foto-kecil figure { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.foto-kecil img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.struk { background: var(--surface); border: 1px dashed var(--muted); width: min(16rem, 100%); padding: 14px; display: flex; flex-direction: column; gap: 6px; font-family: var(--f-angka); font-size: .8rem; }
.struk i { border-top: 1px dashed var(--muted); }
.struk strong { font-size: 1rem; }
.struk em { font-family: var(--f-ui); font-style: normal; color: var(--muted); font-size: .72rem; }

/* ---------- tabel ---------- */
/* Tabel terbentang selebar halaman, tanpa kotak. .gulung hanya jaga-jaga di layar sempit (HP): yang bergeser tabelnya
   saja, bukan seluruh halaman. Judul kolom boleh turun baris supaya kolomnya tidak melebar gara-gara judulnya. */
.gulung { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th:first-child, td:first-child { padding-left: 2px; }
th:last-child, td:last-child { padding-right: 2px; }
table.rapat th, table.rapat td { padding: 7px 8px; }
table.rapat th:first-child, table.rapat td:first-child { padding-left: 2px; }
table.rapat th:last-child, table.rapat td:last-child { padding-right: 2px; }
th { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: normal; vertical-align: bottom; border-bottom: 1.5px solid var(--ink); }
.gulung > table > tbody > tr:hover > td { background: var(--surface); }
.kertas .gulung > table > tbody > tr:hover > td, .nota .gulung > table > tbody > tr:hover > td { background: none; }
td .nota-aksi { flex-wrap: nowrap; gap: 6px; }
td.kanan, th.kanan { text-align: right; }
td.kanan { font-family: var(--f-angka); font-variant-numeric: tabular-nums; }
td.beda { color: var(--bad); font-weight: 700; }
td.lentur { white-space: normal; min-width: 7.5rem; }
td.lipat { white-space: normal; }
td .redup { font-size: .92em; }

/* Tabel yang tidak muat di lebar layar (HP, tablet): tiap baris disusun jadi kelompok "judul kolom, isi", supaya tidak
   ada kolom yang terpotong. Kelas "susun" dipasang dan dicabut sendiri oleh js/umum.js sesuai lebar layar. */
table.susun, table.susun > tbody, table.susun > tfoot { display: block; }
table.susun > thead { display: none; }
table.susun > tbody > tr, table.susun > tfoot > tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 9px 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
table.susun > tbody > tr:first-child { border-top: 1.5px solid var(--ink); }
table.susun > * > tr > td, table.susun > * > tr > td:first-child, table.susun > * > tr > td:last-child { display: block; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; overflow-wrap: anywhere; background: none; }
table.susun > * > tr > td::before { content: attr(data-judul); display: block; font-family: var(--f-ui); font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Sel pertama jadi judul kelompoknya (tanpa tulisan judul kolom); sel tanpa judul kolom (tombol) memakai satu baris penuh. */
table.susun > * > tr > td:first-child, table.susun > * > tr > td[colspan], table.susun > * > tr > td:not([data-judul]) { grid-column: 1 / -1; }
table.susun > * > tr > td:first-child { font-size: 1.04em; font-weight: 700; }
table.susun > * > tr > td:first-child::before { content: none; }
table.susun > * > tr > td:first-child .redup { font-weight: 400; }
table.susun > * > tr > td:empty { display: none; }
table.susun > * > tr > td .nota-aksi { flex-wrap: wrap; }
table.susun > * > tr.jumlah { border-top: 1.5px solid var(--ink); }
table.susun > * > tr.jumlah > td { border-top: 0; }
table.susun > * > tr.anak { padding-top: 0; border-bottom: 0; }
table.susun > * > tr.induk { padding-bottom: 6px; border-bottom: 0; }
table.susun > * > tr.anak:last-child, table.susun > * > tr.akhir { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
tr.jumlah td { font-weight: 700; border-top: 1.5px solid var(--ink); white-space: normal; }
tr.anak td { border-bottom: 0; padding-top: 2px; padding-bottom: 2px; }
tr.anak:last-child td, tr.akhir td { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
tr.induk td { border-bottom: 0; padding-bottom: 2px; font-weight: 700; }
tr.mati td { color: var(--muted); }
td .tb-kecil { padding: 4px 9px; }

/* ---------- login ---------- */
.masuk-latar { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; }
.masuk-kartu { width: min(24rem, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--bayang); }
.masuk-kartu .merek { padding: 0; }
.masuk-kartu h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.masuk-kartu form { display: flex; flex-direction: column; gap: 12px; }
.masuk-bawah { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qr-kotak { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 10px; }
.kode-rahasia { font-family: var(--f-angka); font-size: .95rem; letter-spacing: .06em; background: var(--bg); border-radius: 8px; padding: 8px 10px; text-align: center; overflow-wrap: anywhere; }

/* ---------- kabar dan jendela ---------- */
.kabar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(30rem, calc(100vw - 24px)); pointer-events: none; }
.kabar div { background: var(--ink); color: var(--bg); border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: .92rem; box-shadow: var(--bayang); }
.kabar div.salah { background: var(--bad); color: #fff; }
.latar { position: fixed; inset: 0; background: rgba(8, 21, 29, .55); display: grid; place-items: center; padding: 14px; z-index: 50; overflow-y: auto; }
.jendela { width: min(30rem, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--bayang); }
.jendela.lebar { width: min(46rem, 100%); }
.jendela .isi-kotak, .jendela form.isi { border: 0; padding: 0; background: none; }
.jendela .kaki { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---------- hak akses ---------- */
.hak-grup { display: flex; flex-direction: column; gap: 6px; }
.hak-menu { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 4px 12px; padding: 7px 0; border-top: 1px solid var(--line); align-items: start; }
.hak-menu > b { font-size: .9rem; }
.hak-pilihan { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 34rem) { .hak-menu { grid-template-columns: minmax(0, 1fr); } }

/* ---------- kasir: petak unit, menu, pesanan, bill ---------- */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr)); gap: 8px; }
.kamar { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.8rem, 1fr)); gap: 6px; }
.menu button, .kamar button { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kamar button { padding: 8px 10px; }
.kamar button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.menu button:not([disabled]):hover, .kamar button:not([disabled]):hover { border-color: var(--accent); }
.menu button b, .kamar button b { font-size: .9rem; overflow-wrap: anywhere; }
.menu button span, .kamar button span { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu button span.angka, .kamar button span.angka { color: var(--ink); }
/* Bagian yang dituju saat layar digulir otomatis: beri jarak supaya judulnya tidak tertutup kepala halaman. */
.jangkar { scroll-margin-top: 76px; }
.menu-grup { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.bill-baris { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(5.6rem, auto); gap: 8px; align-items: center; font-size: .9rem; }
.bill-baris > .angka { text-align: right; }
.jml { display: flex; align-items: center; gap: 6px; }
.jml button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; padding: 0; }
.jml input.kecil { width: 3.6rem; text-align: center; }
.total-baris { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.total-baris.besar { font-weight: 800; font-size: 1.04rem; border-top: 1.5px solid var(--ink); padding-top: 7px; }
.bayar-baris { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.bayar-baris > b { flex: 0 0 4.4rem; }
.bayar-baris input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; min-width: 0; }
.bayar-baris input.uang { flex: 0 1 9rem; text-align: right; font-family: var(--f-angka); }
.bayar-baris .rujuk { flex: 1 1 9rem; }
button.chip { border: 1px solid var(--line); font-size: .8rem; }
/* Baris isian berisi pilihan (BBM keluar, barang di pengeluaran langsung): sejajar di layar lebar, turun baris di HP. */
.baris-bbm select { flex: 1 1 9rem; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.baris-bbm input.uang { flex: 0 1 7.5rem; }
.bayar-baris input[disabled] { opacity: .5; }
button.chip:hover { border-color: var(--accent); }

/* ---------- akuntansi: baris jurnal, tabel laporan, slip gaji ---------- */
/* Baris isian jurnal dan pengajuan dana: pilihan dan angka sejajar di layar lebar, turun baris di HP. */
.baris-jurnal select { flex: 1 1 9rem; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.baris-jurnal input.uang { flex: 0 1 8rem; }
.baris-jurnal input.rujuk { flex: 2 1 12rem; }
table.laporan tr.induk td { padding-top: 12px; }
table.laporan td:first-child { white-space: normal; min-width: 11rem; }
.menjorok { display: inline-block; padding-left: 1.2rem; }
button.tautan { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-align: left; }
td input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.kolom textarea { font-family: var(--f-angka); font-size: .82rem; resize: vertical; }
/* Slip gaji: kertas yang lebih sempit dari bill. Saat mencetak semua slip, tiap slip mulai di halaman baru. */
.kertas.kertas-sempit { min-width: 0; width: min(34rem, 100%); }

/* Slip pesanan 58 mm. Ukuran huruf dan lebarnya mutlak (bukan rem), supaya di layar dan di kertas sama persis:
   tinggi kertas dihitung dari tinggi slip ini saat diukur di layar. */
.slip { background: var(--kertas); color: var(--tinta); width: 58mm; padding: 3mm 4mm 5mm; display: flex; flex-direction: column; gap: 1.2mm; font-family: var(--f-angka); font-size: 8.5pt; line-height: 1.3; overflow-wrap: anywhere; }
.slip > b { font-size: 10.5pt; text-align: center; letter-spacing: .04em; }
.slip > i { border-top: 1px dashed var(--tinta); margin: .6mm 0; }
.slip .tengah { text-align: center; }
.slip .dua { display: flex; justify-content: space-between; gap: 2mm; }
.slip .dua span:last-child { white-space: nowrap; }
.slip .tebal { font-weight: 700; font-size: 9.5pt; }
.slip .garis-ttd { border-bottom: 1px solid var(--tinta); height: 14mm; }
.foto .slip { border: 1px dashed var(--muted); }

/* Bill A4. */
.kertas { background: var(--kertas); color: var(--tinta); min-width: 47rem; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; font-size: .8rem; }
.kertas table { font-size: .76rem; }
.kertas th, .kertas td { border-bottom: 1px solid var(--garis-kertas); color: var(--tinta); padding: 5px 7px; }
.kertas th { color: var(--tinta); }
.kertas tr.jumlah td { border-top: 1.5px solid var(--tinta); }
.kertas-atas { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--tinta); padding-bottom: 10px; }
.kertas-atas div { display: flex; flex-direction: column; }
.kertas-judul { font-size: 1.15rem; letter-spacing: .04em; }
.kertas-kanan { text-align: right; }
.kertas-info { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.kertas-bawah { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.kertas-ttd { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 46px; break-inside: avoid; }
.kertas-ttd span { border-top: 1px solid var(--tinta); padding-top: 5px; }
/* Tanda di bill yang sudah dibatalkan. */
.kertas-batal { border: 2px solid var(--tinta); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.kertas-batal b { font-size: 1.05rem; letter-spacing: .14em; }

/* Wadah dokumen yang sedang dicetak. Di layar ia di luar pandangan tapi tetap punya ukuran (bukan display: none),
   karena tinggi slip harus bisa diukur. Saat mencetak, body.modus-cetak hanya menampilkan wadah ini. */
#cetak { position: fixed; left: -10000px; top: 0; visibility: hidden; }
#cetak.cetak-slip { width: 58mm; }
#cetak.cetak-bill { width: 186mm; }

/* ---------- kertas (arsip nota yang bisa dicetak) ---------- */
.arsip-nota { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; break-inside: avoid; }
.arsip-kepala { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; }
.arsip-kepala div { display: flex; flex-direction: column; min-width: 0; }
.cetak-saja { display: none; }

/* ---------- Paket 3: tanda antrean offline, jendela perjalanan, peta penempatan ---------- */
/* Tanda "Belum terkirim" dan "Offline" di kepala halaman: selalu terlihat, juga di layar HP. */
.tanda { font-size: .74rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
.tanda-bad { color: var(--bad); background: var(--bad-soft); }
.isi-kotak h3 { font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.nota.redup { opacity: .74; }
.kamar.peta button[disabled] { opacity: 1; cursor: default; color: var(--ink); }

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #444; --line: #bbb; --accent: #000; --accent-soft: #eee; --warn: #000; --warn-soft: #eee; --bad: #000; --bad-soft: #eee; --ok: #000; --ok-soft: #eee; --tinta: #000; --garis-kertas: #888; color-scheme: light; }
  @page { size: A4; margin: 14mm; }
  body { font-size: 11pt; }
  .samping, .atas-bar, .tirai, .kabar, .tak-cetak, .bilah { display: none !important; }
  .kerangka { display: block; }
  .isi-halaman { max-width: none; padding: 0; gap: 12px; }
  .cetak-saja { display: block; }
  .gulung { overflow: visible; }
  .foto { background: none; padding: 0; justify-content: flex-start; }
  .foto img { max-height: 150mm; }
  th, td { white-space: normal; }

  /* Modus cetak dokumen kasir (slip atau bill) dinyalakan dengan sengaja lewat body.modus-cetak. Tanpa kelas itu
     halaman dicetak seperti biasa dan wadah dokumennya tidak ikut. Ukuran kertasnya (@page) dipasang lewat skrip
     tepat sebelum mencetak: slip 58 mm dengan tinggi mengikuti isinya, bill A4. */
  #cetak { display: none; }
  body.modus-cetak > *:not(#cetak) { display: none !important; }
  body.modus-cetak > #cetak { display: block; position: static; visibility: visible; }
  body.modus-cetak .slip { border: 0; }
  body.modus-cetak .kertas { min-width: 0; padding: 0; font-size: 9.5pt; }
  body.modus-cetak .kertas.kertas-sempit { width: 120mm; }
  body.modus-cetak .halaman { break-after: page; }
  body.modus-cetak .halaman:last-child { break-after: auto; }
  /* Tabel bill harus muat di lebar A4 (186 mm). Kalau lebih lebar, browser mengecilkan seluruh halaman. Jadi nama
     barang dan jenisnya boleh turun baris; tanggal, nomor slip, dan angka tetap satu baris. */
  body.modus-cetak .kertas table { font-size: 8pt; }
  body.modus-cetak .kertas th, body.modus-cetak .kertas td { white-space: normal; padding: 4px 5px; min-width: 0; }
  body.modus-cetak .kertas th, body.modus-cetak .kertas td.utuh, body.modus-cetak .kertas td.kanan { white-space: nowrap; }
  body.modus-cetak .kertas td.lentur { white-space: normal; }
}
