/* =========================================================
   صندوق خيري الدفعة 50 — نظام تصميم موحّد
   Trusted military-alumni charity fund
   ========================================================= */

:root {
    --navy: #0b1f2a;
    --navy-deep: #07141c;
    --olive: #2f3f2c;
    --olive-mid: #3d4f3a;
    --gold: #c9a227;
    --gold-bright: #e4c04a;
    --gold-dim: #9a7b1a;
    --cream: #f4efe4;
    --parchment: #ebe3d2;
    --ink: #17211c;
    --card-paper: #fffdf8;

    --primary-color: #0b1f2a;
    --secondary-color: #c9a227;
    --accent-color: #8f2d2d;
    --danger-color: #8f2d2d;
    --bg-color: #f4efe4;
    --card-bg: #fffdf8;
    --text-color: #17211c;
    --muted-text: #5c675e;
    --border-color: #d6cbb4;
    --input-bg: #fffdf8;
    --success-bg: #e7f3ea;
    --success-color: #245c32;
    --success-border: #9dcea8;
    --info-bg: #e7eef2;
    --info-color: #1d4656;
    --info-border: #9db8c4;
    --header-grad-from: #0b1f2a;
    --header-grad-to: #1a3328;
    --header-line-color: #c9a227;
    --footer-line-color: #c9a227;
    --nav-drawer-bg: #081610;
    --font-family: 'Cairo', 'Sukar-Regular', 'Segoe UI', Tahoma, sans-serif;
    --btn-radius: 12px;
    --card-radius: 16px;
    --card-shadow: 0 10px 28px rgba(11, 31, 42, 0.08);
    --focus-ring: 0 0 0 3px rgba(201, 162, 39, 0.35);
}

html {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.75;
}

body {
    background:
        radial-gradient(1200px 420px at 100% -10%, rgba(201, 162, 39, 0.12), transparent 55%),
        radial-gradient(900px 380px at -10% 0%, rgba(47, 63, 44, 0.1), transparent 50%),
        var(--bg-color);
}

/* ---------- Header lockup ---------- */
header,
.site-header {
    background: linear-gradient(135deg, var(--header-grad-from), var(--header-grad-to)) !important;
    border-bottom: 2px solid var(--gold) !important;
    box-shadow: 0 10px 30px rgba(7, 20, 28, 0.28) !important;
    backdrop-filter: saturate(1.2) blur(10px);
    padding: max(0.45rem, var(--safe-top)) 0 0.45rem !important;
}

.site-nav,
header > nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.logo,
.logo-lockup {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    color: #f8f4e8;
    text-decoration: none;
    flex: 1;
}

.logo-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(201, 162, 39, 0.22), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(201, 162, 39, 0.55);
    color: var(--gold-bright);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.logo-mark i,
.logo-mark img {
    font-size: 1.15rem;
    max-height: 26px;
    width: auto;
}

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

.logo-title,
.logo {
    font-size: clamp(0.84rem, 3.4vw, 1.05rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(228, 192, 74, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.header-icon-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    border: 1px solid rgba(201, 162, 39, 0.38);
    background: rgba(255, 255, 255, 0.05);
    color: #f6e7b2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 0;
}

.header-icon-btn:hover,
.header-icon-btn[aria-expanded="true"] {
    background: rgba(201, 162, 39, 0.16);
    color: #fff;
}
.user-chip.header-icon-btn {
    width: auto;
    padding: 0 0.7rem 0 0.35rem;
}

.header-icon-btn .notify-dot,
.nav-badge {
    background: var(--gold);
    color: #1a1404;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 800;
}

.header-icon-btn .notify-dot {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-chip {
    display: none;
}

.user-menu,
.notify-menu {
    position: relative;
}

.user-menu-panel,
.notify-menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: var(--card-paper);
    color: var(--ink);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(7, 20, 28, 0.22);
    padding: 0.4rem;
    z-index: 1300;
}

.user-menu.open .user-menu-panel,
.notify-menu.open .notify-menu-panel {
    display: block;
}

.user-menu-panel a,
.user-menu-panel button,
.notify-menu-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover,
.notify-menu-panel a:hover {
    background: rgba(201, 162, 39, 0.12);
}

.notify-empty {
    padding: 0.85rem;
    color: var(--muted-text);
    font-size: 0.88rem;
}

.nav-toggle {
    border-color: rgba(201, 162, 39, 0.55) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Drawer groups */
.nav-section-label {
    display: block;
    margin: 0.85rem 0.35rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: rgba(228, 192, 74, 0.78);
    text-transform: none;
}

.nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.68rem;
}

.nav-item,
.nav-links a {
    color: #efe6d0;
}

@media (min-width: 768px) {
    .logo-lockup { flex: 0 1 auto; max-width: 280px; }
    .nav-menu { order: 2; flex: 1 1 auto; }
    .header-tools { order: 3; }
    .logo-sub { display: block; }
    .user-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        max-width: 160px;
        min-height: 42px;
        padding: 0 0.7rem 0 0.35rem;
        border-radius: 999px;
        border: 1px solid rgba(201, 162, 39, 0.35);
        background: rgba(255, 255, 255, 0.06);
        color: #f6e7b2;
        font-weight: 700;
        font-size: 0.82rem;
        cursor: pointer;
    }
    .user-chip span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-chip .avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: rgba(201, 162, 39, 0.22);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--gold-bright);
    }
    .nav-section-label { display: none; }
    .user-menu-panel,
    .notify-menu-panel { left: auto; right: 0; }
    header .nav-menu .nav-item,
    header .nav-menu a.nav-item {
        background: transparent;
        padding: 0.38rem 0.7rem;
        font-size: 0.82rem;
        font-weight: 700;
    }
}

/* ---------- Admin nav control (الإدارة) ---------- */
.nav-admin {
    position: relative;
    flex-shrink: 0;
}

header .nav-admin .nav-admin-btn,
header .nav-admin button.dropdown-toggle,
.nav-admin-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    height: 42px;
    min-height: 42px;
    min-width: 0;
    margin: 0;
    padding: 0 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(201, 162, 39, 0.45);
    background: rgba(255, 255, 255, 0.06);
    color: #f6e7b2;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    text-align: inherit;
}

header .nav-admin .nav-admin-btn:hover,
header .nav-admin .nav-admin-btn:focus-visible,
header .nav-admin.open .nav-admin-btn,
header .nav-admin:hover .nav-admin-btn {
    background: rgba(201, 162, 39, 0.16);
    color: #fff8e6;
    border-color: rgba(201, 162, 39, 0.72);
}

.nav-admin-btn .fa-shield-alt,
.nav-admin-btn i:first-child {
    font-size: 0.88rem;
    line-height: 1;
    color: var(--gold-bright);
}

.nav-admin-label {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

.nav-admin-chevron,
.nav-admin-btn .fa-chevron-down {
    font-size: 0.58rem;
    line-height: 1;
    margin: 0 !important;
    opacity: 0.82;
    transform: none;
    transition: transform 0.18s ease;
}

.nav-admin:hover .nav-admin-chevron,
.nav-admin.open .nav-admin-chevron {
    transform: rotate(180deg);
}

.nav-admin-panel,
header .nav-admin .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    inset-inline-start: auto;
    min-width: 240px;
    max-width: min(320px, 92vw);
    max-height: min(70vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.4rem;
    background: var(--card-paper);
    color: var(--ink);
    border: 1px solid var(--gold);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(7, 20, 28, 0.22);
    z-index: 1300;
}

header .nav-admin:hover .nav-admin-panel,
header .nav-admin.open .nav-admin-panel,
header .nav-admin:hover .dropdown-menu,
header .nav-admin.open .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-admin-panel a,
header .nav-admin .dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
}

.nav-admin-panel a:hover,
header .nav-admin .dropdown-menu a:hover {
    background: rgba(201, 162, 39, 0.12);
    color: var(--navy);
}

@media (max-width: 767px) {
    header .nav-admin {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    header .nav-admin .nav-admin-btn,
    header .nav-admin button.dropdown-toggle {
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        margin: 0.85rem 0.35rem 0.35rem;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: rgba(228, 192, 74, 0.78);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        justify-content: flex-start;
        text-align: start;
        pointer-events: none;
        cursor: default;
        box-shadow: none;
    }

    header .nav-admin .nav-admin-btn:hover,
    header .nav-admin .nav-admin-btn:focus-visible,
    header .nav-admin.open .nav-admin-btn,
    header .nav-admin:hover .nav-admin-btn {
        background: transparent;
        color: rgba(228, 192, 74, 0.78);
        border-color: transparent;
    }

    header .nav-admin .fa-shield-alt,
    header .nav-admin .nav-admin-chevron,
    header .nav-admin .fa-chevron-down {
        display: none;
    }

    header .nav-admin-panel,
    header .nav-admin .dropdown-menu,
    header .nav-admin:hover .nav-admin-panel,
    header .nav-admin.open .nav-admin-panel,
    header .nav-admin:hover .dropdown-menu,
    header .nav-admin.open .dropdown-menu {
        display: flex !important;
        flex-direction: column;
        position: static;
        inset: auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        gap: 0.35rem;
    }

    header .nav-admin-panel a,
    header .nav-admin .dropdown-menu a {
        color: #efe6d0;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 12px;
        min-height: 44px;
        font-size: 0.95rem;
    }

    header .nav-admin-panel a:hover,
    header .nav-admin .dropdown-menu a:hover {
        background: rgba(201, 162, 39, 0.14);
        color: #fff8e6;
    }
}

/* ---------- Cards / type ---------- */
.card,
.lookup-form,
.result-card,
.form-container,
.profile-section,
.logs-section,
.add-transaction,
.analyze-sms,
.bulk-analyze,
.login-container,
.add-user,
.edit-form,
.user-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.card h1,
.card h2,
.lookup-wrap h1,
.dashboard-header h1 {
    color: var(--navy);
    font-weight: 800;
}

.card p.description,
.muted,
.text-muted {
    color: var(--muted-text);
}

.btn,
.btn-primary,
.btn-secondary {
    font-family: inherit;
    font-weight: 700;
    border-radius: var(--btn-radius);
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary,
button.btn-primary {
    background: linear-gradient(180deg, #1a3328, var(--navy));
    color: #fff8e6;
    border: 1px solid rgba(201, 162, 39, 0.35);
    box-shadow: 0 8px 18px rgba(11, 31, 42, 0.18);
}

.btn-primary:hover,
button.btn-primary:hover {
    background: linear-gradient(180deg, #244536, #10242c);
    color: #fff;
}

.btn-secondary {
    background: #efe6d0;
    color: var(--navy);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e4d7b6;
    color: var(--navy);
}

.btn:focus-visible,
.header-icon-btn:focus-visible,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: var(--focus-ring);
    border-color: var(--gold);
}

.badge,
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.badge-success { background: #e4f4e8; color: #1f5a2c; }
.badge-warning { background: #fff3d0; color: #7a5a10; }
.badge-danger { background: #fde8e8; color: #8a2424; }
.badge-info { background: #e5eef3; color: #1d4656; }
.badge-vodafone { background: #fde8e8; color: #8a2424; }
.badge-instapay { background: #e5eef3; color: #1d4656; }

/* ---------- Home ---------- */
.hero,
.home-hero {
    background:
        linear-gradient(145deg, rgba(11, 31, 42, 0.94), rgba(26, 51, 40, 0.92)),
        radial-gradient(circle at 90% 10%, rgba(201, 162, 39, 0.28), transparent 40%) !important;
    color: #f8f4e8;
    border: 1px solid rgba(201, 162, 39, 0.28);
}

/* Title/subtitle only — do not paint every nested card cream-on-cream */
.hero > h1,
.home-hero > h1,
.hero > p,
.home-hero > p {
    color: #f8f4e8 !important;
}

.home-quick-actions {
    position: sticky;
    top: calc(var(--safe-top) + 64px);
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0.65rem 0 0.85rem;
    padding: 0.45rem;
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(11, 31, 42, 0.08);
    backdrop-filter: blur(8px);
}

.home-quick-actions a {
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    text-decoration: none;
    color: #0b1f2a;
    font-weight: 800;
    font-size: 0.78rem;
    border-radius: 12px;
    background: #f4efe4;
}

.home-quick-actions a i {
    color: #7a6114;
    font-size: 1.05rem;
}

.home-quick-actions a:hover {
    background: rgba(201, 162, 39, 0.16);
}

.stat-card {
    background: var(--card-paper) !important;
    border: 1px solid var(--border-color);
    border-radius: 16px !important;
}

.stat-card .amount {
    color: var(--navy) !important;
    font-variant-numeric: tabular-nums;
}

.home-vodafone-number {
    background: rgba(7, 20, 28, 0.72) !important;
    border-color: var(--gold) !important;
}

/* Homepage contrast lock — keep labels/numbers readable on cream and navy */
body.page-home:not(.dark-mode) {
    --navy: #0b1f2a;
    --card-paper: #fffdf8;
    --card-bg: #fffdf8;
    --text-color: #17211c;
    --ink: #17211c;
    --muted-text: #4a554c;
    --primary-color: #0b1f2a;
}

body.page-home:not(.dark-mode) .stat-card {
    background: #fffdf8 !important;
    color: #17211c !important;
}

body.page-home:not(.dark-mode) .stat-card h3 {
    color: #3d4a40 !important;
}

body.page-home:not(.dark-mode) .stat-card .amount,
body.page-home:not(.dark-mode) .stat-card p.amount {
    color: #07141c !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.page-home:not(.dark-mode) .stat-card .sub-amount {
    color: #4a554c !important;
}

body.page-home:not(.dark-mode) .empty-state {
    background: #fffdf8 !important;
    color: #17211c !important;
}

body.page-home:not(.dark-mode) .empty-state strong {
    color: #0b1f2a;
}

body.page-home:not(.dark-mode) .home-vodafone,
body.page-home:not(.dark-mode) .home-vodafone.card {
    background: #fffdf8 !important;
    color: #17211c !important;
}

body.page-home:not(.dark-mode) .home-vodafone h2 {
    color: #0b1f2a !important;
}

body.page-home:not(.dark-mode) .home-vodafone p,
body.page-home:not(.dark-mode) .home-vodafone-label,
body.page-home:not(.dark-mode) .home-vodafone .description {
    color: #3d4a40 !important;
}

body.page-home .home-vodafone-number,
body.page-home .home-vodafone p.home-vodafone-number,
body.page-home:not(.dark-mode) .home-vodafone p.home-vodafone-number,
body.dark-mode.page-home .home-vodafone p.home-vodafone-number {
    color: #fff8e6 !important;
    background: #07141c !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    letter-spacing: 0.03em !important;
}

body.page-home:not(.dark-mode) .home-actions .btn-primary {
    color: #fff8e6 !important;
    background: linear-gradient(180deg, #1a3328, #0b1f2a) !important;
}

body.page-home:not(.dark-mode) .home-actions .btn-secondary {
    color: #0b1f2a !important;
    background: #efe6d0 !important;
    border: 1px solid #d6cbb4 !important;
}

body.page-home:not(.dark-mode) .card:not(.home-hero) {
    color: #17211c;
}

body.page-home:not(.dark-mode) .card h2,
body.page-home:not(.dark-mode) .news-title {
    color: #0b1f2a !important;
}

body.page-home:not(.dark-mode) .news-text {
    color: #17211c !important;
}

body.page-home:not(.dark-mode) .text-muted {
    color: #4a554c !important;
}

body.dark-mode.page-home .stat-card,
body.dark-mode.page-home .home-vodafone,
body.dark-mode.page-home .home-vodafone.card,
body.dark-mode.page-home .home-quick-actions,
body.dark-mode.page-home main > .card {
    background: #151c18 !important;
    color: #f3efe4 !important;
    border-color: #2c3830;
}

body.dark-mode.page-home .stat-card h3,
body.dark-mode.page-home .home-vodafone h2,
body.dark-mode.page-home .card h2,
body.dark-mode.page-home .news-title {
    color: #e4c04a !important;
}

body.dark-mode.page-home .stat-card .amount,
body.dark-mode.page-home .stat-card p.amount {
    color: #f8f4e8 !important;
}

body.dark-mode.page-home .stat-card .sub-amount,
body.dark-mode.page-home .home-vodafone p,
body.dark-mode.page-home .home-vodafone-label,
body.dark-mode.page-home .home-vodafone .description,
body.dark-mode.page-home .text-muted,
body.dark-mode.page-home .empty-state {
    color: #d2cbb8 !important;
}

body.dark-mode.page-home .empty-state {
    background: #151c18 !important;
}

body.dark-mode.page-home .news-text {
    color: #f3efe4 !important;
}

body.dark-mode.page-home .home-quick-actions a {
    background: #1c2620;
    color: #f3efe4;
}

body.dark-mode.page-home .home-quick-actions a i {
    color: #e4c04a;
}

body.dark-mode.page-home .home-actions .btn-primary {
    color: #fff8e6 !important;
}

body.dark-mode.page-home .home-actions .btn-secondary {
    color: #f3efe4 !important;
    background: #243028 !important;
    border-color: #2c3830 !important;
}

/* ---------- Dashboard chips ---------- */
.summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--card-paper);
    border: 1px solid var(--border-color);
    color: var(--ink);
    font-weight: 800;
    font-size: 0.82rem;
    text-decoration: none;
}

.summary-chip strong {
    color: var(--gold-dim);
    font-variant-numeric: tabular-nums;
}

.empty-state {
    text-align: center;
    padding: 1.6rem 1rem;
    color: var(--muted-text);
    background: rgba(255, 253, 248, 0.7);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
}

.empty-state i {
    display: block;
    font-size: 1.6rem;
    color: var(--gold-dim);
    margin-bottom: 0.45rem;
}

/* ---------- Status timeline ---------- */
.status-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 1rem 0 0.25rem;
    padding: 0;
    list-style: none;
}

.status-timeline li {
    flex: 1;
    text-align: center;
    position: relative;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted-text);
}

.status-timeline li::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto 0.4rem;
    border-radius: 50%;
    background: #d6cbb4;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d6cbb4;
    position: relative;
    z-index: 1;
}

.status-timeline li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    right: 50%;
    height: 2px;
    background: #d6cbb4;
}

.status-timeline li + li::after {
    /* line from previous handled by :not(:last-child) on previous */
}

.status-timeline li.is-done,
.status-timeline li.is-current {
    color: var(--navy);
}

.status-timeline li.is-done::before,
.status-timeline li.is-current::before {
    background: var(--gold);
    box-shadow: 0 0 0 2px var(--gold);
}

.status-timeline li.is-rejected {
    color: #8a2424;
}

.status-timeline li.is-rejected::before {
    background: #8a2424;
    box-shadow: 0 0 0 2px #8a2424;
}

/* ---------- Toasts / modal / offline ---------- */
.fund-toasts {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    left: 12px;
    right: 12px;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.fund-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: var(--navy);
    color: #fff8e6;
    box-shadow: 0 16px 36px rgba(7, 20, 28, 0.28);
    font-weight: 700;
    line-height: 1.55;
}

.fund-toast-success { background: #1f4a2c; }
.fund-toast-error { background: #6d2424; }
.fund-toast-warning { background: #6d5310; }
.fund-toast-info { background: #1d3d4a; }
.fund-toast-close {
    margin-right: auto;
    background: transparent;
    border: 0;
    color: inherit;
    min-width: 36px;
    min-height: 36px;
    cursor: pointer;
}
.fund-toast.is-leaving { opacity: 0; transform: translateY(-8px); }

.fund-modal[hidden] { display: none !important; }
.fund-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.fund-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 28, 0.55);
}
.fund-modal-sheet {
    position: relative;
    width: min(440px, 100%);
    background: var(--card-paper);
    color: var(--ink);
    border-radius: 20px 20px 0 0;
    padding: 1.25rem 1.15rem calc(1.15rem + var(--safe-bottom));
    box-shadow: 0 -16px 40px rgba(7, 20, 28, 0.28);
}
.fund-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 162, 39, 0.16);
    color: var(--gold-dim);
    margin-bottom: 0.6rem;
    font-size: 1.2rem;
}
.fund-modal-title { font-size: 1.1rem; margin: 0 0 0.35rem; }
.fund-modal-text { margin: 0 0 1rem; color: var(--muted-text); }
.fund-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.fund-modal-actions .btn { width: 100%; justify-content: center; }
body.fund-modal-open { overflow: hidden; }

.fund-offline {
    position: sticky;
    top: 0;
    z-index: 1250;
    background: #6d5310;
    color: #fff8e6;
    text-align: center;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ---------- Stacked tables (mobile) ---------- */
@media (max-width: 767px) {
    .stack-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }
    .stack-table,
    .stack-table table {
        min-width: 0 !important;
        width: 100%;
    }
    .stack-table tbody tr {
        display: block;
        background: var(--card-paper);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        padding: 0.75rem 0.9rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 8px 20px rgba(11, 31, 42, 0.06);
    }
    .stack-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.7rem;
        width: 100%;
        padding: 0.4rem 0;
        border: 0;
        white-space: normal !important;
        text-align: left;
    }
    .stack-table tbody td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--muted-text);
        flex: 0 0 38%;
        text-align: right;
    }
    .stack-table tbody td.tr-check-col {
        justify-content: flex-start;
    }
    .stack-table tbody td.tr-check-col::before {
        flex-basis: auto;
        margin-left: 0.4rem;
    }
    .stack-table tbody td[colspan] {
        display: block;
    }
    .stack-table tbody td[colspan]::before {
        display: none;
    }
    .page-form .btn-primary,
    .page-auth .btn-primary,
    .lookup-form .btn-primary {
        margin-bottom: 0.5rem;
    }
    .home-quick-actions {
        top: calc(var(--safe-top) + 58px);
    }
}

@media (min-width: 768px) {
    .home-quick-actions {
        display: none;
    }
    .fund-toasts {
        left: auto;
        right: 18px;
        width: min(380px, calc(100vw - 36px));
    }
    .fund-modal {
        align-items: center;
    }
    .fund-modal-sheet {
        border-radius: 18px;
        padding-bottom: 1.15rem;
    }
}

/* ---------- Footer / bottom nav polish ---------- */
footer {
    background: #07141c;
    color: #cfc6b0;
    border-top-color: var(--gold) !important;
}

.bottom-nav {
    background: #081610 !important;
    border-top: 1px solid rgba(201, 162, 39, 0.28) !important;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--gold-bright) !important;
}

.page-form,
.page-auth,
.page-lookup,
.page-dashboard,
.page-admin {
    padding-bottom: calc(var(--bottom-nav-h, 64px) + var(--safe-bottom) + 12px);
}

body.page-admin main.dashboard,
body.page-admin main.manage-users,
body.page-admin main.container,
body.page-dashboard main.dashboard {
    max-width: 1200px;
    margin: 1rem auto 2rem;
    padding: 0 0.9rem;
}

.admin-page-head {
    background: var(--card-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1rem 1.15rem;
    margin-bottom: 0.35rem;
    box-shadow: var(--card-shadow);
}

.admin-page-head h1,
.admin-page-head h2 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.15rem, 3.2vw, 1.45rem);
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-page-head p {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.section-block {
    background: var(--card-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 0.85rem 1rem 1rem;
    margin-top: 1rem;
    box-shadow: 0 8px 20px rgba(11, 31, 42, 0.05);
}

.section-block-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--navy);
}

.count-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.4rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.2);
    color: #6d5310;
    font-size: 0.78rem;
    font-weight: 800;
}

.fold-block {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: var(--card-paper);
    margin-top: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(11, 31, 42, 0.05);
}

.fold-block > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.9rem 1.1rem;
    font-weight: 800;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 52px;
    width: 100%;
    box-sizing: border-box;
    color: var(--navy);
    user-select: none;
}

.fold-block > summary::-webkit-details-marker {
    display: none;
}

.fold-block > summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: auto;
    font-size: 0.85rem;
    color: var(--muted-text);
    transition: transform 0.18s ease;
}

.fold-block[open] > summary {
    border-bottom: 1px solid var(--border-color);
    background: rgba(201, 162, 39, 0.08);
}

.fold-block[open] > summary::after {
    transform: rotate(180deg);
}

.fold-body {
    padding: 0.75rem 0.85rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.fold-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-text);
}

.month-summary-table .month-cell {
    min-width: 8.5rem;
    vertical-align: middle;
}

.month-cell .month-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 0.15rem;
}

.month-cell strong {
    display: block;
    font-size: 0.95rem;
}

.month-cell small {
    display: block;
    color: var(--muted-text);
    font-weight: 600;
}

.month-intents {
    background: rgba(201, 162, 39, 0.16);
    border-inline-start: 4px solid var(--gold);
}

.month-intents .month-kicker {
    color: #6d5310;
}

.month-ledger {
    background: rgba(36, 92, 50, 0.12);
    border-inline-start: 4px solid #245c32;
}

.month-ledger .month-kicker {
    color: #245c32;
}

.month-outgoing {
    background: rgba(143, 45, 45, 0.12);
    border-inline-start: 4px solid #8f2d2d;
}

.month-outgoing .month-kicker {
    color: #8f2d2d;
}

.month-total {
    background: rgba(11, 31, 42, 0.08);
    font-weight: 800;
}

.month-total-negative {
    background: rgba(143, 45, 45, 0.08);
    color: #8a2424;
}

.month-total-negative .month-kicker,
.month-total-negative strong {
    color: #8a2424;
}

.dark-mode .month-intents,
[data-theme="dark"] .month-intents {
    background: rgba(201, 162, 39, 0.14);
}

.dark-mode .month-ledger,
[data-theme="dark"] .month-ledger {
    background: rgba(61, 140, 80, 0.16);
}

.dark-mode .month-ledger .month-kicker,
[data-theme="dark"] .month-ledger .month-kicker {
    color: #9dcea8;
}

.dark-mode .month-outgoing,
[data-theme="dark"] .month-outgoing {
    background: rgba(192, 80, 80, 0.16);
}

.dark-mode .month-outgoing .month-kicker,
[data-theme="dark"] .month-outgoing .month-kicker {
    color: #e0a0a0;
}

.dark-mode .month-total,
[data-theme="dark"] .month-total {
    background: rgba(201, 162, 39, 0.08);
}

.dark-mode .month-total-negative,
[data-theme="dark"] .month-total-negative {
    background: rgba(192, 80, 80, 0.12);
    color: #d4a0a0;
}

.dark-mode .month-total-negative .month-kicker,
.dark-mode .month-total-negative strong,
[data-theme="dark"] .month-total-negative .month-kicker,
[data-theme="dark"] .month-total-negative strong {
    color: #d4a0a0;
}

.month-summary-table .month-more-row > td {
    padding: 0 !important;
    border: 0;
    background: transparent;
}

.month-more-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 1rem;
    border: 0;
    border-top: 2px solid var(--gold);
    background: var(--navy);
    color: var(--gold-bright);
    font: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
}

.month-more-toggle .month-more-label {
    color: inherit;
}

.month-more-toggle .count-chip {
    background: rgba(201, 162, 39, 0.28);
    color: #f6e7a8;
}

.month-more-toggle i {
    font-size: 0.8rem;
    transition: transform 0.18s ease;
}

.month-more-toggle:hover,
.month-more-toggle:focus-visible {
    background: var(--navy-deep);
    color: #f6e7a8;
    outline: none;
}

.month-more-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.month-extra-rows[hidden] {
    display: none;
}

.dark-mode .month-more-toggle,
[data-theme="dark"] .month-more-toggle {
    background: #07141c;
    border-top-color: var(--gold);
    color: var(--gold-bright);
}

.dark-mode .month-more-toggle:hover,
.dark-mode .month-more-toggle:focus-visible,
[data-theme="dark"] .month-more-toggle:hover,
[data-theme="dark"] .month-more-toggle:focus-visible {
    background: #0b1f2a;
}

@media (max-width: 767px) {
    .stack-table tbody tr.month-more-row {
        padding: 0;
        margin: 0.35rem 0 0.75rem;
        border: 0;
        border-radius: 14px;
        box-shadow: none;
        background: transparent;
        overflow: hidden;
    }
    .stack-table tbody tr.month-more-row > td {
        display: block;
        padding: 0 !important;
        width: 100%;
    }
    .stack-table .month-more-toggle {
        border-top: 0;
        border-radius: 14px;
    }
}

/* Admin table actions (loans, transfers, cases): one even column of real buttons */
.loan-actions-cell,
.admin-actions-cell {
    vertical-align: middle;
    white-space: normal !important;
    min-width: 9.5rem;
}

.loan-actions,
.admin-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.loan-actions form,
.admin-actions form {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
}

.loan-actions > .btn,
.loan-actions form > .btn,
.loan-actions a.btn,
.admin-actions > .btn,
.admin-actions form > .btn,
.admin-actions a.btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    min-height: 40px;
    white-space: nowrap;
    text-decoration: none !important;
    color: #fff !important;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
}

.loan-actions a.btn-success,
.loan-actions a.btn-whatsapp,
.admin-actions a.btn-success,
.admin-actions a.btn-whatsapp,
.btn-success {
    background: #1f9d4a !important;
    color: #fff !important;
}

.loan-actions a.btn-primary,
.admin-actions a.btn-primary,
.admin-actions .btn-primary {
    background: linear-gradient(180deg, #1a3328, var(--navy)) !important;
    color: #fff !important;
}

.loan-actions .btn-warning,
.admin-actions .btn-warning {
    background: #b45309 !important;
    color: #fff !important;
}

.admin-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-detail-actions form {
    margin: 0;
}

.admin-detail-card {
    margin-bottom: 1.25rem;
}

.admin-detail-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.9;
}

.loan-edit-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.loan-edit-form h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.loan-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0.75rem 0 1rem;
}

.loan-edit-grid .form-group {
    margin: 0;
}

.loan-edit-grid .form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.loan-edit-grid .form-group input,
.loan-edit-grid .form-group textarea {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    font: inherit;
}

.loan-edit-grid .form-group textarea {
    min-height: 6.5rem;
    resize: vertical;
}

.loan-edit-reason {
    grid-column: 1 / -1;
}

.loan-edit-form .btn {
    min-height: 44px;
}

@media (max-width: 767px) {
    .loan-edit-grid {
        grid-template-columns: 1fr;
    }
}

.admin-muted {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin: 0.35rem 0 0.75rem;
}

.admin-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.85rem 0 1rem;
    align-items: stretch;
}

.admin-search-bar input[type="text"],
.admin-search-bar .form-control {
    flex: 1 1 200px;
    min-height: 44px;
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
}

.admin-search-bar .btn {
    min-height: 44px;
}

.admin-radio-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.5rem 0 0.85rem;
}

.admin-radio-list.admin-radio-inline {
    flex-direction: row;
    flex-wrap: wrap;
}

.admin-radio-list label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--page-bg, #f7f3ea);
    cursor: pointer;
}

.admin-settings-card {
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.15rem 1.25rem;
}

.admin-settings-form .btn,
.admin-inline-form .btn {
    min-height: 44px;
}

.admin-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-top: 0.75rem;
}

.admin-inline-form .form-group {
    flex: 1 1 200px;
    margin: 0;
}

.status-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.badge.status-open {
    background: #dcfce7;
    color: #15803d;
    padding: 3px 10px;
    border-radius: 999px;
}

.badge.status-closed {
    background: #fee2e2;
    color: #b91c1c;
    padding: 3px 10px;
    border-radius: 999px;
}

.pages-checkboxes {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 12px;
    margin-top: 0.5rem;
    background: var(--page-bg, #f9fafb);
}

.pages-checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 4px 12px;
}

.pages-checkboxes-grid label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    font-size: 0.9rem;
}

.owner-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.owner-grid .card {
    flex: 1 1 280px;
    margin: 0;
}

.danger-zone {
    border-color: #ef4444 !important;
}

.danger-zone h2 {
    color: #dc2626;
    margin-top: 0;
    font-size: 1.1rem;
}

.master-name {
    display: inline-block;
    margin-right: 0.4rem;
    color: var(--navy);
    font-weight: 800;
}

.ua-cell {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.admin-actions > a.btn-edit,
.admin-actions > .btn-edit {
    background: #1a4d7a !important;
    color: #fff !important;
}

.admin-actions > a.btn-delete,
.admin-actions > .btn-delete {
    background: var(--burgundy, #7a1f2b) !important;
    color: #fff !important;
}

.admin-actions > a.btn-secondary,
.admin-actions > .btn-secondary {
    background: #4b5563 !important;
    color: #fff !important;
}

@media (max-width: 767px) {
    .ua-cell {
        white-space: normal;
        word-break: break-word;
    }
    .users-grid {
        grid-template-columns: 1fr !important;
    }
    .admin-radio-list.admin-radio-inline {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .stack-table tbody td.loan-actions-cell,
    .stack-table tbody td.admin-actions-cell {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0.5rem;
        text-align: right !important;
    }
    .stack-table tbody td.loan-actions-cell::before,
    .stack-table tbody td.admin-actions-cell::before {
        flex: 0 0 auto !important;
        width: 100% !important;
        text-align: right;
        margin: 0;
    }
    .stack-table .loan-actions,
    .stack-table .admin-actions {
        flex-direction: column;
        width: 100%;
    }
    .stack-table .loan-actions form,
    .stack-table .admin-actions form {
        width: 100%;
    }
    .stack-table .loan-actions > .btn,
    .stack-table .loan-actions form > .btn,
    .stack-table .loan-actions a.btn,
    .stack-table .admin-actions > .btn,
    .stack-table .admin-actions form > .btn,
    .stack-table .admin-actions a.btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 767px) {
    body.page-admin .table-container,
    body.page-dashboard .table-container {
        margin-inline: -0.15rem;
    }
    .fold-hint {
        display: none;
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Dark mode that matches the fund palette */
html.dark-mode,
html[data-theme="dark"],
body.dark-mode,
body[data-theme="dark"] {
    --bg-color: #0c1210;
    --card-bg: #151c18;
    --card-paper: #151c18;
    --text-color: #f3efe4;
    --ink: #f3efe4;
    --muted-text: #b7b09e;
    --border-color: #2c3830;
    --input-bg: #101612;
    --navy: #d8c27a;
}

body.dark-mode,
html.dark-mode body.dark-mode {
    background:
        radial-gradient(900px 380px at 100% -10%, rgba(201, 162, 39, 0.08), transparent 50%),
        #0c1210;
}

body.dark-mode .card,
body.dark-mode .lookup-form,
body.dark-mode .result-card,
body.dark-mode .form-container,
body.dark-mode .profile-section,
body.dark-mode .logs-section,
body.dark-mode .stat-card,
body.dark-mode .add-transaction,
body.dark-mode .analyze-sms,
body.dark-mode .table-container,
body.dark-mode .users-table,
body.dark-mode .home-quick-actions {
    background: #151c18;
    color: #f3efe4;
    border-color: #2c3830;
}

body.dark-mode .card h1,
body.dark-mode .card h2,
body.dark-mode .stat-card h3 {
    color: #e4c04a;
}

.dark-mode .user-menu-panel,
.dark-mode .notify-menu-panel,
.dark-mode .dropdown-menu,
[data-theme="dark"] .user-menu-panel {
    background: #151c18;
    color: #f3efe4;
    border-color: #2c3830;
}

.dark-mode .nav-admin-panel,
.dark-mode header .nav-admin .dropdown-menu,
[data-theme="dark"] .nav-admin-panel {
    background: #151c18;
    color: #f3efe4;
    border-color: var(--gold);
}

.dark-mode .nav-admin-panel a,
[data-theme="dark"] .nav-admin-panel a {
    color: #f3efe4;
}

.dark-mode .user-menu-panel a,
.dark-mode .user-menu-panel button,
.dark-mode .notify-menu-panel a {
    color: #f3efe4;
}

.dark-mode .btn-secondary {
    background: #243028;
    color: #f3efe4;
    border-color: #2c3830;
}

.dark-mode .fund-modal-sheet {
    background: #151c18;
    color: #f3efe4;
}

.dark-mode .admin-page-head,
.dark-mode .section-block,
.dark-mode .fold-block,
[data-theme="dark"] .admin-page-head,
[data-theme="dark"] .section-block,
[data-theme="dark"] .fold-block {
    background: #151c18;
    border-color: #2c3830;
    color: #f3efe4;
}

.dark-mode .admin-page-head h1,
.dark-mode .admin-page-head h2,
.dark-mode .section-block-title,
.dark-mode .fold-block > summary,
[data-theme="dark"] .fold-block > summary {
    color: #e4c04a;
}

.dark-mode .fold-block[open] > summary {
    background: rgba(201, 162, 39, 0.12);
    border-bottom-color: #2c3830;
}

.dark-mode .count-chip {
    background: rgba(201, 162, 39, 0.22);
    color: #e4c04a;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fund-toast.is-leaving { transform: none; }
}
