/* ============================================================
   ChurchHub Design System v2
   ============================================================ */

:root {
    --ch-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    /* Brand (chrome) vs action (CTAs) — keep both in sync via base.html overrides */
    --ch-brand: #0f2942;
    --ch-brand-mid: #1e3a5f;
    --ch-navy: var(--ch-brand);
    --ch-navy-mid: var(--ch-brand-mid);
    --ch-action: #1d4ed8;
    --ch-action-hover: #1e40af;
    --ch-primary: var(--ch-action);
    --ch-primary-hover: var(--ch-action-hover);
    --ch-primary-soft: #eff6ff;
    --ch-accent: #0e7490;
    --ch-accent-soft: #ecfeff;
    --ch-gold: #b45309;
    --ch-gold-soft: #fef3c7;
    --ch-dark: var(--ch-brand);
    --ch-dark-elevated: var(--ch-brand-mid);
    --ch-surface: #f4f7fb;
    --ch-surface-2: #e8edf4;
    --ch-card: #ffffff;
    --ch-border: #dde4ee;
    --ch-border-strong: #c5d0de;
    --ch-text: #0f2942;
    --ch-text-secondary: #475569;
    --ch-muted: #64748b;
    --ch-success: #047857;
    --ch-warning: #b45309;
    --ch-danger: #b91c1c;
    --ch-table-head-bg: var(--ch-brand);
    --ch-table-head-text: #f1f5f9;
    --ch-table-stripe: #f6f9fc;
    --ch-stat-tithe: linear-gradient(135deg, var(--ch-action) 0%, #1e3a8a 100%);
    --ch-stat-combined: linear-gradient(135deg, var(--ch-accent) 0%, #155e75 100%);
    --ch-stat-income: linear-gradient(135deg, var(--ch-success) 0%, #065f46 100%);
    --ch-stat-expense: linear-gradient(135deg, var(--ch-danger) 0%, #991b1b 100%);
    --ch-radius: 14px;
    --ch-radius-sm: 10px;
    --ch-radius-xs: 8px;
    --ch-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --ch-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --ch-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --ch-nav-height: 60px;
    --ch-transition: 0.18s ease;
    --ch-focus-ring: color-mix(in srgb, var(--ch-action) 22%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.app-body {
    font-family: var(--ch-font);
    background:
        radial-gradient(ellipse 120% 80% at 0% -20%, rgba(29, 78, 216, 0.05), transparent 50%),
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(14, 116, 144, 0.05), transparent 45%),
        var(--ch-surface);
    color: var(--ch-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body.app-body.auth-page {
    overflow-x: hidden;
}

/* ── Navbar ── */
.ch-navbar {
    background: linear-gradient(135deg, var(--ch-navy) 0%, var(--ch-navy-mid) 55%, var(--ch-navy) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}

.navbar-menubar {
    min-height: auto;
    padding: 0;
}

/* Navbar shell — use container-fluid + this class; never page-container (v3 column flex) */
.ch-navbar .navbar > .container-fluid.navbar-shell {
    max-width: 1320px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    flex-direction: column;
    align-items: stretch;
}

.navbar-top-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    min-height: 44px;
}

.navbar-top-row .navbar-toggler {
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .ch-navbar .navbar > .container-fluid.navbar-shell {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        padding-left: 1.75rem;
        padding-right: 1.75rem;
        padding-top: 0.35rem;
        padding-bottom: 0;
    }

    .navbar-top-row {
        min-height: 46px;
    }

    .navbar-top-row .navbar-toggler {
        display: none;
    }
}

.ch-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
    margin-right: 0.65rem;
    color: #fff !important;
    text-decoration: none;
    flex-shrink: 1;
    min-width: 0;
    max-width: min(22rem, 46vw);
}

.ch-brand-mark {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--ch-primary), var(--ch-accent));
    border-radius: var(--ch-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.ch-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: var(--ch-radius-xs);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    flex-shrink: 0;
}

.ch-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    line-height: 1.15;
}

.ch-brand-name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-brand-church {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-brand-church--muted {
    color: rgba(255, 255, 255, 0.55);
}

.ch-navbar .navbar-collapse {
    align-items: center;
}

@media (min-width: 992px) {
    .ch-navbar .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex: 0 0 auto;
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        min-width: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0.1rem 0 0.4rem;
        margin-top: 0.15rem;
    }

    .ch-navbar .navbar-nav.nav-primary {
        flex: 0 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.1rem;
        margin: 0 auto;
        min-width: 0;
        width: auto;
    }
}

.ch-navbar .navbar-nav.nav-primary {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
}

.navbar-utilities {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.navbar-utilities .navbar-tools,
.navbar-menubar-end .navbar-tools {
    margin-left: 0;
}

.ch-navbar .navbar {
    min-height: var(--ch-nav-height);
    padding: 0;
    position: relative;
}

.navbar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    text-decoration: none;
    padding: 0.35rem 0;
    flex-shrink: 0;
    min-width: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
}

.brand-church {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-church-switch .form-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.72rem;
    max-width: 140px;
    border-radius: var(--ch-radius-xs);
}

.brand-church-switch .form-select option { color: #000; }

.brand-mark, .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ch-primary), var(--ch-accent));
    border-radius: var(--ch-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.nav-primary {
    gap: 0.15rem;
}

.ch-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem !important;
    border-radius: var(--ch-radius-xs);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--ch-transition), background var(--ch-transition);
}

.ch-navbar .nav-link i { font-size: 1rem; opacity: 0.85; }

.ch-navbar .nav-link:hover,
.ch-navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
}

.ch-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 -2px 0 var(--ch-accent);
}

.ch-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.55rem;
}

.ch-navbar .navbar-toggler-icon {
    filter: invert(1);
}

/* Mega dropdown — compact panels with themed section headers */
.nav-mega {
    border: 1px solid var(--ch-border) !important;
    border-radius: var(--ch-radius-sm) !important;
    padding: 0.65rem 0.85rem !important;
    margin-top: 0.35rem !important;
    background: var(--ch-card) !important;
    box-shadow: var(--ch-shadow-lg) !important;
    min-width: 240px;
}

.nav-mega-links {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

@media (min-width: 992px) {
    .dropdown-mega {
        position: static !important;
    }

    .dropdown-mega .nav-mega--full {
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin-top: 0 !important;
        padding: 0.75rem 1.25rem 0.85rem !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12) !important;
    }

    .nav-mega-inner {
        max-width: 1320px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
    }

    .nav-mega-grid {
        grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
        gap: 0.65rem 1rem;
    }

    .nav-mega-grid--single {
        max-width: 260px;
    }
}

.nav-mega-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.nav-mega-col { min-width: 0; }

.nav-mega-title {
    display: flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 0.3rem;
    padding: 0.28rem 0.45rem;
    border-radius: 4px;
    line-height: 1.2;
    border-left: 3px solid var(--ch-muted);
    background: rgba(100, 116, 139, 0.08);
    color: var(--ch-muted);
}

.nav-mega-col--primary .nav-mega-title { border-left-color: #1d4ed8; background: rgba(29, 78, 216, 0.1); color: #1d4ed8; }
.nav-mega-col--people .nav-mega-title { border-left-color: #0e7490; background: rgba(14, 116, 144, 0.1); color: #0e7490; }
.nav-mega-col--groups .nav-mega-title { border-left-color: #0891b2; background: rgba(8, 145, 178, 0.1); color: #0e7490; }
.nav-mega-col--meetings .nav-mega-title { border-left-color: #7c3aed; background: rgba(124, 58, 237, 0.1); color: #6d28d9; }
.nav-mega-col--records .nav-mega-title { border-left-color: #64748b; background: rgba(100, 116, 139, 0.1); color: #475569; }
.nav-mega-col--accounting .nav-mega-title { border-left-color: #1d4ed8; background: rgba(29, 78, 216, 0.1); color: #1e40af; }
.nav-mega-col--treasury .nav-mega-title { border-left-color: #047857; background: rgba(4, 120, 87, 0.1); color: #047857; }
.nav-mega-col--planning .nav-mega-title { border-left-color: #b45309; background: rgba(180, 83, 9, 0.1); color: #b45309; }
.nav-mega-col--remittance .nav-mega-title { border-left-color: #0284c7; background: rgba(2, 132, 199, 0.1); color: #0369a1; }
.nav-mega-col--payroll .nav-mega-title { border-left-color: #4f46e5; background: rgba(79, 70, 229, 0.1); color: #4338ca; }
.nav-mega-col--assets .nav-mega-title { border-left-color: #ea580c; background: rgba(234, 88, 12, 0.1); color: #c2410c; }
.nav-mega-col--reports .nav-mega-title { border-left-color: #6d28d9; background: rgba(109, 40, 217, 0.1); color: #6d28d9; }
.nav-mega-col--analytics .nav-mega-title { border-left-color: #334155; background: rgba(51, 65, 85, 0.08); color: #334155; }
.nav-mega-col--giving .nav-mega-title { border-left-color: #059669; background: rgba(5, 150, 105, 0.1); color: #047857; }
.nav-mega-col--communications .nav-mega-title { border-left-color: #e11d48; background: rgba(225, 29, 72, 0.08); color: #be123c; }
.nav-mega-col--hierarchy .nav-mega-title { border-left-color: #0f2942; background: rgba(15, 41, 66, 0.08); color: #0f2942; }
.nav-mega-col--onboarding .nav-mega-title { border-left-color: #16a34a; background: rgba(22, 163, 74, 0.1); color: #15803d; }
.nav-mega-col--structure .nav-mega-title { border-left-color: #78716c; background: rgba(120, 113, 108, 0.1); color: #57534e; }
.nav-mega-col--users .nav-mega-title { border-left-color: #2563eb; background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
.nav-mega-col--security .nav-mega-title { border-left-color: #dc2626; background: rgba(220, 38, 38, 0.08); color: #b91c1c; }
.nav-mega-col--calendar .nav-mega-title { border-left-color: #d97706; background: rgba(217, 119, 6, 0.1); color: #b45309; }

.nav-mega-simple { display: flex; flex-direction: column; gap: 0.1rem; min-width: 200px; }

.nav-mega-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.34rem 0.45rem;
    border-radius: 5px;
    color: var(--ch-text) !important;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    transition: background var(--ch-transition), color var(--ch-transition);
}

.nav-mega-link span {
    min-width: 0;
}

.nav-mega-link i {
    color: var(--ch-muted);
    font-size: 0.9rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-mega-link:hover {
    background: var(--ch-primary-soft);
    color: var(--ch-primary) !important;
}

.nav-mega-link:hover i { color: var(--ch-primary); }

.nav-mega-link.active {
    background: var(--ch-primary-soft);
    color: var(--ch-primary) !important;
}

.nav-mega-link.active i { color: var(--ch-primary); }

/* Navbar tools */
.navbar-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.navbar-menubar-end .navbar-tools {
    margin-left: 0;
}

.church-chip {
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.working-day-chip {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--ch-radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.7rem;
    line-height: 1.25;
    min-width: 11.5rem;
    max-width: 16rem;
    text-decoration: none;
}
.working-day-chip--link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.working-day-chip__line {
    display: grid;
    grid-template-columns: 3.4rem 1fr;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.working-day-chip__label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.working-day-chip__value {
    overflow: hidden;
    text-overflow: ellipsis;
}
.working-day-chip__status .working-day-chip__value { font-weight: 600; }
.working-day-chip--open { border-color: rgba(4, 120, 87, 0.55); background: rgba(4, 120, 87, 0.2); }
.working-day-chip--closed { border-color: rgba(180, 83, 9, 0.55); background: rgba(180, 83, 9, 0.18); }
.working-day-chip--unset { border-color: rgba(148, 163, 184, 0.4); }
@media (max-width: 991.98px) {
    .working-day-chip { display: none; }
}

.church-switcher .form-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.78rem;
    max-width: 160px;
    border-radius: var(--ch-radius-xs);
}

.church-switcher .form-select option { color: #000; }

.tool-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ch-radius-xs);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: background var(--ch-transition);
}

.tool-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.tool-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--ch-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.25rem 0.65rem 0.25rem 0.25rem;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--ch-transition);
}

.account-btn:hover { background: rgba(255, 255, 255, 0.12); }

.account-btn::after { margin-left: 0.15rem; }

.account-btn--icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.account-btn--icon::after { display: none; }

.account-avatar, .avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--ch-accent), #0891b2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
}

.nav-account-menu {
    border: 1px solid var(--ch-border) !important;
    border-radius: var(--ch-radius) !important;
    padding: 0.35rem !important;
    min-width: 220px;
    box-shadow: var(--ch-shadow-lg) !important;
}

.nav-account-menu .dropdown-item {
    border-radius: var(--ch-radius-xs);
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-account-menu .dropdown-item.active {
    background: var(--ch-primary-soft);
    color: var(--ch-primary);
}

@media (max-width: 991px) {
    .ch-navbar .navbar-collapse {
        background: var(--ch-dark-elevated);
        margin: 0.5rem 0 0;
        padding: 0.75rem;
        border-radius: var(--ch-radius-sm);
        border: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        flex-basis: 100%;
    }

    .ch-navbar .navbar-nav.nav-primary {
        margin-right: 0;
        margin-bottom: 0;
    }

    .navbar-utilities {
        margin-left: auto;
        flex-shrink: 0;
    }

    .brand-church-switch {
        display: block !important;
        width: 100%;
        margin-top: 0;
    }

    .brand-church-switch .form-select { max-width: 100%; }

    .nav-primary { margin-left: 0 !important; margin-bottom: 0.5rem; }
    .nav-mega { position: static !important; transform: none !important; box-shadow: none !important; border: none !important; background: transparent !important; padding: 0.25rem 0 0.5rem 1rem !important; }
    .nav-mega-link { color: rgba(255,255,255,0.85) !important; }
    .nav-mega-link:hover { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
    .nav-mega-title {
        color: rgba(255, 255, 255, 0.92) !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border-left-color: rgba(255, 255, 255, 0.35) !important;
    }
}

@media (min-width: 992px) {
    .dropdown-mega .nav-mega--full {
        top: 100%;
    }

    .dropdown-mega .nav-mega--full::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -6px;
        height: 6px;
    }
}

/* ── Flash messages ── */
.flash-stack {
    position: fixed;
    top: calc(var(--ch-nav-height) + 12px);
    right: 16px;
    z-index: 1080;
    width: min(400px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}

.app-flash {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.875rem 0.875rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--ch-radius-sm);
    box-shadow: var(--ch-shadow-lg);
    font-size: 0.875rem;
    margin: 0;
    overflow: hidden;
    pointer-events: auto;
    animation: flash-enter 0.35s ease-out;
}

@keyframes flash-enter {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flash-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.app-flash__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.app-flash__content { min-width: 0; }

.app-flash__title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin: 0 0 0.125rem;
    line-height: 1.3;
}

.app-flash__body {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: inherit;
    opacity: 0.92;
}

.app-flash__close {
    margin: 0;
    padding: 0.25rem;
    opacity: 0.55;
    flex-shrink: 0;
}

.app-flash__close:hover { opacity: 1; }

.app-flash__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    opacity: 0.55;
}

.app-flash--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.app-flash--success .app-flash__icon { background: #d1fae5; color: var(--ch-success); }
.app-flash--success .app-flash__progress { background: var(--ch-success); }

.app-flash--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.app-flash--danger .app-flash__icon { background: #fee2e2; color: #dc2626; }
.app-flash--danger .app-flash__progress { background: #dc2626; }

.app-flash--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.app-flash--warning .app-flash__icon { background: #fef3c7; color: #d97706; }
.app-flash--warning .app-flash__progress { background: #d97706; }

.app-flash--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
.app-flash--info .app-flash__icon { background: var(--ch-primary-soft); color: var(--ch-primary); }
.app-flash--info .app-flash__progress { background: var(--ch-primary); }

.app-flash--secondary {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}
.app-flash--secondary .app-flash__icon { background: #e2e8f0; color: #64748b; }
.app-flash--secondary .app-flash__progress { background: #64748b; }

.app-flash.is-paused .app-flash__progress { animation-play-state: paused !important; }

@media (max-width: 575.98px) {
    .flash-stack {
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* ── Layout ── */
.main-content {
    flex: 1;
    padding: 0.65rem 0 1.75rem;
}

.main-content--auth {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.18), transparent),
        linear-gradient(165deg, var(--ch-navy) 0%, var(--ch-navy-mid) 50%, var(--ch-navy) 100%);
}

.page-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 992px) {
    .page-container { padding: 0 1.75rem; }
}

/* ── Page header ── */
.app-breadcrumb { margin-bottom: 0.75rem; }

.breadcrumb {
    font-size: 0.8125rem;
    margin: 0;
    --bs-breadcrumb-divider: "›";
}

.breadcrumb-item a {
    color: var(--ch-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover { color: var(--ch-primary); }

.breadcrumb-item.active { color: var(--ch-text-secondary); }

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0;
}

.page-eyebrow, .page-subtitle {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ch-accent);
    margin: 0 0 0.35rem;
}

.page-title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ch-text);
    margin: 0;
    line-height: 1.2;
}

.page-lead, .page-description {
    font-size: 0.9375rem;
    color: var(--ch-text-secondary);
    margin: 0.35rem 0 0;
    max-width: 52ch;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* ── Module tabs (sub-nav) ── */
.module-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--ch-border);
}

.module-tabs-scroll {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: none;
}

.module-tabs-scroll::-webkit-scrollbar { display: none; }

.module-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color var(--ch-transition), border-color var(--ch-transition);
}

.module-tab:hover {
    color: var(--ch-text);
}

.module-tab.is-active {
    color: var(--ch-primary);
    border-bottom-color: var(--ch-primary);
}

.module-tab i { font-size: 0.95rem; }

/* ── Cards ── */
.card, .data-card {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow-sm);
    overflow: hidden;
}

.data-card { margin-bottom: 0; }

.card-header, .data-card__header {
    background: var(--ch-card);
    border-bottom: 1px solid var(--ch-border);
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ch-text);
}

.card-body { padding: 1.25rem; }

.card-footer {
    background: #fafbfc;
    border-top: 1px solid var(--ch-border);
    padding: 0.75rem 1.25rem;
}

/* ── Metrics ── */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 1rem 1.15rem;
    box-shadow: var(--ch-shadow-sm);
}

.metric-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ch-muted);
    margin-bottom: 0.35rem;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ch-text);
    line-height: 1.1;
}

.metric-card--success .metric-value { color: var(--ch-success); }
.metric-card--primary .metric-value { color: var(--ch-primary); }
.metric-card--warning .metric-value { color: var(--ch-warning); }
.metric-card--danger .metric-value { color: var(--ch-danger); }

.stat-card {
    padding: 1.25rem 1.35rem;
    border-radius: var(--ch-radius);
    color: var(--ch-text);
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    box-shadow: var(--ch-shadow-sm);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 120px;
    height: 120px;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 50%;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ch-muted);
    opacity: 1;
    margin-bottom: 0.4rem;
}

.stat-card .stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--ch-text);
}

/* Gradient variants keep light text on colored backgrounds */
.stat-card.bg-gradient-primary,
.stat-card.bg-gradient-success,
.stat-card.bg-gradient-danger,
.stat-card.bg-gradient-warning,
.stat-card.bg-gradient-teal {
    color: #fff;
    border: none;
    box-shadow: none;
}
.stat-card.bg-gradient-primary::after,
.stat-card.bg-gradient-success::after,
.stat-card.bg-gradient-danger::after,
.stat-card.bg-gradient-warning::after,
.stat-card.bg-gradient-teal::after {
    background: rgba(255, 255, 255, 0.08);
}
.stat-card.bg-gradient-primary .stat-label,
.stat-card.bg-gradient-success .stat-label,
.stat-card.bg-gradient-danger .stat-label,
.stat-card.bg-gradient-warning .stat-label,
.stat-card.bg-gradient-teal .stat-label {
    color: #fff;
    opacity: 0.88;
}
.stat-card.bg-gradient-primary .stat-value,
.stat-card.bg-gradient-success .stat-value,
.stat-card.bg-gradient-danger .stat-value,
.stat-card.bg-gradient-warning .stat-value,
.stat-card.bg-gradient-teal .stat-value {
    color: #fff;
}

.bg-gradient-primary { background: var(--ch-stat-tithe); }
.bg-gradient-success { background: var(--ch-stat-income); }
.bg-gradient-danger  { background: var(--ch-stat-expense); }
.bg-gradient-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.bg-gradient-teal { background: var(--ch-stat-combined); }

/* ── Dashboard inline stats (plain ground) ── */
.dash-inline-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--ch-border);
    border-bottom: 1px solid var(--ch-border);
}

.dash-inline-stat {
    flex: 1 1 120px;
    min-width: 0;
    padding: 0.35rem 1.25rem;
    border-right: 1px solid var(--ch-border);
}

.dash-inline-stat:last-child { border-right: none; }

.dash-inline-stat__label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ch-muted);
    margin-bottom: 0.2rem;
}

.dash-inline-stat__value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ch-text);
    line-height: 1.2;
}

.dash-inline-stat__value a {
    color: inherit;
    text-decoration: none;
}

.dash-inline-stat__value a:hover { color: var(--ch-primary); }

.dash-inline-stat--accent .dash-inline-stat__value { color: var(--ch-primary); }
.dash-inline-stat--success .dash-inline-stat__value { color: var(--ch-success); }
.dash-inline-stat--warning .dash-inline-stat__value { color: var(--ch-warning); }

/* ── Dashboard plain sections ── */
.dash-section {
    margin-bottom: 1.75rem;
}

.dash-section__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--ch-navy);
}

.dash-section__title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ch-navy);
    margin: 0;
}

.dash-section__link {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ch-primary);
    text-decoration: none;
}

.dash-section__link:hover { text-decoration: underline; }

.dash-panel {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    padding: 0.85rem 1rem;
}

.dash-panel--flat {
    background: transparent;
    border: none;
    border-top: 1px solid var(--ch-border);
    border-radius: 0;
    padding: 0.85rem 0 0;
}

.dash-finance-cards {
    margin-bottom: 0.5rem;
}

/* ── Filter bar ── */
.filter-bar {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
    box-shadow: var(--ch-shadow-sm);
}

.filter-form,
.filter-bar form:not(.row):not(.d-inline) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem 0.75rem;
}

.filter-field {
    flex: 0 0 auto;
    min-width: 0;
}

.filter-field--grow {
    flex: 1 1 14rem;
    min-width: 10rem;
}

.filter-field .form-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ch-muted);
    margin-bottom: 0.15rem;
    text-transform: uppercase;
}

.filter-bar .form-control,
.filter-bar .form-select,
.filter-panel .form-control,
.filter-panel .form-select {
    font-size: 0.78rem;
    padding: 0.28rem 0.55rem;
    min-height: 1.85rem;
    width: auto;
    max-width: 100%;
}

.filter-bar input[name="q"],
.filter-bar input[type="search"],
.filter-bar .field-search {
    width: 12.5rem;
}

.filter-bar select.form-select,
.filter-panel select.form-select {
    width: 9rem;
    max-width: 11rem;
}

.filter-bar input[type="date"],
.filter-panel input[type="date"] {
    width: 9.25rem;
}

.filter-bar input[type="number"],
.filter-panel input[type="number"] {
    width: 5.25rem;
}

.filter-bar .filter-actions,
.filter-bar .col-auto {
    flex: 0 0 auto;
}

.filter-bar .btn,
.filter-panel .btn {
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-height: 1.85rem;
    line-height: 1.2;
}

.filter-bar .btn.w-100,
.filter-panel .btn.w-100 {
    width: auto !important;
}

.filter-bar:has(.toolbar-spacer) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.filter-bar--tabs {
    padding: 0.5rem 0.75rem;
}

.filter-bar--tabs .btn {
    padding: 0.22rem 0.6rem;
    font-size: 0.74rem;
}

/* ── Tables ── */
.table-responsive { border-radius: 0; }

.table-wrap {
    width: 100%;
}

.table-wrap--center {
    display: flex;
    justify-content: center;
}

.table-wrap--center .table-responsive,
.table-wrap--center > .table {
    width: auto;
    max-width: 100%;
}

.table-wrap--compact .table thead th,
.table-wrap--compact .table tbody td {
    padding: 0.35rem 0.75rem;
}

.table {
    font-size: 0.8125rem;
    margin: 0;
    --bs-table-hover-bg: rgba(29, 78, 216, 0.04);
    --bs-table-striped-bg: var(--ch-table-stripe);
}

.table thead th {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ch-table-head-text);
    background: var(--ch-table-head-bg);
    border-bottom: none;
    padding: 0.5rem 0.85rem;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.5rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--ch-border);
    color: var(--ch-text);
    font-size: 0.8125rem;
}

.table tbody tr:nth-child(even) {
    background: var(--ch-table-stripe);
}

.table tbody tr:hover {
    background: rgba(29, 78, 216, 0.05);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-sm thead th { padding: 0.4rem 0.65rem; }
.table-sm tbody td { padding: 0.4rem 0.65rem; font-size: 0.78rem; }

.data-card .table thead th:first-child,
.table-responsive .table thead th:first-child { border-radius: 0; }

.table-in-card {
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    overflow: hidden;
}

.table-link {
    font-weight: 600;
    color: var(--ch-text);
    text-decoration: none;
}

.table-link:hover { color: var(--ch-primary); }

/* ── Badges & buttons ── */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

.btn {
    font-family: var(--ch-font);
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--ch-radius-xs);
    padding: 0.45rem 0.9rem;
    transition: all var(--ch-transition);
}

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

.btn-primary {
    background: var(--ch-primary);
    border-color: var(--ch-primary);
}

.btn-primary:hover {
    background: var(--ch-primary-hover);
    border-color: var(--ch-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-outline-primary {
    color: var(--ch-primary);
    border-color: var(--ch-border-strong);
}

.btn-outline-primary:hover {
    background: var(--ch-primary-soft);
    border-color: var(--ch-primary);
    color: var(--ch-primary);
}

.btn-outline-secondary {
    border-color: var(--ch-border-strong);
    color: var(--ch-text-secondary);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--ch-muted);
    padding: 0.35rem 0.5rem;
}

/* ── Forms (compact; columns fill available width) ── */
.form-card {
    max-width: 56rem;
    margin: 0 auto;
    width: 100%;
}

.form-card .card-body { padding: 1.75rem; }

.form-group {
    margin-bottom: 0.85rem;
    max-width: 100%;
}

.form-group--check {
    margin-bottom: 0.65rem;
    max-width: none;
}

.form-group--wide,
.form-group:has(textarea) {
    max-width: 100%;
    width: 100%;
}

.form-group--full {
    max-width: 100%;
}

.form-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--ch-text-secondary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--ch-muted);
    margin-top: 0.2rem;
}

.form-error {
    font-size: 0.72rem;
    color: var(--ch-danger);
    margin-top: 0.2rem;
}

/* Compact controls app-wide in main content */
.main-content .form-control,
.main-content .form-select {
    font-family: var(--ch-font);
    border-radius: 6px;
    border: 1px solid var(--ch-border-strong);
    font-size: 0.8125rem;
    padding: 0.32rem 0.6rem;
    line-height: 1.4;
    min-height: calc(1.4em + 0.64rem);
    width: 100%;
    max-width: 100%;
    transition: border-color var(--ch-transition), box-shadow var(--ch-transition);
}

.main-content textarea.form-control {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
}

.main-content .form-control-sm,
.main-content .form-select.form-control-sm {
    font-size: 0.78rem;
    padding: 0.28rem 0.55rem;
    min-height: calc(1.35em + 0.56rem);
}

/* Default form groups stretch within their layout cell */
.form-card-inner .form-group,
.form-shell .form-group,
.panel-body .form-group,
.narrow-form .form-group,
.compact-form .form-group {
    width: 100%;
    max-width: 100%;
}

/* Compact single-column forms (no Bootstrap row): keep purposeful control widths */
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[type="date"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[type="date"]) .form-control,
.panel-body form:not(:has(> .row)) > .form-group:has(input[type="date"]) .form-control,
.narrow-form form:not(:has(> .row)) > .form-group:has(input[type="date"]) .form-control {
    width: 10.5rem;
}

.form-card-inner form:not(:has(> .row)) > .form-group:has(input[type="datetime-local"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[type="datetime-local"]) .form-control {
    width: 13rem;
}

.form-card-inner form:not(:has(> .row)) > .form-group:has(input[type="number"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[type="number"]) .form-control,
.panel-body form:not(:has(> .row)) > .form-group:has(input[type="number"]) .form-control {
    width: 8rem;
}

.form-card-inner form:not(:has(> .row)) > .form-group:has(input[type="email"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[type="email"]) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[name*="phone"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[name*="phone"]) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[name="username"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[name="username"]) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[name="first_name"]) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[name="last_name"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[name="first_name"]) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[name="last_name"]) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(input[type="text"]:not([name="q"])) .form-control,
.form-shell form:not(:has(> .row)) > .form-group:has(input[type="text"]:not([name="q"])) .form-control,
.form-card-inner form:not(:has(> .row)) > .form-group:has(select) .form-select,
.form-shell form:not(:has(> .row)) > .form-group:has(select) .form-select,
.panel-body form:not(:has(> .row)) > .form-group:has(select) .form-select {
    width: min(100%, 22rem);
    max-width: 100%;
}

.form-card-inner .form-group:has(textarea) .form-control,
.form-shell .form-group:has(textarea) .form-control {
    width: 100%;
    max-width: 100%;
}

/* Multi-column forms: group can fill the cell; short/medium controls stay content-sized */
.row > [class*="col"] > .form-group,
.row > [class*="col"] .form-group {
    width: 100%;
    max-width: 100%;
}

.row > [class*="col"] .form-control,
.row > [class*="col"] .form-select {
    width: 100%;
    max-width: 100%;
}

.row > [class*="col"] .form-group--short {
    max-width: 12rem;
}

.row > [class*="col"] .form-group--medium {
    max-width: 18rem;
}

.row > [class*="col"] .form-group--wide,
.row > [class*="col"] .form-group--full,
.row > [class*="col"] .form-group:has(textarea) {
    max-width: 100%;
}

.row > [class*="col"] textarea.form-control {
    width: 100%;
    max-width: 100%;
}

/* Cap common short types even without width-hint classes */
.row > [class*="col"] .form-group:has(input[type="date"]):not(.form-group--wide):not(.form-group--full) {
    max-width: 11rem;
}
.row > [class*="col"] .form-group:has(input[type="datetime-local"]):not(.form-group--wide):not(.form-group--full) {
    max-width: 14rem;
}
.row > [class*="col"] .form-group:has(input[type="number"]):not(.form-group--wide):not(.form-group--full) {
    max-width: 9rem;
}
.row > [class*="col"] .form-group:has(input[type="email"]):not(.form-group--wide):not(.form-group--full),
.row > [class*="col"] .form-group:has(input[name*="phone"]):not(.form-group--wide):not(.form-group--full) {
    max-width: 18rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ch-primary);
    box-shadow: 0 0 0 2px var(--ch-focus-ring);
}

.form-check-input {
    width: 0.95rem;
    height: 0.95rem;
    margin-top: 0.15rem;
}

.form-check-input:checked {
    background-color: var(--ch-primary);
    border-color: var(--ch-primary);
}

.form-check-label {
    font-size: 0.8125rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.form-actions .btn {
    padding: 0.32rem 0.75rem;
    font-size: 0.78rem;
}

.form-actions .btn.w-100 {
    width: auto !important;
}

.field-search {
    width: 12.5rem;
}

.field-w-xs { width: 5.25rem !important; }
.field-w-sm { width: 9rem !important; }
.field-w-md { width: 13rem !important; }
.field-w-lg { width: 18rem !important; }
.field-w-xl { width: 28rem !important; max-width: 100%; }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: var(--ch-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--ch-muted);
}

.empty-state-text {
    color: var(--ch-muted);
    font-size: 0.9375rem;
    margin: 0;
}

.empty-state .bi.d-block {
    font-size: 2rem;
    color: var(--ch-border-strong);
    margin-bottom: 0.75rem;
}

/* ── Auth ── */
.auth-page .auth-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow-lg);
}

.auth-brand { text-align: center; margin-bottom: 1.75rem; }

.auth-brand h1 { font-weight: 700; letter-spacing: -0.03em; }

/* ── Dashboard ── */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--ch-navy) 0%, var(--ch-navy-mid) 100%);
    border-radius: var(--ch-radius);
    padding: 1.5rem 1.75rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.3), transparent 70%);
}

.dashboard-welcome h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    position: relative;
}

.dashboard-welcome p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.875rem;
    position: relative;
}

.dashboard-welcome--treasury::before {
    background: radial-gradient(circle, color-mix(in srgb, var(--ch-action) 35%, transparent), transparent 70%);
}

.dashboard-welcome--secretary::before {
    background: radial-gradient(circle, color-mix(in srgb, var(--ch-accent) 35%, transparent), transparent 70%);
}

.dashboard-welcome--overseer::before,
.dashboard-welcome--admin::before,
.dashboard-welcome--district_overseer::before,
.dashboard-welcome--leadership::before {
    background: radial-gradient(circle, color-mix(in srgb, var(--ch-brand-mid) 40%, transparent), transparent 70%);
}

.dashboard-role-focus {
    font-size: 0.8125rem;
    opacity: 0.75;
    margin-top: 0.35rem;
}

.alert-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-radius: var(--ch-radius-xs);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.alert-banner.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-banner.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-banner.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-banner.alert-secondary { background: #f8fafc; border-color: var(--ch-border); color: var(--ch-text-secondary); }

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-text);
    text-decoration: none;
    transition: all var(--ch-transition);
    box-shadow: var(--ch-shadow-sm);
}

.quick-action-btn:hover {
    border-color: var(--ch-primary);
    color: var(--ch-primary);
    transform: translateY(-1px);
    box-shadow: var(--ch-shadow);
}

/* ── Announcements ── */
.announcement-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.announcement-card {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    padding: 1.35rem;
    position: relative;
    transition: box-shadow var(--ch-transition), border-color var(--ch-transition);
}

.announcement-card:hover {
    box-shadow: var(--ch-shadow);
    border-color: var(--ch-border-strong);
}

.announcement-card.pinned {
    border-left: 4px solid var(--ch-primary);
    background: linear-gradient(90deg, var(--ch-primary-soft) 0%, var(--ch-card) 12%);
}

.announcement-card .pinned-badge { position: absolute; top: 1rem; right: 1rem; }
.announcement-card .new-badge { position: absolute; top: 1rem; right: 5.5rem; }

.announcement-meta { font-size: 0.8125rem; color: var(--ch-muted); }

.announcement-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.announcement-image {
    max-height: 200px;
    border-radius: var(--ch-radius-xs);
    border: 1px solid var(--ch-border);
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-primary);
    text-decoration: none;
}

.view-btn:hover { text-decoration: underline; }

/* ── Detail panels ── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
}

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

.panel {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    overflow: hidden;
}

.panel-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--ch-border);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ch-text);
}

.panel-body { padding: 1.25rem; }

.list-plain {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-plain li {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.list-plain li:last-child { border-bottom: none; }

/* ── Footer ── */
.app-footer {
    padding: 1rem 0;
    border-top: 1px solid var(--ch-border);
    background: var(--ch-card);
    margin-top: auto;
}

/* ── Utilities ── */
.text-currency { font-variant-numeric: tabular-nums; }

.divider { border-top: 1px solid var(--ch-border); margin: 1.25rem 0; }

.export-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: var(--ch-surface);
    border: 1px solid var(--ch-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ch-text-secondary);
}

.timeline-item {
    border-left: 3px solid var(--ch-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.receipt-card { max-width: 640px; margin: 0 auto; }

/* ── Form shell ── */
.form-shell { max-width: 56rem; margin: 0 auto; width: 100%; }
.form-shell--wide { max-width: 72rem; }
.form-shell--full { max-width: 100%; }
.form-card-inner {
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    overflow: hidden;
}
.form-card-inner .card-header {
    font-weight: 600;
    background: linear-gradient(180deg, #fafbfc, #fff);
}

/* ── Detail layout ── */
.member-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    margin-bottom: 1.25rem;
    box-shadow: var(--ch-shadow-sm);
}
.member-hero--profile {
    align-items: flex-start;
    padding: 1.75rem;
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.06), rgba(14, 116, 144, 0.05)),
        var(--ch-card);
}
.member-hero-photo {
    flex-shrink: 0;
}
.member-hero-photo__img {
    width: 148px;
    height: 148px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid #fff;
    box-shadow: 0 10px 28px rgba(15, 41, 66, 0.14);
    display: block;
}
.member-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--ch-radius);
    background: linear-gradient(135deg, var(--ch-primary-soft), var(--ch-accent-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ch-primary);
    flex-shrink: 0;
}
.member-hero-avatar--xl {
    width: 148px;
    height: 148px;
    border-radius: 16px;
    font-size: 2.75rem;
    border: 3px solid #fff;
    box-shadow: 0 10px 28px rgba(15, 41, 66, 0.12);
}
.member-hero-name {
    letter-spacing: -0.02em;
    margin: 0;
}
.member-hero-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
    font-size: 0.82rem;
    color: var(--ch-muted);
}
.member-list-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.member-list-thumb--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-primary-soft);
    color: var(--ch-primary);
    font-size: 0.65rem;
    font-weight: 700;
}
.detail-dl dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ch-muted);
}
.detail-dl dd { margin-bottom: 0.85rem; }

/* ── Hierarchy tree ── */
.hierarchy-block {
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--ch-shadow-sm);
}
.hierarchy-block-header {
    background: linear-gradient(135deg, var(--ch-navy), var(--ch-navy-mid));
    color: #fff;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.hierarchy-block-body { padding: 1.25rem; background: var(--ch-card); }
.hierarchy-zone { margin-bottom: 1.25rem; }
.hierarchy-zone:last-child { margin-bottom: 0; }
.hierarchy-zone-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ch-primary);
    margin-bottom: 0.5rem;
}
.hierarchy-district {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--ch-border);
    margin-bottom: 0.75rem;
}
.hierarchy-church-list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.hierarchy-church-list li { padding: 0.35rem 0; font-size: 0.875rem; }

/* ── Pagination ── */
.pagination .page-link {
    border-radius: var(--ch-radius-xs);
    margin: 0 2px;
    border-color: var(--ch-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-text-secondary);
}
.pagination .page-item.active .page-link {
    background: var(--ch-primary);
    border-color: var(--ch-primary);
}

/* ── Status dots ── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
}
.status-dot--success { background: var(--ch-success); }
.status-dot--warning { background: var(--ch-warning); }
.status-dot--muted { background: var(--ch-muted); }

/* ── Auth split layout ── */
.auth-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .auth-split {
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        gap: 3rem;
        align-items: stretch;
        padding: 2rem;
        min-height: calc(100vh - 4rem);
        min-height: calc(100dvh - 4rem);
        flex: initial;
    }
}

.auth-split-brand {
    display: none;
    color: #fff;
    padding: 2rem;
}

.auth-split-brand--platform {
    background: linear-gradient(
        135deg,
        var(--ch-brand) 0%,
        var(--ch-brand-mid) 55%,
        color-mix(in srgb, var(--ch-accent) 70%, var(--ch-brand)) 100%
    );
}

@media (min-width: 992px) {
    .auth-split-brand {
        display: flex;
        align-items: center;
        align-self: stretch;
        min-height: 100%;
        border-radius: var(--ch-radius);
    }
}

.auth-split-brand-inner { max-width: 400px; }

/* Increased Logo Space */
.auth-platform-logo {
    max-height: 96px; /* Increased from 72px */
    max-width: 280px; /* Increased from 220px */
    width: auto;
    object-fit: contain;
}

.auth-platform-logo-sm {
    max-height: 64px; /* Increased from 40px */
    max-width: 200px; /* Increased from 160px */
    object-fit: contain;
}

.auth-platform-mark,
.auth-platform-mark-sm {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.auth-platform-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.72;
    margin: 0;
}

.auth-tenant-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ch-border);
    margin-bottom: 1.25rem;
}

.auth-tenant-logo {
    max-height: 56px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}

.auth-tenant-mark {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    color: var(--ch-primary);
    background: rgba(29, 78, 216, 0.08);
}

.auth-tenant-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ch-muted);
    margin: 0;
}

.auth-tenant-name {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ch-text);
}

.auth-platform-mobile {
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--ch-border);
}

.auth-logout-icon {
    width: 3rem;
    height: 3rem;
    margin-inline: auto;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 78, 216, 0.08);
    color: var(--ch-primary);
    font-size: 1.35rem;
}

.auth-split-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
}

.auth-split-tagline {
    opacity: 0.82;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-feature-list i { color: var(--ch-accent); font-size: 1.1rem; }

.auth-split-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1;
    width: 100%;
    min-width: 0;
    padding:
        max(0.75rem, env(safe-area-inset-top, 0px))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .auth-split-form {
        align-items: center;
        justify-content: center;
        align-self: stretch;
        flex: initial;
        padding: 1rem;
        gap: 0;
        min-height: 100%;
    }
}

.auth-split-form .auth-card {
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    border: none;
    border-radius: var(--ch-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

@media (max-width: 991.98px) {
    .auth-split-form .auth-card {
        max-width: none;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    }

    .auth-page .auth-card .card-body {
        padding: 1.25rem !important;
    }

    .auth-form-title {
        font-size: 1.1rem;
    }

    .auth-tenant-header {
        padding-bottom: 0.65rem;
        margin-bottom: 1rem;
    }

    .auth-tenant-logo {
        max-height: 42px;
        max-width: min(160px, 55vw);
    }

    .auth-tenant-name {
        font-size: 0.95rem;
    }
}

.auth-mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0.35rem 0.5rem 0.15rem;
    color: #fff;
    background: transparent;
    border-radius: 0;
}

.auth-mobile-brand__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.auth-mobile-brand__text {
    max-width: 100%;
}

.auth-mobile-brand .auth-platform-logo-sm {
    max-height: 56px;
    max-width: min(220px, 72vw);
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-mobile-brand .auth-platform-mark-sm {
    width: 3rem;
    height: 3rem;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ch-radius-sm);
}

.auth-mobile-brand__name {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.auth-mobile-brand .auth-platform-eyebrow {
    opacity: 0.88;
    margin-bottom: 0.15rem;
}

@media (min-width: 992px) {
    .auth-mobile-brand {
        display: none;
    }
}

.auth-form-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-secondary-links {
    padding-top: 0.85rem;
    border-top: 1px solid var(--ch-border);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.65rem;
}

.auth-secondary-links a {
    color: var(--ch-muted);
}

.auth-secondary-links a:hover {
    color: var(--ch-action);
}

.auth-login-footer {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--ch-border);
}

.auth-login-footer__note {
    margin-top: 0.6rem;
}

.auth-login-footer__note a {
    color: var(--ch-action);
}

/* Staff sign-in: keep the card close to square on desktop instead of a tall column */
@media (min-width: 992px) {
    .auth-split--square {
        max-width: 1240px;
        grid-template-columns: 1fr 1.2fr;
        gap: 2.5rem;
    }

    .auth-split--square .auth-split-form .auth-card {
        max-width: 580px;
    }

    .auth-split--square .auth-card .card-body {
        padding: 1.5rem 2rem !important;
    }

    .auth-split--square .auth-tenant-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.85rem !important;
    }

    .auth-split--square .auth-tenant-logo {
        max-height: 44px;
        margin-bottom: 0.5rem !important;
    }

    .auth-split--square .auth-tenant-mark {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.05rem;
        margin-bottom: 0.5rem !important;
    }

    .auth-split--square .auth-form-title {
        font-size: 1.35rem;
    }

    .auth-split--square .auth-form-title + p {
        margin-bottom: 1rem !important;
    }
}

.input-icon-wrap--password .form-control {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ch-muted);
    width: 2rem;
    height: 2rem;
    border-radius: var(--ch-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--ch-action);
    outline: none;
}

.input-icon-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ch-muted);
    pointer-events: none;
    z-index: 2;
}

/* ── Data card header actions ── */
.data-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.data-card__actions .btn { margin-left: 0.25rem; }

/* ── Member picker (searchable autocomplete) ── */
.member-picker { position: relative; }
.member-picker__search-wrap { position: relative; }
.member-picker__results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1060;
    max-height: 280px;
    overflow-y: auto;
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    box-shadow: var(--ch-shadow-lg);
}
.member-picker__option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.member-picker__option:hover,
.member-picker__option:focus {
    background: var(--ch-primary-soft);
    outline: none;
}
.member-picker__selected {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    background: var(--ch-surface);
}
.member-picker__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ch-primary-soft), #e0e7ff);
    color: var(--ch-primary);
    font-size: 0.75rem;
    font-weight: 700;
}
.member-picker__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-picker__option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.member-picker__name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}
.member-picker__subtitle {
    font-size: 0.72rem;
    line-height: 1.2;
}
.member-picker__clear {
    margin-left: auto;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.member-picker__empty {
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--ch-muted);
}

/* Transfer / record member preview */
.member-preview-card {
    border: 1px solid var(--ch-border);
    box-shadow: var(--ch-shadow-sm);
    background: var(--ch-card);
}
.member-preview-card__avatar {
    width: 88px;
    height: 88px;
    border-radius: var(--ch-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-primary-soft);
    color: var(--ch-primary);
    font-size: 1.5rem;
    font-weight: 700;
}
.member-preview-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-preview-card__initials {
    text-transform: uppercase;
}
.member-preview-card__details dt {
    color: var(--ch-muted);
    font-weight: 600;
}
.member-preview-card__details dd {
    color: var(--ch-text);
}

/* ── Communications calendar ── */
.calendar-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.calendar-metrics--compact { gap: 0.5rem; }
.calendar-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    padding: 0.85rem 1rem;
    border-radius: var(--ch-radius);
    border: 1px solid var(--ch-border);
    background: var(--ch-card);
}
.calendar-metric--sm {
    min-width: auto;
    padding: 0.45rem 0.75rem;
    flex-direction: row;
    gap: 0.35rem;
}
.calendar-metric__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}
.calendar-metric--sm .calendar-metric__value { font-size: 0.95rem; }
.calendar-metric__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ch-muted);
}
.calendar-metric--birthday { border-color: #fbcfe8; background: #fdf2f8; }
.calendar-metric--birthday .calendar-metric__value { color: #be185d; }
.calendar-metric--meeting { border-color: #bfdbfe; background: #eff6ff; }
.calendar-metric--meeting .calendar-metric__value { color: #1d4ed8; }
.calendar-metric--event { border-color: #fde68a; background: #fffbeb; }
.calendar-metric--event .calendar-metric__value { color: #b45309; }
.calendar-metric--today { border-color: #a7f3d0; background: #ecfdf5; }
.calendar-metric--today .calendar-metric__value { color: #047857; }
.calendar-timeline { display: flex; flex-direction: column; gap: 1.25rem; }
.calendar-day {
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    background: var(--ch-card);
    overflow: hidden;
}
.calendar-day__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ch-surface);
    border-bottom: 1px solid var(--ch-border);
}
.calendar-day__weekday {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ch-muted);
}
.calendar-day__full {
    font-weight: 600;
    font-size: 0.95rem;
}
.calendar-day__items { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.calendar-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: calc(var(--ch-radius) - 2px);
    border: 1px solid transparent;
}
.calendar-item--birthday { background: #fdf2f8; border-color: #fce7f3; }
.calendar-item--meeting { background: #eff6ff; border-color: #dbeafe; }
.calendar-item--announcement { background: #fffbeb; border-color: #fef3c7; }
.calendar-item__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    flex-shrink: 0;
}
.calendar-item--birthday .calendar-item__icon { color: #be185d; }
.calendar-item--meeting .calendar-item__icon { color: #1d4ed8; }
.calendar-item--announcement .calendar-item__icon { color: #b45309; }
.calendar-item__body { flex: 1; min-width: 0; }
.calendar-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.calendar-item__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}
.calendar-item__subtitle { font-size: 0.8rem; color: var(--ch-muted); margin-top: 0.15rem; }
.calendar-item__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--ch-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.calendar-item__photo { width: 100%; height: 100%; object-fit: cover; }
.calendar-preview-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0;
}
.calendar-preview-item + .calendar-preview-item { border-top: 1px solid var(--ch-border); }
.calendar-preview-item__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.calendar-preview-item--birthday .calendar-preview-item__icon { background: #fdf2f8; color: #be185d; }
.calendar-preview-item--meeting .calendar-preview-item__icon { background: #eff6ff; color: #1d4ed8; }
.calendar-preview-item--announcement .calendar-preview-item__icon { background: #fffbeb; color: #b45309; }

/* ── Meeting minutes workflow ── */
.minutes-sections { display: flex; flex-direction: column; gap: 1rem; }
.minutes-section textarea { width: 100%; }
.minutes-readonly__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ch-muted);
    margin-bottom: 0.35rem;
}
.minutes-readonly__body {
    background: var(--ch-surface);
    border-radius: calc(var(--ch-radius) - 2px);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* ── Semantic chips ── */
.chip--success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.chip--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.chip--danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.chip--muted { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

/* Permission matrix */
.permission-matrix .matrix-sticky {
    position: sticky;
    left: 0;
    background: var(--ch-card);
    z-index: 1;
    min-width: 220px;
}
.permission-matrix .matrix-role-col { min-width: 90px; font-size: 0.75rem; }
.permission-matrix .matrix-category-row td {
    background: var(--ch-surface);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ch-muted);
}
.permission-matrix .matrix-check { cursor: pointer; width: 1.1rem; height: 1.1rem; }
.chip--info { background: var(--ch-primary-soft); color: var(--ch-primary); border-color: #c7d2fe; }
.chip--secondary { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* ── Attendance roll grid ── */
.roll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.roll-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    background: #fafbfc;
    font-size: 0.875rem;
    transition: border-color var(--ch-transition), background var(--ch-transition);
}

.roll-item:has(input:checked) {
    border-color: var(--ch-accent);
    background: var(--ch-accent-soft);
}

.roll-item .form-check-input { margin: 0; }

/* ── Report grid (use on reports index) ── */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.report-card {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: border-color var(--ch-transition), box-shadow var(--ch-transition), transform var(--ch-transition);
}

.report-card:hover {
    border-color: #c7d2fe;
    box-shadow: var(--ch-shadow);
    transform: translateY(-3px);
}

.report-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ch-primary-soft), #e0e7ff);
    color: var(--ch-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.report-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

.report-card p {
    font-size: 0.8125rem;
    color: var(--ch-muted);
    margin: 0 0 1.25rem;
    line-height: 1.55;
    flex: 1;
}

.report-card .btn { align-self: flex-start; }

/* ── Filter panel ── */
.filter-panel {
    background: var(--ch-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    box-shadow: var(--ch-shadow-sm);
}

.filter-panel-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ch-muted);
    margin-bottom: 0.45rem;
}

.filter-panel form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem 0.75rem;
}

.filter-panel form > [class*="col-"] {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0;
}

/* ── Button group toolbar ── */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.toolbar-spacer { flex: 1; }

/* ── Sticky subnav on scroll (optional) ── */
@media (min-width: 992px) {
    .module-tabs--sticky {
        position: sticky;
        top: calc(var(--ch-nav-height) + 8px);
        z-index: 100;
    }
}

@media (max-width: 767px) {
    .dash-inline-stat {
        flex: 1 1 50%;
        border-right: none;
        border-bottom: 1px solid var(--ch-border);
        padding: 0.5rem 0.75rem;
    }

    .dash-inline-stat:nth-child(odd) {
        border-right: 1px solid var(--ch-border);
    }

    .table-wrap--center .table-responsive {
        width: 100%;
    }
}

.ledger-account-preview .ledger-account-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.ledger-account-preview .ledger-account-box {
    background: var(--ch-surface);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--ch-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ledger-journal-account {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ch-text-secondary);
    max-width: 14rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-confirm-dl dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 0.35rem;
}

.ledger-confirm-dl dd {
    padding-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.ledger-quick-links {
    display: grid;
    gap: 0.5rem;
}

.ledger-quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-xs);
    background: var(--ch-card);
    color: var(--ch-text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: border-color var(--ch-transition), background var(--ch-transition);
}

.ledger-quick-link i {
    font-size: 1.1rem;
    color: var(--ch-primary);
}

.ledger-quick-link:hover {
    border-color: var(--ch-primary);
    background: var(--ch-primary-soft);
    color: var(--ch-primary);
}

.ledger-steps li {
    line-height: 1.45;
}

/* ============================================================
   ChurchHub Design System v3 — Professional polish
   Compact fields, sticky navigation, auto form grids
   ============================================================ */

:root {
    --ch-nav-height: 90px;
    --ch-content-gap: 0.6rem;
    --ch-sticky-blur: rgba(244, 247, 251, 0.9);
}

.ch-navbar {
    box-shadow: 0 2px 16px rgba(15, 41, 66, 0.22);
}

.ch-navbar .nav-link {
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem !important;
}

.nav-mega-link {
    padding: 0.32rem 0.42rem;
    font-size: 0.8rem;
    gap: 0.4rem;
}

.nav-mega-title {
    font-size: 0.6rem;
    margin-bottom: 0.28rem;
    padding: 0.24rem 0.4rem;
}

@media (min-width: 992px) {
    .dropdown-mega .nav-mega--full {
        padding-top: 0.7rem !important;
        padding-bottom: 0.75rem !important;
    }

    .nav-mega-grid {
        gap: 0.6rem 0.9rem;
        grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    }
}

/* Page layout — tight top so chrome (nav/tabs/status) does not stack empty space */
.main-content {
    padding: 0.65rem 0 1.75rem;
}

/* Page content layout — scoped so navbar shell is not affected */
main .page-container,
.page-container.page-shell {
    display: flex;
    flex-direction: column;
    gap: var(--ch-content-gap);
}

.page-shell {
    gap: var(--ch-content-gap);
}

.page-header-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.page-header {
    margin-bottom: 0;
    gap: 0.65rem;
    align-items: center;
}

.page-subtitle {
    margin: 0 0 0.15rem;
}

.page-title {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.page-lead, .page-description {
    font-size: 0.8125rem;
    margin-top: 0.2rem;
}

.app-breadcrumb {
    margin-bottom: 0;
}

/* Sticky section navigation (full-bleed under navbar — no negative margins) */
.module-tabs--sticky {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--ch-sticky-blur);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.module-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--ch-border);
    background: var(--ch-sticky-blur);
}

.module-tabs-scroll {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 992px) {
    .module-tabs-scroll {
        padding: 0 1.75rem;
    }
}

.module-tab {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    gap: 0.35rem;
}

.module-tab i {
    font-size: 0.88rem;
}

.module-tab.is-active {
    color: var(--ch-primary);
    border-bottom-color: var(--ch-primary);
}

.filter-bar--sticky {
    position: sticky;
    z-index: 1015;
    background: var(--ch-sticky-blur);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Metrics & cards — tighter */
.metrics-row {
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.metric-card {
    padding: 0.7rem 0.9rem;
}

.metric-value {
    font-size: 1.2rem;
}

.metric-label {
    font-size: 0.68rem;
    margin-bottom: 0.2rem;
}

.main-content .card > .card-body,
.main-content .form-card-inner > .card-body {
    padding: 1rem 1.15rem;
}

.data-card__header {
    padding: 0.65rem 1rem;
    font-size: 0.8125rem;
}

/* Auto form grid — only for flat (non-Bootstrap-row) forms */
.form-card-inner form:not(.filter-form):not(.row):not(.d-inline):not(:has(> .row)),
.compact-form form:not(.filter-form):not(.row):not(:has(> .row)),
.card-body > form:not(.filter-form):not(.row):not(.d-inline):not(:has(> .row)) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    column-gap: 1.25rem;
    row-gap: 0;
    align-items: start;
}

/* Sign-in forms stay single column even when the card is wide */
.auth-card .card-body > form:not(.filter-form):not(.row):not(.d-inline):not(:has(> .row)) {
    grid-template-columns: 1fr;
}

/* Explicit multi-column layouts use normal block flow and full width */
.form-card-inner form:has(> .row),
.compact-form form:has(> .row),
.card-body > form:has(> .row) {
    display: block;
    width: 100%;
}

.form-card-inner form > .form-group,
.compact-form form > .form-group,
.card-body > form:not(.filter-form) > .form-group {
    margin-bottom: 0.7rem;
}

.form-group--wide,
.form-group--full,
.form-group:has(textarea),
.form-card-inner form > .form-actions,
.form-card-inner form > .d-flex,
.form-card-inner form > .row,
.compact-form form > .form-actions,
.compact-form form > .d-flex,
.compact-form form > .row,
.card-body > form:not(.filter-form) > .form-actions,
.card-body > form:not(.filter-form) > .d-flex.gap-2,
.card-body > form:not(.filter-form) > .d-flex.gap-3,
.card-body > form:not(.filter-form) > .row,
.card-body > form:not(.filter-form) > hr,
.card-body > form:not(.filter-form) > .alert,
.card-body > form:not(.filter-form) > .mb-3:has(textarea) {
    grid-column: 1 / -1;
    max-width: 100%;
    width: 100%;
}

/* Legacy mb-3 field wrappers inside cards */
.card-body > form:not(.filter-form):not(:has(> .row)) > .mb-3 {
    margin-bottom: 0.7rem !important;
    max-width: 100%;
}

.card-body > form:not(.filter-form) > .mb-3:has(textarea),
.card-body > form:not(.filter-form) > .mb-3:has(.form-control[type="hidden"]) {
    max-width: 100%;
}

.form-group--short {
    max-width: 12rem;
}

.form-group--medium {
    max-width: 18rem;
}

/* Tables: plain status text — no chip/badge chrome */
.table td .chip,
.table td .badge,
.data-card table td .chip,
.data-card table td .badge {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    border-radius: 0;
    letter-spacing: normal;
    box-shadow: none;
    vertical-align: baseline;
}

/* Global compact controls */
.main-content .form-control,
.main-content .form-select {
    font-size: 0.78rem;
    padding: 0.26rem 0.52rem;
    min-height: calc(1.35em + 0.52rem);
    border-radius: 5px;
}

.main-content textarea.form-control {
    min-height: 3.75rem;
    font-size: 0.8125rem;
}

.main-content .card .form-control,
.main-content .card .form-select,
.main-content .data-card .form-control,
.main-content .data-card .form-select {
    font-size: 0.78rem;
    padding: 0.26rem 0.52rem;
    min-height: calc(1.35em + 0.52rem);
}

.form-label {
    font-size: 0.7rem;
    margin-bottom: 0.18rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-hint {
    font-size: 0.68rem;
    line-height: 1.35;
}

.form-actions {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--ch-border);
}

.form-actions .btn {
    padding: 0.28rem 0.7rem;
    font-size: 0.75rem;
}

/* Tables — denser rows */
.table tbody td {
    padding: 0.42rem 0.75rem;
    font-size: 0.78rem;
}

.table thead th {
    padding: 0.42rem 0.75rem;
    font-size: 0.6rem;
}

.table-row--interactive {
    cursor: default;
}

.table-row--interactive:hover {
    background: rgba(29, 78, 216, 0.06) !important;
}

.data-card .btn-sm,
.table .btn-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
}

/* Filter bar */
.filter-bar {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* Auth pages */
.auth-card .card-body {
    padding: 1.25rem 1.5rem !important;
}

.auth-card .form-control {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

.auth-card .form-group {
    margin-bottom: 0.75rem;
}

/* Dashboard welcome */
.dashboard-welcome h1 {
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
}

.quick-action-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
}

/* Empty state */
.empty-state {
    padding: 2rem 1rem;
}

.empty-state-icon {
    font-size: 2rem;
}

/* Mobile nav */
@media (max-width: 991.98px) {
    .ch-navbar .navbar-collapse {
        padding: 0.75rem 0 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0.5rem;
    }

    .nav-mega {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(255, 255, 255, 0.04) !important;
        margin: 0.25rem 0 0.5rem !important;
        padding: 0.5rem !important;
    }

    .nav-mega-link {
        color: rgba(255, 255, 255, 0.88) !important;
        font-size: 0.8125rem;
    }

    .nav-mega-link:hover,
    .nav-mega-link.active {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
    }

    .nav-mega-title {
        color: rgba(255, 255, 255, 0.5);
    }

    .navbar-tools {
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
}

/* ── Mission Control / CEO Dashboard ── */
.control-center--executive .cc-hero {
    margin-bottom: 1rem;
    padding-bottom: 1.25rem;
}

.cc-hero__grid {
    display: grid;
    gap: 1.25rem;
    align-items: center;
}

@media (min-width: 992px) {
    .cc-hero__grid {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "main health"
            "actions actions";
    }
    .cc-hero__main { grid-area: main; }
    .cc-hero__health { grid-area: health; justify-self: end; }
    
    /* Align actions container to the right */
    .cc-hero__actions { 
        grid-area: actions; 
        justify-self: end;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

/* Improved Greetings & Typography */
.cc-hero__main h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 0.5rem;
    line-height: 1.1;
    color: #fff;
}

.cc-hero__meta {
    margin-bottom: 0.75rem;
    opacity: 0.9;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cc-hero__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-role-focus {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    font-weight: 400;
    max-width: 60ch;
    line-height: 1.5;
}

.cc-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 0.35rem;
}

.cc-health-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cc-health-pill__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
}

.cc-health-pill--healthy { color: #6ee7b7; }
.cc-health-pill--warning { color: #fcd34d; }
.cc-health-pill--critical { color: #fca5a5; }

.cc-health-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.cc-health-stat {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.cc-health-stat--danger { color: #fecaca; }

/* ── This Week Pulse Bar (Moved out of Hero for cleanliness) ── */
.cc-pulse-bar {
    background: #fff;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    padding: 0.75rem 1.25rem;
    box-shadow: var(--ch-shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cc-pulse-bar .cc-pulse-hero {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    width: 100%;
    justify-content: space-between;
}

.cc-pulse-bar .cc-pulse-hero__label {
    color: var(--ch-navy);
    font-weight: 700;
    font-size: 0.75rem;
}

.cc-pulse-bar .cc-pulse-hero__dates {
    color: var(--ch-muted);
    font-weight: 500;
}

.cc-pulse-bar .cc-pulse-hero__chip {
    background: var(--ch-surface);
    border-color: var(--ch-border);
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
}

.cc-pulse-bar .cc-pulse-hero__chip:hover {
    background: #fff;
    border-color: var(--ch-primary);
    transform: translateY(-1px);
}

.cc-pulse-bar .cc-pulse-hero__chip strong {
    font-size: 0.95rem;
}

/* ── KPI Grid ── */
.cc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .cc-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .cc-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.cc-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--ch-radius);
    background: #fff;
    border: 1px solid var(--ch-border);
    box-shadow: var(--ch-shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform var(--ch-transition), box-shadow var(--ch-transition);
    min-height: 100%;
}

.cc-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--ch-shadow);
    color: inherit;
}

.cc-kpi-card__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ch-muted);
}

.cc-kpi-card__value {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.cc-kpi-card__hint {
    font-size: 0.68rem;
    color: var(--ch-muted);
}

.cc-kpi-card__delta {
    font-size: 0.72rem;
    font-weight: 600;
}
.cc-kpi-card__delta--up { color: var(--ch-success); }
.cc-kpi-card__delta--down { color: var(--ch-danger); }

.cc-settlement-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1rem;
    background: var(--ch-surface-elevated, #fff);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
}
.cc-settlement-strip__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ch-muted);
}
.cc-settlement-strip__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.cc-settlement-strip__chip {
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--ch-bg-subtle, #f4f6f8);
    color: inherit;
    text-decoration: none;
}
.cc-settlement-strip__chip--danger { background: rgba(var(--ch-danger-rgb, 220, 53, 69), 0.12); }
.cc-settlement-strip__chip--warn { background: rgba(var(--ch-warning-rgb, 255, 193, 7), 0.2); }
.cc-settlement-strip__link { font-size: 0.8rem; margin-left: auto; }

.cc-funnel-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}
.cc-funnel-metric { font-size: 0.85rem; }
.cc-funnel-metric--warn { color: var(--ch-warning); }

.cc-inbox-item--unread .fw-medium { font-weight: 700; }
.cc-inbox-item__link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: inherit;
}

@media (max-width: 767.98px) {
    .control-center--home .cc-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .control-center--home .cc-hero__actions {
        width: 100%;
    }
    .control-center--home .quick-action-btn {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
    }
    .control-center--home .cc-settlement-strip__link {
        margin-left: 0;
        width: 100%;
    }
}

/* Compact dashboard hero */
.control-center--home .dashboard-welcome {
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}
.control-center--home .cc-hero__grid {
    gap: 0.65rem;
}
.control-center--home .cc-hero__main h1,
.control-center--home .cc-hero__title {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: 700;
    margin: 0 0 0.2rem;
    line-height: 1.2;
}
.control-center--home .cc-hero__meta {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}
.control-center--home .dashboard-role-focus {
    font-size: 0.72rem;
    margin-top: 0.15rem;
    opacity: 0.85;
}
.control-center--home:not(.control-center--executive) .cc-hero__focus {
    display: none;
}
.control-center--home .cc-hero__footer--compact {
    margin-top: 0.35rem;
    font-size: 0.62rem;
}
.control-center--home .cc-hero__health {
    scale: 0.92;
    transform-origin: top right;
}

.cc-portal-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cc-portal-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--ch-radius-xs);
    border: 1px solid var(--ch-border);
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 0.82rem;
}
.cc-portal-alert__badge {
    background: var(--ch-danger);
    color: #fff;
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 0.72rem;
}
.cc-portal-alert--prayer { border-left: 3px solid var(--ch-accent); }
.cc-portal-alert--praise { border-left: 3px solid var(--ch-warning); }

.portal-page__header {
    margin-bottom: 1rem;
}

@media (max-width: 991.98px) {
    .portal-home__grid {
        display: flex;
        flex-direction: column;
    }
    .portal-home__sidebar {
        order: -1;
    }
    .portal-home__sidebar .cc-panel:first-child {
        margin-bottom: 0.75rem;
    }
}

.cc-health-stat--link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cc-health-stat--link:hover {
    color: var(--ch-accent);
}

.cc-hero__portal-cta .btn {
    font-size: 0.8125rem;
}

.cc-context-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    background: #fff;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow-sm);
}

.cc-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--ch-muted);
}

.cc-context-pill strong {
    color: var(--ch-navy);
    font-weight: 600;
}

.cc-context-pill--open strong { color: var(--ch-success); }
.cc-context-pill--closed strong { color: var(--ch-warning); }
.cc-context-pill--unset strong { color: #64748b; }

.cc-kpi-card--primary { border-top: 3px solid var(--ch-primary); }
.cc-kpi-card--teal,
.cc-kpi-card--accent { border-top: 3px solid var(--ch-accent); }
.cc-kpi-card--warning { border-top: 3px solid var(--ch-warning); }
.cc-kpi-card--danger { border-top: 3px solid var(--ch-danger); }
.cc-kpi-card--success { border-top: 3px solid var(--ch-success); }

.dashboard-welcome {
    border-left: 4px solid transparent;
    padding-left: 0.85rem;
}
.dashboard-welcome--treasury { border-left-color: var(--ch-action); }
.dashboard-welcome--secretary { border-left-color: var(--ch-accent); }
.dashboard-welcome--leadership { border-left-color: var(--ch-warning); }
.dashboard-welcome--admin,
.dashboard-welcome--overseer,
.dashboard-welcome--district_overseer { border-left-color: var(--ch-brand); }

.cc-panel--priority {
    border-color: color-mix(in srgb, var(--ch-action) 22%, var(--ch-border));
    box-shadow: 0 8px 24px rgba(15, 41, 66, 0.06);
}

.cc-panel {
    background: #fff;
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow-sm);
    overflow: hidden;
}

.cc-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--ch-border);
    background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.cc-panel__title {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.cc-panel__badge {
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--ch-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cc-panel__body { padding: 1rem 1.1rem; }

.cc-panel__footer-link {
    display: block;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--ch-border);
    font-size: 0.82rem;
    text-decoration: none;
}

.cc-action-queue { padding: 0.35rem; }

.cc-action-item { border-radius: var(--ch-radius-xs); }

.cc-action-item__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
    transition: background var(--ch-transition);
}

.cc-action-item__link:hover { background: #f4f7fb; color: inherit; }

.cc-action-item__icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: var(--ch-primary);
    flex-shrink: 0;
}

.cc-action-item--critical .cc-action-item__icon { background: #fee2e2; color: #b91c1c; }
.cc-action-item--high .cc-action-item__icon { background: #fef3c7; color: #b45309; }

.cc-action-item__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.cc-action-item__title {
    font-size: 0.86rem;
    font-weight: 600;
}

.cc-action-item__subtitle {
    font-size: 0.72rem;
    color: var(--ch-muted);
}

.cc-action-item__count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ch-primary);
    background: #eef2ff;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}

.cc-action-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ch-muted);
}

.cc-compliance-list { padding: 0.75rem 1.1rem; }

.cc-compliance-item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--ch-border);
}

.cc-compliance-item:last-child { border-bottom: none; }

.cc-mini-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.1rem;
}

.cc-mini-kpi {
    padding: 0.75rem;
    border-radius: var(--ch-radius-xs);
    background: #f8fafc;
    border: 1px solid var(--ch-border);
}

.cc-mini-kpi span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ch-muted);
    margin-bottom: 0.25rem;
}

.cc-mini-kpi strong {
    font-size: 1rem;
}

/* ── Quick Actions (Updated for Right Alignment & Neatness) ── */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end; /* Aligns buttons to the right */
}

@media (max-width: 991px) {
    .quick-actions {
        justify-content: flex-start; /* Reset to left on mobile if preferred */
    }
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem; /* Smaller padding for neatness */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px; /* Cleaner look than full pill */
    font-size: 0.75rem; /* Smaller font */
    font-weight: 600;
    color: #fff !important; /* Pure white */
    text-decoration: none;
    transition: all var(--ch-transition);
    box-shadow: none;
}

.quick-action-btn:hover {
    background: #000; /* Black hover */
    border-color: #000;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-action-btn i {
    font-size: 0.85rem;
    opacity: 0.9;
}


/* ── Refined KPI Cards (Cleaner Look) ── */
.cc-kpi-card {
    /* Remove the colored top borders for a cleaner look */
    border-top: none; 
    border: 1px solid var(--ch-border);
    background: #fff;
}

.cc-kpi-card:hover {
    border-color: var(--ch-primary); /* Subtle highlight on hover */
}

/* Optional: Add a very subtle icon background if you want visual cues without color bars */
.cc-kpi-card--primary .cc-kpi-card__label::before,
.cc-kpi-card--accent .cc-kpi-card__label::before,
.cc-kpi-card--warning .cc-kpi-card__label::before,
.cc-kpi-card--danger .cc-kpi-card__label::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.cc-kpi-card--primary .cc-kpi-card__label::before { background: var(--ch-primary); }
.cc-kpi-card--accent .cc-kpi-card__label::before { background: var(--ch-accent); }
.cc-kpi-card--warning .cc-kpi-card__label::before { background: var(--ch-warning); }
.cc-kpi-card--danger .cc-kpi-card__label::before { background: var(--ch-danger); }

/* ── Compact Tables (District Roll-up & Leaderboard) ── */
.cc-panel .table tbody td {
    padding: 0.5rem 0.75rem; /* Even tighter rows */
    font-size: 0.8rem;
}

.cc-panel .table thead th {
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
}

/* ── Professional Footer Timestamp ── */
.cc-hero__footer {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Action Queue Refinement ── */
.cc-action-queue { 
    padding: 0.5rem; 
}

.cc-action-item { 
    margin-bottom: 0.5rem;
    border-radius: var(--ch-radius-xs);
    border: 1px solid transparent;
    transition: all var(--ch-transition);
}

.cc-action-item:last-child {
    margin-bottom: 0;
}

.cc-action-item__link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
    background: #fff;
    border: 1px solid var(--ch-border);
    transition: all var(--ch-transition);
}

.cc-action-item__link:hover { 
    background: #fff;
    border-color: var(--ch-primary);
    box-shadow: 0 4px 12px rgba(15, 41, 66, 0.08);
    transform: translateY(-1px);
}

.cc-action-item__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-surface);
    color: var(--ch-navy);
    font-size: 0.9rem;
    flex-shrink: 0;
    border: 1px solid var(--ch-border);
}

/* Priority Styling via Icon Color */
.cc-action-item--critical .cc-action-item__icon { 
    background: #fef2f2; 
    color: #b91c1c; 
    border-color: #fecaca;
}
.cc-action-item--high .cc-action-item__icon { 
    background: #fffbeb; 
    color: #b45309; 
    border-color: #fde68a;
}
.cc-action-item--normal .cc-action-item__icon {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.cc-action-item__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.cc-action-item__title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ch-text);
}

.cc-action-item__subtitle {
    font-size: 0.72rem;
    color: var(--ch-muted);
    margin-top: 0.1rem;
}

.cc-action-item__count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ch-primary);
    background: var(--ch-primary-soft);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    min-width: 1.5rem;
    text-align: center;
}

.cc-action-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--ch-muted);
    background: var(--ch-surface);
    border-radius: var(--ch-radius-xs);
    border: 1px dashed var(--ch-border);
}

.cc-action-empty i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--ch-success);
}


/* ── Teller Console Refinement ── */
#teller-console .table thead th {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* Restored Dark Navy Header */
    background: var(--ch-table-head-bg); 
    color: var(--ch-table-head-text);
    border-bottom: none;
    padding: 0.5rem 0.75rem;
}

#teller-console .table tbody td {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

#teller-console .table tfoot tr {
    background: var(--ch-surface-2);
    font-weight: 700;
}

#teller-console .table tfoot td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-top: 2px solid var(--ch-border-strong);
}

/* Highlight the 'New Receipt' button in the header */
#teller-console .btn-primary {
    background: var(--ch-navy);
    border-color: var(--ch-navy);
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
}

#teller-console .btn-primary:hover {
    background: #000;
    border-color: #000;
}


/* ── Workspace status bar (below module tabs) ── */
.workspace-status-bar {
    border-bottom: 1px solid var(--ch-border);
    background: #f8fafc;
}
.workspace-status-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 1rem;
    padding: 0.3rem 0;
}
.workspace-status-bar__meta,
.workspace-status-bar__cash,
.workspace-status-bar__finance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}
.workspace-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--ch-muted);
}
.workspace-status-pill__label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
}
.workspace-status-pill strong {
    color: var(--ch-navy);
    font-weight: 600;
}
.workspace-status-pill.is-open strong { color: var(--ch-success); }
.workspace-status-pill.is-closed strong { color: var(--ch-warning); }
.workspace-status-pill.is-unset strong { color: #64748b; }
.workspace-status-pill__link {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.15rem;
}
.workspace-status-pill--cash strong { font-variant-numeric: tabular-nums; }
.workspace-status-pill--finance strong { font-variant-numeric: tabular-nums; }

.filter-bar--actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    align-items: flex-end;
}
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.table-status {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ch-muted);
}
.table-status--approved { color: #047857; }
.table-status--pending { color: #b45309; }
.table-status--rejected { color: #b91c1c; }
.table-status--voided {
    display: inline-block;
    margin-left: 0.35rem;
    color: #64748b;
    font-weight: 500;
}

/* ── Member portal ─────────────────────────────────────────── */
.portal-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.35rem;
    background: linear-gradient(135deg, rgba(15, 41, 66, 0.04), rgba(14, 116, 144, 0.08));
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-lg, 12px);
}
.portal-hero__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.portal-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: var(--ch-shadow-sm);
}
.portal-avatar--lg { width: 96px; height: 96px; }
.portal-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
}
.portal-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.auth-split--portal .auth-split-brand--portal {
    background: linear-gradient(160deg, #0f2942 0%, #0e7490 100%);
}
.portal-navbar .navbar-utilities {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Organization scope UI ───────────────────────────────── */
.scope-invite-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    .scope-invite-layout { grid-template-columns: 1fr; }
}
.scope-invite-aside {
    background: linear-gradient(165deg, #0f2942 0%, #1e3a5f 55%, #0e7490 140%);
    color: #e8eef5;
    border-radius: 12px;
    padding: 1.35rem 1.25rem;
}
.scope-invite-aside__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
}
.scope-invite-steps {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.55;
}
.scope-invite-steps li { margin-bottom: 0.45rem; }
.scope-invite-aside__note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(232, 238, 245, 0.82);
}
.scope-form-section {
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ch-border);
}
.scope-form-section:last-of-type { border-bottom: 0; }
.scope-form-section__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ch-muted);
    margin: 0 0 0.75rem;
}
.scope-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 10rem;
}
.scope-cell__name { font-weight: 600; font-size: 0.92rem; }
.scope-cell__home { font-size: 0.78rem; }
.scope-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--ch-surface-2);
    color: var(--ch-text-secondary);
}
.scope-pill--church { background: #ecfeff; color: #0e7490; }
.scope-pill--district { background: #eff6ff; color: #1d4ed8; }
.scope-pill--zone { background: #f0fdf4; color: #047857; }
.scope-pill--conference { background: #fef3c7; color: #b45309; }
.scope-pill--union,
.scope-pill--general_conference { background: #faf5ff; color: #6b21a8; }
.scope-pill--denomination { background: #0f2942; color: #f1f5f9; }
.scope-summary-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid var(--ch-border);
    border-radius: 10px;
    background: linear-gradient(180deg, #fff 0%, var(--ch-surface) 100%);
}
.scope-summary-card__name { font-weight: 700; font-size: 1.05rem; }
.scope-summary-card__path { font-size: 0.85rem; }

/* User Control Center shell */
.ucc-nav {
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--ch-border);
}
.ucc-nav__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ch-text-secondary);
}
.ucc-nav__title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ch-text);
}
.ucc-nav__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--ch-text-secondary);
    max-width: 40rem;
}
.ucc-nav__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.95rem;
}
.ucc-nav__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ch-text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
}
.ucc-nav__tab:hover {
    color: var(--ch-text);
    background: var(--ch-surface-2);
}
.ucc-nav__tab.is-active {
    color: var(--ch-primary, #0f2942);
    background: var(--ch-surface);
    border-color: var(--ch-border);
}
.ucc-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.ucc-section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.ucc-section-desc {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--ch-text-secondary);
}

/* Page location eyebrow nav (legacy include; unused when subtitle is in page header) */
nav.page-eyebrow {
    border-bottom: 1px solid var(--ch-border);
    background: var(--ch-surface, #f8fafc);
}
nav.page-eyebrow .page-eyebrow__inner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.78rem;
    font-weight: 600;
}
nav.page-eyebrow .page-eyebrow__section { color: var(--ch-text-secondary); }
nav.page-eyebrow .page-eyebrow__sep { color: var(--ch-muted, #94a3b8); }
nav.page-eyebrow .page-eyebrow__page { color: var(--ch-text); }

.alert-banner-stack { display: flex; flex-direction: column; gap: 0.4rem; }
.alert-banner__link {
    flex-shrink: 0;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    opacity: 0.85;
}
.alert-banner__link:hover { opacity: 1; text-decoration: underline; }
.alert-banner-more { padding-left: 0.15rem; }

.calendar-preview-item__meta { font-size: 0.75rem; }

.nav-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
}

/* Mobile accordion primary nav */
.nav-mobile-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.35rem 0 0.75rem;
}
.nav-mobile-link,
.nav-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
}
.nav-mobile-link:hover,
.nav-mobile-toggle:hover,
.nav-mobile-link.is-active,
.nav-mobile-toggle.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.nav-mobile-link__label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.nav-mobile-toggle__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.85;
}
.nav-mobile-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}
.nav-mobile-panel {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.15rem 0.35rem 0.55rem 1.75rem;
}
.nav-mobile-panel__title {
    margin: 0.45rem 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}
.nav-mobile-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.875rem;
}
.nav-mobile-item:hover,
.nav-mobile-item.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ch-empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
}
.ch-empty-state--compact { padding: 0.85rem 0.5rem; }
.ch-empty-state__icon {
    font-size: 1.5rem;
    color: var(--ch-muted, #94a3b8);
    display: block;
    margin-bottom: 0.35rem;
}
.ch-empty-state__title {
    margin: 0 0 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.ch-empty-state__message { font-size: 0.85rem; }
.ch-empty-state__actions { margin-top: 0.75rem; }

.list-group-item--unread {
    background: var(--ch-primary-soft, rgba(37, 99, 235, 0.06));
    border-left: 3px solid var(--ch-primary, #2563eb);
}

.filter-field--check {
    display: flex;
    align-items: flex-end;
    padding-bottom: 0.15rem;
}
.filter-field--check .form-check {
    margin: 0;
    min-height: auto;
}
.filter-field--check .form-check-label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.8125rem;
}

/* This Week Pulse — compact hero strip */
.cc-pulse-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}
.cc-pulse-hero__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
}
.cc-pulse-hero__dates {
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: #94a3b8;
}
.cc-pulse-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}
.cc-pulse-hero__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 0.75rem;
    line-height: 1.2;
}
.cc-pulse-hero__chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: inherit;
}
.cc-pulse-hero__chip strong {
    font-size: 0.9rem;
    font-weight: 700;
}
.cc-pulse-hero__chip span { color: #64748b; }
.cc-pulse-hero__chip--visitors { border-color: #fbcfe8; background: #fdf2f8; }
.cc-pulse-hero__chip--visitors strong { color: #be185d; }
.cc-pulse-hero__chip--birthdays { border-color: #fde68a; background: #fffbeb; }
.cc-pulse-hero__chip--birthdays strong { color: #b45309; }
.cc-pulse-hero__chip--transfers { border-color: #bfdbfe; background: #eff6ff; }
.cc-pulse-hero__chip--transfers strong { color: #1d4ed8; }
.cc-pulse-hero__chip--meetings { border-color: #a7f3d0; background: #ecfdf5; }
.cc-pulse-hero__chip--meetings strong { color: #047857; }

/* Legacy pulse panel styles (unused compact grid kept for safety) */
.cc-pulse__chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .cc-pulse__chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cc-pulse__chip {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--ch-radius-sm, 0.5rem);
    border: 1px solid var(--ch-border, #e5e7eb);
    text-decoration: none;
    color: inherit;
}
.cc-pulse__chip-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
}
.cc-pulse__chip-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

/* ── App chrome: workspace + section nav below main navbar ── */
.app-chrome-secondary {
    background: var(--ch-surface);
    border-bottom: 1px solid var(--ch-border);
}

.module-tabs--section {
    position: static;
    background: transparent;
    border-bottom: none;
    padding: 0.15rem 0 0.55rem;
    margin: 0;
}

.module-tabs--section .module-tabs-scroll {
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.module-tabs--section .module-tab {
    padding: 0.28rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--ch-border);
    border-radius: 999px;
    margin-bottom: 0;
    background: #fff;
    color: var(--ch-text-secondary);
}

.module-tabs--section .module-tab:hover {
    color: var(--ch-text);
    border-color: var(--ch-border-strong);
    background: #fff;
}

.module-tabs--section .module-tab.is-active {
    color: var(--ch-primary);
    border-color: color-mix(in srgb, var(--ch-primary) 35%, var(--ch-border));
    background: var(--ch-primary-soft);
    border-bottom-color: color-mix(in srgb, var(--ch-primary) 35%, var(--ch-border));
}

.module-tabs--section .module-tab i {
    font-size: 0.78rem;
}

.workspace-status-bar {
    border-bottom: none;
    background: transparent;
}

.workspace-status-bar__inner {
    padding: 0.35rem 0 0.15rem;
}

/* ── Calm density: tables, buttons, cards ── */
.main-content .btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.72rem;
    box-shadow: none;
}

.main-content .btn-sm {
    font-size: 0.72rem;
    padding: 0.22rem 0.55rem;
}

.main-content .btn-primary:hover {
    transform: none;
    box-shadow: none;
}

.main-content .card,
.main-content .data-card,
.main-content .cc-panel {
    border-radius: var(--ch-radius-sm);
    box-shadow: none;
}

.main-content .cc-panel__header {
    padding: 0.55rem 0.85rem;
    background: #fff;
    border-bottom: 1px solid var(--ch-border);
}

.main-content .cc-panel__title {
    font-size: 0.82rem;
    font-weight: 600;
}

.main-content .cc-panel__body {
    padding: 0.65rem 0.85rem;
}

.main-content .card-header,
.main-content .data-card__header {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.main-content .card-body {
    padding: 0.75rem 0.85rem;
}

.main-content .table thead th {
    background: var(--ch-table-head-bg);
    color: var(--ch-table-head-text);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: none;
    padding: 0.38rem 0.65rem;
}

.main-content .table tbody td {
    padding: 0.38rem 0.65rem;
    font-size: 0.76rem;
}

.main-content .table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.main-content .table tbody tr:hover {
    background: rgba(15, 41, 66, 0.03);
}

.main-content .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    font-weight: 600;
}

.control-center--home .cc-hero {
    box-shadow: none;
}

@media print {
    .ch-navbar, .app-footer, .flash-stack, .module-tabs,
    .workspace-status-bar, .filter-bar, .no-print, .page-header-actions,
    .ucc-nav, .page-eyebrow, .nav-mobile-accordion { display: none !important; }
    .main-content { padding: 0; }
    .card, .data-card { box-shadow: none; border: 1px solid #ddd; }
}
