/* Gaya wadah — tanpa framework CSS (aturan tanpa paket tambahan). Warna, huruf, jarak, dan
   aturan HP mengikuti panduan UI/UX Meddinah (catatan/UI-UX/panduan-ui-ux-meddinah.md):
   navy #1a4789 sebagai warna utama, Poppins, angka tabular, isian ≥16 px & sasaran sentuh
   ≥40 px di HP, tabel dibungkus .gulir. Menu admin meniru Accurate (rel ikon gelap di kiri,
   panel ubin melayang, warna ubin per jenis). Satu berkas untuk admin, mitra, toko, masuk. */
:root {
  --navy: #1a4789; --navy-dd: #0d2950; --gold: #f5b400;
  --bg: #f4f6fa; --line: #e2e8f2; --txt: #1e293b; --mut: #64748b; --ok: #16a34a; --red: #dc2626;
  --garis: var(--line); --tinta: var(--txt); --redup: var(--mut); --aksen: var(--navy);
  --rel: var(--navy-dd); --rel-on: #e5254b;
  --hijau-bg: #e6f4d7; --hijau-tepi: #7cb342; --hijau: #2e6b1f;
  --biru-bg: #d9ecfb; --biru-tepi: #64a6e8; --biru: #1b4f8a;
  --oranye-bg: #fde3d0; --oranye-tepi: #f3a06a; --oranye: #9a4a12;
  --ungu-bg: #ecdcf7; --ungu-tepi: #b07fd9; --ungu: #5a2d86;
  --abu-bg: #eceff1; --abu-tepi: #b0bec5; --abu: #37474f;
  --radius: 10px; --bayang: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.6 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--txt); background: var(--bg); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; }
main h1 { font-size: 1.3rem; font-weight: 600; margin: 0 0 1rem; }
main h2 { font-size: 1rem; font-weight: 600; margin: 1.4rem 0 .6rem; color: var(--txt); }
.jejak { font-size: .78rem; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .15rem; }

/* Bilah atas (navy, ikut panduan §7): nama toko kiri, identitas + Keluar kanan */
.bilah { display: flex; align-items: center; gap: .8rem; padding: 0 1rem; min-height: 56px; background: linear-gradient(90deg, var(--navy), var(--navy-dd)); color: #fff; }
.bilah > strong { font-weight: 600; font-size: 1.02rem; margin-right: auto; display: inline-flex; align-items: center; gap: .55rem; }
.bilah > strong::before { content: ""; width: 26px; height: 26px; border-radius: 7px; background: var(--gold); flex: none; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1-5h16l1 5'/%3E%3Cpath d='M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0'/%3E%3Cpath d='M5 12v9h14v-9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E") center/20px no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l1-5h16l1 5'/%3E%3Cpath d='M3 9a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0'/%3E%3Cpath d='M5 12v9h14v-9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E") center/20px no-repeat; }
.bilah a { color: #fff; }
.bilah a:hover { text-decoration: none; opacity: .9; }
.bilah form { display: inline-flex; gap: .7rem; align-items: center; margin: 0; }
.bilah form span { font-size: .85rem; opacity: .92; }
.bilah button { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.bilah button:hover { background: rgba(255,255,255,.22); }
.rangka { display: grid; grid-template-columns: 64px 1fr; min-height: calc(100vh - 56px); }

/* Rel ikon (Accurate) */
.rel { position: relative; background: var(--rel); padding: .5rem 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.rel-ikon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; opacity: .85; }
.rel-ikon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rel-ikon:hover, .rel-ikon.buka { background: rgba(255,255,255,.14); opacity: 1; }
.rel-ikon.on { background: var(--rel-on); opacity: 1; }

/* Panel ubin melayang */
.panel { position: absolute; left: 64px; z-index: 50; width: 660px; max-width: calc(100vw - 80px); background: #fff; border-radius: 0 12px 12px 0; box-shadow: 0 12px 36px rgba(13,41,80,.28); padding: 1rem 1.1rem 1.2rem; }
.panel-judul { font-size: 1.2rem; font-weight: 600; color: var(--txt); padding-bottom: .5rem; border-bottom: 2px solid var(--rel-on); margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
.panel-tutup { display: none; border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; min-height: 40px; min-width: 40px; }
.ubin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.ubin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; min-height: 112px; padding: .8rem .5rem; border: 1.5px solid var(--abu-tepi); border-radius: 10px; background: var(--abu-bg); color: var(--abu); text-align: center; line-height: 1.25; font-size: .86rem; font-weight: 500; transition: transform .12s, box-shadow .12s; }
.ubin:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,41,80,.12); }
.ubin.on { outline: 2px solid var(--rel-on); }
.ubin-ikon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,.75); font-weight: 700; font-size: .9rem; }
.ubin-ikon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ubin.jenis-transaksi { background: var(--hijau-bg); border-color: var(--hijau-tepi); color: var(--hijau); }
.ubin.jenis-master { background: var(--biru-bg); border-color: var(--biru-tepi); color: var(--biru); }
.ubin.jenis-anggaran { background: var(--oranye-bg); border-color: var(--oranye-tepi); color: var(--oranye); }
.ubin.jenis-laporan { background: var(--ungu-bg); border-color: var(--ungu-tepi); color: var(--ungu); }

/* Isi halaman */
main { padding: 1.2rem 1.6rem 2rem; min-width: 0; }
.borang { display: grid; gap: .75rem; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--bayang); }
.borang label { display: grid; gap: .3rem; font-size: .8rem; color: var(--mut); font-weight: 500; }
.borang label.baris { display: flex; align-items: center; gap: .5rem; color: var(--txt); font-weight: 400; font-size: .9rem; }
.borang h2 { margin: .4rem 0 0; font-size: .95rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.borang p { margin: .2rem 0; }
input, select, textarea { padding: .5rem .65rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; color: var(--txt); background: #fff; min-height: 38px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid rgba(26,71,137,.35); outline-offset: 1px; border-color: var(--navy); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 17px; height: 17px; accent-color: var(--navy); }
.aksi-atas { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 0 0 .9rem; }
.aksi-atas label { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--mut); }
.aksi-atas form { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.aksi-atas a { min-height: 0; }
.pesan { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: .6rem .9rem; border-radius: 8px; margin: 0 0 1rem; }
.galat { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: .6rem .9rem; border-radius: 8px; margin: 0 0 1rem; }
button, .tombol { cursor: pointer; padding: .45rem .95rem; min-height: 38px; border: 1px solid #cbd5e1; background: #fff; color: var(--txt); border-radius: 8px; font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; transition: background .12s, box-shadow .12s; }
button:hover { background: #f8fafc; }
button.utama, .tombol.utama { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 1px 2px rgba(26,71,137,.3); }
button.utama:hover { background: #163c74; }
button.emas { background: var(--gold); border-color: var(--gold); color: #1e293b; }
button.merah { background: var(--red); border-color: var(--red); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
a > button { vertical-align: middle; }

/* Formulir tidak boleh melebar melewati layar: anak grid/flex boleh mengecil, isian ikut lebar wadah */
.borang > *, .aksi-atas > *, .aksi-atas label { min-width: 0; }
.borang input, .borang select, .borang textarea { width: 100%; max-width: 100%; }
.borang input[type=checkbox], .borang input[type=radio], .aksi-atas input[type=checkbox] { width: 17px; flex: none; }
label.baris { justify-content: flex-start; }
.aksi-atas label { flex: 1 1 auto; }
.aksi-atas label > input, .aksi-atas label > select { min-width: 0; max-width: 100%; }
.borang .aksi-atas { margin-bottom: 0; align-items: end; }
.borang .aksi-atas label { display: grid; font-size: .8rem; }   /* di formulir, label tetap di atas isian */
.borang .aksi-atas label.baris { display: flex; align-items: center; }

/* Daftar Laporan: nav kategori kiri, kartu laporan kanan */
.laporan-rangka { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; align-items: start; }
.laporan-nav { position: sticky; top: 1rem; }
.laporan-nav a { display: block; padding: .35rem .5rem; border-radius: 6px; }
.laporan-kartu { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin-bottom: 1rem; }

/* Tabel: kartu putih, kepala abu, angka tabular; dibungkus .gulir oleh menu.js supaya bisa digeser di HP */
.gulir { overflow: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--bayang); margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; background: #fff; font-variant-numeric: tabular-nums; }
.gulir table { min-width: max-content; width: 100%; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .74rem; font-weight: 600; color: var(--mut); text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfe; }
tfoot th, tbody th { font-weight: 600; background: #f8fafc; }
td.angka, th.angka { text-align: right; white-space: nowrap; }
.pil { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.5; background: #e2e8f0; color: #334155; white-space: nowrap; }
.pil.hijau { background: #dcfce7; color: #166534; }
.pil.merah { background: #fee2e2; color: #991b1b; }
.pil.kuning { background: #fef3c7; color: #92400e; }
.pil.biru { background: #dbeafe; color: #1e40af; }

/* Kartu ringkasan (beranda, mitra) */
.kartu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin: 0 0 1.2rem; }
.k { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .95rem; box-shadow: var(--bayang); color: inherit; display: block; }
.k:hover { text-decoration: none; border-color: #c7d2e6; }
.k .label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); font-weight: 600; }
.k .angka { display: block; font-size: 1.45rem; font-weight: 600; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.k .sub { display: block; font-size: .78rem; color: var(--mut); }
.k.sorot { background: var(--navy); border-color: var(--navy); color: #fff; }
.k.sorot .label, .k.sorot .sub { color: rgba(255,255,255,.8); }
.k.awas .angka { color: var(--red); }
.pintasan { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; }
.pintasan a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; min-height: 40px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; font-size: .88rem; box-shadow: var(--bayang); }
.pintasan a:hover { text-decoration: none; border-color: var(--navy); }
.pintasan a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kosong { text-align: center; padding: 2rem 1rem; color: var(--mut); }

/* Masuk */
body.masuk { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dd) 100%); }
.kotak-masuk { width: min(360px, calc(100vw - 2rem)); background: #fff; padding: 1.6rem 1.5rem 1.3rem; border-radius: 14px; display: grid; gap: .85rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.kotak-masuk h1 { margin: 0 0 .3rem; font-size: 1.25rem; font-weight: 600; text-align: center; }
.kotak-masuk label { display: grid; gap: .3rem; font-size: .8rem; color: var(--mut); font-weight: 500; }
.kotak-masuk button { background: var(--navy); color: #fff; border-color: var(--navy); min-height: 42px; }
.kotak-masuk p { margin: 0; text-align: center; font-size: .85rem; }
.toko { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }

@media print { .bilah, .rel, .aksi-atas, .pintasan { display: none !important; } .rangka { display: block; } main { padding: 0; } .gulir { border: 0; box-shadow: none; } }

@media (max-width: 820px) {
  input, select, textarea { font-size: 16px; }   /* iOS tidak men-zoom */
  button, .tombol { min-height: 40px; }
  main { padding: 1rem .9rem 2rem; }
  .rangka { grid-template-columns: 56px 1fr; }
  .rel-ikon { width: 44px; height: 44px; }
  .panel { position: fixed; inset: 0; left: 0; width: auto; max-width: none; border-radius: 0; overflow-y: auto; top: 0 !important; }
  .panel-tutup { display: inline-flex; }
  .ubin-grid { grid-template-columns: repeat(2, 1fr); }
  .borang { padding: .9rem .9rem; }
  .aksi-atas > form > label, .borang .aksi-atas > label { flex: 1 1 100%; }
  .borang { max-width: 100% !important; }   /* menimpa style="max-width" di tampilan lebar */
  .kartu-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .k .angka { font-size: 1.2rem; }
  .laporan-rangka { grid-template-columns: 1fr; }
  .laporan-nav { position: static; display: flex; gap: .3rem; overflow-x: auto; }
  .laporan-nav a { white-space: nowrap; border: 1px solid var(--line); background: #fff; }
  main table { font-size: .85rem; }
}
@media (max-width: 700px) {
  .bilah { flex-wrap: wrap; padding: .5rem .8rem; }
  .bilah > strong { flex: 1 1 100%; }
  .bilah form { margin-left: auto; }
}
