/* ============================================================
   Masjid Rakha — Elegan Islami (emerald + gold)
   Mobile app shell (Android-like) with bottom navigation
   ============================================================ */
:root {
  --emerald-950: #04251c;
  --emerald-900: #06382a;
  --emerald-800: #074b36;
  --emerald-700: #0b6146;
  --emerald-600: #0f7a56;
  --emerald-500: #13996b;
  --emerald-50: #e7f5ee;
  --gold-600: #a9821f;
  --gold-500: #c9a227;
  --gold-400: #d9b64a;
  --gold-300: #ecd08a;
  --gold-100: #f7ecc9;
  --cream: #f7f4ea;
  --cream-2: #efeade;
  --ink: #15251f;
  --muted: #5f7168;
  --line: rgba(21, 37, 31, 0.09);
  --white: #ffffff;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --rose: #b91c1c;
  --rose-bg: #fee2e2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(4, 37, 28, 0.06), 0 4px 14px rgba(4, 37, 28, 0.05);
  --shadow: 0 10px 30px rgba(4, 37, 28, 0.10);
  --shadow-lg: 0 18px 48px rgba(4, 37, 28, 0.18);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c9a227' stroke-opacity='0.16' stroke-width='1'%3E%3Cpath d='M32 2 L42 22 L62 32 L42 42 L32 62 L22 42 L2 32 L22 22 Z'/%3E%3Ccircle cx='32' cy='32' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: #0b2a22;
  background-image:
    radial-gradient(700px 500px at 12% 0%, rgba(19, 153, 107, 0.45), transparent 65%),
    radial-gradient(600px 460px at 92% 10%, rgba(201, 162, 39, 0.24), transparent 60%),
    radial-gradient(700px 600px at 50% 100%, rgba(6, 56, 42, 0.95), transparent 70%),
    linear-gradient(160deg, #0a3227, #04201a 60%, #082b22);
  height: 100vh;          /* fallback: browser lama tanpa dvh */
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;       /* dokumen tidak ikut scroll -> nav tidak bisa terdorong */
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald-700); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.display { font-family: 'Amiri', Georgia, serif; font-weight: 700; letter-spacing: 0; }

/* ---------------- app shell ---------------- */
/* Shell = kerangka aplikasi yang MENEMPEL ke viewport.
   Dipakai position:fixed (bukan height:100dvh) supaya:
   - tidak bergantung dukungan `dvh` (browser HP lama mengabaikannya → tinggi jadi auto
     dan tab bar terdorong keluar layar, persis bug yang dilaporkan),
   - address bar Chrome muncul/hilang tidak mengubah layout,
   - dokumen tidak pernah ikut scroll; hanya .app-main yang scroll. */
.app-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: auto;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.45);
}
@media (min-width: 560px) {
  body { padding: 0; }
  .app-shell { top: 22px; bottom: 22px; border-radius: 30px; }
}
.app-main {
  flex: 1 1 auto;
  min-height: 0; /* agar menyusut & bottom nav tidak terdorong keluar layar */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 26px;
}
.app-main.no-nav { padding-bottom: 14px; }

/* ---------------- top bar / hero ---------------- */
.hero {
  position: relative;
  background:
    radial-gradient(420px 220px at 88% -20%, rgba(201, 162, 39, 0.38), transparent 68%),
    linear-gradient(150deg, var(--emerald-700) 0%, var(--emerald-900) 55%, var(--emerald-950) 100%);
  color: #f3fbf7;
  padding: 18px 18px 34px;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--pattern);
  background-size: 64px 64px;
  opacity: 0.5;
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute;
  right: -54px; bottom: -70px;
  width: 210px; height: 210px;
  border-radius: 50%;
  border: 1px solid rgba(236, 208, 138, 0.28);
  box-shadow: 0 0 0 24px rgba(236, 208, 138, 0.06), 0 0 0 48px rgba(236, 208, 138, 0.04);
  z-index: -1;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--gold-300), var(--gold-500));
  color: var(--emerald-900);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 15.5px; font-weight: 800; line-height: 1.15; }
.brand-sub { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-300); font-weight: 700; }
.hero-icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #f3fbf7;
  cursor: pointer;
}
.hero-icon-btn svg { width: 18px; height: 18px; }
.hero-icon-btn:hover { background: rgba(255, 255, 255, 0.18); }
.hero h1 { font-size: 24px; line-height: 1.2; margin-top: 16px; color: #fff; }
.hero .hero-sub { color: rgba(243, 251, 247, 0.82); font-size: 12.8px; margin-top: 6px; max-width: 34ch; }
.hero-bismillah { text-align: center; font-size: 19px; color: var(--gold-300); letter-spacing: 0.02em; margin-top: 6px; }

/* simple page header (non-home) */
.page-head {
  position: relative;
  background: linear-gradient(150deg, var(--emerald-700), var(--emerald-900));
  color: #fff;
  padding: 14px 16px 18px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  isolation: isolate;
}
.page-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: var(--pattern); background-size: 64px 64px; opacity: 0.4;
}
.page-head-row { display: flex; align-items: center; gap: 10px; }
.page-head h1 { font-size: 17px; font-weight: 800; }
.page-head .sub { font-size: 11.5px; color: rgba(255,255,255,0.75); }
.back-btn {
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}
.back-btn svg { width: 17px; height: 17px; }

/* ---------------- layout helpers ---------------- */
.wrap { padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-center { text-align: center; }
.strong { font-weight: 800; }
.nowrap { white-space: nowrap; }
.overlap { margin-top: -24px; position: relative; z-index: 2; }

/* ---------------- cards ---------------- */
.card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(21, 37, 31, 0.07);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card-gold {
  background: linear-gradient(150deg, #fffdf6, var(--gold-100));
  border-color: rgba(201, 162, 39, 0.3);
}
.card-emerald {
  background: linear-gradient(150deg, var(--emerald-800), var(--emerald-950));
  color: #eafaf2;
  border-color: rgba(236, 208, 138, 0.22);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.card-emerald::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: var(--pattern); background-size: 64px 64px; opacity: 0.4;
}
.card-emerald .text-muted { color: rgba(234, 250, 242, 0.72); }
.card-title { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; color: var(--emerald-600); }
.card-emerald .card-title svg { color: var(--gold-300); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 14.5px; }
.section-head a { font-size: 12px; font-weight: 700; color: var(--emerald-600); }

/* campaign card */
.campaign { position: relative; }
.campaign-label {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 800; color: var(--gold-600);
}
.campaign h2 { font-size: 17px; margin-top: 4px; }
.amount-raised { font-size: 26px; font-weight: 800; color: var(--emerald-800); letter-spacing: -0.03em; line-height: 1.15; }
.amount-target { font-size: 12px; color: var(--muted); }

/* progress bar */
.progress { margin-top: 12px; }
.progress-track {
  height: 11px; border-radius: 999px; background: rgba(21, 37, 31, 0.09);
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald-600), var(--emerald-500) 55%, var(--gold-400));
  box-shadow: 0 2px 10px rgba(15, 122, 86, 0.35);
  position: relative;
  min-width: 6px;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 3.4s 1 both;   /* sekali jalan saja: hemat repaint */
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.progress-pct { font-weight: 800; color: var(--emerald-700); font-size: 12.5px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  box-shadow: var(--shadow-sm);
}
.stat .stat-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat .stat-value { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.stat .stat-icon {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--emerald-50); color: var(--emerald-700); margin-bottom: 8px;
}
.stat .stat-icon svg { width: 16px; height: 16px; }
.stat.gold .stat-icon { background: var(--gold-100); color: var(--gold-600); }
.stat.rose .stat-icon { background: var(--rose-bg); color: var(--rose); }
.stat.amber .stat-icon { background: var(--amber-bg); color: var(--amber); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 700; font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: linear-gradient(135deg, var(--emerald-600), var(--emerald-800)); color: #fff; box-shadow: 0 8px 20px rgba(11, 97, 70, 0.28); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(11, 97, 70, 0.36); }
.btn-gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: #3b2c04; box-shadow: 0 8px 20px rgba(201, 162, 39, 0.3); }
.btn-outline { background: #fff; border-color: rgba(15, 122, 86, 0.28); color: var(--emerald-700); }
.btn-ghost { background: rgba(21, 37, 31, 0.05); color: var(--ink); }
.btn-danger { background: var(--rose-bg); color: var(--rose); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 14.5px; border-radius: 15px; }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 10px; gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- donor list rows ---------------- */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line); }
.donor-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; }
.donor-row:first-child { padding-top: 0; }
.donor-row:last-child { padding-bottom: 0; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 13px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  background: linear-gradient(150deg, #eaf6f0, #d5ece1);
  color: var(--emerald-700);
  border: 1px solid rgba(15, 122, 86, 0.12);
}
.avatar.anon { background: linear-gradient(150deg, #fdf6e3, var(--gold-100)); color: var(--gold-600); border-color: rgba(201, 162, 39, 0.24); }
.donor-name { font-weight: 700; font-size: 13px; }
.donor-meta { font-size: 11px; color: var(--muted); }
.donor-amount { margin-left: auto; text-align: right; font-weight: 800; font-size: 13px; color: var(--emerald-700); white-space: nowrap; }
.donor-row .doa { font-size: 11.5px; color: var(--muted); font-style: italic; margin-top: 2px; }

/* ---------------- badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.01em;
}
.badge-ok { background: var(--emerald-50); color: var(--emerald-700); }
.badge-wait { background: var(--amber-bg); color: var(--amber); }
.badge-fail { background: var(--rose-bg); color: var(--rose); }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-muted { background: rgba(21, 37, 31, 0.06); color: var(--muted); }
.badge-memorial { background: var(--emerald-50); color: var(--emerald-700); border: 1px dashed rgba(11, 97, 70, 0.32); }
.badge-memorial svg { width: 11px; height: 11px; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: #33473d; }
.field .hint { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(21, 37, 31, 0.12);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 4px rgba(19, 153, 107, 0.12);
}
.textarea { resize: vertical; min-height: 78px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f7168' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--muted); }
.input-prefix .input { padding-left: 42px; }
.form-note { font-size: 11.5px; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 13px; background: #fff; border: 1.5px solid rgba(21, 37, 31, 0.12); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--emerald-600); flex: none; }
.check .check-title { font-size: 12.5px; font-weight: 700; }
.check .check-sub { font-size: 11px; color: var(--muted); }

/* nominal chips */
.nominal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nominal {
  position: relative;
  padding: 11px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(21, 37, 31, 0.12);
  background: #fff;
  font-weight: 800; font-size: 13px;
  text-align: center; cursor: pointer;
  transition: all 0.15s ease;
  color: var(--ink);
}
.nominal:hover { border-color: rgba(15, 122, 86, 0.4); }
.nominal input { position: absolute; opacity: 0; pointer-events: none; }
.nominal.selected {
  border-color: var(--emerald-600);
  background: linear-gradient(150deg, #eaf7f0, #d9f0e5);
  color: var(--emerald-800);
  box-shadow: 0 0 0 3px rgba(19, 153, 107, 0.1);
}
.nominal.selected::after {
  content: '✓'; position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--emerald-600); font-weight: 900;
}
.upload-box {
  border: 1.5px dashed rgba(15, 122, 86, 0.35);
  background: rgba(231, 245, 238, 0.55);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  display: block;
}
.upload-box svg { width: 26px; height: 26px; margin: 0 auto 6px; color: var(--emerald-600); }
.upload-box .t { font-size: 12.5px; font-weight: 700; }
.upload-box .s { font-size: 11px; color: var(--muted); }
.upload-preview { display: none; margin-top: 10px; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.upload-preview img { width: 100%; max-height: 220px; object-fit: cover; }
.upload-preview.show { display: block; }

/* ---------------- flash / alerts ---------------- */
.flash { padding: 11px 13px; border-radius: 13px; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.flash svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.flash-ok { background: var(--emerald-50); color: var(--emerald-800); border: 1px solid rgba(15, 122, 86, 0.18); }
.flash-err { background: var(--rose-bg); color: #7f1d1d; border: 1px solid rgba(185, 28, 28, 0.16); }
.flash-info { background: #eef2ff; color: #3730a3; border: 1px solid rgba(79, 70, 229, 0.16); }
.flash-warn { background: var(--amber-bg); color: #78350f; border: 1px solid rgba(180, 83, 9, 0.16); }

/* ---------------- bottom navigation ---------------- */
.bottom-nav {
  flex: 0 0 auto;
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(4, 37, 28, 0.06);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 2px;
  color: #8b9a92;
  font-size: 10px; font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
}
.nav-item svg { width: 21px; height: 21px; stroke-width: 1.9; }
.nav-item.active { color: var(--emerald-700); }
.nav-item.active svg { stroke-width: 2.3; }
.nav-item.center { transform: translateY(-14px); color: var(--emerald-900); }
.nav-item.center .nav-fab {
  width: 50px; height: 50px; border-radius: 17px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold-300), var(--gold-500));
  color: #3b2c04;
  box-shadow: 0 10px 22px rgba(201, 162, 39, 0.42), inset 0 0 0 1px rgba(255,255,255,0.55);
  margin-bottom: 1px;
}
.nav-item.center .nav-fab svg { width: 24px; height: 24px; stroke-width: 2.2; }
.nav-item.center.active .nav-fab { background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); }

/* ---------------- tabs / segmented ---------------- */
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(21, 37, 31, 0.06);
  border-radius: 13px;
}
.segmented a, .segmented button {
  flex: 1; text-align: center; padding: 8px 6px; border-radius: 10px;
  font-size: 11.5px; font-weight: 800; color: var(--muted);
  border: 0; background: transparent; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.segmented a.active, .segmented button.active { background: #fff; color: var(--emerald-800); box-shadow: var(--shadow-sm); }

/* ---------------- admin menu list ---------------- */
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; text-decoration: none; color: var(--ink);
}
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item .mi-icon {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--emerald-50); color: var(--emerald-700);
}
.menu-item .mi-icon svg { width: 18px; height: 18px; }
.menu-item .mi-title { font-size: 13px; font-weight: 700; }
.menu-item .mi-sub { font-size: 11px; color: var(--muted); }
.menu-item .mi-arrow { margin-left: auto; color: #b3c0b9; }
.menu-item .mi-arrow svg { width: 16px; height: 16px; }
.menu-item.gold .mi-icon { background: var(--gold-100); color: var(--gold-600); }

/* ---------------- reports / tables ---------------- */
.report-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; font-size: 13px;
}
.report-row + .report-row { border-top: 1px dashed var(--line); }
.report-row .label { color: var(--muted); font-size: 12.5px; }
.report-row .value { font-weight: 800; }
.value-in { color: var(--emerald-700); }
.value-out { color: #b45309; }
.divider { height: 1px; background: var(--line); margin: 10px 0; }
.dashed { border-top: 1px dashed rgba(21,37,31,0.16); margin: 12px 0; }

.data-row {
  display: flex; gap: 10px; padding: 11px 0; align-items: flex-start;
}
.data-row + .data-row { border-top: 1px solid var(--line); }
.data-row .dr-main { min-width: 0; flex: 1; }
.data-row .dr-title { font-size: 12.8px; font-weight: 700; }
.data-row .dr-sub { font-size: 11px; color: var(--muted); }
.data-row .dr-amount { font-weight: 800; font-size: 13px; white-space: nowrap; }

/* ---------------- chart ---------------- */
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* category bars */
.cat-bars { display: flex; flex-direction: column; gap: 10px; }
.cat-bar .cb-head { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 4px; }
.cat-bar .cb-head b { font-weight: 800; font-size: 11.5px; }
.cat-bar .cb-track { height: 8px; background: rgba(21, 37, 31, 0.07); border-radius: 999px; overflow: hidden; }
.cat-bar .cb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--emerald-600), var(--gold-400)); }

/* ---------------- timeline / progress updates ---------------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--emerald-500), rgba(201, 162, 39, 0.55));
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -24px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(19, 153, 107, 0.12);
}
.tl-item:first-child::before { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.16); }
.tl-title { font-size: 13px; font-weight: 800; }
.tl-meta { font-size: 11px; color: var(--muted); }
.tl-desc { font-size: 12px; color: #3f5148; margin-top: 3px; }
.tl-photo { margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.tl-photo img { width: 100%; max-height: 190px; object-fit: cover; }
.pct-pill { font-size: 10.5px; font-weight: 800; background: var(--emerald-50); color: var(--emerald-700); padding: 2px 8px; border-radius: 999px; }

/* ---------------- mosque illustration ---------------- */
.mosque-art { width: 100%; height: auto; display: block; }
.hero-art { position: absolute; right: -12px; bottom: -8px; width: 138px; opacity: 0.26; z-index: -1; }

/* ---------------- login screen ---------------- */
.auth-screen {
  min-height: 100%;
  display: flex; flex-direction: column;
  padding: 34px 20px 24px;
  background:
    radial-gradient(400px 300px at 85% 0%, rgba(201, 162, 39, 0.2), transparent 65%),
    radial-gradient(420px 320px at 0% 20%, rgba(19, 153, 107, 0.16), transparent 60%),
    var(--cream);
}
.auth-badge {
  width: 66px; height: 66px; border-radius: 22px; margin: 0 auto 16px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--emerald-700), var(--emerald-950));
  color: var(--gold-300);
  box-shadow: 0 14px 34px rgba(6, 56, 42, 0.35), inset 0 0 0 1px rgba(236, 208, 138, 0.35);
}
.auth-badge svg { width: 34px; height: 34px; }
.auth-title { text-align: center; font-size: 22px; }
.auth-sub { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------------- share ---------------- */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 4px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.share-btn svg { width: 22px; height: 22px; }
.share-btn.wa { color: #128c7e; }
.share-btn.fb { color: #1877f2; }
.share-btn.ig { color: #c13584; }
.share-btn.tg { color: #229ed9; }
.share-btn.copy { color: var(--emerald-700); }
.share-card-preview {
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(150deg, var(--emerald-800), var(--emerald-950));
  color: #fff; padding: 18px; position: relative; isolation: isolate;
}
.share-card-preview::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); background-size: 64px 64px; opacity: 0.5; }
.share-card-preview .scp-gold { color: var(--gold-300); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 800; }
.share-card-preview h3 { font-size: 20px; margin-top: 6px; color: #fff; }
.share-card-preview p { font-size: 11.5px; color: rgba(255,255,255,0.78); margin-top: 6px; }
.scp-amount { font-size: 24px; font-weight: 800; margin-top: 12px; letter-spacing: -0.02em; }
.scp-bar { height: 8px; background: rgba(255,255,255,0.16); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.scp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-300), var(--gold-500)); border-radius: 999px; }

/* ---------------- misc ---------------- */
.empty { text-align: center; padding: 26px 14px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 8px; color: #c3cec8; }
.pill-note { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.rekening {
  background: linear-gradient(150deg, #fffdf5, #f9f1d8);
  border: 1px solid rgba(201, 162, 39, 0.32);
  border-radius: 14px; padding: 13px;
}
.rekening .bank { font-size: 11px; font-weight: 800; color: var(--gold-600); letter-spacing: 0.06em; text-transform: uppercase; }
.rekening .norek { font-size: 19px; font-weight: 800; letter-spacing: 0.06em; color: #3d2f06; margin-top: 3px; }
.rekening .an { font-size: 11.5px; color: #6b5a22; }
.copy-btn { margin-left: auto; }
.sticky-cta {
  position: sticky; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 65%, rgba(247, 244, 234, 0));
}
.row-list { display: flex; flex-direction: column; }
.wa-status { font-size: 10.5px; }
.img-proof { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.filter-bar { display: flex; gap: 8px; }
.filter-bar .input, .filter-bar .select { padding: 9px 11px; font-size: 12.5px; }
.mini-form { display: flex; gap: 8px; }
.mini-form .input { padding: 9px 11px; font-size: 12.5px; }
dialog {
  border: 0; padding: 0; border-radius: 20px; width: calc(100% - 34px); max-width: 430px;
  background: #fff; box-shadow: var(--shadow-lg); color: var(--ink);
}
dialog::backdrop { background: rgba(4, 37, 28, 0.55); backdrop-filter: blur(2px); }
dialog .dlg-body { padding: 18px; }
dialog h3 { font-size: 16px; margin-bottom: 4px; }
dialog .dlg-actions { display: flex; gap: 8px; margin-top: 14px; }
dialog .dlg-actions .btn { flex: 1; }
details.acc { border-radius: 14px; background: #fff; border: 1px solid var(--line); }
details.acc > summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  font-size: 12.5px; font-weight: 700; display: flex; justify-content: space-between; align-items: center;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: '+'; font-size: 16px; color: var(--emerald-600); font-weight: 800; }
details.acc[open] > summary::after { content: '–'; }
details.acc .acc-body { padding: 0 14px 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 5px 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; word-break: break-word; }
.small-caps { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.list-link { text-decoration: none; color: inherit; display: block; }
.list-link:active { opacity: 0.75; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f6f6f6 37%, #eee 63%); background-size: 400% 100%; animation: sk 1.4s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
  .progress-fill::after { animation: none; }
  * { transition: none !important; }
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(6, 56, 42, 0.96); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; z-index: 999;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
  max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media print {
  .bottom-nav, .hero, .page-head, .btn, .segmented, form { display: none !important; }
  .app-shell { height: auto; max-width: none; box-shadow: none; }
  .app-main { overflow: visible; }
  body { background: #fff; }
}

/* ============================================================
   PWA: splash, pull-to-refresh, install banner, gallery
   ============================================================ */

/* ---- splash screen (only when launched from home screen) ---- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  background:
    radial-gradient(420px 320px at 80% 12%, rgba(201, 162, 39, 0.28), transparent 62%),
    linear-gradient(165deg, #0b6146 0%, #06382a 55%, #04251c 100%);
  opacity: 1;
  transition: opacity 0.45s ease;
}
.splash::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--pattern); background-size: 64px 64px; opacity: 0.4;
}
.splash.show { display: flex; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { position: relative; text-align: center; padding: 0 28px; }
.splash-logo {
  width: 96px; height: 96px; margin: 0 auto 18px;
  border-radius: 26px; overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(236, 208, 138, 0.35);
  background: rgba(255, 255, 255, 0.06);
  animation: splashPop 0.7s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.splash-logo img { width: 100%; height: 100%; object-fit: cover; }
.splash-name { font-size: 27px; color: #fff; letter-spacing: 0.01em; }
.splash-sub { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: #ecd08a; font-weight: 800; margin-top: 6px; }
.splash-bismillah { font-size: 22px; color: rgba(236, 208, 138, 0.85); margin-top: 22px; }
.splash-bar { width: 132px; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.16); margin: 22px auto 0; overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 99px; background: linear-gradient(90deg, #ecd08a, #c9a227); animation: splashBar 1.15s ease-in-out infinite; }
@keyframes splashBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes splashPop { from { opacity: 0; transform: scale(0.86) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---- pull to refresh ---- */
.ptr {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px;
  transform: translateY(-100%);
  color: var(--emerald-700);
  font-size: 11.5px; font-weight: 800;
  pointer-events: none;
  transition: opacity 0.2s ease;
  opacity: 0;
}
.ptr.visible { opacity: 1; }
.ptr.ready .ptr-text::after { content: ' — lepaskan'; }
.ptr-spinner svg { width: 18px; height: 18px; display: block; }
.ptr.loading .ptr-spinner svg { animation: ptrSpin 0.8s linear infinite; }
.ptr.loading .ptr-text::after { content: ''; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ---- install banner ---- */
.install-banner {
  position: absolute; left: 10px; right: 10px; bottom: 78px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(21, 37, 31, 0.09);
  box-shadow: 0 14px 34px rgba(4, 37, 28, 0.22);
  transform: translateY(14px); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.3s ease;
}
.install-banner[hidden] { display: none; }
.install-banner.show { transform: translateY(0); opacity: 1; }
.ib-icon { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none; background: var(--emerald-50); }
.ib-icon img { width: 100%; height: 100%; object-fit: cover; }
.ib-copy { flex: 1; min-width: 0; }
.ib-title { font-size: 12.5px; font-weight: 800; }
.ib-sub { font-size: 10.5px; color: var(--muted); }
.ib-btn {
  border: 0; cursor: pointer; flex: none;
  padding: 8px 13px; border-radius: 11px;
  font-size: 11.5px; font-weight: 800;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-800));
  color: #fff;
  box-shadow: 0 6px 16px rgba(11, 97, 70, 0.28);
}
.ib-close { border: 0; background: transparent; color: #a3b0a9; cursor: pointer; padding: 4px; flex: none; }
.ib-close svg { width: 15px; height: 15px; display: block; }

/* ---- install page ---- */
.install-hero { width: 92px; height: 92px; margin: 0 auto; border-radius: 24px; overflow: hidden; box-shadow: 0 14px 32px rgba(4,37,28,0.2); background: var(--emerald-50); }
.install-hero img { width: 100%; height: 100%; object-fit: cover; }

/* ---- perbandingan foto sebelum & sesudah ---- */
.update-stamp {
  display: flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.update-stamp svg { width: 12px; height: 12px; flex: none; }
.cmp {
  position: relative; margin-top: 8px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--emerald-950);
  --p: 55%;
}
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-before { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.cmp-tag {
  position: absolute; top: 8px; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(4, 37, 28, 0.72); color: #fff; backdrop-filter: blur(4px);
}
.cmp-tag-l { left: 8px; }
.cmp-tag-r { right: 8px; background: rgba(236, 208, 138, 0.92); color: #3b2c04; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--p); z-index: 3;
  width: 3px; transform: translateX(-1.5px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(4, 37, 28, 0.22);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.cmp-handle svg {
  width: 30px; height: 30px; padding: 4px; box-sizing: content-box;
  border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--emerald-800);
  transform: rotate(90deg); box-shadow: var(--shadow-sm);
}
.cmp-range {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
  background: transparent;
}
.cmp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 44px; height: 100%; }
.cmp-range::-moz-range-thumb { width: 44px; height: 100%; border: 0; }
.cmp-hint { font-size: 10.5px; color: var(--muted); margin-top: 6px; text-align: center; }

/* ---- QRIS di form donasi ---- */
.qris-box { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.qris-img {
  width: auto; max-width: min(280px, 100%); height: auto; display: block;
  border-radius: 16px; border: 1px solid var(--line); background: #fff; padding: 8px;
  image-rendering: auto;
}
.qris-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.qris-tip {
  display: flex; gap: 6px; align-items: flex-start; text-align: left;
  font-size: 11px; color: var(--muted); background: rgba(21, 37, 31, 0.04);
  border-radius: 10px; padding: 8px 10px; margin-top: 4px;
}
.qris-tip svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }

/* ---- halaman QR kanal (admin) ---- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.qr-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; text-align: center; box-shadow: var(--shadow-sm);
}
.qr-card img { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 10px; display: block; background: #fff; }
.qr-dl { position: relative; display: block; border-radius: 10px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.qr-dl:active { transform: scale(0.985); }
.qr-dl-badge {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(4, 37, 28, 0.82); color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.16s ease;
}
.qr-dl-badge svg { width: 11px; height: 11px; }
.qr-dl:hover .qr-dl-badge, .qr-dl:focus-visible .qr-dl-badge { opacity: 1; }
@media (hover: none) { .qr-dl-badge { opacity: 1; } }
.qr-card .qr-label { font-size: 12px; font-weight: 800; margin-top: 8px; }
.qr-card .qr-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.qr-card .qr-actions { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.qr-card .qr-actions .btn { padding: 6px 9px; font-size: 11px; }
.qr-link { font-size: 10px; color: var(--muted); word-break: break-all; margin-top: 6px; }
.qr-card.is-off { opacity: 0.62; }
.qr-steps { margin: 8px 0 0 18px; padding: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.qr-steps li { margin-bottom: 2px; }

/* ---- progress photo gallery (swipe) ---- */
.gallery { margin-top: 4px; }
.gal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gal-count { font-size: 11px; color: var(--muted); font-weight: 700; }
.gal-count b { color: var(--emerald-700); font-size: 12.5px; }
.gal-track {
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 16px;
  margin: 0 -2px;
  padding: 2px;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative; margin: 0;
  border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 11;
  background: #e9efe9;
  box-shadow: var(--shadow-sm);
}
.gal-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(4, 37, 28, 0.86), rgba(4, 37, 28, 0));
  color: #fff; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.gal-pct { background: rgba(236, 208, 138, 0.95); color: #3b2c04; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.gal-title { font-size: 12px; font-weight: 800; }
.gal-date { font-size: 10px; color: rgba(255,255,255,0.75); margin-left: auto; }
.gal-dots { display: flex; gap: 5px; justify-content: center; margin-top: 9px; }
.gal-dot {
  width: 6px; height: 6px; padding: 0; border: 0; border-radius: 99px;
  background: rgba(21, 37, 31, 0.18); cursor: pointer; transition: all 0.2s ease;
}
.gal-dot.active { width: 18px; background: var(--emerald-600); }
.gal-hint { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 6px; }

/* ---- admin media manager ---- */
.media-box { display: flex; gap: 12px; align-items: center; }
.media-thumb {
  width: 84px; height: 56px; flex: none; border-radius: 12px; overflow: hidden;
  background: rgba(21, 37, 31, 0.06); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb.square { width: 64px; height: 64px; border-radius: 16px; }
.media-thumb.card-ratio { width: 72px; height: 90px; border-radius: 12px; }
.media-meta { min-width: 0; flex: 1; }
.media-meta .t { font-size: 12.5px; font-weight: 700; }
.media-meta .s { font-size: 11px; color: var(--muted); }
.file-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.file-row input[type=file] { font-size: 11.5px; max-width: 100%; }

/* ---- audit trail ---- */
.audit-item { display: flex; gap: 10px; padding: 11px 0; }
.audit-item + .audit-item { border-top: 1px solid var(--line); }
.audit-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--emerald-50); color: var(--emerald-700);
}
.audit-icon svg { width: 15px; height: 15px; }
.audit-icon.gold { background: var(--gold-100); color: var(--gold-600); }
.audit-icon.rose { background: var(--rose-bg); color: var(--rose); }
.audit-icon.amber { background: var(--amber-bg); color: var(--amber); }
.audit-main { min-width: 0; flex: 1; }
.audit-title { font-size: 12.5px; font-weight: 700; }
.audit-sub { font-size: 11px; color: var(--muted); word-break: break-word; }
.audit-time { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ============================================================
   MODE TERINSTAL (PWA) — pastikan bottom nav SELALU terlihat.
   Dulu shell dipaksa 100dvh tanpa mengunci html/body, sehingga di
   beberapa perangkat nav terdorong keluar layar. Sekarang tinggi
   dikunci ke 100% viewport dan app-main diberi min-height:0 agar
   mau menyusut (flexbox) sehingga nav tetap di tempatnya.
   ============================================================ */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  html, body { height: 100%; min-height: 100%; overflow: hidden; padding: 0 !important; margin: 0 !important; }
  body { display: block; }
  .app-shell {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    padding-bottom: 0;
  }
  .app-main {
    flex: 1 1 auto !important;
    min-height: 0 !important;   /* kunci: tanpa ini nav bisa terdorong ke luar layar */
    overflow-y: auto;
  }
  .bottom-nav {
    flex: 0 0 auto !important;
    position: relative;
    z-index: 70;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    background: #fff;
  }
  .install-banner { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .ptr { position: absolute; }
}

/* ---- donasi barang ---- */
.goods-list { display: flex; flex-direction: column; gap: 10px; }
.goods-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; }
.goods-item + .goods-item { border-top: 1px dashed var(--line); }
.gi-icon {
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--gold-100); color: var(--gold-600);
}
.gi-icon svg { width: 17px; height: 17px; }
.gi-name { font-size: 12.8px; font-weight: 700; }
.gi-sub { font-size: 11px; color: var(--muted); }
.goods-summary {
  border-radius: 14px; padding: 13px;
  background: linear-gradient(150deg, #fffdf6, var(--gold-100));
  border: 1px solid rgba(201, 162, 39, 0.3);
}
.gs-label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; color: var(--gold-600); }
.gs-amount { font-size: 24px; font-weight: 800; color: #3d2f06; letter-spacing: -0.02em; margin-top: 2px; }
.gs-note { font-size: 11px; color: #6b5a22; margin-top: 2px; }
.upload-box.upload-error {
  border-color: var(--rose);
  background: rgba(254, 226, 226, 0.5);
  color: #7f1d1d;
}
.upload-box.shake { animation: shakeX 0.4s ease; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.hero h1 { overflow-wrap: anywhere; }
.imp-report { font-size: 11.5px; }
.imp-report li { margin-bottom: 2px; }

/* ---- FIX: [hidden] harus menang atas display:flex dari .stack/.grid ---- */
[hidden] { display: none !important; }

/* ikon inline di dalam teks (mis. "Diperbarui 1 jam lalu") tidak boleh membesar */
.pill-note svg { width: 13px; height: 13px; flex: none; }
.pill-note { align-items: flex-start; }
.pill-note svg { margin-top: 1px; }

/* ---- Barang dibutuhkan: kartu geser (swipe) ---- */
.goods-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -2px;
  padding: 2px 2px 4px;
}
.goods-slider::-webkit-scrollbar { display: none; }
.goods-card {
  flex: 0 0 70%;
  max-width: 240px;
  scroll-snap-align: start;
  border-radius: 16px;
  padding: 13px;
  background: linear-gradient(150deg, #fffdf6, var(--gold-100));
  border: 1px solid rgba(201, 162, 39, 0.3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.goods-card .gc-icon {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.75); color: var(--gold-600);
}
.goods-card .gc-icon svg { width: 17px; height: 17px; }
.goods-card .gc-name {
  font-size: 12.8px; font-weight: 800; color: #3d2f06; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.goods-card .gc-price { font-size: 12.5px; font-weight: 800; color: var(--emerald-700); }
.goods-card .gc-meta { font-size: 10.5px; color: #6b5a22; }
.goods-dots { display: flex; gap: 5px; justify-content: center; margin-top: 9px; }
.goods-dots .gal-dot { background: rgba(201, 162, 39, 0.3); }
.goods-dots .gal-dot.active { background: var(--gold-500); }

/* ---- pilih barang donasi (radio cards) ---- */
.goods-pick { display: flex; flex-direction: column; gap: 8px; }
.gp-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(21, 37, 31, 0.12);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.gp-item input { position: absolute; opacity: 0; pointer-events: none; }
.gp-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.gp-name { font-size: 12.8px; font-weight: 800; }
.gp-price { font-size: 11.5px; color: var(--emerald-700); font-weight: 700; }
.gp-meta { font-size: 10.5px; color: var(--muted); }
.gp-check {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2px solid rgba(21, 37, 31, 0.18);
  display: grid; place-items: center;
}
.gp-check::after {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--emerald-600); transform: scale(0); transition: transform 0.15s;
}
.gp-item.selected {
  border-color: var(--emerald-600);
  background: linear-gradient(150deg, #eaf7f0, #dbf1e6);
  box-shadow: 0 0 0 3px rgba(19, 153, 107, 0.1);
}
.gp-item.selected .gp-check { border-color: var(--emerald-600); }
.gp-item.selected .gp-check::after { transform: scale(1); }

/* ---- stepper jumlah barang ---- */
.qty-row { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px; border: 1.5px solid rgba(15, 122, 86, 0.3);
  background: #fff; color: var(--emerald-700);
  font-size: 20px; font-weight: 800; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}
.qty-btn:active { transform: scale(0.95); }
.qty-input { text-align: center; font-weight: 800; font-size: 15px; }
.qty-unit { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---- ukuran ikon di dalam kontrol (sebelumnya tidak dibatasi → melar raksasa) ---- */
.segmented a svg, .segmented button svg { width: 15px; height: 15px; flex: none; vertical-align: -2px; margin-right: 4px; }
.segmented a, .segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.goods-card .gc-icon svg { width: 17px; height: 17px; flex: none; }
.gi-icon svg, .avatar svg, .stat-icon svg, .mi-icon svg, .audit-icon svg { flex: none; }
/* pengaman: tidak ada SVG di dalam app yang boleh lebih tinggi dari layar */
.app-main svg { max-height: 100%; }
.stat-icon svg { width: 16px; height: 16px; }
.avatar svg { width: 16px; height: 16px; }
.ib-close svg, .hero-icon-btn svg, .back-btn svg { flex: none; }

/* ikon di tombol segmented: kunci ukuran (atribut + CSS) */
.segmented .ui-ico, .segmented svg.ui-ico { width: 15px !important; height: 15px !important; flex: none !important; }
.gc-icon svg { width: 17px !important; height: 17px !important; }

/* ---- serah terima barang (non-transfer) ---- */
.handover-box {
  border-radius: 14px;
  padding: 13px;
  background: linear-gradient(150deg, #f4fbf7, #e7f5ee);
  border: 1px solid rgba(15, 122, 86, 0.22);
}
.handover-box .hb-title { font-size: 12.5px; font-weight: 800; color: var(--emerald-800); }
.handover-box .hb-sub { font-size: 11.5px; color: #4a6b5c; margin-top: 3px; }

/* logo aplikasi di header: pastikan terpotong rapi mengikuti sudut */
.brand-mark { overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* ============================================================
   DESKTOP LAYOUT (>= 900px) — khusus panel pengurus.
   Di bawah 900px TIDAK ADA yang berubah: tampilan mobile tetap
   seperti sebelumnya (app shell + bottom nav).
   ============================================================ */
.layout-root { display: block; }
.side-nav { display: none; }

@media (min-width: 900px) {
  /* dokumen kembali normal-scroll, kerangka tidak lagi fixed */
  html, body { height: auto; min-height: 100%; overflow: visible; }
  body { padding: 0 !important; }

  .layout-root.desk {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    min-height: 100vh;
    background: #f4f1e8;
  }

  /* ---------- sidebar ---------- */
  .side-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 20px 16px;
    color: #dfeee7;
    background:
      radial-gradient(320px 220px at 88% -10%, rgba(201, 162, 39, 0.24), transparent 66%),
      linear-gradient(168deg, #0b6146 0%, #06382a 58%, #04251c 100%);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 6px; }
  .side-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; flex: none; overflow: hidden; background: rgba(255,255,255,0.1); }
  .side-name { font-size: 14.5px; font-weight: 800; color: #fff; line-height: 1.2; }
  .side-role { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-300); font-weight: 700; margin-top: 2px; }

  .side-menu { display: flex; flex-direction: column; gap: 4px; }
  .side-item {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; border-radius: 12px;
    color: #cfe3d9; font-size: 13px; font-weight: 700;
    text-decoration: none; transition: background 0.15s, color 0.15s;
  }
  .side-item svg { width: 18px; height: 18px; flex: none; }
  .side-item:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
  .side-item.active {
    background: linear-gradient(120deg, rgba(236, 208, 138, 0.22), rgba(201, 162, 39, 0.12));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(236, 208, 138, 0.4);
  }
  .side-item.active svg { color: var(--gold-300); }

  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.12); }
  .side-user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding: 6px; border-radius: 12px; }
  .side-user:hover { background: rgba(255,255,255,0.08); }
  .side-user .avatar { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.22); }
  .side-uname { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-urole { font-size: 10.5px; color: rgba(255,255,255,0.6); }
  .side-actions { display: flex; gap: 8px; }
  .side-mini {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700;
    color: #dfeee7; text-decoration: none; background: rgba(255,255,255,0.08);
  }
  .side-mini svg { width: 14px; height: 14px; }
  .side-mini:hover { background: rgba(255,255,255,0.16); }
  .side-mini.danger { background: rgba(185, 28, 28, 0.24); color: #ffd9d9; }
  .side-mini.danger:hover { background: rgba(185, 28, 28, 0.36); }

  /* ---------- konten utama ---------- */
  .layout-root.desk .app-shell {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    background: transparent;
  }
  .layout-root.desk .app-main { overflow: visible; padding-bottom: 40px; }
  .layout-root.desk .bottom-nav { display: none; }
  .layout-root.desk .ptr { display: none; }
  .layout-root.desk .splash { display: none !important; }

  /* header atas lebih lebar & lega */
  .layout-root.desk .hero {
    border-radius: 0 0 26px 26px;
    padding: 24px 34px 34px;
  }
  .layout-root.desk .hero-art { width: 190px; right: 18px; bottom: 6px; opacity: 0.3; }
  .layout-root.desk .hero h1 { font-size: 28px; }
  .layout-root.desk .hero-bismillah { font-size: 22px; margin-top: 4px; }

  .layout-root.desk .page-head {
    border-radius: 0 0 20px 20px;
    padding: 18px 34px 22px;
  }
  .layout-root.desk .page-head h1 { font-size: 20px; }

  /* kolom isi dibatasi agar nyaman dibaca */
  .layout-root.desk .wrap { max-width: 1160px; margin: 0 auto; padding: 0 34px; }
  .layout-root.desk .wrap.overlap { margin-top: -26px; }
  .layout-root.desk .stack { gap: 20px; }
  .layout-root.desk .stack-lg { gap: 26px; }
  .layout-root.desk .card { padding: 22px 24px; border-radius: 20px; }
  .layout-root.desk .card-title { font-size: 15px; }
  .layout-root.desk .section-head h2 { font-size: 16px; }

  /* grid statistik jadi 4 kolom */
  .layout-root.desk .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .layout-root.desk .stat { padding: 18px; border-radius: 18px; }
  .layout-root.desk .stat .stat-value { font-size: 20px; }
  .layout-root.desk .stat .stat-icon { width: 34px; height: 34px; }

  /* dua kolom untuk kartu tertentu */
  .layout-root.desk .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .layout-root.desk .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .layout-root.desk .amount-raised { font-size: 32px; }
  .layout-root.desk .amount-raised[style*="font-size:22px"] { font-size: 26px !important; }

  /* form lebih lega: label di kiri pada layar besar */
  .layout-root.desk .input, .layout-root.desk .select, .layout-root.desk .textarea { padding: 12px 14px; font-size: 14px; }
  .layout-root.desk .nominal-grid { grid-template-columns: repeat(3, 1fr); }
  .layout-root.desk .timeline { padding-left: 30px; }

  /* tabel & baris data lebih lapang */
  .layout-root.desk .data-row, .layout-root.desk .donor-row, .layout-root.desk .audit-item { padding-top: 14px; padding-bottom: 14px; }
  .layout-root.desk .report-row { padding: 12px 0; }
  .layout-root.desk .btn { border-radius: 12px; }
  .layout-root.desk .btn-lg { padding: 14px 22px; font-size: 15px; }

  /* menu list jadi 2 kolom agar tidak memanjang */
  .layout-root.desk .menu-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
  }
  .layout-root.desk .menu-item { padding: 13px 0; }
  .layout-root.desk .menu-item + .menu-item { border-top: 0; }
  .layout-root.desk .menu-item:nth-child(n + 3) { border-top: 1px solid var(--line); }

  /* dialog lebih lebar */
  dialog { max-width: 560px; }
  .toast { bottom: 28px; }

  /* galeri & slider barang lebih tinggi */
  .layout-root.desk .gal-slide { aspect-ratio: 16 / 9; }
  .layout-root.desk .goods-card { flex-basis: 32%; }

  /* laporan: grafik & kategori berdampingan */
  .layout-root.desk .desk-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
}

/* desktop sangat lebar: kartu laporan berdampingan lebih banyak */
@media (min-width: 1280px) {
  .layout-root.desk { grid-template-columns: 274px minmax(0, 1fr); }
  .layout-root.desk .wrap { max-width: 1240px; }
}

/* ---- desktop: kontrol form jangan melar selebar layar ---- */
@media (min-width: 900px) {
  .layout-root.desk .field > .input,
  .layout-root.desk .field > .select,
  .layout-root.desk .field > .textarea,
  .layout-root.desk .field > .input-prefix { max-width: 620px; }
  .layout-root.desk .field > .textarea { min-height: 96px; }
  /* kartu-kartu form utama dibatasi agar enak dibaca, tetap rata kiri */
  .layout-root.desk form.stack { max-width: 780px; }
  .layout-root.desk form.stack .card { padding: 22px 24px; }
  /* grafik laporan lebih tinggi & proporsional */
  .layout-root.desk .chart { height: 210px; }
  /* tabel data (rincian) diberi jarak lebih nyaman */
  .layout-root.desk .report-row .label { font-size: 13px; }
  .layout-root.desk .report-row .value { font-size: 13.5px; }
  /* sidebar scrollbar halus */
  .side-nav::-webkit-scrollbar { width: 6px; }
  .side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }
}
