﻿@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/PlusJakartaSans.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --biru: #1E5AA8;
  --biru-gelap: #00214D;
  --biru-muda: #D9E6FF;
  --kuning: #F2B705;
  --kuning-muda: #FFE7A3;
  --hijau: #2E9E44;
  --merah: #D93A2B;
  --teks: #1A1B20;
  --kelabu: #5C5F68;
  --garis: #E1E3EB;
  --latar: #F7F8FC;
  --kad: #FFFFFF;
  --bayang: 0 4px 14px rgba(20, 40, 90, 0.07);
  --atas: env(safe-area-inset-top, 0px);
  --bawah: env(safe-area-inset-bottom, 0px);
  --nav: calc(64px + var(--bawah));
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--latar); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--teks);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100%; position: relative; background: var(--latar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
a { color: var(--biru); }

.memuat { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--kelabu); font-weight: 600; }
.memuat img { border-radius: 18px; }

/* ---------- common ---------- */
.skrin { padding-bottom: calc(var(--nav) + 24px); }
.bar-atas { display: flex; align-items: center; gap: 8px; padding: calc(var(--atas) + 10px) 12px 8px; background: var(--latar); position: sticky; top: 0; z-index: 20; }
.bar-atas h1 { font-size: 19px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -0.2px; }
.bar-atas small { display: block; font-size: 12px; color: var(--kelabu); font-weight: 600; }
.ikon-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ikon-btn:active { background: rgba(0,0,0,0.06); }
.ikon-btn svg, .btn svg { width: 22px; height: 22px; }
.bulat-putih { background: rgba(255,255,255,0.94); box-shadow: 0 2px 8px rgba(0,0,0,0.18); }

.btn { height: 52px; border-radius: 26px; border: none; padding: 0 20px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:disabled { opacity: 0.5; }
.btn-utama { background: var(--biru); color: #fff; }
.btn-kuning { background: var(--kuning-muda); color: #3A2A00; }
.btn-garis { background: #fff; border: 1.5px solid #C4C6D0; color: var(--teks); }
.btn-hijau { background: #25A244; color: #fff; }
.btn-penuh { width: 100%; }
.btn-kecil { height: 38px; border-radius: 19px; font-size: 13px; padding: 0 14px; }

.kad { background: var(--kad); border-radius: 20px; padding: 14px; box-shadow: var(--bayang); }
.seksyen { margin: 12px 16px 0; }
.tajuk-seksyen { font-weight: 800; font-size: 16px; margin: 18px 0 10px; }
/* Statistik */
.tab-tempoh { display: flex; gap: 4px; background: #E9ECF4; border-radius: 16px; padding: 4px; margin-top: 14px; }
.tab-tempoh button { flex: 1; height: 38px; border: none; border-radius: 12px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: #5C5F68; }
.tab-tempoh button.hidup { background: #fff; color: #1A1B20; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.grid-angka { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kotak-angka { border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; }
.kotak-angka span { font-size: 12px; font-weight: 700; }
.kotak-angka b { font-size: 28px; font-weight: 800; line-height: 1.2; }
.kotak-angka small { font-size: 12px; font-weight: 600; opacity: 0.8; min-height: 15px; }
.tajuk-kad { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.bar-stat { margin: 8px 0; }
.bar-stat .atas { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.bar-stat .atas span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-stat .trek { height: 8px; border-radius: 4px; background: #EEF1F7; overflow: hidden; }
.bar-stat .trek span { display: block; height: 100%; border-radius: 4px; }
.kelabu { color: var(--kelabu); }
.kecil { font-size: 12px; }
.tebal { font-weight: 700; }
.ralat { color: #B3261E; font-weight: 600; font-size: 14px; }
.berjaya { color: #1B5E20; font-weight: 600; font-size: 14px; }

.cip-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 10px; white-space: nowrap; }
.cip { display: inline-block; background: #fff; border: 1px solid var(--garis); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 10px; }
.titik { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.medan { display: flex; flex-direction: column; gap: 6px; }
.medan label { font-size: 13px; font-weight: 700; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid #C4C6D0; border-radius: 14px; padding: 12px 14px; background: #fff; font-size: 16px; outline: none; }
.input:focus { border-color: var(--biru); }
textarea.input { min-height: 110px; resize: vertical; }

.segmen { display: flex; gap: 4px; background: #E9ECF4; border-radius: 16px; padding: 4px; }
.segmen button { flex: 1; height: 42px; border: none; border-radius: 12px; background: transparent; font-weight: 700; font-size: 14px; color: var(--kelabu); }
.segmen button.hidup { background: #fff; color: var(--teks); box-shadow: 0 2px 6px rgba(20,40,90,0.12); }

/* ---------- bottom navigation ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav); padding-bottom: var(--bawah); background: #fff; box-shadow: 0 -4px 20px rgba(20,40,90,0.06); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 30; max-width: 560px; margin: 0 auto; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: #44474F; font-size: 12px; font-weight: 600; }
.nav a span.ik { width: 56px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.nav a span.ik svg { width: 22px; height: 22px; }
.nav a.hidup { color: var(--teks); font-weight: 800; }
.nav a.hidup span.ik { background: var(--biru-muda); color: var(--biru-gelap); }

/* ---------- login / waiting ---------- */
.masuk { min-height: 100vh; background: var(--biru); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; text-align: center; gap: 18px; }
.masuk img { height: 150px; width: auto; }
.masuk h1 { margin: 0; font-size: 28px; font-weight: 800; }
.masuk p { margin: 0; opacity: 0.9; }
.masuk .btn { background: #fff; color: var(--teks); width: 100%; max-width: 340px; }
.masuk .ralat { color: #FFDAD6; }

/* ---------- home ---------- */
.kepala { background: var(--biru); color: #fff; border-radius: 0 0 36px 36px; padding: calc(var(--atas) + 14px) 20px 74px; }
.kepala .baris { display: flex; align-items: center; gap: 14px; }
.kepala .logo { height: 76px; width: auto; }
.kepala .salam { font-size: 13px; opacity: 0.85; }
.kepala .nama { font-size: 19px; font-weight: 800; }
.lencana { font-size: 11px; font-weight: 800; padding: 6px 12px; border-radius: 12px; background: var(--kuning); color: #2B1E00; }
.cari { margin-top: 18px; height: 48px; border-radius: 24px; background: rgba(255,255,255,0.16); display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.cari input { flex: 1; border: none; background: transparent; outline: none; color: #fff; font-size: 15px; }
.cari input::placeholder { color: rgba(255,255,255,0.75); }
.ringkasan { margin: -56px 16px 0; position: relative; }
.ringkasan .atas { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.ringkasan .jalur { display: flex; gap: 4px; height: 8px; margin: 14px 0; }
.ringkasan .jalur span { border-radius: 4px; }
.ringkasan .angka { display: grid; grid-template-columns: repeat(3, 1fr); }
.ringkasan .angka b { font-size: 26px; font-weight: 800; display: block; }
.ringkasan .angka span { font-size: 13px; color: var(--kelabu); display: flex; align-items: center; gap: 6px; }
.cips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 16px 4px; scrollbar-width: none; }
.cips::-webkit-scrollbar { display: none; }
.cips button { flex-shrink: 0; height: 36px; border-radius: 18px; border: 1.5px solid #C4C6D0; background: #fff; padding: 0 16px; font-weight: 600; font-size: 14px; }
.cips button.hidup { background: var(--biru-muda); border-color: var(--biru-muda); color: var(--biru-gelap); font-weight: 800; }
.senarai { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
.kad-aduan { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 20px; padding: 12px; box-shadow: var(--bayang); text-decoration: none; color: inherit; }
.kad-aduan .gbr { width: 82px; height: 82px; border-radius: 16px; object-fit: cover; background: #E6E8EF; flex-shrink: 0; }
.kad-aduan .isi { flex: 1; min-width: 0; }
.kad-aduan .tj { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kad-aduan .tm { font-size: 13px; color: var(--kelabu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 3px 0 7px; }
.kad-aduan .bwh { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kad-aduan .no { font-size: 12px; color: var(--kelabu); font-weight: 600; }
.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(var(--nav) + 16px); height: 56px; border-radius: 28px; border: none; background: var(--kuning); color: #2B1E00; font-weight: 800; font-size: 15px; padding: 0 22px; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.22); z-index: 25; text-decoration: none; }
.fab svg { width: 22px; height: 22px; }
.tip { margin: 12px 16px 0; background: #FFF6D6; border: 1px solid #F2D27A; border-radius: 16px; padding: 12px 14px; font-size: 13px; }

/* ---------- detail ---------- */
.hero { position: relative; height: 330px; background: #1A1B20; }
.hero .slaid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.hero .slaid::-webkit-scrollbar { display: none; }
.hero .slaid > div { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.hero .slaid img, .hero .slaid video { width: 100%; height: 100%; object-fit: cover; }
.hero .main { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.hero .main svg { width: 60px; height: 60px; color: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.hero .atas { position: absolute; top: calc(var(--atas) + 10px); left: 16px; right: 16px; display: flex; gap: 8px; }
.hero .kiraan { position: absolute; right: 16px; bottom: 44px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 12px; }
.helaian { margin-top: -28px; position: relative; background: var(--latar); border-radius: 28px 28px 0 0; padding: 20px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.helaian h2 { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 0; letter-spacing: -0.3px; }
.baris-cip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: #E5DEFF; color: #3A2A99; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bulat-btn { width: 46px; height: 46px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.bulat-btn svg { width: 22px; height: 22px; }
.info { display: grid; grid-template-columns: 34% 1fr; gap: 6px 8px; font-size: 14px; }
.info dt { color: var(--kelabu); font-size: 13px; }
.info dd { margin: 0; font-weight: 500; }
.info dd.tebal { font-weight: 700; }
.garis-masa { display: flex; flex-direction: column; }
.langkah { display: flex; gap: 12px; }
.langkah .kiri { display: flex; flex-direction: column; align-items: center; width: 26px; flex-shrink: 0; }
.langkah .bulatan { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.langkah .bulatan svg { width: 15px; height: 15px; color: #fff; }
.langkah .siap { background: var(--hijau); }
.langkah .tunggu { background: #FFDDB3; border: 3px solid #F2A51A; }
.langkah .tiang { width: 3px; flex: 1; border-radius: 2px; min-height: 16px; }
.langkah .kanan { padding-bottom: 16px; }
.langkah .kanan b { display: block; font-size: 14px; }
.bar-bawah { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: #fff; box-shadow: 0 -4px 20px rgba(20,40,90,0.08); padding: 12px 16px calc(12px + var(--bawah)); display: flex; gap: 10px; z-index: 30; }
.bar-bawah .btn { flex: 1; min-width: 0; }
.galeri-kecil { display: flex; gap: 8px; overflow-x: auto; }
.galeri-kecil > div { width: 112px; height: 150px; border-radius: 16px; overflow: hidden; flex-shrink: 0; background: #1A1B20; position: relative; }
.galeri-kecil img, .galeri-kecil video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- full-screen viewer and sheets ---------- */
.pemapar { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; align-items: center; justify-content: center; }
.pemapar img, .pemapar video { max-width: 100%; max-height: 100%; }
.pemapar .tutup { position: absolute; top: calc(var(--atas) + 10px); right: 12px; }
/* Photo arrows (detail hero and full-screen viewer). The "kembali" arrow is mirrored for "next". */
.anak-panah { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; opacity: 0.92; }
.anak-panah.kiri { left: 12px; }
.anak-panah.kanan { right: 12px; }
.anak-panah.kanan svg { transform: scaleX(-1); }
.anak-panah:disabled { opacity: 0.25; }
.titik-slaid { position: absolute; bottom: 46px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.titik-slaid span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.titik-slaid span.hidup { background: #fff; width: 18px; border-radius: 4px; }
.kiraan-pemapar { position: absolute; bottom: calc(var(--bawah) + 20px); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 13px; background: rgba(255,255,255,0.15); padding: 5px 12px; border-radius: 12px; }
.lapik { position: fixed; inset: 0; background: rgba(10,15,30,0.45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.lembar { background: #fff; width: 100%; max-width: 560px; border-radius: 28px 28px 0 0; padding: 12px 20px calc(24px + var(--bawah)); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.lembar .pemegang { width: 36px; height: 4px; border-radius: 2px; background: #C4C6D0; margin: 0 auto 4px; }
.lembar h3 { margin: 0; font-size: 18px; font-weight: 800; }

/* ---------- borang ---------- */
.langkah-bar { display: flex; gap: 6px; padding: 0 20px; }
.langkah-bar span { flex: 1; height: 6px; border-radius: 3px; background: #E6E8EF; }
.langkah-bar span.hidup { background: var(--biru); }
.borang { padding: 12px 16px calc(110px + var(--bawah)); display: flex; flex-direction: column; gap: 14px; }
.grid-kat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-kat button { min-height: 74px; border-radius: 16px; border: 1.5px solid var(--garis); background: #fff; padding: 10px 6px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.2; }
.grid-kat button.hidup { border: 2.5px solid var(--biru); background: var(--biru-muda); }
.grid-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-media > div { aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; position: relative; background: #1A1B20; }
.grid-media img, .grid-media video { width: 100%; height: 100%; object-fit: cover; }
.grid-media .buang { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.grid-media .buang svg { width: 16px; height: 16px; }
.grid-media .label { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dua .btn { height: 48px; font-size: 14px; padding: 0 10px; }

/* ---------- map ---------- */
.peta-penuh { position: fixed; top: 0; left: 0; right: 0; bottom: var(--nav); max-width: 560px; margin: 0 auto; }
.peta-penuh .leaflet { position: absolute; inset: 0; }
.terapung { position: absolute; top: calc(var(--atas) + 12px); left: 16px; right: 16px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.pil-cari { height: 52px; background: #fff; border-radius: 26px; box-shadow: 0 4px 16px rgba(20,40,90,0.16); display: flex; align-items: center; gap: 10px; padding: 0 6px 0 18px; }
.pil-cari input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; min-width: 0; }
.pil-cari .lapisan { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--biru-muda); color: var(--biru-gelap); display: flex; align-items: center; justify-content: center; }
.pil-cari .lapisan.aktif { background: var(--biru); color: #fff; }
.pil-cari svg { width: 20px; height: 20px; }
.cip-peta { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.cip-peta::-webkit-scrollbar { display: none; }
.cip-peta button { flex-shrink: 0; height: 36px; border-radius: 18px; border: none; background: #fff; box-shadow: 0 2px 8px rgba(20,40,90,0.14); padding: 0 14px; font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.cip-peta button.hidup { background: var(--biru); color: #fff; }
.btn-lokasi { position: absolute; right: 16px; z-index: 500; width: 48px; height: 48px; border-radius: 16px; border: none; background: #fff; color: var(--biru); box-shadow: 0 4px 12px rgba(20,40,90,0.2); display: flex; align-items: center; justify-content: center; }
.btn-lokasi svg { width: 22px; height: 22px; }
.kad-pin { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 500; background: #fff; border-radius: 24px; box-shadow: 0 8px 28px rgba(20,40,90,0.22); padding: 12px; display: flex; gap: 12px; }
.kad-pin .gbr { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; background: #E6E8EF; flex-shrink: 0; }
.kad-pin .isi { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kad-pin .tj { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.kad-pin .dua { margin-top: auto; padding-top: 8px; }
.kad-pin .dua .btn { height: 36px; font-size: 13px; }
.label-lok span { display: inline-block; transform: translate(-50%, -50%); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.pin-tengah { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 500; pointer-events: none; color: #D32F2F; }
.pin-tengah svg { width: 46px; height: 46px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.modal-peta { position: fixed; inset: 0; z-index: 95; background: #fff; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.modal-peta .badan { flex: 1; position: relative; }
.modal-peta .badan .leaflet { position: absolute; inset: 0; }
.modal-peta .kaki { padding: 14px 16px calc(14px + var(--bawah)); display: flex; flex-direction: column; gap: 6px; }
.leaflet-container { font-family: inherit; }

.pemapar .simpan-media { position: absolute; top: calc(var(--atas) + 14px); left: 12px; background: rgba(255,255,255,0.92); text-decoration: none; }

.kad-aduan .bwh .baris-lencana { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.kad-aduan .no { white-space: nowrap; }
