@font-face { font-family: Poppins; src: url(fonts/Poppins-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url(fonts/Poppins-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Poppins; src: url(fonts/Poppins-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Poppins; src: url(fonts/Poppins-ExtraBold.ttf); font-weight: 800; font-display: swap; }

:root {
  --hitam: #0D0D0D; --kartu: #1C1C1C; --aksen: #F4A522; --aksen-muda: #FFC75A; --aksen-tua: #C47F0E; --krem: #FFF6E2;
  --teks: #1C1C1C; --redup: #6E6E6E; --garis: #ECE9E2; --putih: #fff;
  --merah: #D64532; --hijau: #1E9E5A;
  --grad-emas: linear-gradient(135deg, #FFD27A 0%, #F4A522 45%, #D98B12 100%);
  --grad-gelap: linear-gradient(145deg, #262626 0%, #141414 100%);
  --bayang: 0 1px 2px rgba(13,13,13,.04), 0 8px 24px -8px rgba(13,13,13,.12);
  --glow: 0 10px 30px -10px rgba(244,165,34,.65);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-quint: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0; font-family: Poppins, system-ui, sans-serif; color: var(--teks); font-size: 15px; letter-spacing: -0.01em;
  background: radial-gradient(120% 60% at 100% 0%, rgba(244,165,34,.10), transparent 60%), linear-gradient(180deg, #FBFAF7 0%, #F2F0EA 100%) fixed;
  min-height: 100dvh;
}
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- header: latar 6A (hitam + cahaya kuning + grid halus) ---------- */
.top {
  position: sticky; top: 0; z-index: 5; color: #fff; overflow: hidden;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 20px;
  background:
    radial-gradient(140px 140px at 88% 10%, rgba(244,165,34,.45), transparent 70%),
    radial-gradient(220px 160px at 0% 120%, rgba(60,60,60,.7), transparent 70%),
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 22px 22px,
    #0D0D0D;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.8);
}
.brand { display: inline-flex; align-items: center; gap: 6px; color: var(--aksen); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.brand::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--aksen); box-shadow: 0 0 10px 2px rgba(244,165,34,.7); }
.top h1 { margin: 4px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
main { flex: 1; padding: 18px 16px calc(110px + env(safe-area-inset-bottom, 0px)); max-width: 720px; width: 100%; margin: 0 auto; outline: none; }

/* ---------- navigasi bawah: kapsul kaca melayang ---------- */
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px; max-width: 520px; margin: 0 auto;
  background: rgba(18,18,18,.82); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08); border-radius: 24px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.6);
}
.tabs button { position: relative; background: none; border: 0; color: #9A9A9A; font: inherit; font-size: 10.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 18px; transition: color 200ms var(--ease), transform 120ms var(--ease); }
.tabs button:active { transform: scale(.94); }
.tabs svg { width: 22px; height: 22px; fill: currentColor; position: relative; z-index: 1; }
.tabs span { position: relative; z-index: 1; }
.tabs button[aria-current="page"] { color: var(--hitam); }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; inset: 0; border-radius: 18px; background: var(--grad-emas); box-shadow: var(--glow); animation: pil 260ms var(--ease-quint); }
@keyframes pil { from { opacity: 0; transform: scale(.8); } }

button, a, [role="button"], label.pil, label.btn { touch-action: manipulation; user-select: none; -webkit-user-select: none; }

/* ---------- tombol ---------- */
.btn { position: relative; overflow: hidden; display: block; font: inherit; font-weight: 700; border: 0; border-radius: 16px; padding: 15px 18px; width: 100%; font-size: 16px; text-align: center;
  background: var(--grad-emas); color: var(--hitam); box-shadow: var(--glow); transition: transform 120ms var(--ease), box-shadow 200ms var(--ease); }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); }
.btn:active { transform: scale(.97); box-shadow: 0 4px 14px -8px rgba(244,165,34,.8); }
.btn:active::after { transform: translateX(120%); transition: transform 500ms var(--ease); }
.btn.sekunder { background: var(--putih); color: var(--teks); border: 1px solid var(--garis); box-shadow: var(--bayang); }
.btn.bahaya { background: var(--putih); color: var(--merah); border: 1px solid #F3CFC9; box-shadow: none; }

/* ---------- kartu ---------- */
.kartu { position: relative; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: var(--bayang); }
.kartu h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.kartu h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--grad-emas); }
.catatan { color: var(--redup); font-size: 12px; line-height: 1.55; margin: 10px 0 0; }

/* ---------- kartu hero: gaji bulan ini ---------- */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; margin-bottom: 14px; color: var(--hitam);
  background: radial-gradient(160px 160px at 100% 0%, rgba(255,255,255,.55), transparent 70%), var(--grad-emas);
  box-shadow: 0 20px 40px -18px rgba(217,139,18,.75); display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; border: 1.5px solid rgba(13,13,13,.10); pointer-events: none; }
.hero::before { width: 220px; height: 220px; right: -70px; bottom: -110px; }
.hero::after { width: 140px; height: 140px; right: -20px; bottom: -70px; }
.hero small { font-size: 11px; font-weight: 700; letter-spacing: .08em; opacity: .7; }
.hero .angka { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.hero .sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; position: relative; z-index: 1; }
.hero .sub span { background: rgba(13,13,13,.10); padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.ring { grid-row: span 2; position: relative; width: 74px; height: 74px; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .alas { stroke: rgba(13,13,13,.14); }
.ring .isi { stroke: var(--hitam); stroke-dasharray: 188.5; }
.ring b { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 15px; font-weight: 800; line-height: 1; }
.ring b em { font-style: normal; font-size: 9px; font-weight: 600; opacity: .7; margin-top: 2px; }

/* ---------- kartu KPI gelap ---------- */
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi div { position: relative; overflow: hidden; background: var(--grad-gelap); color: #fff; border-radius: 18px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.06); box-shadow: 0 10px 24px -14px rgba(0,0,0,.7); }
.kpi div::after { content: ""; position: absolute; width: 90px; height: 90px; right: -40px; top: -40px; border-radius: 50%; background: radial-gradient(circle, rgba(244,165,34,.28), transparent 70%); }
.kpi small { display: block; color: #9A9A9A; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.kpi b { display: block; font-size: 16.5px; font-weight: 800; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(90deg, #FFD27A, #F4A522); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi .lebar { grid-column: span 2; }

/* ---------- chip status ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #EFEDE7; color: var(--teks); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.aman { background: #DDF3E6; color: var(--hijau); }
.chip.tipis { background: var(--krem); color: #9A6208; }
.chip.kritis { background: #FBE1DC; color: var(--merah); }
.chip.kritis::before { animation: denyut 1.6s ease-in-out infinite; }
@keyframes denyut { 50% { box-shadow: 0 0 0 4px rgba(214,69,50,.18); } }

/* ---------- rencana vs realisasi ---------- */
.pos { padding: 11px 0; border-bottom: 1px solid var(--garis); }
.pos:last-child { border-bottom: 0; }
.pos .baris { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.bar { height: 9px; background: #F0EEE8; border-radius: 99px; margin: 8px 0 5px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad-emas); transform-origin: left; box-shadow: 0 0 10px rgba(244,165,34,.45); }
.bar i.lewat { background: linear-gradient(90deg, #F08A6E, #D64532); box-shadow: 0 0 10px rgba(214,69,50,.4); }
.pos small { color: var(--redup); font-size: 12px; }

/* ---------- grafik ---------- */
.grafik { width: 100%; height: auto; display: block; overflow: visible; }
.grafik rect.b { transform-box: fill-box; transform-origin: bottom; }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--redup); margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- form ---------- */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(13,13,13,.06); border-radius: 16px; padding: 4px; margin-bottom: 14px; }
.seg button { font: inherit; font-weight: 700; font-size: 14px; border: 0; background: none; padding: 11px 0; border-radius: 12px; color: var(--redup); transition: color 200ms var(--ease); }
.seg button[aria-pressed="true"] { background: var(--hitam); color: var(--aksen); box-shadow: 0 8px 18px -10px rgba(0,0,0,.8); animation: pil 220ms var(--ease-quint); }

.isian { display: grid; gap: 12px; }
.isian label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
input, select { font: inherit; font-size: 16px; padding: 13px 14px; border: 1.5px solid transparent; border-radius: 14px; background: var(--krem); color: var(--teks); width: 100%; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms; }
input:focus, select:focus { outline: none; border-color: var(--aksen); background: #fff; box-shadow: 0 0 0 4px rgba(244,165,34,.18); }
input[name="jumlah"] { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; padding: 14px 16px; }
label.pil { display: flex !important; align-items: center; gap: 10px !important; font-weight: 600; background: rgba(13,13,13,.04); padding: 12px 14px; border-radius: 14px; }
label.pil input { width: 22px; height: 22px; accent-color: var(--hitam); margin: 0; }
.dua { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- riwayat ---------- */
.riwayat { list-style: none; margin: 0; padding: 0; }
.riwayat li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--garis); }
.riwayat li:last-child { border-bottom: 0; }
.riwayat .ikon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-content: center; font-weight: 800; font-size: 16px; }
.riwayat .ikon.masuk { background: #DDF3E6; color: var(--hijau); }
.riwayat .ikon.keluar { background: #FBE1DC; color: var(--merah); }
.riwayat .ikon.setor { background: var(--krem); color: #9A6208; }
.riwayat .info { flex: 1; min-width: 0; }
.riwayat .info b { display: block; font-size: 14px; }
.riwayat .info small { color: var(--redup); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riwayat .nom { font-weight: 700; white-space: nowrap; }
.riwayat .hapus { border: 0; background: none; color: #B5B0A6; font-size: 20px; padding: 6px 8px; border-radius: 10px; }
.riwayat .hapus:active { background: #FBE1DC; color: var(--merah); }
.nom.masuk { color: var(--hijau); }
.nom.keluar { color: var(--merah); }
.kosong { color: var(--redup); text-align: center; padding: 18px 0; font-size: 14px; }

/* ---------- tabel ---------- */
.tabel { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabel th { text-align: left; font-size: 11px; color: var(--redup); font-weight: 600; padding: 6px 6px; }
.tabel td { padding: 10px 6px; border-top: 1px solid var(--garis); white-space: nowrap; }
.tabel td.r, .tabel th.r { text-align: right; }
.tabel tr.kini td { background: var(--krem); font-weight: 700; }
.tabel tr.kini td:first-child { border-radius: 10px 0 0 10px; box-shadow: inset 3px 0 0 var(--aksen); }
.tabel tr.kini td:last-child { border-radius: 0 10px 10px 0; }

/* ---------- toast & peringatan ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9;
  display: flex; align-items: center; gap: 8px; background: rgba(18,18,18,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: 0 14px 30px -14px rgba(0,0,0,.7); animation: toast 320ms var(--ease-quint); white-space: nowrap; }
.toast::before { content: "✓"; display: grid; place-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--grad-emas); color: var(--hitam); font-size: 12px; font-weight: 800; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.peringatan { background: #FBE1DC; color: var(--merah); padding: 11px 13px; border-radius: 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* ---------- animasi masuk (hanya saat pindah tab) ---------- */
main.masuk > * { animation: naik 520ms var(--ease-quint) both; }
main.masuk > *:nth-child(2) { animation-delay: 50ms; }
main.masuk > *:nth-child(3) { animation-delay: 100ms; }
main.masuk > *:nth-child(4) { animation-delay: 150ms; }
main.masuk > *:nth-child(n+5) { animation-delay: 200ms; }
@keyframes naik { from { opacity: 0; transform: translateY(14px); } }
main.masuk .bar i { animation: tumbuh 900ms 250ms var(--ease-quint) both; }
@keyframes tumbuh { from { transform: scaleX(0); } }
main.masuk .grafik rect.b { animation: tinggi 800ms var(--ease-quint) both; }
@keyframes tinggi { from { transform: scaleY(0); } }
main.masuk .ring .isi { animation: cincin 1100ms 200ms var(--ease-quint) both; }
@keyframes cincin { from { stroke-dashoffset: 188.5; } }

@media (hover: hover) and (pointer: fine) {
  .tabs button:not([aria-current]):hover { color: #fff; }
  .btn:hover { box-shadow: 0 14px 34px -10px rgba(244,165,34,.8); }
  .riwayat .hapus:hover { color: var(--merah); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- laporan PDF (lewat cetak → Simpan sebagai PDF) ---------- */
#laporan { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .app, .toast { display: none !important; }
  #laporan { display: block; color: #1C1C1C; font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#laporan .kop { background: #0D0D0D; color: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
#laporan .kop small { color: #F4A522; font-weight: 700; letter-spacing: .08em; font-size: 8pt; }
#laporan .kop h1 { margin: 2px 0 0; font-size: 18pt; font-weight: 800; }
#laporan .kop p { margin: 2px 0 0; color: #BDBDBD; font-size: 9pt; }
#laporan h2 { font-size: 12pt; margin: 16px 0 6px; padding-left: 8px; border-left: 4px solid #F4A522; break-after: avoid; }
#laporan table { width: 100%; border-collapse: collapse; font-size: 9pt; }
#laporan th { background: #1C1C1C; color: #F4A522; text-align: left; padding: 5px 6px; font-weight: 700; }
#laporan td { padding: 4px 6px; border-bottom: 1px solid #ECE9E2; }
#laporan tr { break-inside: avoid; }
#laporan .r { text-align: right; }
#laporan .ringkas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#laporan .ringkas div { border: 1px solid #ECE9E2; border-radius: 10px; padding: 8px 10px; }
#laporan .ringkas small { display: block; color: #6E6E6E; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; }
#laporan .ringkas b { font-size: 11pt; }
#laporan .kaki { margin-top: 14px; color: #6E6E6E; font-size: 8pt; }

/* ---------- layar kunci PIN ---------- */
body.terkunci .tabs { display: none; }
.hero.aktivasi { grid-template-columns: 1fr; }
.hero.aktivasi .angka { font-size: 24px; white-space: normal; }
.btn:disabled { opacity: .6; }
.titik { display: flex; justify-content: center; gap: 14px; margin: 22px 0 8px; }
.titik i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C9C4B8; transition: transform 160ms var(--ease), background 160ms; }
.titik i.isi { background: var(--grad-emas); border-color: transparent; box-shadow: 0 0 10px rgba(244,165,34,.6); transform: scale(1.1); }
.pesan-kunci { min-height: 20px; text-align: center; color: var(--merah); font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.papan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; }
.papan button, .papan span { height: 64px; }
.papan button { font: inherit; font-size: 24px; font-weight: 700; border: 0; border-radius: 20px; background: rgba(255,255,255,.95); color: var(--teks); box-shadow: var(--bayang); display: grid; place-content: center; transition: transform 100ms var(--ease), background 100ms; }
.papan button:active { transform: scale(.93); background: var(--krem); }
.papan svg { width: 28px; height: 28px; fill: var(--aksen-tua); }
.lupa { display: block; margin: 18px auto 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--redup); text-decoration: underline; padding: 8px; }

/* ---------- sapaan nama di Dasbor ---------- */
.sapa { display: flex; align-items: center; gap: 12px; margin: 2px 2px 14px; line-height: 1.15; min-width: 0; }
.sapa > div { min-width: 0; }
.sapa small { display: block; color: var(--redup); font-size: 13px; font-weight: 600; }
.sapa b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(90deg, #1C1C1C 30%, #C47F0E); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sapa-isi { display: flex; align-items: center; gap: 12px; }
.sapa-isi .isian { flex: 1; font-size: 14px; font-weight: 700; }

/* ---------- foto profil ---------- */
.avatar { position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0; display: grid; place-content: center;
  background: var(--grad-emas); color: var(--hitam); font: inherit; font-weight: 800; font-size: 18px; box-shadow: 0 0 0 3px #fff, 0 6px 16px -6px rgba(217,139,18,.8); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar svg { width: 26px; height: 26px; fill: var(--hitam); opacity: .75; }
.avatar i { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--hitam); color: var(--aksen);
  font-style: normal; font-size: 14px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.avatar:active { transform: scale(.95); }
.avatar.besar { width: 76px; height: 76px; font-size: 26px; }
.profil { display: flex; align-items: center; gap: 14px; }
.profil > div { display: flex; flex-wrap: wrap; gap: 8px; }
#laporan .kop-foto { float: right; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid #F4A522; }

/* ---------- cara pakai ---------- */
.bantuan { position: absolute; right: 18px; top: calc(18px + env(safe-area-inset-top, 0px)); width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(244,165,34,.5); background: rgba(244,165,34,.12); color: var(--aksen); font: inherit; font-size: 18px; font-weight: 800; }
.bantuan:active { transform: scale(.94); }
body.terkunci .bantuan { display: none; }
.panduan { padding: 0; overflow: hidden; }
.panduan summary { list-style: none; cursor: pointer; padding: 16px 44px 16px 18px; font-weight: 700; font-size: 15px; position: relative; }
.panduan summary::-webkit-details-marker { display: none; }
.panduan summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%;
  background: var(--krem); color: var(--aksen-tua); display: grid; place-content: center; font-weight: 800; transition: transform 200ms var(--ease); }
.panduan[open] summary::after { content: "−"; background: var(--hitam); color: var(--aksen); }
.panduan > div { padding: 0 18px 16px; font-size: 14px; line-height: 1.6; color: #333; }
.panduan p { margin: 0 0 10px; }
.panduan ol, .panduan ul { margin: 0 0 12px; padding-left: 20px; }
.panduan li { margin-bottom: 6px; }
.panduan .chip { font-size: 10.5px; padding: 2px 8px; }
.kartu.mulai { background: linear-gradient(135deg, #FFF6E2, #fff); border: 1px solid #F6DFA8; }

/* ---------- simulasi investasi ---------- */
.sim-kartu { background: linear-gradient(135deg, #fff 55%, #FFF6E2); }
.sim-angka { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 12px;
  background: linear-gradient(90deg, #1C1C1C, #C47F0E); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =====================================================================
   MODE GELAP (palet brand 6A). Aktif lewat <html data-tema="gelap">.
   ===================================================================== */
:root[data-tema="gelap"] {
  color-scheme: dark;
  --teks: #EDEDED; --redup: #9A9A9A; --garis: #2A2A2A; --putih: #1C1C1C; --krem: #262017;
  --merah: #FF6B57; --hijau: #3FCB7E;
  --bayang: 0 1px 2px rgba(0,0,0,.35), 0 10px 26px -10px rgba(0,0,0,.75);
}
[data-tema="gelap"], [data-tema="gelap"] body { background-color: #0D0D0D; }
[data-tema="gelap"] body {
  background: radial-gradient(120% 50% at 100% 0%, rgba(244,165,34,.12), transparent 60%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #121212 0%, #0B0B0B 100%) fixed;
}
[data-tema="gelap"] .kartu { background: rgba(28,28,28,.94); border-color: rgba(255,255,255,.06); }
[data-tema="gelap"] .btn.bahaya { border-color: #5A2A24; }
[data-tema="gelap"] .chip { background: #2A2A2A; }
[data-tema="gelap"] .chip.aman { background: #12301E; }
[data-tema="gelap"] .chip.tipis { background: #3A2D0C; color: #FFC75A; }
[data-tema="gelap"] .chip.kritis, [data-tema="gelap"] .peringatan { background: #3A1A17; }
[data-tema="gelap"] .bar { background: #2A2A2A; }
[data-tema="gelap"] .seg { background: rgba(255,255,255,.06); }
[data-tema="gelap"] .seg button[aria-pressed="true"] { background: var(--grad-emas); color: var(--hitam); }
[data-tema="gelap"] input:focus, [data-tema="gelap"] select:focus { background: #1C1C1C; }
[data-tema="gelap"] label.pil { background: rgba(255,255,255,.05); }
[data-tema="gelap"] label.pil input { accent-color: var(--aksen); }
[data-tema="gelap"] .riwayat .ikon.masuk { background: #12301E; }
[data-tema="gelap"] .riwayat .ikon.keluar { background: #3A1A17; }
[data-tema="gelap"] .riwayat .ikon.setor { color: #FFC75A; }
[data-tema="gelap"] .riwayat .hapus { color: #6E6E6E; }
[data-tema="gelap"] .riwayat .hapus:active { background: #3A1A17; }
[data-tema="gelap"] .kpi div { border-color: rgba(244,165,34,.14); }
[data-tema="gelap"] .titik i { border-color: #4A4A4A; }
[data-tema="gelap"] .papan button { background: #1C1C1C; }
[data-tema="gelap"] .papan button:active { background: #262017; }
[data-tema="gelap"] .papan svg { fill: var(--aksen); }
[data-tema="gelap"] .sapa b, [data-tema="gelap"] .sim-angka { background-image: linear-gradient(90deg, #FFFFFF 30%, #F4A522); }
[data-tema="gelap"] .avatar { box-shadow: 0 0 0 3px #0D0D0D, 0 6px 16px -6px rgba(217,139,18,.8); }
[data-tema="gelap"] .avatar i { box-shadow: 0 0 0 2px #0D0D0D; }
[data-tema="gelap"] .panduan > div { color: #CFCFCF; }
[data-tema="gelap"] .panduan[open] summary::after { background: var(--grad-emas); color: var(--hitam); }
[data-tema="gelap"] .kartu.mulai { background: linear-gradient(135deg, #2A2112, #1C1C1C); border-color: #4A3A12; }
[data-tema="gelap"] .sim-kartu { background: linear-gradient(135deg, #1C1C1C 55%, #2A2112); }
[data-tema="gelap"] .tabel tr.kini td { background: #262017; }
/* grafik SVG: garis & batang "abu" dibuat terang supaya terlihat di latar gelap */
[data-tema="gelap"] .grafik line { stroke: #2E2E2E; }
[data-tema="gelap"] #gAbu stop:first-child { stop-color: #9A9A9A; }
[data-tema="gelap"] #gAbu stop:last-child { stop-color: #5A5A5A; }
[data-tema="gelap"] .legenda span:first-child i { background: linear-gradient(#9A9A9A, #5A5A5A) !important; }

/* ---------- tombol ganti tema (header) ---------- */
.tema { position: absolute; right: 64px; top: calc(18px + env(safe-area-inset-top, 0px)); width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(244,165,34,.5); background: rgba(244,165,34,.12); color: var(--aksen); display: grid; place-content: center; padding: 0; }
.tema:active { transform: scale(.94); }
.tema svg { width: 19px; height: 19px; fill: currentColor; }
.tema .matahari, [data-tema="gelap"] .tema .bulan { display: none; }
[data-tema="gelap"] .tema .matahari { display: block; }
body.terkunci .tema { right: 18px; } /* tombol ? disembunyikan saat terkunci */
@media print { html, [data-tema="gelap"] { background: #fff !important; } } /* PDF selalu putih, apa pun temanya */
