:root {
  --navy: #12324a; --navy2: #1d4a6b; --bg: #eef2f5; --kartu: #fff; --teks: #17212b; --pudar: #5d6b78;
  --garis: #d5dde4; --aksen: #f2a900; --hijau: #1f8a4c; --merah: #c0392b; --oranye: #d9730d; --kuning: #b88a00; --biru: #2267b0;
  --r: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--teks); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--biru); }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; background: var(--navy); color: #fff;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px; min-height: 56px; }
.bar .judul { flex: 1; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bar .judul b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .judul small { opacity: .8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .ikon { background: transparent; color: #fff; border: 0; font-size: 26px; width: 44px; height: 44px; padding: 0; }

main { padding: 12px; max-width: 640px; margin: 0 auto; padding-bottom: 40px; }
.kartu { background: var(--kartu); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
h2 { font-size: 18px; margin: 0 0 10px; } h3 { font-size: 16px; margin: 0 0 8px; }
h2 small, h3 small { font-weight: 400; color: var(--pudar); font-size: 13px; }
.sub { margin: 18px 4px 8px; }
label { display: block; font-size: 14px; color: var(--pudar); margin-bottom: 10px; }
label.cek { display: flex; gap: 10px; align-items: center; color: var(--teks); font-size: 15px; }
label.cek input { width: 22px; height: 22px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 18px; padding: 12px; border: 1.5px solid var(--garis);
  border-radius: 10px; background: #fff; color: var(--teks); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--biru); box-shadow: 0 0 0 3px rgba(34,103,176,.15); }
input[type=file] { font-size: 14px; padding: 10px; }
input[type=checkbox] { display: inline; width: auto; margin: 0; }
.baris { display: flex; gap: 8px; align-items: stretch; }
.baris input { flex: 1; margin-top: 4px; }
button { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--garis); background: #fff; color: var(--teks);
  min-height: 48px; cursor: pointer; }
button:active { transform: translateY(1px); }
button.utama { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
button.hijau { background: var(--hijau); border-color: var(--hijau); }
button.bahaya { color: var(--merah); border-color: #e8b4ad; }
.kartu > button, .aksi > button { width: 100%; margin-top: 8px; }
.aksi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.aksi > button { flex: 1 1 140px; }
.ikon.kamera { width: 56px; margin-top: 4px; font-size: 24px; background: var(--navy2); color: #fff; border-color: var(--navy2); }
.catatan { font-size: 13px; color: var(--pudar); line-height: 1.5; }

.daftar { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--kartu); border-radius: 10px; padding: 12px; display: flex; gap: 10px; align-items: center; border-left: 4px solid var(--garis); }
.item .isi { flex: 1; min-width: 0; }
.item .isi b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.item .isi small { color: var(--pudar); font-size: 13px; display: block; overflow-wrap: anywhere; }
.item .angka { font-size: 22px; font-weight: 700; min-width: 48px; text-align: right; }
.item button { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.item.selesai { border-left-color: var(--hijau); }
.item.aktif { border-left-color: var(--aksen); }
.item.batal { opacity: .45; text-decoration: line-through; }
.ringkas .item { padding: 8px 10px; }
.kosong { text-align: center; color: var(--pudar); padding: 18px; font-size: 14px; }
.lencana { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #e5ebf0; color: var(--pudar); font-weight: 600; }
.lencana.hijau { background: #dff2e6; color: var(--hijau); } .lencana.kuning { background: #fff2cc; color: var(--kuning); }

.segmen { display: flex; background: #dfe6ec; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.segmen button { flex: 1; border: 0; background: transparent; min-height: 44px; font-weight: 600; color: var(--pudar); }
.segmen button[aria-selected=true] { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.terakhir { background: var(--navy); color: #fff; border-radius: var(--r); padding: 14px; display: flex; gap: 12px; align-items: center; }
.terakhir .isi { flex: 1; min-width: 0; } .terakhir b { font-size: 17px; display: block; overflow-wrap: anywhere; }
.terakhir small { opacity: .8; } .terakhir .angka { font-size: 40px; font-weight: 800; color: var(--aksen); }
.terakhir.galat { background: var(--merah); } .terakhir.galat .angka { color: #fff; }
.kilat { animation: kilat .35s; } @keyframes kilat { from { transform: scale(1.03); filter: brightness(1.4); } }

.kamera-layar { position: fixed; inset: 0; background: #000; z-index: 20; }
.kamera-layar video { width: 100%; height: 100%; object-fit: cover; }
.bingkai { position: absolute; left: 10%; right: 10%; top: 32%; height: 22%; border: 3px solid var(--aksen); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
.kamera-info { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #fff; font-size: 18px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.kamera-aksi { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 16px; right: 16px; display: flex; gap: 10px; }
.kamera-aksi button { flex: 1; }

dialog { border: 0; border-radius: 16px; padding: 18px; width: min(92vw, 440px); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,20,30,.55); }
dialog h3 { font-size: 18px; } #dlgIsi { font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
#dlgIsi input { margin-top: 8px; }
.prototipe { background: #fff4dc; border: 1.5px dashed #e0a800; color: #5c4300; border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.prototipe b { color: #8a5a00; letter-spacing: .05em; }
.prototipe button { display: block; width: 100%; margin-top: 8px; background: #fff; border-color: #e0a800; font-weight: 600; }
.saran { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 10px; max-height: 50vh; overflow-y: auto; }
.saran button { text-align: left; display: flex; gap: 8px; align-items: center; padding: 10px 12px; min-height: 52px; border-color: #c9d6e2; }
.saran button span { flex: 1; min-width: 0; } .saran button b { display: block; overflow-wrap: anywhere; }
.saran button small { color: var(--pudar); font-size: 13px; }
.saran .kosong { padding: 8px; text-align: left; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #17212b; color: #fff;
  padding: 12px 18px; border-radius: 99px; font-size: 15px; z-index: 30; max-width: 92vw; text-align: center; }
