/* ==========================================================================
   LINK BERKAH – Modern UI layer
   Palet tetap: emerald / teal + aksen emas. Dimuat SETELAH Tailwind (layout_home.php).
   Semua aturan di-scope ke body / .app-* agar tidak menyentuh halaman admin.
   ========================================================================== */

:root {
  --em-50:  #ecfdf5;
  --em-100: #d1fae5;
  --em-200: #a7f3d0;
  --em-500: #10b981;
  --em-600: #059669;
  --em-700: #047857;
  --teal-600: #0d9488;
  --gold: #f5b301;
  --gold-soft: #fff7d6;
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, .06);
  --radius-card: 22px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .08);
  --shadow-glow: 0 10px 24px -10px rgba(5, 150, 105, .55);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

body.font-poppins,
body {
  font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}
body .font-poppins { font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, sans-serif; }
body h1, body h2, body h3, body h4 { letter-spacing: -.02em; }

/* ---------- Latar ---------- */
body { background: #f3faf7; }

/* ---------- Header ---------- */
body .app-header {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  min-height: 58px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  background: linear-gradient(120deg, #10b981 0%, #0d9488 100%);
  border-radius: 0 0 26px 26px;
  box-shadow: 0 12px 28px -14px rgba(4, 120, 87, .7);
  overflow: visible;
}
body .app-header::after {           /* kilau halus di sudut kanan */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%);
  pointer-events: none;
}
body .app-header h1,
body .app-header .app-header-title {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.15;
  text-transform: uppercase;
  font-feature-settings: 'ss01' on, 'kern' on;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
body .app-header .app-header-sub {
  display: block;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.2;
  opacity: .9;
}
body .app-header #menuToggle img {
  border-color: rgba(255, 255, 255, .75);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}
body .app-header #dropdownMenu { border-radius: 16px; border: 0; box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .25); overflow: hidden; }

/* ---------- Area konten ---------- */
body .app-shell { box-shadow: 0 0 60px -20px rgba(4, 120, 87, .25); background: transparent; }
body .app-content {
  background: linear-gradient(180deg, #ecfdf5 0, #f6fbf9 220px, #f8fafc 100%) !important;
  border-color: transparent !important;
  padding-top: 5.25rem;
  padding-bottom: 5.25rem;
}

/* ---------- Kartu ---------- */
body .app-content .bg-white:is(.rounded-lg, .rounded-xl, .rounded-2xl):not(button):not(input):not(select):not(textarea):not(a.group):is(.shadow-xs, .shadow-sm, .shadow, .shadow-md, .shadow-lg, .shadow-xl, .border) {
  border-radius: var(--radius-card);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}
body .app-content .bg-white.border-gray-100,
body .app-content .bg-white.border-gray-200 { border-color: var(--line); }

/* Judul seksi: aksen vertikal emas */
body .app-content h3.text-lg.font-semibold {
  position: relative;
  padding-left: 12px;
  font-weight: 700;
  color: var(--ink);
}
body .app-content h3.text-lg.font-semibold::before {
  content: "";
  position: absolute; left: 0; top: 12%; bottom: 12%;
  width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, var(--em-500), var(--gold));
}
body .app-content h3.text-lg.font-semibold i { display: none; }
/* "Lihat Semua" jadi chip */
body .app-content a.text-emerald-600.text-sm.font-medium {
  background: var(--em-50);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
body .app-content a.text-emerald-600.text-sm.font-medium:hover { background: var(--em-100); }

/* ---------- Tombol ---------- */
body .app-content button.bg-gradient-to-r,
body .app-content a.bg-gradient-to-r {
  border-radius: 14px;
  box-shadow: var(--shadow-glow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
body .app-content button.bg-gradient-to-r:hover,
body .app-content a.bg-gradient-to-r:hover { filter: saturate(1.1) brightness(1.03); }
body .app-content button.bg-gradient-to-r:active,
body .app-content a.bg-gradient-to-r:active { transform: scale(.98); }

/* ---------- Form ---------- */
body .app-content :is(input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea) {
  border-radius: 14px;
  border-color: #dbe5e1;
  background-color: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
body .app-content :is(input, select, textarea):focus {
  outline: none;
  border-color: var(--em-500) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .16) !important;
}

/* ---------- Menu Utama (ikon) ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 6px 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.menu-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -14px rgba(5, 150, 105, .5); border-color: var(--em-200); }
.menu-tile .ico {
  width: 54px; height: 54px; border-radius: 17px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--em-500), var(--teal-600));
  color: #fff; font-size: 1.35rem;
  box-shadow: 0 10px 18px -10px rgba(5, 150, 105, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.menu-tile.is-gold .ico { background: linear-gradient(145deg, #fbbf24, #f59e0b); box-shadow: 0 10px 18px -10px rgba(245, 158, 11, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.menu-tile.is-soft .ico { background: var(--em-50); color: var(--em-600); box-shadow: inset 0 0 0 1px var(--em-200); }
.menu-tile span { font-size: .72rem; font-weight: 700; color: #1e293b; line-height: 1.2; }

/* ---------- Banner ---------- */
body .app-content #bannerSlider { border-radius: var(--radius-card); }
body .app-content .relative.overflow-hidden.rounded-lg { border-radius: var(--radius-card); box-shadow: var(--shadow-card); }

/* ---------- Navigasi bawah (compact, menempel di dasar, lekuk untuk tombol tengah) ---------- */
body .footer-menu.app-bottomnav {
  bottom: 0 !important;
  width: 100% !important;
  max-width: 32rem !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 7px 6px calc(5px + env(safe-area-inset-bottom, 0px)) !important;
  border: 0 !important;
  background: transparent !important;
  filter: drop-shadow(0 -5px 12px rgba(4, 120, 87, .32));
}
/* latar bergradasi + lekuk setengah lingkaran di tengah atas */
body .footer-menu.app-bottomnav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(120deg, #10b981, #0d9488);
  /* pusat lekuk (12px dari tepi atas) = pusat tombol tengah (46px, margin-top -27px); celah 6px */
  -webkit-mask: radial-gradient(circle 29px at 50% 12px, transparent 28px, #000 29px);
          mask: radial-gradient(circle 29px at 50% 12px, transparent 28px, #000 29px);
}
body .footer-menu.app-bottomnav > .flex { margin-top: 0 !important; height: auto !important; align-items: flex-end !important; }

body .footer-menu.app-bottomnav a {
  flex: 1 1 0; min-height: 42px !important; padding: 2px 0 0 !important; gap: 3px !important;
  position: relative !important; border-radius: 12px; justify-content: flex-end;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--ease);
}
body .footer-menu.app-bottomnav a:active { transform: scale(.92); }
body .footer-menu.app-bottomnav a span { font-size: .62rem; line-height: 1; font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .82) !important; transition: color .2s var(--ease); }
/* ikon: pil transparan, jadi pil emas-lembut saat aktif */
body .footer-menu.app-bottomnav a div.w-5 {
  width: 38px; height: 24px; border-radius: 999px;
  background: transparent !important;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
body .footer-menu.app-bottomnav a div.w-5 i { font-size: .95rem; color: rgba(255, 255, 255, .9) !important; transition: color .2s var(--ease); }
body .footer-menu.app-bottomnav a.active { background: transparent; }
body .footer-menu.app-bottomnav a.active div.w-5 { background: rgba(255, 215, 0, .22) !important; }
body .footer-menu.app-bottomnav a.active div.w-5 i,
body .footer-menu.app-bottomnav a.active span { color: #FFD700 !important; }
body .footer-menu.app-bottomnav a.active span { font-weight: 700; }

/* tombol tengah: duduk di dalam lekuk */
body .footer-menu.app-bottomnav a.nav-cta { flex: 0 0 76px; transform: none; padding-top: 0 !important; }
body .footer-menu.app-bottomnav a.nav-cta:active { transform: scale(.94); }
body .footer-menu.app-bottomnav a.nav-cta div.w-8 {
  width: 46px !important; height: 46px !important; flex: none;
  margin-top: -27px;
  background: linear-gradient(145deg, #ffe27a, #f5b301) !important;
  border: 0;
  box-shadow: 0 8px 16px -6px rgba(245, 179, 1, .9), inset 0 1px 0 rgba(255, 255, 255, .6);
}
body .footer-menu.app-bottomnav a.nav-cta div.w-8 i { color: #7a5200 !important; font-size: 1rem; }
body .footer-menu.app-bottomnav a.nav-cta span { color: #FFE27A !important; font-weight: 700; margin-top: 1px; }
body .footer-menu.app-bottomnav a.nav-cta.active { background: transparent; }

/* ---------- Tombol melayang (naik / aksesibilitas) ---------- */
@media (max-width: 768px) {
  body .fixed.right-2.bottom-20 { bottom: 70px !important; }
  body #backToTop { bottom: 114px !important; }
}

/* ---------- Sidebar ---------- */
body #sidebar { border-radius: 0 26px 26px 0; box-shadow: none; }
body #sidebar:not(.-translate-x-full) { box-shadow: 30px 0 60px -30px rgba(15, 23, 42, .4); }
body #sidebar nav a { border-radius: 14px; padding-top: .6rem; padding-bottom: .6rem; font-weight: 500; }
body #sidebar nav a i { width: 22px; text-align: center; color: var(--em-600); }
body #sidebar nav a.bg-emerald-50,
body #sidebar nav a[class*="bg-emerald-"][class*="text-emerald"] { font-weight: 700; }
body #overlay { backdrop-filter: blur(3px); background: rgba(15, 23, 42, .45); }

/* ---------- Animasi masuk ---------- */
@keyframes ui-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  body .app-content > div > .bg-white,
  body .app-content > div > div[class*="bg-gradient"],
  body .app-content > div > .mb-6 { animation: ui-rise .55s var(--ease) both; }
  body .app-content > div > :nth-child(2) { animation-delay: .05s; }
  body .app-content > div > :nth-child(3) { animation-delay: .1s; }
  body .app-content > div > :nth-child(4) { animation-delay: .15s; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- Desktop: bingkai aplikasi di tengah ---------- */
@media (min-width: 640px) {
  body { background: radial-gradient(900px 500px at 15% -10%, #d1fae5 0, transparent 60%), radial-gradient(700px 500px at 100% 10%, #fff7d6 0, transparent 55%), #f3faf7; }
  body .app-shell { border-radius: 0; }
}

/* ---------- Perapian teks tombol ---------- */
body .app-content button.bg-gradient-to-r,
body .app-content a.bg-gradient-to-r { font-size: .86rem; letter-spacing: -.005em; }
body .app-content .zakat-easy-nominal { white-space: nowrap; padding-left: .25rem; padding-right: .25rem; border-radius: 14px; font-weight: 700; }
body .app-content .zakat-easy-nominal:hover { transform: translateY(-1px); }

/* ==========================================================================
   Halaman: kemudahan penggunaan & keterbacaan (semua halaman frontend)
   ========================================================================== */

/* Header halaman (gradasi hijau) – sudut seragam + kilau halus */
body .app-content .bg-gradient-to-r.from-emerald-500.to-teal-600.text-white:not(button):not(a) {
  position: relative; overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: 0 16px 30px -18px rgba(5, 150, 105, .75);
}
body .app-content .bg-gradient-to-r.from-emerald-500.to-teal-600.text-white:not(button):not(a)::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 68%); pointer-events: none;
}

/* Judul seksi di tengah (kartu info/CTA) tidak perlu garis aksen */
body .app-content .text-center h3.text-lg.font-semibold,
body .app-content h3.text-lg.font-semibold.text-center { padding-left: 0; }
body .app-content .text-center h3.text-lg.font-semibold::before,
body .app-content h3.text-lg.font-semibold.text-center::before { display: none; }

/* Teks artikel: rata kiri (justify membuat jarak kata bolong) + daftar punya bullet */
body .app-content .prose,
body .app-content .prose *,
body .app-content [style*="text-align: justify"],
body .app-content [style*="text-align:justify"],
body .app-content .text-justify { text-align: left !important; }
body .app-content .prose { font-size: .95rem; line-height: 1.75; color: #334155; }
body .app-content .prose :is(ul, ol) { padding-left: 1.4rem; margin: .75rem 0; }
body .app-content .prose ul { list-style: disc; }
body .app-content .prose ol { list-style: decimal; }
body .app-content .prose li { margin: .3rem 0; }
body .app-content .prose a { color: var(--em-600); text-decoration: underline; text-underline-offset: 2px; }
body .app-content .prose table { display: block; max-width: 100%; overflow-x: auto; }
body .app-content .prose img { max-width: 100%; height: auto; }

/* Angka rupiah tidak terpotong ke baris baru */
body .app-content .tabular-nums,
body .app-content [class*="font-bold"][class*="text-emerald"],
body .app-content .grid-cols-4 > div > .text-lg.font-bold { white-space: nowrap; }
body .app-content .grid-cols-4 > div > .text-lg.font-bold { font-size: .95rem; }
body .app-content button[onclick^="selectNominal"],
body .app-content button[onclick*="Nominal"] { white-space: nowrap; }

/* ---------- Form: nyaman di layar sentuh ---------- */
@media (max-width: 640px) {
  /* 16px mencegah iOS memperbesar layar saat input difokuskan */
  body .app-content :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea) {
    font-size: 16px !important;
  }
}
body .app-content :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select) { min-height: 46px; }
body .app-content textarea { min-height: 96px; }
body .app-content label { cursor: pointer; }
body .app-content input[type=checkbox], body .app-content input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--em-600); }
body .app-content input[type=file] { padding: .55rem .75rem; }
body .app-content input[type=file]::file-selector-button {
  margin-right: .75rem; padding: .45rem .9rem; border: 0; border-radius: 10px;
  background: var(--em-50); color: var(--em-700); font-weight: 600; cursor: pointer;
}
body .app-content ::placeholder { color: #94a3b8; }

/* Tombol: target sentuh minimal 44px */
body .app-content button[type=submit],
body .app-content button.bg-gradient-to-r,
body .app-content a.bg-gradient-to-r,
body .app-content button.bg-emerald-600,
body .app-content a.bg-emerald-600 { min-height: 44px; }

/* Fokus keyboard yang jelas */
body :is(a, button, summary, [tabindex]):focus-visible { outline: 3px solid rgba(245, 179, 1, .85); outline-offset: 2px; border-radius: 10px; }

/* ---------- Tab (Berita/Pengumuman/Event, Profil, Riwayat) ---------- */
body .app-content :is(nav, div)[class*="overflow-x-auto"] { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body .app-content :is(nav, div)[class*="overflow-x-auto"]::-webkit-scrollbar { display: none; }

/* ---------- Filter lipat (Riwayat) ---------- */
body .riwayat-filter > summary { list-style: none; min-height: 48px; }
body .riwayat-filter > summary::-webkit-details-marker { display: none; }
body .riwayat-filter .riwayat-filter-chevron { transition: transform .25s var(--ease); }
body .riwayat-filter[open] .riwayat-filter-chevron { transform: rotate(180deg); }
body .riwayat-filter[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: .85rem; }

/* ---------- Kartu daftar: efek tekan & jarak antar baris ---------- */
body .app-content a.group { transition: transform .2s var(--ease), box-shadow .2s var(--ease); -webkit-tap-highlight-color: transparent; }
body .app-content a.group:active { transform: scale(.985); }
body .app-content .line-clamp-2, body .app-content .line-clamp-3 { overflow-wrap: anywhere; }

/* ---------- Tabel di halaman: bisa digeser, tidak melebihi layar ---------- */
body .app-content .overflow-x-auto { max-width: 100%; }
body .app-content table { font-size: .85rem; }

/* ---------- Status kosong ---------- */
body .app-content .text-center > .fa-3x, body .app-content .text-center > i.text-4xl { opacity: .8; }

/* Nominal besar (Terkumpul / Target) tidak terpecah dan mengecil bila sempit */
body .app-content p.text-lg.font-bold { white-space: nowrap; font-size: clamp(.78rem, 3.4vw, 1.1rem); }

/* ==========================================================================
   Halaman Donasi
   ========================================================================== */
.donasi-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 8px 13px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: #fff; color: #475569; border: 1px solid #e2e8f0;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.donasi-chip.is-on { background: linear-gradient(120deg, var(--em-500), var(--teal-600)); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.donasi-sort {
  min-height: 38px !important; padding: 6px 28px 6px 12px !important; border-radius: 999px !important;
  font-size: .8rem !important; font-weight: 600; border: 1px solid #e2e8f0 !important; background-color: #fff;
}
.donasi-card {
  background: #fff; border-radius: var(--radius-card); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.donasi-card:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -16px rgba(5, 150, 105, .45); }
.donasi-card:active { transform: scale(.99); }
.donasi-cover { position: relative; aspect-ratio: 16 / 9; background: #ecfdf5; overflow: hidden; }
.donasi-cover img { width: 100%; height: 100%; object-fit: cover; }
.donasi-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: #fff; backdrop-filter: blur(6px);
}
.donasi-badge.is-live { background: rgba(5, 150, 105, .92); }
.donasi-badge.is-done { background: rgba(71, 85, 105, .92); }
.donasi-pct { font-size: .75rem; font-weight: 800; color: var(--em-700); background: var(--em-50); padding: 3px 10px; border-radius: 999px; }
.donasi-bar { height: 8px; border-radius: 999px; background: #e8efec; overflow: hidden; }
.donasi-bar > span { display: block; height: 100%; border-radius: inherit; min-width: 2px; background: linear-gradient(90deg, var(--em-500), #34d399 70%, var(--gold)); transition: width .8s var(--ease); }
.donasi-cta { font-weight: 700; color: var(--em-700); background: var(--em-50); padding: 7px 14px; border-radius: 999px; }
.donasi-cta.is-muted { color: #64748b; background: #f1f5f9; }
.donasi-page {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 12px; font-size: .85rem; font-weight: 600; background: #fff; color: #475569; border: 1px solid #e2e8f0;
}
.donasi-page.is-on { background: var(--em-600); color: #fff; border-color: var(--em-600); }

/* ==========================================================================
   Login & Daftar
   ========================================================================== */
.pw-wrap { position: relative; }
.pw-wrap > input { padding-right: 3rem !important; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 0; background: transparent; color: #94a3b8; border-radius: 12px; cursor: pointer;
}
.pw-toggle:hover { color: var(--em-600); background: var(--em-50); }

.auth-perks { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-perks span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: var(--em-700); background: #fff; border: 1px solid var(--em-200);
}
.auth-perks i { color: var(--gold); }

/* Kartu login: header lebih lega + bayangan hijau */
body .app-content .max-w-md.mx-auto > .bg-white.rounded-xl { box-shadow: 0 24px 48px -24px rgba(5, 150, 105, .45); }
body .app-content .max-w-md.mx-auto div.bg-gradient-to-r.from-emerald-500 { padding-top: 2rem; padding-bottom: 2rem; }

/* Pilihan radio (Personal/Instansi) lebih jelas */
body .app-content label.relative.flex.items-center.border-2 { border-radius: 16px; min-height: 64px; }
body .app-content label.relative.flex.items-center.border-2.border-emerald-500 { box-shadow: 0 0 0 4px rgba(16, 185, 129, .14); }

/* Captcha rapi di layar sempit */
body .app-content #captcha-img { border-radius: 10px; }
body .app-content input#captcha { text-align: center; font-weight: 700; }
body .app-content input#captcha:not(:placeholder-shown) { letter-spacing: .15em; }

/* ==========================================================================
   Pengajuan Bantuan
   ========================================================================== */
.aju-state { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; }
.aju-state.is-warn { background: var(--gold-soft); }
.aju-state.is-ok { background: var(--em-50); }
.aju-state-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; font-size: 1.05rem; }
.aju-state.is-warn .aju-state-ico { background: linear-gradient(145deg, #fbbf24, #f59e0b); }
.aju-state.is-ok .aju-state-ico { background: linear-gradient(145deg, var(--em-500), var(--teal-600)); }
.aju-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px;
  border-radius: 14px; font-size: .85rem; font-weight: 700; text-align: center; transition: transform .15s var(--ease), box-shadow .2s var(--ease);
}
.aju-btn:active { transform: scale(.97); }
.aju-btn.is-primary { background: linear-gradient(120deg, var(--em-500), var(--teal-600)); color: #fff; box-shadow: var(--shadow-glow); }
.aju-btn.is-outline { background: #fff; color: var(--em-700); border: 2px solid var(--em-500); }

.aju-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.aju-steps li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.aju-steps li:last-child { padding-bottom: 0; }
.aju-steps li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: linear-gradient(var(--em-200), var(--em-50)); }
.aju-steps .n { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff; background: linear-gradient(145deg, var(--em-500), var(--teal-600)); box-shadow: 0 6px 12px -6px rgba(5, 150, 105, .8); }
.aju-steps li:last-child .n { background: linear-gradient(145deg, #fbbf24, #f59e0b); }
.aju-steps b { display: block; font-size: .85rem; color: #1e293b; }
.aju-steps p { margin: 2px 0 0; font-size: .75rem; color: #64748b; line-height: 1.45; }

.aju-acc { border-top: 1px solid var(--line); }
.aju-acc:first-of-type { border-top: 0; }
.aju-acc > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: .9rem; font-weight: 700; color: #1e293b; cursor: pointer; }
.aju-acc > summary::-webkit-details-marker { display: none; }
.aju-acc .aju-chev { transition: transform .25s var(--ease); }
.aju-acc[open] .aju-chev { transform: rotate(180deg); }
.aju-prog { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }

.aju-track { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-card); transition: transform .2s var(--ease); }
.aju-track:active { transform: scale(.985); }
.aju-track .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--em-50); color: var(--em-600); box-shadow: inset 0 0 0 1px var(--em-200); }

/* Pengajuan: data pemohon lipat & kartu tracking */
.aju-pemohon { background: var(--em-50); border: 1px solid var(--em-200); border-radius: 16px; padding: 0 14px; }
.aju-pemohon > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; cursor: pointer; }
.aju-pemohon > summary::-webkit-details-marker { display: none; }
.aju-pemohon > summary .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(145deg, var(--em-500), var(--teal-600)); }
.aju-pemohon[open] .aju-chev { transform: rotate(180deg); }
.aju-pemohon .aju-chev { transition: transform .25s var(--ease); }
.aju-pemohon > div { padding-bottom: 14px; }

.trk-card { display: block; background: #fff; border: 1px solid var(--line); border-left: 5px solid #f59e0b; border-radius: 18px; padding: 14px; box-shadow: var(--shadow-card); transition: transform .2s var(--ease); }
.trk-card:active { transform: scale(.985); }
.trk-card[data-tone="is-teal"] { border-left-color: var(--teal-600); }
.trk-card[data-tone="is-green"] { border-left-color: var(--em-500); }
.trk-card[data-tone="is-red"] { border-left-color: #ef4444; }
.trk-kode { font-weight: 800; color: var(--em-700); font-size: 1.05rem; }
.trk-badge { font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #fef3c7; color: #92400e; white-space: nowrap; }
.trk-card[data-tone="is-teal"] .trk-badge { background: #ccfbf1; color: #115e59; }
.trk-card[data-tone="is-green"] .trk-badge { background: var(--em-100); color: var(--em-700); }
.trk-card[data-tone="is-red"] .trk-badge { background: #fee2e2; color: #991b1b; }

/* ==========================================================================
   Riwayat
   ========================================================================== */
.riw-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.riw-hero-col {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 14px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--em-500), var(--teal-600)); box-shadow: 0 16px 28px -18px rgba(5, 150, 105, .8);
}
.riw-hero-col.is-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 16px 28px -18px rgba(245, 158, 11, .85); }
.riw-hero-col::after { content: ""; position: absolute; right: -30px; top: -40px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 70%); }
.riw-hero-col .lbl { font-size: .7rem; font-weight: 700; opacity: .92; text-transform: uppercase; letter-spacing: .04em; }
.riw-hero-col .lbl i { margin-right: 4px; }
.riw-hero-col b { font-size: clamp(.95rem, 4.3vw, 1.2rem); font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.riw-hero-col small { font-size: .7rem; opacity: .9; }

body .riwayat-tabs { gap: 6px; background: #f1f5f9; border-radius: 16px; padding: 4px; }
body .riwayat-tabs .tab-button {
  border: 0 !important; border-radius: 12px; min-height: 44px; font-weight: 700; color: #64748b !important; background: transparent;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
body .riwayat-tabs .tab-button.active { background: #fff; color: var(--em-700) !important; box-shadow: 0 4px 12px -4px rgba(15, 23, 42, .18); }
body .riwayat-tabs .tab-button#tab-pendistribusian.active { color: #b45309 !important; }

.riw-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.riw-row > div { flex: 1; min-width: 0; }
.riw-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--em-50); color: var(--em-600); font-size: .85rem; }
.riw-ico.is-gold { background: #fef3c7; color: #b45309; }
body .app-content a.py-1\.5.px-3 { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }

/* Anak grid boleh mengecil (mencegah grafik/konten melebarkan halaman) */
body .app-content .grid > * { min-width: 0; }
body .app-content canvas { max-width: 100%; }
.riw-row p.font-bold { white-space: nowrap; }

/* ---------- Donasi: tombol donasi melayang ---------- */
.sticky-donasi {
  position: fixed; left: 50%; bottom: 76px; z-index: 9000; width: calc(100% - 24px); max-width: 488px;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, #064e3b, #047857); box-shadow: 0 16px 30px -12px rgba(4, 78, 59, .7);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform .3s var(--ease), opacity .25s var(--ease);
}
.sticky-donasi.is-show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sticky-donasi-btn { flex: none; display: inline-flex; align-items: center; padding: 0 16px; min-height: 44px; border-radius: 14px; font-size: .85rem; font-weight: 800; color: #5a3d00; background: linear-gradient(145deg, #ffe27a, #f5b301); }
@media (max-width: 768px) {
  body.has-sticky-cta #backToTop { bottom: 190px !important; }
  body.has-sticky-cta .fixed.right-2.bottom-20 { bottom: 146px !important; }
}

/* ==========================================================================
   Beranda
   ========================================================================== */
.home-hero {
  position: relative; overflow: hidden; padding: 20px 18px 18px; border-radius: var(--radius-card); color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #0d9488 70%, #0f766e 100%);
  box-shadow: 0 22px 36px -22px rgba(4, 120, 87, .85);
}
.home-hero::before, .home-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.home-hero::before { right: -50px; top: -60px; width: 190px; height: 190px; background: radial-gradient(circle, rgba(255, 255, 255, .26), transparent 68%); }
.home-hero::after { left: -40px; bottom: -70px; width: 170px; height: 170px; background: radial-gradient(circle, rgba(255, 215, 0, .22), transparent 68%); }
.home-hero > * { position: relative; z-index: 1; }
.home-hero-sapa { font-size: .8rem; font-weight: 600; opacity: .9; margin: 0; }
.home-hero-title { font-size: 1.55rem; font-weight: 800; line-height: 1.15; margin: 2px 0 6px; letter-spacing: -.02em; }
.home-hero-sub { font-size: .8rem; line-height: 1.5; opacity: .92; max-width: 30ch; margin: 0; }
.home-hero-actions { display: flex; gap: 10px; margin-top: 14px; }
.home-hero-actions a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 14px;
  font-size: .85rem; font-weight: 800; transition: transform .15s var(--ease);
}
.home-hero-actions a:active { transform: scale(.97); }
.home-hero-actions .is-gold { color: #5a3d00; background: linear-gradient(145deg, #ffe27a, #f5b301); box-shadow: 0 10px 18px -10px rgba(245, 179, 1, .95); }
.home-hero-actions .is-glass { color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }

/* Rel geser horizontal untuk campaign */
.home-rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.home-rail::-webkit-scrollbar { display: none; }
.home-rail-item { flex: 0 0 76%; max-width: 300px; scroll-snap-align: start; }

/* Label seksi kecil */
.home-sec-label { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #b45309; }

/* QRIS lipat */
.home-qris { background: #fff; border-radius: 16px; padding: 0 14px; }
.home-qris > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 52px; font-size: .85rem; font-weight: 700; color: #1e293b; cursor: pointer; }
.home-qris > summary::-webkit-details-marker { display: none; }
.home-qris .home-chev { transition: transform .25s var(--ease); }
.home-qris[open] .home-chev { transform: rotate(180deg); }
.home-qris > div { padding-bottom: 14px; }

/* Statistik */
.home-stats {
  position: relative; overflow: hidden; padding: 18px; border-radius: var(--radius-card); color: #fff;
  background: linear-gradient(135deg, #065f46, #0d9488); box-shadow: 0 22px 36px -22px rgba(4, 95, 70, .9);
}
.home-stats::after { content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 215, 0, .25), transparent 68%); pointer-events: none; }
.home-stats h3 { color: #fff; }
.home-stats > h3::before { background: linear-gradient(180deg, #fff, var(--gold)) !important; }
.home-stats > .grid { position: relative; z-index: 1; }
.home-stat { padding: 14px 10px; text-align: center; border-radius: 16px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px); }
.home-stat-num { font-size: clamp(1rem, 5vw, 1.35rem); font-weight: 800; line-height: 1.2; color: #ffe27a; white-space: nowrap; }
.home-stat-lbl { margin-top: 4px; font-size: .7rem; font-weight: 600; opacity: .92; }

.home-prog-card {
  display: flex; flex-direction: column; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; color: inherit;
}
.home-prog-fig { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--lembut, #ecfdf5); }
.home-prog-fig img { width: 100%; height: 100%; object-fit: cover; }
.home-prog-fig span {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; background: #fff; color: var(--aksen, var(--em-700));
  font-size: .62rem; font-weight: 800; text-transform: uppercase;
}
.home-prog-card h4 { margin: 8px 10px 2px; font-size: .8rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.home-prog-card p { margin: 0 10px 10px; font-size: .68rem; line-height: 1.45; color: var(--muted); }
.home-prog-act {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  border-radius: 12px; font-size: .8rem; font-weight: 800; color: #fff;
}
.home-prog-act.is-a { background: linear-gradient(145deg, #047857, #0d9488); }
.home-prog-act.is-b { color: #422006; background: linear-gradient(145deg, #ea8c00, #f5b301); }

/* ==========================================================================
   Pemisah mobile / desktop (aturan desktop ada di modern-desktop.css, >= 1024px)
   ========================================================================== */
.desk-only { display: none; }
