/*
 * TAARIFA: Rangi/fonti hapa ni "Approved visual system" kutoka
 * CLAUDE-EMERGENCY-MVP-BUILD-BRIEF.md Sehemu ya 3. Usibadilishe values hizi
 * bila idhini ya PM (angalia amendment #15).
 */

:root {
  --ivory-50: #fffdf8;
  --ivory-100: #fdf8ee;
  --ivory-200: #f5ead7;
  --burgundy-700: #7a1b2e;
  --burgundy-800: #621323;
  --gold-500: #b48627;
  --gold-600: #966d1d;
  --walnut-700: #4a2815;
  --walnut-800: #32180d;
  --ink-900: #2a1810;
  --ink-600: #765a49;
  --line: rgba(122, 27, 46, .22);
  --success: #2f7d3b;
  --partial: #b7831f;
  --pending: #7a1b2e;

  color-scheme: light;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

html, body {
  margin: 0;
  background: var(--ivory-50);
  color: var(--ink-900);
}

body {
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', 'Iowan Old Style', serif;
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--gold-600); }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-block: 32px 56px;
}

/* ---------- Hero (nje ya frame - ivory/white kama brief inavyotaka) ---------- */
.hero { text-align: center; }
.eyebrow {
  display: block;
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--burgundy-700);
  font-weight: 600;
  margin-bottom: 16px;
}
.names {
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1.05;
}
.names em {
  font-style: italic;
  color: var(--gold-600);
  font-weight: 500;
  padding: 0 4px;
}
.date-line { margin-top: 14px; font-size: 18px; color: var(--ink-600); }
.venue-line { margin-top: 2px; font-size: 14px; color: var(--ink-600); }
.intro {
  max-width: 52ch;
  margin: 18px auto 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-600);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
  color: var(--gold-500);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.divider .mark { font-size: 13px; }

/* ---------- Wooden frame (Sehemu ya 3: "Wooden frame surrounds the complete
   public pledge card and success card") ---------- */
.frame {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, var(--walnut-700), var(--walnut-800));
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 40px -22px rgba(50, 24, 13, .55);
  position: relative;
}
.frame::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(180, 134, 39, .55);
  border-radius: 12px;
  pointer-events: none;
}
.frame-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  color: var(--gold-500);
  font-size: 14px;
  line-height: 1;
}
.frame-corner.tl { top: 6px; left: 6px; }
.frame-corner.tr { top: 6px; right: 6px; }
.frame-corner.bl { bottom: 6px; left: 6px; }
.frame-corner.br { bottom: 6px; right: 6px; }

.card {
  background: var(--ivory-50);
  border-radius: 10px;
  padding: 28px clamp(18px, 5vw, 32px) 30px;
}

.card-heading { text-align: center; margin-bottom: 8px; }
.card-heading h2 {
  font-size: 28px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--burgundy-700);
}
.card-heading .sub {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--ink-600);
  margin-top: 2px;
}

.pricing-line {
  text-align: center;
  margin: 16px 0 4px;
  font-size: 14px;
  color: var(--ink-900);
}
.pricing-line strong { color: var(--burgundy-700); }
.pricing-help {
  text-align: center;
  margin: 4px 0 22px;
  font-size: 12.5px;
  color: var(--ink-600);
  font-style: italic;
}

/* ---------- Form fields (icons ndani ya input, kama picha iliyoidhinishwa) ---------- */
form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-600);
}
.field .req { color: var(--burgundy-700); margin-left: 2px; }

.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-600);
  pointer-events: none;
  font-size: 15px;
}

input[type="text"], input[type="tel"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink-900);
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px 11px 38px;
}
select { padding-left: 38px; appearance: none; background-position: right 13px center; }
textarea { padding-left: 13px; resize: vertical; min-height: 76px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(180, 134, 39, .22);
}

input[readonly] { color: var(--ink-600); background: var(--ivory-200); }

.field-error {
  font-size: 12.5px;
  color: var(--burgundy-800);
}

.submit-btn {
  margin-top: 4px;
  background: var(--burgundy-700);
  color: var(--ivory-50);
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
}
.submit-btn:hover { background: var(--burgundy-800); }
.submit-btn:disabled { opacity: .6; cursor: default; }

.form-level-error {
  background: var(--ivory-200);
  border: 1px solid var(--line);
  color: var(--burgundy-800);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
}

/* ---------- Success card ---------- */
.status-badge {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--burgundy-700);
  color: var(--ivory-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 18px;
}
.success-heading { text-align: center; }
.success-heading .label {
  display: block;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--burgundy-700);
  font-weight: 600;
  margin-bottom: 14px;
}
.success-heading h1 { font-size: 30px; color: var(--burgundy-700); }
.success-heading p { margin-top: 8px; font-size: 14.5px; color: var(--ink-600); }

.summary-list { display: flex; flex-direction: column; gap: 0; margin: 22px 0; }
.summary-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .ic {
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--ivory-200); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex: none;
}
.summary-row .meta .k { font-size: 12px; color: var(--ink-600); }
.summary-row .meta .v { font-size: 16px; font-weight: 600; color: var(--ink-900); }

.payment-box {
  background: var(--ivory-100);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-top: 8px;
}
.payment-box h3 { text-align: center; font-size: 18px; margin-bottom: 12px; }
.payment-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.payment-item + .payment-item { border-top: 1px dashed var(--line); }
.payment-item .tile {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--ivory-200); color: var(--gold-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex: none;
}
.payment-item .name { font-weight: 600; }
.payment-item .sub { font-size: 12.5px; color: var(--ink-600); }
.payment-item .number { font-family: 'Cormorant Garamond', serif; font-size: 19px; color: var(--burgundy-700); }

.action-btn {
  display: block; width: 100%;
  text-align: center;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 10px;
  border: 1px solid var(--burgundy-700);
  cursor: pointer;
  font-family: inherit;
}
.action-btn.solid { background: var(--burgundy-700); color: var(--ivory-50); }
.action-btn.outline { background: transparent; color: var(--burgundy-700); }

.footnote { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--ink-600); font-style: italic; }

footer.page-footer {
  text-align: center;
  margin-top: 36px;
  font-size: 12.5px;
  color: var(--ink-600);
  line-height: 1.8;
}

/* =====================================================================
 * VISUAL REFRESH - "app shell" ya Login/Dashboard ya kamati (Gate B,
 * baada ya PM kutuma mockup ya sidebar-based dashboard na kuomba redesign
 * "ifuate kwa karibu iwezekanavyo"). Ukurasa wa umma wa Gate A (pledge
 * form/success) HAUKUGUSWA - unaendelea kutumia .wrap/.frame/.card hapo
 * juu bila mabadiliko.
 * ===================================================================== */

:root {
  --sidebar-w: 236px;
}

/* ---------- App shell (sidebar + main) ---------- */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  margin: 0 -20px;
}

.sidebar {
  flex: none;
  width: var(--sidebar-w);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, var(--walnut-700), var(--walnut-800));
  color: var(--ivory-100);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand { text-align: center; margin-bottom: 18px; }
.sidebar-mark { color: var(--gold-500); font-size: 20px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 9px;
  color: rgba(253, 248, 238, .82);
  text-decoration: none;
  font-size: 14.5px;
  position: relative;
}
.nav-item .nav-ic { flex: none; display: flex; }
.nav-item .nav-label { flex: 1; }
.nav-item.active {
  background: var(--burgundy-700);
  color: var(--ivory-50);
  font-weight: 600;
}
.nav-item:not(.active):hover { background: rgba(253, 248, 238, .1); color: var(--ivory-100); }
.nav-item.soon {
  color: rgba(253, 248, 238, .6);
}
.nav-item.soon.active {
  background: rgba(253, 248, 238, .1);
  color: var(--ivory-100);
}
.soon-pill {
  font-size: 9.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(253, 248, 238, .12);
  color: rgba(253, 248, 238, .65);
  padding: 2px 6px;
  border-radius: 999px;
  flex: none;
}

.sidebar-tagline {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--gold-500);
  line-height: 1.5;
  margin-top: 18px;
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 24px clamp(16px, 3vw, 36px) 56px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.topbar-title h1 { font-size: clamp(24px, 4vw, 32px); }
.topbar-title h1 .amp { color: var(--gold-600); font-style: italic; }
.topbar-date { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-600); }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { flex: none; }
.btn-outline-gold { background: transparent; border: 1px solid var(--line); color: var(--burgundy-700); }
.btn-maroon { background: var(--burgundy-700); border: 1px solid var(--burgundy-700); color: var(--ivory-50); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; }

.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--ivory-100);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  cursor: pointer;
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 30px -14px rgba(50, 24, 13, .4);
  padding: 12px;
  min-width: 200px;
  z-index: 20;
}
.user-menu-fullname { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.user-menu-logout {
  width: 100%;
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: transparent;
  border: 1px solid var(--burgundy-700);
  color: var(--burgundy-700);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Welcome row ---------- */
.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.welcome-row h2 { font-size: 22px; color: var(--ink-900); }
.welcome-row p { margin-top: 4px; font-size: 14px; color: var(--ink-600); }
.welcome-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--gold-600);
  text-align: right;
  max-width: 30ch;
}

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-ic {
  width: 42px; height: 42px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ivory-50);
  flex: none;
}
.stat-ic.tone-burgundy { background: var(--burgundy-700); }
.stat-ic.tone-success { background: var(--success); }
.stat-ic.tone-gold { background: var(--gold-500); }
.stat-ic.tone-walnut { background: var(--walnut-700); }
.stat-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-k { font-size: 12.5px; color: var(--ink-600); }
.stat-v { font-size: 19px; font-weight: 700; color: var(--ink-900); }
.stat-v small { font-size: 12px; font-weight: 500; color: var(--ink-600); }

/* ---------- Progress ---------- */
.progress-section {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin-bottom: 24px;
}
.progress-box {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}
.progress-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.progress-heading h3 { font-size: 18px; }
.progress-pct { font-size: 13.5px; font-weight: 600; color: var(--gold-600); }
.progress-track {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: var(--ivory-200);
  overflow: hidden;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-600), var(--gold-500)); border-radius: 999px; }
.progress-caption { margin-top: 8px; font-size: 12.5px; color: var(--ink-600); }

.days-card {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.days-ic {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--ivory-200); color: var(--burgundy-700);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

/* ---------- Pledges table ---------- */
.pledges-panel {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.pledges-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.pledges-heading h2 { font-size: 19px; }
.disabled-link { font-size: 13px; color: var(--ink-600); cursor: default; }
.empty-note { font-size: 13.5px; color: var(--ink-600); font-style: italic; }

.table-scroll { overflow-x: auto; }
.pledges-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.pledges-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-600);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.pledges-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink-900); vertical-align: middle; }
.pledges-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: '\25CF'; margin-right: 5px; font-size: 9px; }
.badge-amekamilisha { background: rgba(47, 125, 59, .12); color: var(--success); }
.badge-amelipa_sehemu { background: rgba(183, 131, 31, .14); color: var(--partial); }
.badge-hajaanza { background: rgba(122, 27, 46, .1); color: var(--pending); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tip banner ---------- */
.tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--ivory-100);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.tip-ic { color: var(--gold-600); flex: none; margin-top: 2px; }
.tip-body { flex: 1; font-size: 13px; color: var(--ink-600); }
.tip-body strong { color: var(--ink-900); }
.tip-body p { margin: 2px 0 0; }
.tip-close {
  background: none; border: none; cursor: pointer;
  color: var(--ink-600); font-size: 18px; line-height: 1; flex: none;
}

/* ---------- Coming soon placeholder ---------- */
.coming-soon-panel {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto 0;
}
.coming-soon-ic { color: var(--gold-600); display: flex; justify-content: center; margin-bottom: 14px; }
.coming-soon-panel h2 { font-size: 22px; color: var(--burgundy-700); }
.coming-soon-panel p { margin: 10px 0 20px; font-size: 14px; color: var(--ink-600); }

/* ---------- Login split screen ---------- */
.login-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 100vh;
  margin: 0 -20px;
}

.login-hero {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, var(--walnut-700), var(--walnut-800));
  color: var(--ivory-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: 4px;
  position: relative;
}
.login-hero-mark { color: var(--gold-500); font-size: 20px; }
.login-hero-mark.bottom { margin-top: 18px; }
.login-hero-emblem { font-size: 34px; margin: 10px 0; }
.login-hero h1 { font-size: clamp(30px, 4vw, 42px); color: var(--ivory-50); }
.login-hero h1 .amp { color: var(--gold-500); font-style: italic; }
.login-hero-sub { margin-top: 10px; font-size: 14.5px; color: rgba(253, 248, 238, .78); line-height: 1.6; }
.login-hero-tagline { margin-top: 14px; font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--gold-500); font-size: 15px; }

.login-card-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--ivory-50);
}
.login-card { width: 100%; max-width: 380px; }
.login-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--burgundy-700);
  font-weight: 600;
  margin-bottom: 8px;
}
.login-card h2 { font-size: 30px; }
.login-intro { margin-top: 8px; margin-bottom: 20px; font-size: 13.5px; color: var(--ink-600); line-height: 1.6; }

.input-icon { position: relative; }
.input-icon .icon svg { display: block; }
.input-toggle {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-600);
  cursor: pointer;
  display: flex;
  padding: 2px;
}
#password { padding-right: 40px; }

.login-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  margin-top: -4px;
}
.login-forgot {
  color: var(--gold-600);
  font-weight: 600;
  text-decoration: none;
}
.login-forgot[href]:hover { text-decoration: underline; }

.submit-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }

.login-footnote { margin-top: 22px; font-size: 12px; color: var(--ink-600); text-align: center; }
.login-contact {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--burgundy-700);
  font-weight: 600;
  text-decoration: none;
}
.login-contact[href]:hover { text-decoration: underline; }
.login-contact.login-contact-static { cursor: default; }

/* ---------- Responsive: mobile (sidebar -> top icon strip, single column) ---------- */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; margin: 0 -20px; }
  .sidebar {
    width: auto;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 10px 8px;
    overflow-x: auto;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; flex: 1; gap: 2px; }
  .nav-item { flex-direction: column; gap: 3px; padding: 7px 9px; font-size: 10.5px; text-align: center; }
  .nav-item .nav-label { flex: none; }
  .soon-pill { display: none; }
  .sidebar-tagline { display: none; }

  .main-area { padding: 18px 14px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-section { grid-template-columns: 1fr; }
  .welcome-quote { text-align: left; max-width: none; }
  .topbar-actions .btn span, .topbar-actions .btn { font-size: 12px; }

  .login-split { grid-template-columns: 1fr; }
  .login-hero { padding: 32px 20px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Success celebration (confetti ya gold) ----------
 * PM review: micro-interaction moja tu baada ya ahadi mpya kutumwa, kwenye
 * ukurasa wa "public/success". Angalia public/assets/js/success.js kwa
 * mantiki - CSS hii inatoa TU chombo (layer) na muonekano wa kila kipande,
 * mwendo (transform/opacity) unadhibitiwa na Web Animations API kwenye JS
 * ili kila kipande kiwe na njia tofauti kidogo (random) bila kuandika
 * madarasa mengi ya @keyframes.
 *
 * MUHIMU: layer ni "position: fixed; inset: 0; pointer-events: none;" hivyo
 * KAMWE haiwezi kuzuia copy/payment/WhatsApp buttons - watumiaji wanaweza
 * kubofya "kupitia" confetti wakati wote.
 */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 2px;
  will-change: transform, opacity;
}

/* Reduced-motion fallback: JS haitengenezi confetti hata kidogo - badala
 * yake inaongeza darasa hili kwa muda mfupi (kupitia setTimeout, siyo CSS
 * transition/animation) ili kuepuka kabisa kanuni ya jumla ya
 * "prefers-reduced-motion" hapo juu inayolazimisha muda wa animation kuwa
 * .001ms - hapa hakuna animation kabisa, ni glow tuli inayoonekana/kutoweka
 * kwa muda uliopangwa na JavaScript. */
.status-badge-glow {
  box-shadow:
    0 0 0 10px rgba(180, 134, 39, 0.32),
    0 0 26px 8px rgba(212, 175, 55, 0.55);
}

/* ---------- Slice 2: Malipo (Payment Recording + Full Reversal) ---------- */
.btn-outline-burgundy { background: transparent; border: 1px solid var(--burgundy-700); color: var(--burgundy-700); }
.btn-outline-burgundy:hover { background: rgba(122, 27, 46, .06); }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-heading h1 { font-size: 24px; color: var(--ink-900); }
.page-heading p { margin-top: 4px; font-size: 13.5px; color: var(--ink-600); }

.page-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
}
.page-banner-success { background: rgba(47, 125, 59, .1); color: var(--success); border: 1px solid rgba(47, 125, 59, .25); }
.page-banner-error { background: rgba(122, 27, 46, .08); color: var(--burgundy-800); border: 1px solid var(--line); }

.badge-payment { background: rgba(47, 125, 59, .12); color: var(--success); }
.badge-reversal { background: rgba(122, 27, 46, .1); color: var(--pending); }
.reversed-note { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-600); font-style: italic; }
.amount-negative { color: var(--pending); font-weight: 600; }

/* ---------- Modal (form ya kurekodi malipo / kubatilisha) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 24, 16, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--ivory-50);
  border-radius: 14px;
  padding: 24px clamp(18px, 5vw, 28px) 26px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 24px 60px -20px rgba(42, 24, 16, .55);
}
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.modal-heading h3 { font-size: 18px; color: var(--burgundy-700); }
.modal-close {
  background: none; border: none; cursor: pointer; flex: none;
  color: var(--ink-600); padding: 2px;
}
.modal-sub { font-size: 13px; color: var(--ink-600); margin-bottom: 16px; }
.modal-box form { gap: 14px; }

.pledge-list-section, .ledger-section {
  background: var(--ivory-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}
.pledge-list-section h2, .ledger-section h2 { font-size: 19px; margin-bottom: 12px; }

.view-only-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-600);
  background: var(--ivory-100);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

/* Gate B Slice 3 (Branded WhatsApp Reports) - rangi zote kutoka tokens zilizopo hapo juu, hakuna mpya. */
.report-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.report-status {
  font-size: 13px;
  color: var(--ink-600);
}
.report-status-error { color: var(--burgundy-700); font-weight: 600; }

.report-pages {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 26px;
}
.report-page-card {
  background: var(--ivory-100);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  /* P1 (UI fix, round 3 - PM review): preview bado ilikuwa pana zaidi ya
     inavyohitajika hata baada ya round 2 (560px/440px) - imepunguzwa zaidi
     (480px/400px) SAMBAMBA na Canvas kupata dynamic height (angalia
     report-canvas-metrics.js/drawPage()) ili ripoti fupi (wachangiaji
     wachache) isionekane na nafasi tupu isiyo ya lazima. CSS pekee
     (siyo inline style - angalia drawPage()) ndiyo inayodhibiti upana wa
     PREVIEW; Canvas dimensions za NDANI (kwa PNG) hazibadiliki kamwe kwa
     hii - angalia ReportCanvasStyleContractTest. Card iko KATIKATI ya safu
     wima kwa "margin-inline: auto". */
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}
.report-page-canvas {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(42, 24, 16, .12);
}
.report-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

@media (max-width: 560px) {
  .report-toolbar { flex-direction: column; align-items: stretch; }
  .report-toolbar .btn { width: 100%; justify-content: center; }

  /* P1 (UI fix): kwenye mobile, preview ijaze nafasi inayopatikana bila
     overflow ya horizontal (siyo ibaki ikilazimishwa kwenye upana wa
     480px/400px wa desktop). */
  .report-page-card {
    max-width: 100%;
    padding: 10px;
  }

  .report-page-canvas {
    max-width: 100%;
  }
}
