/* gaya.css, lapisan Web fondasi Kwitans.
   Sistem gaya mockup Kwitans baru (Mercury + Linear, artefak
   mockup-kwitans-2): permukaan terang tenang dengan angka sebagai
   hero, sidebar gelap rapat ala Linear, token warna, tipografi,
   radius, dan bayangan yang sama persis dengan mockup. Nama kelas
   dipertahankan dari kerang lama supaya struktur layar dan
   perilaku tidak berubah; yang diganti hanya lapisan tampilan. */

:root {
  --bg: #f6f7f8; --surface: #ffffff; --surface-2: #fbfbfc; --surface-3: #f1f2f4;
  --ink: #101418; --ink-2: #3c4450; --muted: #6b7482; --faint: #98a1ad;
  --line: #e6e8ec; --line-2: #eef0f2;
  --accent: #12715a; --accent-soft: #e7f4ef; --accent-ink: #0c5a47;
  --indigo: #5e6ad2;
  --amber: #b7791f; --amber-soft: #fdf3e0;
  --red: #c2413a; --red-soft: #fdecea;
  --blue: #2563eb; --blue-soft: #e9effd;
  --sidebar: #0e1116; --sidebar-2: #171b21; --sidebar-ink: #e8eaee; --sidebar-muted: #8b93a1;
  --sidebar-line: rgba(255,255,255,.08);
  --shadow: 0 1px 2px rgba(16,20,24,.05), 0 8px 24px -12px rgba(16,20,24,.12);
  --shadow-lg: 0 2px 4px rgba(16,20,24,.06), 0 24px 48px -16px rgba(16,20,24,.18);
  --r-lg: 16px; --r-md: 12px; --r-sm: 8px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10; --surface: #13161b; --surface-2: #171a20; --surface-3: #1d2129;
    --ink: #eceef1; --ink-2: #c3c9d2; --muted: #8b93a1; --faint: #626b78;
    --line: #23272f; --line-2: #1c2027;
    --accent: #3ec79f; --accent-soft: #123128; --accent-ink: #7fe0c3;
    --amber: #e5b45a; --amber-soft: #33270e;
    --red: #f08a84; --red-soft: #3a1a18;
    --blue: #7ea6f8; --blue-soft: #1a2440;
    --sidebar: #08090c; --sidebar-2: #101318;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
kbd {
  font-family: var(--mono); font-size: 10px;
  background: rgba(127,135,150,.18); border: 1px solid rgba(127,135,150,.25);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  min-height: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(94,106,210,.18);
}

/* ---------- Kerang: sidebar gelap Linear (rel + submenu) ---------- */
.kerang { display: flex; min-height: 100vh; }
.rel {
  width: 60px; flex: 0 0 60px;
  background: var(--sidebar);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 4px;
  position: sticky; top: 0; height: 100vh; z-index: 30;
}
.rel .merek {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #1d9e7a, #0c5a47); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.rel button.modul {
  width: 48px; padding: 7px 0 5px; min-height: 36px;
  background: transparent; border: 0; border-radius: 8px;
  color: #c9ced8; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 9.5px; font-weight: 500; line-height: 1.15; text-align: center;
  transition: background .15s, color .15s;
}
.rel button.modul .glif { font-size: 16px; line-height: 1; opacity: .85; }
.rel button.modul:hover { color: #fff; background: rgba(255,255,255,.05); }
.rel button.modul.aktif { color: #fff; background: rgba(255,255,255,.09); }
.rel button.modul.aktif::before {
  content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--indigo);
}

.submenu {
  width: 204px; flex: 0 0 204px;
  background: var(--sidebar); color: var(--sidebar-ink);
  padding: 14px 10px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
  scrollbar-width: thin;
}
.submenu h2 {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sidebar-muted);
  margin: 2px 8px 6px;
}
.submenu a {
  display: flex; align-items: center; min-height: 36px;
  padding: 7px 8px; border-radius: 8px; position: relative;
  color: #c9ced8; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.submenu a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.submenu a.aktif { background: rgba(255,255,255,.09); color: #fff; }
.submenu a.aktif::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--indigo);
}
.cari-samping {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--sidebar-2); border: 1px solid var(--sidebar-line);
  color: var(--sidebar-muted); border-radius: 9px;
  padding: 0 10px; min-height: 36px; margin-bottom: 12px;
  font-size: 12.5px; text-align: left;
}
.cari-samping:hover { border-color: rgba(255,255,255,.18); }
.cari-samping kbd { margin-left: auto; }

/* ---------- Kepala: topbar lengket dengan blur ---------- */
.utama { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kepala {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 10px 28px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.kepala .tab { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.kepala .tumbuh { flex: 1; }
.kepala .perusahaan { font-weight: 600; font-size: 13.5px; }
.kepala .pengguna { color: var(--muted); font-size: 13px; }
main {
  padding: 26px 28px 90px; max-width: 1240px; width: 100%; margin: 0 auto;
}
main > div { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Komponen ---------- */
h1.judul { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 3px; }
.subjudul { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.kartu {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 14px;
  overflow-x: auto;
}
.kartu h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.grid-kartu { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-kartu .kartu { margin-bottom: 0; }
.angka-besar { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.etiket {
  color: var(--muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
}

table.tabel { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tabel th {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
table.tabel td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  text-align: left; vertical-align: middle;
}
table.tabel tr:last-child td { border-bottom: 0; }
table.tabel tbody tr { transition: background .12s; }
table.tabel td.kanan, table.tabel th.kanan {
  text-align: right; font-variant-numeric: tabular-nums;
}
table.tabel td.kanan { font-family: var(--mono); font-size: 12.5px; }
table.tabel tr.klik { cursor: pointer; }
table.tabel tr.klik:hover { background: var(--surface-2); }

.lencana {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.lencana.ok { background: var(--accent-soft); color: var(--accent-ink); }
.lencana.warn { background: var(--amber-soft); color: var(--amber); }
.lencana.danger { background: var(--red-soft); color: var(--red); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,20,24,.04);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { box-shadow: var(--shadow); text-decoration: none; }
.btn.utama { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.utama:hover { transform: translateY(-1px); }
.btn.bahaya { color: var(--red); }
.btn.bahaya:hover { background: var(--red-soft); }
.btn.kecil { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.baris-aksi { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; align-items: center; }

.pesan {
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.pesan.galat { background: var(--red-soft); color: var(--red); }
.pesan.peringatan { background: var(--amber-soft); color: var(--amber); }

.medan { margin-bottom: 12px; }
.medan label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.medan input, .medan select, .medan textarea { width: 100%; }
.grid-medan { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.petunjuk { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

dl.rincian { display: grid; grid-template-columns: 190px 1fr; gap: 6px 16px; margin: 0; }
dl.rincian dt { color: var(--muted); font-size: 13px; }
dl.rincian dd { margin: 0; font-size: 13.5px; word-break: break-word; }

/* ---------- Layar masuk dan atur ulang ---------- */
.pusat { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.kotak-masuk {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 28px;
}
.kotak-masuk .kartu { background: var(--surface-2); box-shadow: none; padding: 16px 18px; }
.kotak-masuk .merek-besar {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, #1d9e7a, #0c5a47); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.kotak-masuk h1.judul { font-size: 24px; }
.memuat { color: var(--muted); padding: 24px 0; }

/* ---------- Palette perintah (pola mockup) ---------- */
.palet-latar {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(10,12,16,.5); backdrop-filter: blur(3px);
}
.palet-latar.terbuka { display: flex; }
.palet {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; overflow: hidden; border: 1px solid var(--line);
}
.palet input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink);
  font-size: 15px; padding: 15px 18px; min-height: 52px; border-radius: 0;
}
.palet input:focus { box-shadow: none; border-color: var(--line); }
.palet-daftar { max-height: 320px; overflow-y: auto; padding: 6px; }
.palet-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; background: transparent; border-radius: 9px;
  color: var(--ink); font-size: 13.5px; text-align: left; min-height: 36px;
}
.palet-item:hover, .palet-item.sel { background: var(--surface-3); }
.palet-item .grup { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.palet-kosong { padding: 16px; color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- Dock HP melayang ---------- */
.dock { display: none; }

/* ---------- Lebar menengah ---------- */
@media (max-width: 1020px) {
  .grid-kartu { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ---------- Layar sempit: tabel menjadi kartu, dock tampil ---------- */
@media (max-width: 760px) {
  .kerang { flex-direction: column; }
  .rel { display: none; }
  .submenu {
    width: 100%; flex: none; height: auto; position: static;
    display: flex; align-items: center; gap: 2px; overflow-x: auto;
    padding: 8px; background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .submenu h2 { display: none; }
  .submenu .cari-samping {
    width: auto; flex: none; margin-bottom: 0; white-space: nowrap;
    background: var(--surface-3); border-color: var(--line); color: var(--muted);
  }
  .submenu .cari-samping kbd { display: none; }
  .submenu a {
    white-space: nowrap; color: var(--ink-2); min-height: 34px; flex: none;
  }
  .submenu a:hover { background: var(--surface-2); color: var(--ink); }
  .submenu a.aktif { background: var(--accent-soft); color: var(--accent-ink); }
  .submenu a.aktif::before { display: none; }
  .kepala { padding: 10px 14px; }
  main { padding: 18px 14px 120px; }
  h1.judul { font-size: 23px; }
  .kartu { padding: 16px; }
  dl.rincian { grid-template-columns: 118px 1fr; }

  table.tabel thead { display: none; }
  table.tabel, table.tabel tbody, table.tabel tr, table.tabel td { display: block; width: 100%; }
  table.tabel tbody tr { padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
  table.tabel tbody tr:last-child { border-bottom: 0; }
  table.tabel td {
    border: 0; padding: 3px 8px;
    display: flex; justify-content: space-between; gap: 14px; align-items: center;
  }
  table.tabel td::before {
    content: attr(data-l); font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--faint); font-weight: 700;
  }
  table.tabel td.kanan { text-align: right; }
  table.tabel td input, table.tabel td select { max-width: 62%; }
  table.tabel td .baris-aksi { margin: 0; }

  .dock {
    display: flex; position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50;
    background: var(--sidebar); border-radius: 18px; padding: 6px;
    box-shadow: var(--shadow-lg); justify-content: space-around;
  }
  .dock button {
    flex: 1; border: 0; background: transparent; color: var(--sidebar-muted);
    font-size: 9.5px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 1px; border-radius: 12px; min-height: 48px;
  }
  .dock button .glif { font-size: 17px; line-height: 1; }
  .dock button.aktif { background: rgba(255,255,255,.1); color: #fff; }
}
