/* Layanan DTSEN — gaya bersama halaman warga dan dashboard petugas */
:root {
  --bg: #F5F6F2; --surface: #FFFFFF; --ink: #16231C; --ink-2: #3D4A42; --muted: #56635B;
  --line: #DDE2DA; --line-2: #B9C3BC; --soft: #ECEFEA;
  --primary: #0E6B4F; --primary-dark: #0A5540; --primary-tint: #E3F1EB; --primary-ink: #1F3B2E;
  --warn-bg: #FFF3D6; --warn-line: #E8C26A; --warn-ink: #5C3B00;
  --danger: #A3261B; --danger-bg: #F8E4E1; --danger-ink: #8A2117;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: var(--primary); } a:hover { color: var(--primary-dark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ikon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-utama { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-utama:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-garis { border: 2px solid var(--primary); color: var(--primary); }
.btn-garis:hover { color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-teks { border-color: transparent; background: transparent; color: var(--primary); }
.btn-bahaya { border-color: var(--danger); color: var(--danger); }
.btn-bahaya:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-besar { min-height: 60px; font-size: 19px; border-radius: 14px; width: 100%; }
.btn-kecil { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn input[type=file] { display: none; }

/* ---------- Pesan ---------- */
.flash { padding: 12px 16px; border-radius: 12px; background: var(--primary-tint); color: var(--primary-ink); font-size: 15px; }
.flash.error, .kotak-error { background: var(--danger-bg); color: var(--danger-ink); }
.kotak-error { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.kotak-warn { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--warn-bg);
  border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 15px; }
.kotak-info { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--primary-tint); color: var(--primary-ink); font-size: 15px; }

/* ---------- Lencana status ---------- */
.lencana { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.st-menunggu { background: #EEF1EC; color: var(--ink-2); }
.st-sebagian { background: #E3ECF8; color: #1E4C8A; }
.st-lengkap { background: var(--primary-tint); color: var(--primary-dark); }
.st-ulang { background: var(--warn-bg); color: var(--warn-ink); }
.st-diinput { background: #ECE8F6; color: #4A3A8A; }
.st-kedaluwarsa, .st-dihapus { background: var(--danger-bg); color: var(--danger-ink); }

/* ================= HALAMAN WARGA ================= */
.warga { max-width: 480px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }
.warga-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.warga-head .judul { display: flex; flex-direction: column; }
.warga-head .judul b { font-size: 16px; }
.warga-head .judul span { font-size: 13px; color: var(--muted); }
.warga-main { flex: 1; padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; }
.warga-main h1 { font-size: 27px; font-weight: 800; }
.warga-main .lead { font-size: 17px; color: var(--ink-2); }
.warga-foot { padding: 14px 20px 18px; background: var(--surface); border-top: 1px solid var(--line); text-align: center;
  font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.warga-foot strong { color: var(--ink); }
.dorong { flex: 1; }
.label { font-size: 16px; font-weight: 700; }
.bantu { font-size: 14px; color: var(--muted); }
.input-kode { height: 72px; width: 100%; border: 2px solid var(--primary); border-radius: 14px; background: var(--surface);
  text-align: center; font: 800 34px var(--font); letter-spacing: 6px; text-transform: uppercase; color: var(--ink); }
.input-besar { height: 60px; width: 100%; border: 2px solid var(--line-2); border-radius: 14px; background: var(--surface);
  padding: 0 16px; font: 700 22px var(--font); letter-spacing: 1px; color: var(--ink); }
.input-kode:focus, .input-besar:focus { outline: 3px solid #9FD3BE; outline-offset: 1px; }
.kartu { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kartu-qr { display: flex; gap: 14px; align-items: flex-start; }
.mini-struk { width: 56px; height: 72px; flex: none; border: 2px dashed #9AA79F; border-radius: 6px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.mini-struk i { width: 28px; height: 28px; background: var(--ink); border-radius: 3px; }
.mini-struk u { width: 34px; height: 5px; background: #9AA79F; border-radius: 2px; }

/* Langkah */
.langkah-head { position: sticky; top: 0; z-index: 2; padding: 10px 20px 14px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.langkah-head .baris { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.langkah-head .kembali { width: 44px; height: 44px; margin-left: -10px; border: 0; background: none; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.progres { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.progres i { height: 6px; border-radius: 3px; background: var(--line); }
.progres i.on { background: var(--primary); }
.nama-kk { font-size: 15px; color: var(--muted); }
.bagian-pilih, .bagian-pratinjau { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.bagian-pilih h1 { margin: 2px 0 6px; }
.contoh { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contoh figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.contoh .gbr { height: 128px; border-radius: 12px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.contoh .benar .gbr { background: #D8E6DD; border: 3px solid var(--primary); color: var(--primary-ink); }
.contoh .salah .gbr { background: #4A4F4C; border: 3px solid var(--danger); color: #9AA39E; align-items: flex-start; justify-content: flex-start; }
.contoh .gbr svg { width: 110px; height: 92px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.contoh .salah .gbr svg { width: 170px; height: 142px; margin: 26px 0 0 34px; }
.contoh figcaption { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.contoh .benar figcaption { color: var(--primary); }
.contoh .salah figcaption { color: var(--danger); }
.tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.tips li { display: flex; gap: 10px; }
.tips li::before { content: "•"; color: var(--primary); font-weight: 800; }
.privasi { display: flex; gap: 8px; font-size: 14px; color: var(--ink-2); }
.privasi svg { color: var(--primary); width: 18px; height: 18px; margin-top: 2px; }
.tombol-pilih { display: flex; flex-direction: column; gap: 12px; }
.pratinjau-gbr { height: 300px; border-radius: 14px; background: #6E7A72; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pratinjau-gbr img { width: 100%; height: 100%; object-fit: contain; background: #2B312D; }
.pratinjau-pdf { flex-direction: column; gap: 8px; background: var(--soft); color: var(--ink-2); font-weight: 700; }
.pratinjau-pdf svg { width: 64px; height: 64px; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.daya { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.daya label, .daya-lain label { display: block; }
.daya input, .daya-lain input { position: absolute; opacity: 0; pointer-events: none; }
.daya span, .daya-lain span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px;
  border: 2px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 17px; cursor: pointer; text-align: center; }
.daya-lain span { font-size: 15px; }
.daya input:checked + span, .daya-lain input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.daya input:focus-visible + span, .daya-lain input:focus-visible + span { outline: 3px solid #9FD3BE; }
.tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #E9ECE6; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.centang-besar { width: 84px; height: 84px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; align-self: center; }
.centang-besar svg { width: 46px; height: 46px; stroke-width: 2.6; }
.tengah { text-align: center; }
.daftar-cek { padding: 4px 16px; }
.daftar-cek > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.daftar-cek > div:last-child { border-bottom: 0; }
.ok { color: var(--primary); font-weight: 700; font-size: 14px; }
.belum { color: var(--muted); font-weight: 700; font-size: 14px; }
.perlu { color: var(--warn-ink); font-weight: 700; font-size: 14px; }
.kartu-ulang { border: 2px solid var(--warn-line); }

/* ================= DASHBOARD ================= */
.dash { min-height: 100vh; display: flex; flex-wrap: wrap; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--ink); color: #E6ECE8; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .merek { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.sidebar .merek .logo { width: 36px; height: 36px; border-radius: 10px; }
.sidebar .merek b { color: #fff; font-size: 15px; display: block; }
.sidebar .merek span { color: #A9B6AE; font-size: 12px; }
.sidebar a { display: flex; justify-content: space-between; padding: 11px 12px; border-radius: 10px; color: #C9D3CC; font-size: 15px; text-decoration: none; }
.sidebar a:hover { background: #1F3027; color: #fff; }
.sidebar a.aktif { background: #24362C; color: #fff; font-weight: 700; }
.sidebar .grup { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #8D9A92; }
.sidebar .akun { margin-top: auto; padding: 12px; border-top: 1px solid #2E4237; font-size: 13px; color: #A9B6AE; display: flex; flex-direction: column; gap: 8px; }
.sidebar .akun strong { color: #fff; }
.sidebar .akun button { align-self: flex-start; background: none; border: 1px solid #3C5246; color: #C9D3CC; border-radius: 8px; padding: 6px 10px; font: 600 13px var(--font); cursor: pointer; }
.konten { flex: 999 1 560px; min-width: 0; padding: 26px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.kepala { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.kepala h1 { font-size: 26px; font-weight: 800; }
.kepala p { color: var(--muted); font-size: 15px; margin-top: 2px; }
.ringkas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.ringkas a { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ringkas a span { font-size: 14px; color: var(--muted); }
.ringkas a b { display: block; margin-top: 4px; font-size: 30px; }
.ringkas a.hijau { background: var(--primary-tint); border-color: #B8D9C9; }
.ringkas a.kuning { background: var(--warn-bg); border-color: var(--warn-line); }
.cari { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cari input { flex: 1 1 300px; height: 48px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 14px; font: 15px var(--font); background: var(--surface); }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.chip.aktif { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tabel-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table.tabel { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.tabel th { text-align: left; padding: 12px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabel td { padding: 12px 14px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.tabel tr:last-child td { border-bottom: 0; }
.tabel .kode { font-weight: 800; letter-spacing: .5px; }
.tabel .angka { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.merah { color: var(--danger-ink); font-weight: 700; }
.kosong { padding: 32px; text-align: center; color: var(--muted); }
.catatan-kecil { font-size: 13px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field label small { font-weight: 500; color: var(--muted); font-size: 14px; }
.field input, .field select, .field textarea { min-height: 46px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 12px;
  font: 16px var(--font); color: var(--ink); background: var(--surface); }
.field .err { color: var(--danger); font-size: 13px; font-weight: 600; }
.field.salah input { border-color: var(--danger); }
.wajib { color: var(--danger); }
.dua-kolom { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.dua-kolom > .utama { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dua-kolom > .samping { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.panel-hijau { border: 2px solid var(--primary); }
.hasil { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.hasil img.qr { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.kode-besar { font-size: 38px; font-weight: 800; letter-spacing: 3px; }
.kecil-abu { font-size: 13px; color: var(--muted); }
.grid-tombol { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.info-baris { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.info-baris span:first-child { color: var(--muted); }
.info-baris span:last-child { text-align: right; }
.grid-file { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.kartu-file { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.kartu-file.ulang { border: 2px solid var(--warn-line); }
.kartu-file .gbr { height: 210px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: none; }
.kartu-file .gbr img { width: 100%; height: 100%; object-fit: cover; }
.kartu-file .isi { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.kartu-file h3 { font-size: 15px; color: var(--ink); }
.kartu-file .aksi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kartu-file details summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 13px; padding: 6px 0; }
.kartu-file details form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kartu-file select { min-height: 36px; border: 1.5px solid var(--line-2); border-radius: 8px; font: 13px var(--font); padding: 0 8px; flex: 1; }
.riwayat { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.riwayat li { display: flex; justify-content: space-between; gap: 10px; }
.riwayat time { color: var(--muted); white-space: nowrap; }
.panel-bahaya { border-color: #E7C3BE; }
.panel-bahaya h2 { color: var(--danger-ink); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 400px; }
.inline { display: inline; }
.baris-aksi { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .konten { padding: 20px 16px 40px; } }

/* ================= STRUK 80 mm ================= */
.struk-layar { background: #E9ECE6; min-height: 100vh; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.struk { width: 80mm; background: #fff; color: #000; padding: 5mm 4mm; display: flex; flex-direction: column; align-items: center; gap: 2.5mm; text-align: center; font-family: var(--font); }
.struk .kantor { font-size: 14px; font-weight: 800; }
.struk .sub { font-size: 11px; }
.struk hr { width: 100%; border: 0; border-top: 1.5px dashed #000; margin: 0; }
.struk img { width: 46mm; height: 46mm; }
.struk .kode { font-size: 26px; font-weight: 800; letter-spacing: 3px; border: 2px solid #000; border-radius: 8px; padding: 0 12px; }
.struk ol { margin: 0; padding: 0; list-style: none; width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.35; }
.struk ol li { display: flex; gap: 8px; }
.struk ol b { width: 18px; height: 18px; flex: none; border-radius: 50%; background: #000; color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.struk .t12 { font-size: 12px; } .struk .t11 { font-size: 11px; line-height: 1.45; }
.struk .cap { width: 100%; height: 18mm; border: 1.5px dashed #000; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-size: 10px; }
@page { size: 80mm auto; margin: 0; }
@media print {
  .struk-layar { background: #fff; padding: 0; }
  .tidak-dicetak { display: none !important; }
}
