/* BRAND PALETTE (Rwanda flag / Violette Foundation) */

:root {
    --brand-blue: #00a1de;   /* sky blue */
    --brand-yellow: #fad201; /* flag yellow */
    --brand-green: #1e7145;  /* flag green */
    --brand-red: #c1272d;    /* banner red */
    --brand-navy: #1a2e8f;   /* logo deep blue */
    --brand-gold: #e8a020;   /* logo title gold */
}

/* BRAND LOGO IN NAVBAR */

.brand-logo {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
    border: 2px solid var(--brand-yellow);
}

/* GLOBAL */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: white;
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-weight: 800;
    letter-spacing: -2px;
}

p {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* NAVBAR */

.custom-navbar {
    background: transparent;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: background-color 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}

/* Home navbar turns solid once the user scrolls past the hero top */
.custom-navbar.scrolled {
    background: var(--brand-navy);
    padding: 0.75rem 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.navbar-brand {
    font-size: 2rem;
    font-weight: 800;
    color: white !important;
}

.nav-link {
    color: white !important;
    margin-left: 1rem;
    font-weight: 600;
}

/* HERO SECTION */

.hero-section {
    position: relative;
    min-height: 100vh;

    background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));

    background-size: cover;
    background-position: center;

    display: flex;
    align-items: center;
    text-align: center;

    padding: 6rem 1rem;
}

.hero-section .container {
    max-width: 1000px;
}

.hero-section h1 {
    font-size: clamp(2.4rem, 9vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.98;
    margin-bottom: 2rem;
    overflow-wrap: break-word;
}

.hero-section p {
    font-size: 1.5rem;
    color: var(--brand-yellow);
    font-weight: 600;
    margin-bottom: 2rem;
}

.feature-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    min-height: 5rem;
}
.team-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem auto;
    display: block;
    border: 4px solid var(--brand-navy);
}
/* BUTTONS */

.btn-primary {
    background: white;
    color: var(--brand-navy);
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: 700;
    transition: 0.3s ease;
}

.btn-primary:hover {
    background: var(--brand-yellow);
    color: var(--brand-navy);
    transform: translateY(-2px);
}
/* Interior pages: navbar sits in flow but sticks to the top while scrolling */
.custom-navbar.solid {
    background: var(--brand-navy);
    position: sticky;
    top: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* FEATURES */

.feature-card {
    background: white;
    color: var(--brand-navy);
    border-radius: 25px;
    padding: 3rem 2rem;
    text-align: center;
    height: 100%;
    transition: 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* MAIN CONTENT SECTION */

main section.container {
    color: #111;
}

/* FOOTER */

.site-footer {
    background: var(--brand-green);
    text-align: center;
    padding: 5rem 1rem;
}

.site-footer h5 {
    font-size: 3rem;
    font-weight: 900;
}

.site-footer p {
    color: var(--brand-yellow);
    margin: 1rem 0;
}

.site-footer small {
    color: white;
}

/* ORG CHART */

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-top {
    width: 100%;
    max-width: 320px;
    margin-bottom: 0;
}

.org-connector-vertical {
    width: 4px;
    height: 50px;
    background: var(--brand-navy);
}

.org-connector-horizontal {
    width: 75%;
    height: 4px;
    background: var(--brand-navy);
}

.org-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1.5rem;
}

.org-branch {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-stem {
    width: 4px;
    height: 50px;
    background: var(--brand-navy);
}

.org-card {
    width: 100%;
}

@media (max-width: 768px) {
    .org-connector-horizontal {
        display: none;
    }
    .org-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    .org-stem {
        height: 30px;
    }
}

/* ============================================================
   MOBILE POLISH (phones)
   ============================================================ */
@media (max-width: 768px) {
    /* Navbar: shrink brand so the menu button fits */
    .navbar-brand { font-size: 1.15rem; }
    .brand-logo { width: 38px; height: 38px; margin-right: 0.5rem; }
    .custom-navbar { padding: 0.85rem 0; }
    .btn-donate { padding: 0.45rem 1.1rem; }

    /* Hero: fit the headline, ease the height, stack buttons full-width */
    .hero-section {
        min-height: auto;
        padding: 6rem 1.25rem 4rem;
    }
    .hero-section h1 { letter-spacing: -1px; }
    .hero-section p { font-size: 1.15rem; margin-bottom: 1.5rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }

    /* Tighter section rhythm on small screens */
    .section-lg { padding: 3.5rem 0; }
    .impact-band { padding: 3.5rem 1rem; }
    .impact-title { font-size: 2rem; }
    .impact-sub { margin-bottom: 2rem; }

    /* Headings: less aggressive negative tracking at small sizes */
    h1, h2, h3, h4, h5 { letter-spacing: -0.5px; }
}

/* ============================================================
   PREMIUM SCROLL SYSTEM
   ============================================================ */

/* Scroll progress indicator (top of viewport) */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    z-index: 2000;
    background: linear-gradient(90deg, var(--brand-yellow), var(--brand-green));
    transition: width 0.08s linear;
    pointer-events: none;
}

/* Generous, consistent vertical rhythm between sections */
.section-lg {
    padding: 6rem 0;
}

/* --- Scroll-triggered reveals (only active when JS is present) --- */
.js .reveal {
    opacity: 0;
    transform: translateY(42px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal.from-left  { transform: translateX(-52px); }
.js .reveal.from-right { transform: translateX(52px); }

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger children within a group */
.js .reveal.delay-1 { transition-delay: 0.12s; }
.js .reveal.delay-2 { transition-delay: 0.24s; }
.js .reveal.delay-3 { transition-delay: 0.36s; }

/* --- Hero entrance: staggered fade-up of the headline stack --- */
.hero-section h1 {
    animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-section p {
    animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.hero-section .btn {
    animation: fade-up 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Container that JS parallax-shifts on scroll — no transition so it tracks smoothly */
.hero-section .container {
    will-change: transform, opacity;
}

/* --- Respect users who prefer reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .js .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .hero-section h1,
    .hero-section p,
    .hero-section .btn {
        animation: none;
    }

    .scroll-progress { display: none; }
}

/* ============================================================
   ADMIN AUTH (split-screen) + DASHBOARD
   ============================================================ */

.auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 90px);
    padding: 3rem 1rem;
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 920px;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(26, 46, 143, 0.18);
}

.auth-brand {
    flex: 1 1 44%;
    background: linear-gradient(150deg, var(--brand-navy), var(--brand-blue));
    color: #fff;
    padding: 3.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.auth-brand img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--brand-yellow);
    margin-bottom: 1.5rem;
}

.auth-brand h2 { font-size: 1.8rem; margin: 0 0 0.5rem; }
.auth-brand p { color: var(--brand-yellow); font-weight: 600; margin: 0; }

.auth-form {
    flex: 1 1 56%;
    padding: 3.5rem 3rem;
    color: var(--brand-navy);
}

.auth-form h2 { margin-bottom: 0.35rem; }
.auth-form .auth-sub {
    color: #7a7a7a;
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: normal;
}

.auth-form .form-control {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.auth-alt {
    margin-top: 1.5rem;
    text-align: center;
    color: #7a7a7a;
    font-size: 0.95rem;
}
.auth-alt a { color: var(--brand-navy); font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .auth-card { flex-direction: column; max-width: 460px; }
    .auth-brand { padding: 2.5rem 1.5rem; }
    .auth-brand img { width: 84px; height: 84px; }
    .auth-form { padding: 2.5rem 1.75rem; }
}

/* --- Dashboard --- */

.dash-header h1 { color: var(--brand-navy); margin-bottom: 0.25rem; }
.dash-user {
    color: #7a7a7a;
    letter-spacing: normal;
    font-weight: 400;
    margin-bottom: 2.5rem;
}
.dash-user strong { color: var(--brand-navy); }

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #8a8a8a;
    margin-bottom: 0.35rem;
}
.stat-value {
    font-size: 2.3rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -1px;
}

.text-donations { color: var(--brand-green) !important; }
.text-expenses  { color: var(--brand-red) !important; }
.text-navy      { color: var(--brand-navy) !important; }

.dash-card h3 {
    font-size: 1.3rem;
    color: var(--brand-navy);
    letter-spacing: -0.5px;
    margin-bottom: 1.25rem;
}

.dash-table { color: var(--brand-navy); }
.dash-table thead th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a8a8a;
    border-bottom: 2px solid rgba(26, 46, 143, 0.12);
}
.dash-empty { color: #8a8a8a; letter-spacing: normal; }

.btn-delete {
    color: var(--brand-red);
    border: none;
    background: none;
    padding: 0 0.4rem;
    font-weight: 700;
    line-height: 1;
}
.btn-delete:hover { color: #8f1d22; }

.upload-list { padding-left: 1.1rem; }
.upload-list a { color: var(--brand-navy); }

/* --- Dashboard tabs --- */
.dash-role {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(26, 46, 143, 0.1);
    color: var(--brand-navy);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.dash-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid rgba(26, 46, 143, 0.12);
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
    flex: 0 0 auto;
    border: none;
    background: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #8a8a8a;
    letter-spacing: normal;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.dash-tab:hover { color: var(--brand-navy); }
.dash-tab.is-active {
    color: var(--brand-navy);
    border-bottom-color: var(--brand-navy);
}
.dash-tab:focus-visible {
    outline: 3px solid var(--card-focus, #1b6ef3);
    outline-offset: 2px;
    border-radius: 6px;
}

.dash-panel { display: none; }
.dash-panel.is-active {
    display: block;
    animation: dash-fade 0.3s ease;
}
.dash-panel:focus { outline: none; }

@keyframes dash-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Settings account info */
.dash-info { margin: 0; }
.dash-info > div {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(26, 46, 143, 0.08);
}
.dash-info dt { color: #8a8a8a; font-weight: 600; margin: 0; letter-spacing: normal; }
.dash-info dd { color: var(--brand-navy); font-weight: 700; margin: 0; }

.dash-time { color: #8a8a8a; font-size: 0.85rem; letter-spacing: normal; }

.dash-form .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-navy);
    margin-bottom: 0.3rem;
    letter-spacing: normal;
}

@media (prefers-reduced-motion: reduce) {
    .dash-panel.is-active { animation: none; }
}

/* --- Table tools: search / date filter / sort --- */
.table-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.25rem;
}
.table-tools .tt-search { flex: 1 1 200px; min-width: 150px; }
.table-tools .tt-from,
.table-tools .tt-to { flex: 0 0 auto; width: auto; }
.table-tools .ui-card__btn { margin-left: auto; white-space: nowrap; }

.dash-table th.tt-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.dash-table th.tt-sort::after { content: "↕"; opacity: 0.35; margin-left: 0.35rem; font-size: 0.8em; }
.dash-table th.tt-sort.sorted-asc::after  { content: "↑"; opacity: 1; }
.dash-table th.tt-sort.sorted-desc::after { content: "↓"; opacity: 1; }
.dash-table th.tt-sort:hover { color: var(--brand-navy); }

.btn-icon {
    border: none;
    background: none;
    color: var(--brand-navy);
    padding: 0 0.4rem;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.btn-icon:hover { color: var(--brand-blue); }

.tt-count { margin-top: 0.75rem; font-size: 0.85rem; }

/* --- Lightweight modal (theme-aware via card tokens) --- */
.ui-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ui-modal[hidden] { display: none; }
.ui-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 64, 0.55);
    animation: modal-fade 0.15s ease;
}
.ui-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: var(--card-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    padding: 1.75rem;
    animation: modal-pop 0.18s ease;
}
.ui-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.ui-modal__head h3 {
    margin: 0;
    color: var(--card-title);
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}
.ui-modal__close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--card-muted);
}
.ui-modal__close:hover { color: var(--brand-red); }
.ui-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .ui-modal__backdrop,
    .ui-modal__dialog { animation: none; }
}

/* --- Fundraising goal progress --- */
.goal-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.goal-season {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-blue);
    margin: 0 0 0.5rem;
}
.goal-current { font-size: 1.6rem; font-weight: 800; }
.goal-target { color: var(--card-muted); font-weight: 500; }
.goal-pct { margin-left: auto; font-weight: 800; color: var(--brand-navy); }
.goal-bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(26, 46, 143, 0.1);
    overflow: hidden;
}
.goal-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-blue));
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Student status badges --- */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-active { background: rgba(30, 113, 69, 0.14); color: var(--brand-green); }
.status-graduated { background: rgba(0, 161, 222, 0.16); color: #0a6aa1; }
.status-paused { background: rgba(193, 39, 45, 0.12); color: var(--brand-red); }

/* Period summary toggle + figures */
.period-toggle {
    display: inline-flex;
    gap: 0.25rem;
    background: rgba(26, 46, 143, 0.07);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
}
.period-btn {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--brand-navy);
    text-decoration: none;
    letter-spacing: normal;
}
.period-btn.is-active { background: var(--brand-navy); color: #fff; }
.period-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
}
.period-figures > div { display: flex; flex-direction: column; }
.period-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.period-lbl { font-size: 0.82rem; color: var(--card-muted); font-weight: 600; margin-top: 0.2rem; letter-spacing: normal; }

/* Per-student funding mini-bar */
.fund-bar {
    height: 7px;
    border-radius: 999px;
    background: rgba(26, 46, 143, 0.12);
    overflow: hidden;
    margin-bottom: 0.25rem;
}
.fund-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-blue));
}
.fund-bar__fill.over { background: var(--brand-red); }

.budget-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.budget-form .form-control { flex: 1 1 180px; width: auto; }

/* View-only role */
.readonly-banner {
    background: rgba(0, 161, 222, 0.12);
    border: 1px solid rgba(0, 161, 222, 0.3);
    color: #0a6aa1;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: normal;
}
/* Hide every mutating control for viewers (server also blocks them) */
.viewer-mode .dash-form,
.viewer-mode .budget-form,
.viewer-mode .tt-edit,
.viewer-mode .btn-delete,
.viewer-mode .table-tools .ui-card__btn {
    display: none !important;
}
.fund-pct { font-size: 0.78rem; font-weight: 700; color: var(--brand-navy); letter-spacing: normal; }

/* Student profile page */
.student-link { color: var(--brand-navy); font-weight: 700; text-decoration: none; }
.student-link:hover { text-decoration: underline; }
.profile-back { display: inline-block; color: var(--brand-navy); font-weight: 600; text-decoration: none; margin-bottom: 1rem; letter-spacing: normal; }
.profile-back:hover { text-decoration: underline; }
.profile-head { margin-bottom: 2rem; }
.profile-head h1 { color: var(--brand-navy); margin-bottom: 0.25rem; }
.profile-sub { color: #555; font-size: 1.1rem; letter-spacing: normal; }

/* Student tag in the expenses table */
.student-tag {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 161, 222, 0.14);
    color: #0a6aa1;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: normal;
}

@media (prefers-reduced-motion: reduce) {
    .goal-bar__fill { transition: none; }
}

/* --- Recent activity feed --- */
.activity-feed {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}
.activity-feed li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(26, 46, 143, 0.08);
}
.activity-feed li:last-child { border-bottom: none; }
.activity-action { color: var(--brand-navy); font-weight: 600; }
.activity-meta {
    color: #8a8a8a;
    font-size: 0.82rem;
    white-space: nowrap;
    letter-spacing: normal;
}

/* ============================================================
   PUBLIC SITE — Donate button, impact band, donate page
   ============================================================ */

/* Donate button (navbar + hero + donate page) */
.btn-donate {
    display: inline-block;
    background: var(--brand-yellow);
    color: var(--brand-navy) !important;
    font-weight: 800;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    text-decoration: none;
    border: none;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-donate:hover {
    background: #ffdd33;
    color: var(--brand-navy) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.btn-donate.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* Hero action row */
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Impact stats band */
.impact-band {
    background: var(--brand-navy);
    color: #fff;
    padding: 5rem 1rem;
    text-align: center;
}
.impact-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 0.5rem; }
.impact-sub {
    color: var(--brand-yellow);
    font-weight: 600;
    max-width: 640px;
    margin: 0 auto 3rem;
}
.impact-stat { display: flex; flex-direction: column; align-items: center; }
.impact-num {
    font-size: clamp(2.8rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1;
    color: var(--brand-yellow);
    letter-spacing: -2px;
}
.impact-label {
    margin-top: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
}
.impact-breakdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}
.impact-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: normal;
}
.impact-chip strong { color: var(--brand-yellow); font-weight: 800; }

/* News (public) */
.news-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.news-date { color: var(--card-muted); font-size: 0.85rem; margin: 0.2rem 0 0.75rem; letter-spacing: normal; }
.news-body { white-space: pre-line; color: #333; }

/* Gallery (public) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.gallery-item {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(16, 24, 64, 0.1);
}
.gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-item figcaption { padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--brand-navy); font-weight: 600; }

/* Gallery (admin management) */
.gallery-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.gallery-admin-item { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: #f1f3f8; }
.gallery-admin-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.gallery-admin-item figcaption { padding: 0.3rem 0.5rem; font-size: 0.75rem; color: var(--card-muted); letter-spacing: normal; }
.gallery-admin-item form { position: absolute; top: 4px; right: 4px; margin: 0; }
.gallery-admin-item .btn-delete {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    width: 26px; height: 26px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* News (admin management) */
.news-admin { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.news-admin li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(26, 46, 143, 0.08);
}
.news-admin li:last-child { border-bottom: none; }
.news-admin form { margin: 0; }

/* Newsletter form (footer) */
.newsletter-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 460px;
    margin: 1.5rem auto;
}
.newsletter-form .form-control {
    flex: 1 1 220px;
    width: auto;
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.25rem;
}

/* Donate page */
.donate-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.donate-head h1 { color: var(--brand-navy); }
.donate-head p { color: #444; font-size: 1.2rem; }
.donate-goal { max-width: 720px; margin: 0 auto 1rem; }
.donate-amounts { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.25rem 0; }
.donate-amount {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.9rem 1rem;
    border: 2px solid var(--brand-navy);
    border-radius: 12px;
    color: var(--brand-navy);
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.donate-amount:hover { background: var(--brand-navy); color: #fff; }
.donate-list { padding-left: 1.1rem; color: #333; line-height: 2; }
.donate-list strong { color: var(--brand-navy); }
.donate-note { font-size: 0.9rem; color: #777; margin-top: 1rem; }

/* ============================================================
   TOASTS + ERROR PAGES
   ============================================================ */

/* Flash toasts */
.toast-stack {
    position: fixed;
    top: 5.5rem;
    right: 1.25rem;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(360px, calc(100vw - 2rem));
}
.toast-msg {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff;
    color: #16204a;
    box-shadow: 0 10px 30px rgba(16, 24, 64, 0.18);
    border-left: 4px solid var(--brand-green);
    font-weight: 600;
    letter-spacing: normal;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-msg.toast-error { border-left-color: var(--brand-red); }
.toast-icon {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 0.8rem;
    color: #fff;
    background: var(--brand-green);
}
.toast-error .toast-icon { background: var(--brand-red); }
.toast-text { flex: 1 1 auto; font-size: 0.92rem; }
.toast-close {
    flex: 0 0 auto;
    border: none; background: none; cursor: pointer;
    color: #9aa0b0; font-size: 0.9rem; line-height: 1;
}
.toast-close:hover { color: #16204a; }
.toast-msg.toast-hide { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }

@media (prefers-reduced-motion: reduce) {
    .toast-msg, .toast-msg.toast-hide { animation: none; }
}

/* Error pages (404 / 500) */
.error-page { text-align: center; }
.error-page .error-code {
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -4px;
    color: var(--brand-navy);
    opacity: 0.15;
}
.error-page h1 { color: var(--brand-navy); margin-top: -0.5rem; }
.error-page p { color: #555; font-size: 1.15rem; margin-bottom: 2rem; }

/* ============================================================
   REUSABLE CARD COMPONENT (.ui-card)
   Theme-aware (light + dark), accessible, responsive.
   Namespaced to avoid clashing with Bootstrap's .card.
   ============================================================ */

/* --- Design tokens: light (default) --- */
:root {
    --card-bg: #ffffff;
    --card-border: rgba(26, 46, 143, 0.10);
    --card-shadow: 0 2px 10px rgba(16, 24, 64, 0.06);
    --card-shadow-hover: 0 16px 38px rgba(16, 24, 64, 0.16);
    --card-title: #16204a;
    --card-text: #4b5266;
    --card-muted: #838aa0;
    --card-icon-bg: rgba(0, 161, 222, 0.12);
    --card-icon-fg: var(--brand-navy);
    --card-focus: #1b6ef3;
    --card-skeleton: rgba(16, 24, 64, 0.09);
    --card-skeleton-sheen: rgba(255, 255, 255, 0.6);
    --card-radius: 20px;
}

/* --- Design tokens: dark (system preference) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: #161b28;
        --card-border: rgba(255, 255, 255, 0.09);
        --card-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
        --card-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.65);
        --card-title: #f4f6fb;
        --card-text: #c2c8d6;
        --card-muted: #868da0;
        --card-icon-bg: rgba(0, 161, 222, 0.20);
        --card-icon-fg: #64c4ef;
        --card-focus: #6ba7ff;
        --card-skeleton: rgba(255, 255, 255, 0.08);
        --card-skeleton-sheen: rgba(255, 255, 255, 0.16);
    }
}

/* --- Explicit theme override (wins over system in both directions) --- */
[data-theme="dark"] {
    --card-bg: #161b28;
    --card-border: rgba(255, 255, 255, 0.09);
    --card-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.65);
    --card-title: #f4f6fb;
    --card-text: #c2c8d6;
    --card-muted: #868da0;
    --card-icon-bg: rgba(0, 161, 222, 0.20);
    --card-icon-fg: #64c4ef;
    --card-focus: #6ba7ff;
    --card-skeleton: rgba(255, 255, 255, 0.08);
    --card-skeleton-sheen: rgba(255, 255, 255, 0.16);
}
[data-theme="light"] {
    --card-bg: #ffffff;
    --card-border: rgba(26, 46, 143, 0.10);
    --card-shadow: 0 2px 10px rgba(16, 24, 64, 0.06);
    --card-shadow-hover: 0 16px 38px rgba(16, 24, 64, 0.16);
    --card-title: #16204a;
    --card-text: #4b5266;
    --card-muted: #838aa0;
    --card-icon-bg: rgba(0, 161, 222, 0.12);
    --card-icon-fg: var(--brand-navy);
    --card-focus: #1b6ef3;
    --card-skeleton: rgba(16, 24, 64, 0.09);
    --card-skeleton-sheen: rgba(255, 255, 255, 0.6);
}

/* --- Base card --- */
.ui-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--card-bg);
    color: var(--card-text);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    height: 100%;
    text-decoration: none;
    letter-spacing: normal;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.ui-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.ui-card__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--card-icon-bg);
    color: var(--card-icon-fg);
}
.ui-card__icon svg { width: 22px; height: 22px; }

.ui-card__heading { flex: 1 1 auto; min-width: 0; }

.ui-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--card-title);
    /* graceful wrapping for long titles */
    overflow-wrap: anywhere;
}

.ui-card__desc {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--card-muted);
    font-weight: 400;
}

.ui-card__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--card-title);
    overflow-wrap: anywhere;
}

.ui-card__body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--card-text);
}

.ui-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: auto;         /* pins actions to the bottom regardless of body length */
    padding-top: 0.35rem;
}

/* Trend badge (month-over-month) */
.ui-card__trend {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: normal;
}
.ui-card__trend.good { color: var(--brand-green); }
.ui-card__trend.bad  { color: var(--brand-red); }
.ui-card__trend-label { color: var(--card-muted); font-weight: 500; }

/* --- Accent top bars --- */
.ui-card--accent    { border-top: 3px solid var(--brand-navy); }
.ui-card--donations { border-top: 3px solid var(--brand-green); }
.ui-card--expenses  { border-top: 3px solid var(--brand-red); }

/* --- Interactive (hover lift + accessible focus) --- */
.ui-card--interactive { cursor: pointer; color: var(--card-text); }
.ui-card--interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--brand-blue);
}
.ui-card--interactive:focus-visible {
    outline: 3px solid var(--card-focus);
    outline-offset: 2px;
}

/* Visible focus for actionable elements inside any card */
.ui-card a:focus-visible,
.ui-card button:focus-visible,
.ui-card__btn:focus-visible {
    outline: 3px solid var(--card-focus);
    outline-offset: 2px;
}

/* --- Action buttons --- */
.ui-card__btn {
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--card-title);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ui-card__btn:hover {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
}
.ui-card__btn--primary {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
}
.ui-card__btn--primary:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}

/* --- Loading skeleton --- */
.ui-card--loading { pointer-events: none; }
.ui-card--loading .ui-card__title,
.ui-card--loading .ui-card__desc,
.ui-card--loading .ui-card__value,
.ui-card--loading .ui-card__body {
    color: transparent !important;
    min-height: 1em;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        var(--card-skeleton) 25%,
        var(--card-skeleton-sheen) 37%,
        var(--card-skeleton) 63%
    );
    background-size: 400% 100%;
    animation: card-shimmer 1.4s ease infinite;
}
.ui-card--loading .ui-card__icon { background: var(--card-skeleton); color: transparent; }

@keyframes card-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* --- Responsive --- */
@media (max-width: 576px) {
    .ui-card { padding: 1.25rem; }
    .ui-card__value { font-size: 1.7rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .ui-card { transition: none; }
    .ui-card--interactive:hover { transform: none; }
    .ui-card--loading .ui-card__title,
    .ui-card--loading .ui-card__desc,
    .ui-card--loading .ui-card__value,
    .ui-card--loading .ui-card__body { animation: none; }
}
