:root {
  --biru: #1D2FC1;
  --biru-gelap: #16239B;
  --emas: #E5C427;
  --teks: #1a1a2e;
  --redup: #6b7280;
  --putih: #ffffff;
  --bg: #f4f6fb;
  --garis: #e2e6f0;
  --salah: #c62828;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--teks);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ---- Bilah atas ---- */
.topbar {
  background: var(--biru);
  color: var(--putih);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--putih); object-fit: contain; }
.topbar-teks { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topbar-teks strong { font-size: 1rem; }
.topbar-teks span { font-size: 0.78rem; color: var(--emas); }
.tombol-keluar {
  background: rgba(255,255,255,0.15);
  color: var(--putih);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

/* ---- Tata letak ---- */
main { padding: 14px; max-width: 620px; margin: 0 auto; }
.kartu {
  background: var(--putih);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(20,30,80,0.08);
}
h1 { font-size: 1.25rem; margin: 0 0 4px; }
h2 { font-size: 1.02rem; margin: 0 0 10px; color: var(--biru-gelap); }
.redup { color: var(--redup); margin: 0 0 12px; }
.kecil { font-size: 0.82rem; }

/* ---- Formulir (min 16px agar iPhone tidak zoom) ---- */
label { display: block; font-size: 0.9rem; font-weight: 600; margin: 12px 0 6px; }
select, input[type="password"], input[type="text"] {
  width: 100%;
  font-size: 16px;
  padding: 12px;
  border: 1.5px solid var(--garis);
  border-radius: 10px;
  background: var(--putih);
  color: var(--teks);
}
select:focus, input:focus { outline: none; border-color: var(--biru); }

.tombol-utama {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--putih);
  background: var(--biru);
  border: 0;
  border-radius: 10px;
}
.tombol-utama:active { background: var(--biru-gelap); }
.tombol-utama[disabled] { opacity: 0.6; }

.pesan-salah {
  color: var(--salah);
  background: #fdecec;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 0.9rem;
}

/* ---- Ringkasan ---- */
.ringkas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ringkas .kotak {
  background: #eef1fc;
  border-left: 4px solid var(--biru);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.ringkas .kotak b { display: block; font-size: 1.15rem; color: var(--biru-gelap); }
.ringkas .kotak.emas { background: #fdf7e0; border-left-color: var(--emas); }
.ringkas .kotak.emas b { color: #8a6d00; }

/* ---- Daftar laporan ---- */
.baris {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--garis);
}
.baris:last-child { border-bottom: 0; }
.baris .kiri { min-width: 0; }
.baris .nama-kerja { font-weight: 600; }
.baris .sub { font-size: 0.8rem; color: var(--redup); }
.baris .jumlah { font-weight: 700; color: var(--biru-gelap); white-space: nowrap; }

.kosong { color: var(--redup); font-style: italic; padding: 8px 0; }

.kaki { text-align: center; color: var(--redup); font-size: 0.78rem; padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); }

@media (prefers-color-scheme: dark) {
  :root { --bg: #10131f; --putih: #1a1f33; --teks: #e8ebf5; --garis: #2a3150; --redup: #96a0bd; }
  .ringkas .kotak { background: #232a45; }
  .ringkas .kotak.emas { background: #33301c; }
  .pesan-salah { background: #3a1f1f; }
}
