/* DeboFund — Premium DeboPay gold / black / white fintech UI */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Sans:wght@500;600;700&display=swap');

:root,
[data-bs-theme="light"] {
    --df-brand: #D4A017;
    --df-brand-dark: #A67C00;
    --df-brand-light: #FBF3D9;
    --df-brand-hover: #C49212;
    --df-accent: #E8C547;
    --df-accent-dark: #A67C00;
    --df-black: #0A0A0A;
    --df-soft-gray: #F3F4F6;

    --df-body-bg: #FAFAFA;
    --df-surface: #ffffff;
    --df-surface-2: #F3F4F6;
    --df-text: #0A0A0A;
    --df-text-muted: #6B7280;
    --df-border: #E5E7EB;
    --df-shadow: 0 2px 16px rgba(10, 10, 10, 0.06);
    --df-shadow-lg: 0 16px 48px rgba(10, 10, 10, 0.10);
    --df-radius: 14px;
    --df-radius-lg: 20px;

    --df-navbar-bg: #ffffff;
    --df-footer-bg: #0A0A0A;
    --df-logo-nav: 50px;
    --df-logo-footer: 56px;
    --df-logo-dash: 42px;
    --df-logo-admin: 50px;
    --df-logo-auth: 56px;
    --df-logo-about: 84px;
    --df-hero-overlay: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 45%, rgba(255,255,255,0.2) 100%);
    --df-card-img-bg: #e8eaed;

    --bs-body-bg: var(--df-body-bg);
    --bs-body-color: var(--df-text);
    --bs-primary: var(--df-brand);
    --bs-primary-rgb: 212, 160, 23;
    --bs-link-color: var(--df-brand-dark);
    --bs-link-hover-color: var(--df-brand-hover);
    --bs-border-color: var(--df-border);
    --bs-success: #1B7A4E;
}

[data-bs-theme="dark"] {
    --df-body-bg: #121212;
    --df-surface: #1e1e1e;
    --df-surface-2: #2a2a2a;
    --df-text: #f5f5f5;
    --df-text-muted: #a0a0a0;
    --df-border: #333;
    --df-navbar-bg: #1a1a1a;
    --df-footer-bg: #0a0a0a;
    --df-hero-overlay: linear-gradient(90deg, rgba(18,18,18,0.95) 0%, rgba(18,18,18,0.7) 100%);
    --bs-body-bg: var(--df-body-bg);
    --bs-body-color: var(--df-text);
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--df-body-bg);
    color: var(--df-text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

h1, h2, h3, .display-6, .navbar-brand {
    font-family: 'Instrument Sans', 'DM Sans', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

/* ——— Navbar (light) ——— */
.navbar-debofund {
    background: var(--df-navbar-bg) !important;
    border-bottom: 1px solid var(--df-border);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
    padding: 0.65rem 0;
}

.navbar-debofund .nav-link {
    color: var(--df-text) !important;
    font-weight: 500;
    font-size: 0.95rem;
}

.navbar-debofund .nav-link:hover {
    color: var(--df-brand) !important;
}

.navbar-debofund .navbar-brand img,
.navbar-brand-gfm img,
.df-logo-nav {
    height: var(--df-logo-nav);
    width: auto;
}

.df-logo-footer {
    height: var(--df-logo-footer);
    width: auto;
}

.df-logo-dash {
    height: var(--df-logo-dash);
    width: auto;
}

.df-logo-admin {
    height: var(--df-logo-admin);
    width: auto;
}

.df-logo-auth {
    height: var(--df-logo-auth);
    width: auto;
}

.df-logo-about {
    height: var(--df-logo-about);
    width: auto;
}

.btn-brand {
    background: var(--df-brand);
    border: none;
    color: #0a0a0a !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
}

.btn-brand:hover {
    background: var(--df-brand-hover);
    color: #0a0a0a !important;
}

.btn-outline-brand {
    color: var(--df-brand);
    border: 2px solid var(--df-brand);
    font-weight: 600;
    border-radius: 999px;
}

.btn-outline-brand:hover {
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
}

/* Legacy gold buttons → brand */
.btn-gold, .btn-primary {
    background: var(--df-brand) !important;
    border-color: var(--df-brand-dark) !important;
    color: #0a0a0a !important;
    font-weight: 600;
    border-radius: 999px;
}

.btn-gold:hover, .btn-primary:hover {
    background: var(--df-brand-hover) !important;
    border-color: var(--df-brand-hover) !important;
    color: #0a0a0a !important;
}

.btn-outline-primary {
    color: var(--df-brand);
    border-color: var(--df-brand);
    border-radius: 999px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
}

.text-primary { color: var(--df-brand) !important; }
.bg-primary { background-color: var(--df-brand) !important; }
.progress-bar { background: var(--df-brand) !important; }

/* Currency switcher */
.currency-switcher {
    display: inline-flex;
    background: var(--df-surface-2);
    border-radius: 999px;
    padding: 3px;
    border: 1px solid var(--df-border);
}

.currency-switcher a {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--df-text-muted);
    transition: all 0.2s;
}

.currency-switcher a.active {
    background: var(--df-surface);
    color: var(--df-brand);
    box-shadow: var(--df-shadow);
}

.btn-theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--df-border);
    background: var(--df-surface);
    color: var(--df-text-muted);
}

/* ——— Hero slider (light) ——— */
.hero-section { margin-top: 0; }

.hero-fundraising-slider .carousel {
    position: relative;
    overflow: hidden;
}

.hero-fundraising-slider .carousel-inner {
    position: relative;
    width: 100%;
    min-height: 520px;
}

.hero-fundraising-slider .carousel-item {
    min-height: 520px;
}

.hero-fundraising-slider .carousel.carousel-fade .carousel-item {
    transition: opacity 0.65s ease-in-out;
}

.hero-fundraising-slider .hero-carousel-dots {
    z-index: 8;
    margin-bottom: 1.25rem;
}

.hero-fundraising-slider .hero-carousel-control {
    z-index: 8;
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--df-brand);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
    opacity: 1;
}

.hero-fundraising-slider .hero-carousel-control:hover {
    background: var(--df-brand-light);
    border-color: var(--df-brand-dark);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.hero-fundraising-slider .hero-carousel-control .carousel-control-prev-icon,
.hero-fundraising-slider .hero-carousel-control .carousel-control-next-icon {
    width: 1.35rem;
    height: 1.35rem;
    filter: brightness(0) saturate(100%) invert(62%) sepia(42%) saturate(800%) hue-rotate(6deg);
}

.hero-fundraising-slider .hero-carousel-control:hover .carousel-control-prev-icon,
.hero-fundraising-slider .hero-carousel-control:hover .carousel-control-next-icon {
    filter: brightness(0) saturate(100%) invert(45%) sepia(55%) saturate(900%) hue-rotate(6deg);
}

.hero-fundraising-slider .hero-slide {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--df-surface);
    cursor: pointer;
}

.hero-slide-actions,
.hero-slide-actions a {
    cursor: pointer;
}

.hero-slide-bg {
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 7s ease-out;
    will-change: transform;
}

.carousel-item.active .hero-slide-bg {
    transform: scale(1.04);
}

.hero-reduced-motion .hero-slide-bg,
.hero-reduced-motion .carousel-item.active .hero-slide-bg {
    transform: none;
    transition: none;
}

.hero-slide-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(0, 0, 0, 0.52) 0%,
        rgba(0, 0, 0, 0.28) 42%,
        rgba(0, 0, 0, 0.08) 72%,
        rgba(0, 0, 0, 0.02) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.hero-slide.has-gradient .hero-slide-scrim {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, 0.06) 100%);
}

.hero-slide-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 2.5rem 0 3rem;
    pointer-events: none;
}

.hero-slide-panel {
    max-width: 480px;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: var(--df-radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
}

.hero-slide.has-gradient .hero-slide-panel {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--df-shadow-lg);
}

.hero-slide.has-image .hero-slide-panel {
    background: rgba(255, 255, 255, 0.68);
}

.hero-slide-actions {
    pointer-events: auto;
    position: relative;
    z-index: 4;
}

.hero-slide-photo {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--df-radius-lg);
    box-shadow: var(--df-shadow-lg);
    display: block;
    background: var(--df-card-img-bg);
}

.hero-slide.has-gradient {
    background: var(--hero-gradient, var(--df-body-bg));
}

.hero-fundraising-slider .carousel-inner {
    border-radius: 0;
    overflow: hidden;
}

.hero-slide-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--df-hero-overlay);
    z-index: 0;
}

.hero-slide .container { position: relative; z-index: 1; }

.hero-slide h1 {
    color: var(--df-text);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hero-slide-lead {
    color: var(--df-text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.hero-slide-meta {
    color: var(--df-text-muted);
}

.hero-slide .lead {
    color: var(--df-text-muted);
}

.hero-slide .hero-badge {
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.hero-slide .hero-progress {
    max-width: 400px;
    height: 8px;
    background: var(--df-border);
    border-radius: 4px;
}

.hero-slide .hero-progress-bar {
    background: var(--df-brand);
    height: 100%;
    border-radius: 4px;
}

.hero-type-medical { --hero-gradient: linear-gradient(135deg, #e3f2fd, #f8f9fa); }
.hero-type-education { --hero-gradient: linear-gradient(135deg, #e8f5e9, #f8f9fa); }
.hero-type-emergency { --hero-gradient: linear-gradient(135deg, #ffebee, #f8f9fa); }
.hero-type-religious { --hero-gradient: linear-gradient(135deg, #fff8e1, #f8f9fa); }
.hero-type-startup { --hero-gradient: linear-gradient(135deg, #e8eaf6, #f8f9fa); }
.hero-type-ngo { --hero-gradient: linear-gradient(135deg, #f3e5f5, #f8f9fa); }
.hero-type-default { --hero-gradient: linear-gradient(135deg, #FBF6E8, #f8f9fa); }
.hero-type-donation { --hero-gradient: linear-gradient(135deg, #FBF6E8 0%, #f0f2f5 100%); }
.hero-slide.hero-type-donation .hero-badge { background: var(--df-brand); color: #0a0a0a; }

.hero-slide.has-gradient {
    background-image: var(--hero-gradient);
}

/* ——— Cards ——— */
.glass-card, .df-card {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-lg);
    box-shadow: var(--df-shadow);
}

.campaign-card {
    border-radius: var(--df-radius-lg) !important;
    overflow: hidden;
    border: 1px solid var(--df-border) !important;
    background: var(--df-surface);
    transition: transform 0.2s, box-shadow 0.2s;
}

.campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--df-shadow-lg);
}

.campaign-img, .campaign-show-img {
    background-size: cover;
    background-position: center;
    background-color: var(--df-card-img-bg);
}

.campaign-img { height: auto; }

.campaign-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.campaign-img.ratio-4x3 {
    --bs-aspect-ratio: 75%;
}

.campaign-show-img { height: 360px; border-radius: var(--df-radius-lg) 0 0; }

.stat-card {
    border-top: 4px solid var(--df-brand);
    border-radius: var(--df-radius);
}

.section-surface { background: var(--df-surface-2); }

/* ——— Recent donations ticker ——— */
.recent-donations-panel {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-lg);
    overflow: hidden;
}

.recent-donations-panel .panel-header {
    background: var(--df-brand-light);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--df-border);
}

.recent-donation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--df-border);
    animation: slideIn 0.4s ease;
}

.recent-donation-item:last-child { border-bottom: none; }

.recent-donation-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--df-brand-light);
    color: var(--df-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.recent-donation-item .amount {
    margin-left: auto;
    font-weight: 700;
    color: var(--df-brand);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ——— Wizard ——— */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--df-border);
    z-index: 0;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.wizard-step .step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--df-surface-2);
    border: 2px solid var(--df-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--df-text-muted);
    margin-bottom: 0.35rem;
}

.wizard-step.active .step-dot,
.wizard-step.done .step-dot {
    background: var(--df-brand);
    border-color: var(--df-brand);
    color: #fff;
}

.wizard-step .step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--df-text-muted);
}

.wizard-step.active .step-label { color: var(--df-brand); }

.wizard-pane { display: none; }
.wizard-pane.active { display: block; }

/* Payment method cards */
.payment-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--df-text-muted);
    margin: 1rem 0 0.5rem;
}

.payment-method-card {
    border: 2px solid var(--df-border);
    border-radius: var(--df-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    height: 100%;
}

.payment-method-card:hover {
    border-color: var(--df-brand);
    background: var(--df-brand-light);
}

.payment-method-card.selected {
    border-color: var(--df-brand);
    background: var(--df-brand-light);
    box-shadow: 0 0 0 3px rgba(0, 185, 100, 0.15);
}

.payment-method-card input { display: none; }

.payment-method-card i {
    font-size: 1.5rem;
    color: var(--df-brand);
    display: block;
    margin-bottom: 0.35rem;
}

/* Image upload grid (campaign wizard) */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.image-upload-slot {
    aspect-ratio: 1;
    border: 2px dashed var(--df-border);
    border-radius: var(--df-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: var(--df-surface-2);
    transition: border-color 0.2s;
}

.image-upload-slot:hover { border-color: var(--df-brand); }

.image-upload-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-slot .remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 0.7rem;
}

/* Dashboard charts */
.chart-card {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-lg);
    padding: 1.25rem;
}

.dashboard-stat {
    background: linear-gradient(135deg, var(--df-brand) 0%, var(--df-brand-dark) 100%);
    color: #fff;
    border-radius: var(--df-radius-lg);
    padding: 1.5rem;
}

.dashboard-stat h3 { font-weight: 800; margin: 0; }

.trust-bar {
    background: var(--df-surface);
    border-bottom: 1px solid var(--df-border);
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--df-text-muted);
}

.trust-bar i { color: var(--df-brand); }

/* Footer (dark gold/black) */
.footer-debofund {
    background: var(--df-footer-bg);
    color: #c4c4c4;
    border-top: 1px solid #2a2a2a;
}

.footer-debofund a { color: var(--df-brand); text-decoration: none; }
.footer-debofund a:hover { color: #f0d878; }
.footer-debofund h6 { color: #ffffff; font-weight: 700; }
.footer-debofund .df-logo-footer-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
.footer-debofund .df-logo-footer {
    /* Keep original logo colors — white plate provides contrast on dark footer */
    filter: none;
    height: var(--df-logo-footer);
    width: auto;
    display: block;
}
.footer-debofund .footer-muted { color: #a3a3a3; }
.footer-debofund .footer-powered { color: #d4d4d4; }
.footer-debofund .footer-powered-link { color: var(--df-brand); }
.footer-debofund .footer-rule {
    border: 0;
    border-top: 1px solid #333;
    opacity: 1;
}

.live-feed-item { border-left: 3px solid var(--df-brand); }

.admin-sidebar,
.admin-sidebar.offcanvas,
.admin-sidebar .offcanvas-body {
    --bs-offcanvas-bg: #1e1e1e;
    --bs-offcanvas-color: #f5f5f5;
    background: #1e1e1e !important;
    color: #f5f5f5 !important;
    border-right: 1px solid #333;
    width: 260px;
    flex-shrink: 0;
}

.admin-sidebar.offcanvas.show,
.admin-sidebar.offcanvas-lg.show {
    background: #1e1e1e !important;
}

@media (min-width: 992px) {
    .admin-sidebar.offcanvas-lg {
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none !important;
        visibility: visible !important;
        z-index: auto;
    }
}

.admin-sidebar a.nav-link,
.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    text-decoration: none;
}

.admin-sidebar a.nav-link:not(.active),
.admin-sidebar .nav-link:not(.active) {
    color: rgba(255, 255, 255, 0.85) !important;
}

.admin-sidebar .nav-link i {
    color: rgba(255, 255, 255, 0.55);
}

.admin-sidebar .nav-link.active {
    color: #fff !important;
    background: rgba(212, 175, 55, 0.18) !important;
    border-left: 3px solid var(--df-brand);
}

.admin-sidebar .nav-link.active i {
    color: var(--df-brand) !important;
}

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

.admin-sidebar .nav-link:hover i {
    color: var(--df-brand);
}

.admin-sidebar .small,
.admin-sidebar p {
    color: rgba(255, 255, 255, 0.6) !important;
}

.admin-sidebar .text-warning {
    color: var(--df-brand) !important;
}

.admin-topbar {
    z-index: 1030;
    box-shadow: 0 1px 0 var(--df-border);
}

.admin-shell {
    height: 100vh;
    overflow: hidden;
}

.admin-content {
    min-width: 0;
    width: 100%;
    overflow-y: auto;
    height: 100vh;
}

.admin-sidebar .offcanvas-body {
    overflow-y: auto;
    max-height: calc(100vh - 1rem);
}

#langSwitcher + .dropdown-menu,
.nav-item.dropdown .dropdown-menu,
.campaign-lang-wrap .dropdown-menu {
    z-index: 1060;
}

.campaign-sidebar-card {
    overflow: visible;
}

.campaign-lang-wrap {
    position: relative;
    z-index: 20;
}

.admin-main {
    min-width: 0;
    overflow-x: auto;
}

.admin-body {
    background: var(--df-body-bg);
}

.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}

body.admin-sidebar-open .admin-sidebar-backdrop {
    display: block;
}

.admin-breadcrumb {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    padding: 0.65rem 1rem;
    overflow-x: auto;
}

.admin-breadcrumb .breadcrumb {
    margin-bottom: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.admin-breadcrumb .breadcrumb-item a {
    color: var(--df-brand-dark);
    text-decoration: none;
    font-weight: 500;
}

.admin-breadcrumb .breadcrumb-item.active {
    color: var(--df-text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    .admin-shell {
        flex-direction: column;
    }
}

/* Public navbar — distinctive DeboFund style */
.navbar-gfm {
    padding: 0.65rem 0;
    background: var(--df-navbar-bg) !important;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--df-brand), transparent) 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.navbar-gfm .nav-link {
    font-weight: 600;
    position: relative;
}

.navbar-gfm .nav-link:hover::after,
.navbar-gfm .nav-link.show::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--df-brand);
    border-radius: 2px;
}

/* Navbar collapse: no animation glitches when minimized */
.navbar-gfm .navbar-collapse {
    transition: none !important;
}
.navbar-gfm .collapsing {
    transition: none !important;
    height: auto !important;
}
.navbar-gfm .dropdown-menu {
    transition: none !important;
    animation: none !important;
}

.navbar-gfm-row {
    min-height: 58px;
}

@media (min-width: 992px) {
    .navbar-gfm .container-lg {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }

    .navbar-brand-gfm {
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .navbar-gfm .navbar-collapse {
        flex-grow: 1;
        min-width: 0;
    }

    .site-header-actions {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        width: auto !important;
        gap: 0.5rem !important;
    }

    .site-header-actions .nav-item {
        width: auto !important;
        flex-shrink: 0;
    }

    .site-header-btn .btn {
        display: inline-block;
        white-space: nowrap;
        width: auto !important;
    }

    .site-header-actions .currency-switcher {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .site-header-actions .currency-switcher a {
        white-space: nowrap;
        display: inline-block;
    }
}

.navbar-search-wrap {
    position: relative;
    z-index: 10;
}

.navbar-search-trigger {
    border: none;
    background: transparent;
    color: var(--df-text);
    font-size: 1.2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.navbar-search-trigger:hover {
    background: var(--df-surface-2);
}

.navbar-search-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.navbar-search-field {
    width: 0;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 0.95rem;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.25s ease, padding 0.3s ease, border-color 0.2s;
    outline: none;
    box-shadow: none;
}

.navbar-gfm.search-active .navbar-search-field {
    width: min(380px, 42vw);
    opacity: 1;
    padding: 0.35rem 0.5rem;
    margin-left: 0.25rem;
    border-bottom-color: var(--df-brand);
}

.navbar-gfm.search-active .navbar-search-trigger {
    color: var(--df-brand-dark);
}

.navbar-gfm .nav-link {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Homepage redesign blocks */
.home-trust-strip {
    background: var(--df-surface);
    border-bottom: 1px solid var(--df-border);
    padding: 0.75rem 0;
}

.home-trust-strip span {
    font-size: 0.85rem;
    color: var(--df-text-muted);
    font-weight: 500;
}

.home-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    color: var(--df-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.home-category-pill:hover {
    border-color: var(--df-brand);
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    transform: translateY(-2px);
    box-shadow: var(--df-shadow);
}

.home-impact-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #1a1a2e 100%);
    color: #fff;
    border-radius: var(--df-radius-lg);
    overflow: hidden;
}

.home-impact-banner .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--df-brand);
}

.mega-dropdown-menu {
    min-width: min(520px, 92vw);
    padding: 1.25rem;
    border-radius: var(--df-radius-lg);
    border: 1px solid var(--df-border);
    box-shadow: var(--df-shadow-lg);
}

.mega-dropdown-menu .dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.mega-dropdown-menu .dropdown-item:hover {
    background: var(--df-brand-light);
}

/* Campaign public page (GoFundMe-style) */
.campaign-page { background: var(--df-body-bg); }

.campaign-cover-wrap {
    position: relative;
    background: var(--df-surface-2);
    aspect-ratio: 4 / 3;
    max-height: 480px;
}

.campaign-cover-btn {
    background: transparent;
    cursor: zoom-in;
    display: block;
}

.campaign-cover-btn:hover .campaign-cover-img {
    transform: scale(1.02);
}

.campaign-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.photo-gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: var(--df-radius);
    overflow: hidden;
    background: var(--df-surface-2);
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--df-shadow);
}

.photo-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.5rem;
}

.gallery-manage-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--df-border);
}

.gallery-manage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-manage-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-manage-item:hover .gallery-manage-remove,
.gallery-manage-item:focus-within .gallery-manage-remove {
    opacity: 1;
}

/* Lightbox */
.df-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.df-lightbox.open {
    display: flex;
}

body.df-lightbox-open {
    overflow: hidden;
}

.df-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.df-lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 960px);
    width: 100%;
    padding: 0 3rem;
}

.df-lightbox-figure {
    margin: 0;
    text-align: center;
}

.df-lightbox-img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.df-lightbox-counter {
    color: rgba(255, 255, 255, 0.85);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.df-lightbox-close,
.df-lightbox-nav {
    position: absolute;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.df-lightbox-close:hover,
.df-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.df-lightbox-close {
    top: -3rem;
    right: 0;
}

.df-lightbox-nav.prev { left: 0; top: 50%; transform: translateY(-50%); }
.df-lightbox-nav.next { right: 0; top: 50%; transform: translateY(-50%); }

.campaign-urgent-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #dc3545;
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.campaign-type-badge {
    background: var(--df-brand-light) !important;
    color: var(--df-brand-dark) !important;
    font-weight: 600;
}

.campaign-organizer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--df-brand), var(--df-brand-dark));
    color: #0a0a0a;
    font-weight: 800;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.campaign-tabs .nav-link {
    color: var(--df-text-muted);
    font-weight: 600;
    border: none;
}

.campaign-tabs .nav-link.active {
    color: var(--df-brand-dark);
    border-bottom: 2px solid var(--df-brand);
    background: transparent;
}

.campaign-donate-card {
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-lg);
}

.campaign-raised-amount { color: var(--df-brand-dark); }

.campaign-progress { height: 10px; background: var(--df-surface-2); }

.campaign-trust-list div { margin-bottom: 0.35rem; }

.campaign-donor-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.campaign-donor-avatar.sm { width: 28px; height: 28px; font-size: 0.75rem; }

.auth-wizard-card {
    max-width: 520px;
    margin: 0 auto;
}

/* Campaign image link */
.campaign-img-link {
    display: block;
    overflow: hidden;
    cursor: pointer;
}

.campaign-img-link:hover .campaign-img {
    transform: scale(1.04);
    transition: transform 0.35s ease;
}

.campaign-img-link .campaign-img {
    transition: transform 0.35s ease;
}

/* Hero + campaign carousel indicators */
.hero-fundraising-slider .carousel-indicators,
.campaign-carousel-dots {
    margin-bottom: 0;
}

.hero-fundraising-slider .carousel-indicators [data-bs-target],
.campaign-carousel-dots button {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--df-brand-dark);
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    opacity: 1;
    transition: opacity 0.2s, transform 0.2s, background 0.2s, border-color 0.2s;
}

.hero-fundraising-slider .carousel-indicators .active,
.campaign-carousel-dots .active {
    background: var(--df-brand);
    border-color: var(--df-brand-dark);
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(201, 160, 48, 0.45);
}

[data-bs-theme="dark"] .hero-fundraising-slider .hero-carousel-control {
    background: var(--df-surface-2);
    border-color: var(--df-brand);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .hero-fundraising-slider .hero-carousel-control .carousel-control-prev-icon,
[data-bs-theme="dark"] .hero-fundraising-slider .hero-carousel-control .carousel-control-next-icon {
    filter: brightness(0) saturate(100%) invert(84%) sepia(35%) saturate(600%) hue-rotate(6deg);
}

[data-bs-theme="dark"] .hero-fundraising-slider .carousel-indicators [data-bs-target] {
    background: var(--df-surface);
    border-color: var(--df-brand);
}

[data-bs-theme="dark"] .hero-slide-panel {
    background: rgba(20, 20, 20, 0.82);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .hero-slide.has-gradient .hero-slide-panel {
    background: rgba(20, 20, 20, 0.9);
}

.campaign-carousel {
    padding-bottom: 2.5rem;
}

.campaign-carousel-dots {
    position: relative;
    bottom: auto;
    margin-top: 1.25rem;
    justify-content: center;
}

.campaign-carousel-control {
    width: 44px;
    height: 44px;
    top: 42%;
    border-radius: 50%;
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    opacity: 0.95;
}

.campaign-carousel-control .carousel-control-prev-icon,
.campaign-carousel-control .carousel-control-next-icon {
    filter: invert(0.4);
    width: 1.25rem;
    height: 1.25rem;
}

/* Quick donate / QR */
.qr-code-wrap img {
    background: #fff;
    padding: 8px;
}

.quick-amount.active {
    background: var(--df-brand);
    border-color: var(--df-brand-dark);
    color: #1a1a1a;
}

/* About page */
.about-hero {
    background: linear-gradient(180deg, var(--df-brand-light) 0%, var(--df-body-bg) 100%);
}

.about-logo {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
    height: var(--df-logo-about);
    width: auto;
}

.about-badge {
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    font-weight: 600;
}

.about-story-card {
    border-left: 4px solid var(--df-brand);
}

.about-story-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.about-cta {
    background: linear-gradient(135deg, var(--df-brand-light), var(--df-surface));
    border: 1px solid var(--df-border);
}

.about-pillar:hover {
    transform: translateY(-2px);
    box-shadow: var(--df-shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.about-flag {
    font-size: 1.9rem;
    line-height: 1;
    flex: 0 0 auto;
}

.about-impact .counter { letter-spacing: -0.02em; }

@media (max-width: 768px) {
    .hero-fundraising-slider .carousel-inner,
    .hero-fundraising-slider .carousel-item,
    .hero-fundraising-slider .hero-slide {
        min-height: 460px;
    }

    .hero-slide-content {
        padding: 1.75rem 0 2.25rem;
    }

    .hero-slide-panel {
        max-width: 100%;
        padding: 1.1rem 1.15rem 1.25rem;
    }

    .hero-slide h1 {
        font-size: 1.65rem;
    }

    .hero-slide-scrim {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.08) 0%,
            rgba(0, 0, 0, 0.45) 55%,
            rgba(0, 0, 0, 0.62) 100%
        );
    }

    .hero-slide-panel {
        background: rgba(255, 255, 255, 0.92);
    }

    .wizard-step .step-label { display: none; }
    .campaign-show-hero { height: 220px; }
    .campaign-carousel .carousel-item .col-6 { flex: 0 0 100%; max-width: 100%; }
}

/* ——— Dashboard header & layout ——— */
.dash-body { min-height: 100vh; }

.dash-header {
    background: var(--df-surface);
    border-bottom: 1px solid var(--df-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    z-index: 1030;
}

.dash-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    min-height: 64px;
}

.dash-brand img,
.df-logo-dash {
    height: var(--df-logo-dash);
    width: auto;
}

.dash-nav-link {
    color: var(--df-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.dash-nav-link:hover,
.dash-nav-link.active {
    color: var(--df-brand-dark);
    background: var(--df-brand-light);
}

.dash-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--df-border);
    background: var(--df-surface);
    border-radius: 999px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    font-size: 0.875rem;
}

.dash-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--df-brand), var(--df-brand-dark));
    color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.dash-mobile-nav {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--df-border);
    background: var(--df-surface);
    padding: 0.5rem 1rem 1rem;
    gap: 0.25rem;
}

.dash-mobile-nav.open { display: flex; }

.dash-mobile-nav a {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--df-text);
    text-decoration: none;
    font-weight: 500;
}

.dash-mobile-nav a:hover { background: var(--df-brand-light); }

.dash-main { max-width: 1400px; }

.dash-recent-list li:last-child { border-bottom: none !important; }

/* ——— Upload dropzones ——— */
.upload-dropzone {
    border: 2px dashed var(--df-border);
    border-radius: var(--df-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    background: var(--df-surface-2);
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--df-brand);
    background: var(--df-brand-light);
}

.upload-dropzone i { font-size: 1.75rem; color: var(--df-brand-dark); }

.upload-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

.upload-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.upload-preview-img {
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--df-border);
}

.upload-file-chip {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    background: var(--df-surface-2);
    border-radius: 6px;
    font-size: 0.8rem;
}

.upload-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--df-border);
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar {
    height: 100%;
    background: var(--df-brand);
    width: 0;
    transition: width 0.3s;
}

.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.image-upload-grid .upload-preview-img {
    width: 100%;
    max-width: none;
    aspect-ratio: 1;
}

/* ——— Sponsors & partners ——— */
.sp-card {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-lg);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    height: 100%;
}

.sp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--df-shadow-lg);
}

.sp-card-logo {
    max-height: 64px;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(30%);
    transition: filter 0.25s;
}

.sp-card:hover .sp-card-logo { filter: none; }

.sp-card-placeholder {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--df-text-muted);
}

.sp-level-platinum { background: #e8eaf6; color: #3949ab; }
.sp-level-gold { background: var(--df-brand-light); color: var(--df-brand-dark); }
.sp-level-silver { background: #eceff1; color: #546e7a; }
.sp-level-bronze { background: #efebe9; color: #6d4c41; }
.sp-level-standard { background: var(--df-surface-2); color: var(--df-text-muted); }

.sp-home-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0 1rem;
    -webkit-overflow-scrolling: touch;
}

.sp-home-carousel::-webkit-scrollbar { height: 4px; }
.sp-home-carousel::-webkit-scrollbar-thumb { background: var(--df-border); border-radius: 2px; }

.sp-home-item {
    flex: 0 0 140px;
    scroll-snap-align: start;
    text-align: center;
}

.sp-home-item img {
    max-height: 48px;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.sp-home-item:hover img { opacity: 1; }

.sp-logo-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--df-border);
}

.sp-logo-placeholder {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--df-surface-2);
    border-radius: 6px;
    color: var(--df-text-muted);
}

.donor-card {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.donor-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--df-shadow);
}

.donor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    font-weight: 600;
}

.success-pulse {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.admin-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--df-border);
}

.admin-user-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.admin-user-avatar-fallback.lg,
.admin-user-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--df-border);
}

.admin-user-avatar-fallback.lg {
    font-size: 2rem;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

/* ===================================================================
   RESPONSIVE FOUNDATION & OVERFLOW GUARDS (Priority 1)
   Goal: zero horizontal scrolling, everything fits from 320px up.
   =================================================================== */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    min-width: 0;
}

/* Media never forces the viewport wider than the screen */
img,
svg,
video,
iframe,
canvas,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Long unbroken strings (URLs, emails, tokens) must wrap, not scroll */
p,
h1, h2, h3, h4, h5, h6,
a,
span,
li,
td,
.card-title,
.live-feed-item,
.recent-donation-item {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Bootstrap containers: gutters that never overflow on tiny screens */
@media (max-width: 575.98px) {
    .container,
    .container-fluid,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Tame oversized vertical rhythm on phones */
    .py-5 { padding-top: 2.25rem !important; padding-bottom: 2.25rem !important; }
}

/* Tables & code blocks scroll internally instead of the page */
.table-responsive { width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; }

/* ——— Public breadcrumb: scroll internally, never push the layout ——— */
nav[aria-label="breadcrumb"] .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 0;
}
nav[aria-label="breadcrumb"] .breadcrumb::-webkit-scrollbar { display: none; }
nav[aria-label="breadcrumb"] .breadcrumb-item {
    white-space: nowrap;
}
nav[aria-label="breadcrumb"] .breadcrumb-item.active {
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================================================
   HERO SLIDER — fluid scaling 320px → desktop (Priority 1 + 4)
   =================================================================== */
@media (max-width: 575.98px) {
    .hero-fundraising-slider .carousel-inner,
    .hero-fundraising-slider .carousel-item,
    .hero-fundraising-slider .hero-slide {
        min-height: 380px;
    }

    .hero-slide-content {
        padding: 1.25rem 0 1.5rem;
    }

    .hero-slide-panel {
        max-width: 100%;
        padding: 1rem 1rem 1.1rem;
        border-radius: var(--df-radius);
    }

    .hero-slide h1 {
        font-size: 1.4rem;
        line-height: 1.2;
    }

    .hero-slide-lead {
        font-size: 0.95rem;
        /* Keep hero cards compact: clamp the description to 2 lines */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-slide .hero-progress { max-width: 100%; }

    /* Stack hero CTAs full-width with comfortable touch targets */
    .hero-slide-actions { width: 100%; }
    .hero-slide-actions .btn {
        flex: 1 1 100%;
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Carousel controls: keep them tappable but inside the viewport */
    .hero-fundraising-slider .hero-carousel-control {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 360px) {
    .hero-slide h1 { font-size: 1.25rem; }
    .hero-fundraising-slider .carousel-inner,
    .hero-fundraising-slider .carousel-item,
    .hero-fundraising-slider .hero-slide { min-height: 340px; }
}

/* ===================================================================
   SLIDER / CAMPAIGN CARDS — modern glassmorphism (Priority 4)
   Compact, translucent, background visible through the card.
   =================================================================== */
.campaign-carousel-section .campaign-card {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: var(--df-radius-lg) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.campaign-carousel-section .campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.16);
}

.campaign-carousel-section .campaign-card .card-body {
    padding: 0.9rem 1rem 1rem;
}

.campaign-carousel-section .campaign-card .card-title {
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

[data-bs-theme="dark"] .campaign-carousel-section .campaign-card {
    background: rgba(30, 30, 30, 0.55);
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-bs-theme="dark"] .campaign-carousel-section .campaign-card .card-title a {
    color: var(--df-text) !important;
}

/* Two cards per row on phones with no overflow + readable type */
@media (max-width: 575.98px) {
    .campaign-carousel-section .row { --bs-gutter-x: 0.75rem; }
    .campaign-carousel-section .campaign-card .card-title {
        font-size: 0.85rem;
        min-height: 2.3em;
    }
    .campaign-carousel-section .campaign-card .btn-sm {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Carousel side controls shouldn't overlap the cards on mobile */
    .campaign-carousel-control { display: none; }
}

/* ===================================================================
   HOMEPAGE SECTION POLISH (Priority 1 + 4 mobile fixes)
   =================================================================== */
@media (max-width: 575.98px) {
    /* Category pills wrap & scroll cleanly */
    .home-category-pill { font-size: 0.85rem; padding: 0.4rem 0.75rem; }

    /* Impact banner & stat numbers scale down */
    .home-impact-banner { text-align: center; }
    .home-impact-banner .stat-num { font-size: 1.4rem; }
    .stat-card .display-6 { font-size: 1.5rem; }

    /* Sponsor logos: smaller fixed track so it never overflows */
    .sp-home-item { flex-basis: 110px; }

    /* Live donation rows: prevent name/amount overlap */
    .live-feed-item { flex-wrap: wrap; }
    .live-feed-item .badge { margin-left: auto; }

    /* Testimonials padding fit */
    .section-cta .glass-card-dark { padding: 1.25rem !important; }
}

/* Touch targets: ensure interactive controls meet 44px guidance */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .home-category-pill,
    .quick-amount {
        min-height: 44px;
    }
    .carousel-indicators [data-bs-target] {
        width: 14px;
        height: 14px;
    }
}

/* Respect reduced-motion for carousel zoom/animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===================================================================
   #13 GLOBAL MOBILE RESPONSIVE GUARDS
   Eliminate horizontal scrolling, keep tables/currency labels/nav
   contained across phone, tablet & desktop.
   =================================================================== */

/* No page-level horizontal scroll anywhere */
html, body { max-width: 100%; overflow-x: hidden; }

/* Tables stay within their container; wrap wide tables in .table-responsive. */
.df-card .table,
.card .table { width: 100%; max-width: 100%; }
.table-responsive { -webkit-overflow-scrolling: touch; max-width: 100%; }

/* Currency labels / input add-ons never overflow their group */
.input-group-text {
    white-space: nowrap;
    flex-shrink: 0;
}
.currency-label,
.amount-currency {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    /* Comfortable card padding on phones */
    .df-card { padding: 1rem !important; }

    /* Headings scale down so they don't wrap awkwardly */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.3rem; }
    h3, .h3 { font-size: 1.15rem; }

    /* Stat/number values stay on one line, scale to fit */
    .stat-value, .display-6 { font-size: 1.35rem; }

    /* Dashboard top nav links: allow horizontal scroll rather than overflow */
    .dash-nav-scroll {
        display: flex;
        gap: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dash-nav-scroll::-webkit-scrollbar { display: none; }

    /* Button groups / action toolbars wrap cleanly */
    .btn-toolbar, .d-flex.gap-2.flex-wrap { row-gap: 0.5rem; }
}

/* Tablet: keep multi-column dashboards from cramping */
@media (min-width: 576px) and (max-width: 991.98px) {
    .df-card { padding: 1.25rem; }
}

/* Hero card — compact, image-forward on mobile */
@media (max-width: 767.98px) {
    .hero-slide-content {
        display: flex;
        align-items: flex-end;
        min-height: 420px;
        padding: 1rem 0 1.25rem;
    }
    .hero-slide-panel {
        max-width: 100%;
        width: 100%;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.78);
    }
    .hero-slide h1 {
        font-size: 1.35rem;
        line-height: 1.2;
    }
    .hero-slide-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.9rem;
        padding: 0.55rem 0.85rem;
    }
    .hero-fundraising-slider .carousel-inner,
    .hero-fundraising-slider .carousel-item,
    .hero-fundraising-slider .hero-slide {
        min-height: 420px;
    }
}

/* Mobile site header — search + buttons aligned */
@media (max-width: 991.98px) {
    .site-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    .site-header-actions .nav-item {
        width: 100%;
    }
    .site-header-btn .btn {
        display: block;
        text-align: center;
    }
    .navbar-search-form-mobile .input-group {
        border-radius: 50rem;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
    }
    #navMain .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
        box-shadow: none;
        border: 1px solid var(--df-border);
    }
}

.header-alert-btn {
    text-decoration: none !important;
    line-height: 1;
}

/* Dashboard header — compact on mobile */
@media (max-width: 991.98px) {
    .dash-header-inner {
        gap: 0.35rem;
        padding: 0.5rem 0.65rem;
    }

    .dash-header-tools {
        gap: 0.25rem !important;
        min-width: 0;
    }

    .dash-header-tools .currency-switcher,
    .dash-header-tools .language-switcher,
    .dash-header-tools-extra {
        display: none !important;
    }

    .dash-profile-btn .d-md-inline {
        display: none !important;
    }

    .dash-brand span {
        display: none !important;
    }

    .header-alerts .badge {
        font-size: 0.55rem !important;
        padding: 0.2em 0.45em;
    }
}

@media (max-width: 575.98px) {
    .dash-header-tools .header-alert-btn i {
        font-size: 1.1rem !important;
    }

    .dash-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

/* Admin email sub-navigation */
.admin-email-nav .nav-link {
    color: var(--df-text);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50rem;
    padding: 0.45rem 0.9rem;
}

.admin-email-nav .nav-link.active {
    background: var(--df-brand);
    color: #fff;
}

.admin-email-nav .nav-link:not(.active):hover {
    background: var(--df-surface-2);
}

/* Donate wizard — confirm step summary */
.donate-confirm-list {
    background: linear-gradient(135deg, #fffdf7, #fff8e7);
    border: 1px solid #f0e2bd;
    border-radius: var(--df-radius);
    padding: 0.85rem 1rem;
}

.donate-confirm-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed rgba(201, 160, 48, 0.25);
    font-size: 0.92rem;
}

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

.donate-confirm-list li span {
    color: var(--df-text-muted);
    font-weight: 500;
}

.donate-confirm-list li strong {
    text-align: right;
    font-weight: 700;
    color: var(--df-text);
    word-break: break-word;
}

.donate-confirm-list .donate-confirm-total {
    background: rgba(201, 160, 48, 0.12);
    margin: 0.25rem -0.5rem;
    padding: 0.55rem 0.5rem;
    border-radius: 0.5rem;
    border-bottom: none;
}

.donate-confirm-list .donate-confirm-total strong {
    color: var(--df-brand-dark);
    font-size: 1.05rem;
}

.donate-tip-compact {
    background: var(--df-surface);
}

.donate-tip-compact .tip-btn-group .tip-btn {
    min-width: 3.25rem;
}

.donate-tip-compact .tip-btn-group .tip-btn.active,
.donate-tip-compact .tip-btn.btn-brand.active {
    background: var(--df-brand);
    border-color: var(--df-brand);
    color: #111;
}

/* Admin dashboard stat cards */
.admin-live-badge {
    background: var(--df-brand-light);
    color: var(--df-brand-dark);
    font-weight: 600;
    padding: 0.5rem 0.85rem;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--df-radius);
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.admin-stat-card--gold .admin-stat-icon { background: rgba(201, 160, 48, 0.15); color: #a88420; }
.admin-stat-card--warning .admin-stat-icon { background: rgba(255, 193, 7, 0.15); color: #b8860b; }
.admin-stat-card--info .admin-stat-icon { background: rgba(13, 202, 240, 0.12); color: #0aa2c0; }
.admin-stat-card--success .admin-stat-icon { background: rgba(25, 135, 84, 0.12); color: #198754; }

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--df-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--df-text);
}

.admin-stat-value small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--df-text-muted);
}

.admin-mini-stat {
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.admin-mini-stat strong {
    font-size: 1.2rem;
    font-weight: 700;
}

.admin-mini-stat--link:hover {
    border-color: var(--df-brand);
    box-shadow: 0 2px 8px rgba(201, 160, 48, 0.15);
}

.admin-action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--df-surface);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius);
    color: var(--df-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-action-card:hover {
    border-color: var(--df-brand);
    box-shadow: 0 4px 12px rgba(201, 160, 48, 0.12);
    color: var(--df-text);
}

.admin-action-card i {
    font-size: 1.75rem;
    color: var(--df-brand);
}

.admin-action-card small {
    display: block;
    color: var(--df-text-muted);
}

.admin-chart-card .card-body {
    min-height: 220px;
}

.admin-settings-card .list-group-item {
    padding: 0.85rem 1rem;
}

@media (max-width: 575.98px) {
    .admin-stat-value {
        font-size: 1.35rem;
    }

    .donate-confirm-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .donate-confirm-list li strong {
        text-align: left;
    }
}

/* Admin topbar profile */
.admin-topbar-profile .admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--df-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Prevent horizontal scroll on mobile viewports */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

img, video, iframe, svg {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.skip-to-content:focus {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1080;
    padding: 0.5rem 0.75rem;
    background: var(--df-brand, #F0C14B);
    color: #111;
    border-radius: 0.35rem;
    clip: auto !important;
    width: auto;
    height: auto;
}

:focus-visible {
    outline: 2px solid var(--df-brand, #F0C14B);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .navbar .dropdown-menu {
        max-width: calc(100vw - 1.5rem);
    }

    .donate-wizard,
    .campaign-card,
    .hero-section {
        overflow-x: hidden;
    }

    .btn, .form-control, .form-select {
        max-width: 100%;
    }
}



/* Admin / dashboard theme surfaces */
.admin-topbar {
    background: var(--df-surface);
    color: var(--df-text);
}
.dash-body {
    background: var(--df-body-bg);
    color: var(--df-text);
}
.btn-outline-brand {
    color: var(--df-brand, #0d6e3f);
    border-color: var(--df-brand, #0d6e3f);
}
.btn-outline-brand:hover {
    background: var(--df-brand, #0d6e3f);
    color: #fff;
}


/* ——— Fintech polish: skeletons, empty states, motion ——— */
.df-skeleton {
    background: linear-gradient(90deg, var(--df-surface-2) 25%, #eceff3 37%, var(--df-surface-2) 63%);
    background-size: 400% 100%;
    animation: df-shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes df-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}
.df-empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    border: 1px dashed var(--df-border);
    border-radius: var(--df-radius-lg);
    background: var(--df-surface);
}
.df-empty-state i {
    font-size: 2rem;
    color: var(--df-brand);
}
.df-card, .chart-card, .dashboard-stat {
    transition: transform .18s ease, box-shadow .18s ease;
}
.df-card:hover, .chart-card:hover {
    box-shadow: var(--df-shadow-lg);
}
.btn-brand:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}
.btn-brand:active {
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .df-skeleton, .df-card, .chart-card, .btn-brand { animation: none !important; transition: none !important; }
}
