:root {
  --ink: #2a2118;
  --latar: #f3efe9;
  --kad: #ffffff;
  --garis: #e2d9cd;
  --teks: #2a2118;
  --pudar: #7a6d60;
  --oren: #e8833a;
  --oren-gelap: #b9601e;
  --oren-lembut: #fbeadb;
  --merah: #c8372d;
  --merah-lembut: #fbe3e0;
  --kuning: #d99a00;
  --kuning-lembut: #fdf2d3;
  --hijau: #2e7d4f;
  --hijau-lembut: #e0f1e6;
  --biru: #2f6fa8;
  --lembut: #f8f5f0;
  --fon: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --c-western: #e8833a;
  --c-cun: #2f6fa8;
  --c-afc: #c8372d;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--fon); font-size: 15px; line-height: 1.45; background: var(--latar); color: var(--teks); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
.memuat-awal { min-height: 100vh; display: grid; place-items: center; }
.pusing { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--garis); border-top-color: var(--oren); animation: pusing .8s linear infinite; display: inline-block; }
@keyframes pusing { to { transform: rotate(360deg); } }

/* Kepala */
.kepala { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 10px; }
.kepala h1 { font-size: 18px; margin: 0; font-weight: 800; flex: 1; letter-spacing: -.2px; }
.kepala .kecil { font-size: 12px; color: #d8c8b6; font-weight: 500; display: block; }
.kepala button { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: 10px; padding: 7px 11px; font-weight: 600; font-size: 13px; }
.kepala .balik { font-size: 20px; padding: 3px 11px; }

main { padding: 14px 14px 100px; max-width: 760px; margin: 0 auto; }

/* Menu bawah */
.menu-bawah { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--kad); border-top: 1px solid var(--garis); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.menu-bawah button { flex: 1; background: none; border: 0; padding: 8px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--pudar); }
.menu-bawah button svg { width: 22px; height: 22px; }
.menu-bawah button.aktif { color: var(--oren-gelap); }
.menu-bawah button .titik { position: absolute; margin-left: 18px; margin-top: -2px; background: var(--merah); color: #fff; font-size: 10px; border-radius: 9px; padding: 0 5px; }

/* Kad */
.kad { background: var(--kad); border: 1px solid var(--garis); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.kad h2 { font-size: 15px; margin: 0 0 10px; font-weight: 800; }
.kad h3 { font-size: 13px; margin: 12px 0 6px; color: var(--pudar); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tajuk-seksyen { font-size: 13px; font-weight: 800; color: var(--pudar); text-transform: uppercase; letter-spacing: .5px; margin: 18px 4px 8px; display: flex; align-items: center; justify-content: space-between; }
.pudar { color: var(--pudar); }
.kecil { font-size: 12.5px; }
.tebal { font-weight: 700; }
.baris { display: flex; align-items: center; gap: 10px; }
.baris > .isi { flex: 1; min-width: 0; }
.jarak { height: 8px; }

/* Outlet */
.cip-outlet { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--lembut); }
.cip-outlet::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.o-western { --c: var(--c-western); } .o-cun { --c: var(--c-cun); } .o-afc { --c: var(--c-afc); }

/* Ringkasan outlet */
.grid-outlet { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .grid-outlet { grid-template-columns: repeat(3, 1fr); } }
.kad-outlet { border-left: 5px solid var(--c); }
.kad-outlet .nama { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.angka-besar { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.jadual-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.jadual-mini td { padding: 3px 0; }
.jadual-mini td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.jadual-mini tr.jumlah td { border-top: 1px solid var(--garis); padding-top: 6px; font-weight: 800; }
.bar-peratus { height: 8px; border-radius: 6px; background: var(--lembut); overflow: hidden; margin: 6px 0 2px; }
.bar-peratus > span { display: block; height: 100%; border-radius: 6px; }
.lencana { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.l-merah { background: var(--merah-lembut); color: var(--merah); }
.l-kuning { background: var(--kuning-lembut); color: #8a6300; }
.l-hijau { background: var(--hijau-lembut); color: var(--hijau); }
.l-kelabu { background: var(--lembut); color: var(--pudar); }
.l-biru { background: #e2edf7; color: var(--biru); }
.positif { color: var(--hijau); } .negatif { color: var(--merah); }

/* Amaran */
.amaran { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--garis); }
.amaran:last-child { border-bottom: 0; }
.amaran .ikon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 800; }
.amaran.merah .ikon { background: var(--merah-lembut); color: var(--merah); }
.amaran.kuning .ikon { background: var(--kuning-lembut); color: #8a6300; }
.amaran .tajuk { font-weight: 700; font-size: 14px; }

/* Senarai */
.senarai { background: var(--kad); border: 1px solid var(--garis); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--garis); background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; }
.item:last-child { border-bottom: 0; }
.item .isi { flex: 1; min-width: 0; }
.item .t1 { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 12.5px; color: var(--pudar); }
.item .nilai { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kepala-tarikh { background: var(--lembut); padding: 7px 14px; font-size: 12.5px; font-weight: 800; color: var(--pudar); display: flex; justify-content: space-between; border-bottom: 1px solid var(--garis); }
.kosong { text-align: center; padding: 26px 16px; color: var(--pudar); }

/* Borang */
label.medan { display: block; margin-bottom: 12px; }
label.medan > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
label.medan > small { display: block; color: var(--pudar); font-size: 12px; margin-top: 3px; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=month], select, textarea {
  width: 100%; border: 1px solid var(--garis); border-radius: 10px; padding: 11px 12px; background: #fff; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--oren); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wang { position: relative; }
.wang::before { content: "RM"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--pudar); font-size: 14px; font-weight: 600; pointer-events: none; }
.wang input { padding-left: 42px; font-variant-numeric: tabular-nums; }
.pilih-segmen { display: flex; gap: 6px; flex-wrap: wrap; }
.pilih-segmen button { border: 1px solid var(--garis); background: #fff; border-radius: 20px; padding: 7px 13px; font-weight: 700; font-size: 13px; }
.pilih-segmen button.aktif { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 15px; background: var(--lembut); color: var(--teks); }
.btn-utama { background: var(--oren); color: #fff; }
.btn-gelap { background: var(--ink); color: #fff; }
.btn-hijau { background: var(--hijau); color: #fff; }
.btn-merah { background: var(--merah-lembut); color: var(--merah); }
.btn-penuh { width: 100%; }
.btn-kecil { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; }
.butang-baris { display: flex; gap: 8px; flex-wrap: wrap; }
.butang-baris .btn { flex: 1; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; background: var(--oren); color: #fff; border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 800; font-size: 15px; box-shadow: 0 6px 18px rgba(184,96,30,.35); display: flex; gap: 6px; align-items: center; }

/* Semakan langsung */
.semakan { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 4px 0 12px; }
.semakan.ok { background: var(--hijau-lembut); color: var(--hijau); }
.semakan.salah { background: var(--merah-lembut); color: var(--merah); }
.semakan.info { background: var(--lembut); color: var(--pudar); }

/* Log masuk */
.log-masuk { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.log-masuk .logo { width: 72px; height: 72px; margin: 0 auto 14px; display: block; }
.log-masuk h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.log-masuk p.sub { text-align: center; color: var(--pudar); margin: 0 0 22px; }
.ralat { background: var(--merah-lembut); color: var(--merah); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }

/* Carta */
.carta { width: 100%; height: auto; display: block; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--pudar); margin-top: 6px; }
.legenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }

/* Lembaran bawah */
.latar-modal { position: fixed; inset: 0; background: rgba(20,14,8,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.lembaran { background: var(--latar); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.lembaran .atas { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lembaran .atas h2 { margin: 0; font-size: 17px; }
.lembaran .tutup { background: var(--lembut); border: 0; border-radius: 10px; width: 34px; height: 34px; font-size: 18px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; font-weight: 600; font-size: 14px; max-width: 90vw; }
.gambar-resit { max-width: 100%; border-radius: 10px; border: 1px solid var(--garis); display: block; }
.pratonton { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--garis); }
.cek { width: 22px; height: 22px; accent-color: var(--oren); flex: none; }
.pemilih-bulan { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pemilih-bulan button { background: var(--kad); border: 1px solid var(--garis); border-radius: 10px; width: 38px; height: 38px; font-size: 17px; font-weight: 700; }
.pemilih-bulan .bulan { flex: 1; text-align: center; font-weight: 800; font-size: 16px; }
.tab-atas { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tab-atas button { border: 1px solid var(--garis); background: var(--kad); border-radius: 20px; padding: 7px 14px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.tab-atas button.aktif { background: var(--ink); border-color: var(--ink); color: #fff; }
.kotak-kamera { background: var(--kad); border: 1px dashed var(--oren); border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.btn-kamera { padding: 16px; font-size: 17px; }
.pratonton-besar { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; margin-top: 10px; background: var(--lembut); }
.kecil-pusing { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; margin-right: 6px; }
/* Anna */
.anna-fab { position: fixed; left: 14px; top: calc(100vh - 150px - env(safe-area-inset-bottom)); z-index: 26; width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 0; background: conic-gradient(from 210deg, #8b5cf6, #ec4899, #f59e0b, #8b5cf6); box-shadow: 0 8px 22px rgba(139,92,246,.40), 0 2px 6px rgba(0,0,0,.15); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; transition: left .25s cubic-bezier(.2,.8,.3,1.2), top .25s cubic-bezier(.2,.8,.3,1.2), transform .15s; }
.anna-fab.seret { transition: none; transform: scale(1.08); cursor: grabbing; box-shadow: 0 14px 30px rgba(139,92,246,.5); }
.anna-fab::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(236,72,153,.45); animation: anna-denyut 2.6s ease-out infinite; pointer-events: none; }
.anna-fab.seret::before { animation: none; opacity: 0; }
.anna-fab .anna-muka { position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #ffffff 0, #f5f0ff 55%, #ede4ff 100%); display: grid; place-items: center; pointer-events: none; }
.anna-fab svg { width: 30px; height: 30px; }
.anna-fab .anna-label { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); background: #1f1235; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; padding: 2px 8px; border-radius: 10px; border: 2px solid #fff; pointer-events: none; }
.anna-fab .anna-titik { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; pointer-events: none; }
@keyframes anna-denyut { 0% { transform: scale(1); opacity: .9; } 70% { transform: scale(1.28); opacity: 0; } 100% { opacity: 0; } }
.sembang { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; max-height: 58vh; overflow-y: auto; padding: 4px 2px 10px; }
.mesej { max-width: 86%; padding: 10px 12px; border-radius: 14px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }
.mesej.saya { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.mesej.anna { align-self: flex-start; background: var(--kad); border: 1px solid var(--garis); border-bottom-left-radius: 4px; }
.mesej img { max-width: 100%; border-radius: 8px; display: block; margin-bottom: 6px; }
.mesej .sumber { margin-top: 6px; font-size: 12px; } .mesej .sumber a { color: var(--biru); display: block; }
.baris-tanya { display: flex; gap: 6px; align-items: flex-end; }
.baris-tanya textarea { min-height: 44px; max-height: 120px; flex: 1; }
.baris-tanya button { height: 44px; }
.cadangan-anna { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cadangan-anna button { border: 1px solid var(--garis); background: var(--kad); border-radius: 16px; padding: 6px 11px; font-size: 12.5px; font-weight: 600; }
