/* =========================================================================
   Aesthetic Redesign - Professional Faint Light Theme (v3 - Compact Fix)
   ========================================================================= */

:root {
    --brand-primary: #281E5D; /* Deep Navy/Purple Primary */
    --brand-dark: #1E1548; /* Darker Navy */
    --brand-light: #EBE9FA; /* Lightest Purple/Cream */
    --brand-accent: #5C4DD1; /* Bright Purple Accent */
    --text-main: #1A1A1A; /* Crisp dark text */
    --text-muted: #6B7280;
    --bg-main: #F4F6F8; /* Soft light grey */
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(40, 30, 93, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(40, 30, 93, 0.08), 0 2px 4px -1px rgba(40, 30, 93, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(40, 30, 93, 0.1), 0 4px 6px -2px rgba(40, 30, 93, 0.05);
    --border-color: #E2E8F0;
}

body {
    background: var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: 'Poppins', sans-serif !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =============================================
   HEADER - Make it position:static so it takes 
   up space and content flows naturally below
   ============================================= */
.main-header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: 100 !important;
    background: #ffffff !important;
    padding: 0 !important;
    /* GAP FIX: removed top padding */
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    backdrop-filter: none !important;
    transition: none !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
}

.village-name {
    color: var(--text-main) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    background: none !important;
    -webkit-text-fill-color: var(--text-main) !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
}

.lgd-code {
    background: var(--bg-main) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    font-weight: 500 !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
}

/* =============================================
   NAVBAR - Tight animated gradient separator
   ============================================= */
.navbar {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary)) !important;
    margin-top: 0 !important;
    /* GAP FIX: removed top margin */
    margin-bottom: 0 !important;
    padding: 0 !important;
    position: relative !important;
    border-top: none !important;
    border-bottom: none !important;
}

.navbar::before {
    content: '' !important;
    position: absolute !important;
    top: -3px !important;
    left: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand-accent), var(--brand-primary), var(--brand-accent), var(--brand-dark)) !important;
    background-size: 300% auto !important;
    animation: gradientSlide 4s linear infinite !important;
}

@keyframes gradientSlide {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: -300% center;
    }
}

.nav-item {
    color: #ffffff !important;
    font-weight: 500 !important;
    padding: 13px 18px !important;
    border-radius: 0 !important;
    border: none !important;
    text-transform: none !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    border-bottom: 3px solid transparent !important;
    letter-spacing: 0 !important;
}

.nav-item:hover,
.nav-item.active {
    background: var(--brand-light) !important;
    color: var(--brand-dark) !important;
    border: none !important;
    border-bottom: 3px solid var(--brand-primary) !important;
    transform: none !important;
}

.hero-wrapper {
    display: flex !important;
    position: relative !important;
    padding-top: 0 !important;
    /* GAP FIX: removed padding */
    height: 450px !important;
    overflow: hidden !important;
    margin: 0 30px 2rem 30px !important;
    /* Top margin zeroed to remove gap */
    /* Slider in different shape */
    border-radius: 40px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

#dynamic-content-area {
    padding-top: 0 !important;
    /* Override style.css 180px gap */
    min-height: unset !important;
}

/* Hide inner-page spacer (no longer needed now header is relative) */
.inner-page-spacer {
    display: none !important;
}

.hero-slider-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
}

.hero-slider-bg::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.35) 60%, rgba(0, 0, 0, 0.05) 100%) !important;
}

/* Slide images - use object-fit cover */
.h-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background-color: var(--brand-dark) !important;
    opacity: 0 !important;
    transition: opacity 1.2s ease-in-out !important;
}

.h-slide.active {
    opacity: 1 !important;
}

.hero-content {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 20px !important;
    text-align: center !important;
    width: 100% !important;
    margin: 0 auto !important;
    max-width: 900px !important;
}

.hero-content h1 {
    font-size: 2.2rem !important;
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 8px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
}

.hero-content .hero-subtitle {
    font-size: 1rem !important;
    color: #e2e8f0 !important;
    text-shadow: none !important;
    margin-bottom: 16px !important;
    font-weight: 400 !important;
}

.hero-actions {
    justify-content: center !important;
    gap: 15px !important;
    display: flex !important;
}

/* =============================================
   MINISTER MARQUEE - Compact, flush
   ============================================= */
.minister-marquee-wrapper {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    margin: 0 0 15px 0 !important;
    /* Minimal gap below minister section */
    max-width: 100% !important;
    padding: 8px 0 !important;
    box-shadow: none !important;
}

.minister-pill {
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    background: #f9fafb !important;
    padding: 5px 14px !important;
    border-radius: 30px !important;
    margin: 0 10px !important;
}

.minister-img {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin-right: 10px !important;
}

.minister-info span {
    color: var(--text-main) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.minister-info small {
    color: var(--text-muted) !important;
    font-size: 0.72rem !important;
}

/* =============================================
   HOME MAIN GRID - Compact gaps/padding
   ============================================= */
.home-main-grid {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 30px !important;
    padding: 20px 30px 40px 30px !important;
    max-width: 100% !important;
    /* Fill entire width */
    margin: 0 auto !important;
    align-items: stretch !important;
}

.home-col-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
}

.home-col-right {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
}

@media (max-width: 991px) {
    .home-main-grid {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
    }
}

/* =============================================
   PANEL BOXES - Compact internal padding
   ============================================= */
.panel-box {
    background: var(--bg-card) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: var(--shadow-md) !important;
    padding: 24px !important;
    margin: 0 !important;
    backdrop-filter: blur(5px) !important;
    transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    flex-direction: column !important;
    animation: fadeInUp 0.8s ease-out forwards;
}

.panel-box:hover {
    box-shadow: var(--shadow-lg) !important;
    transform: translateY(-6px) !important;
}

.panel-title {
    font-size: 1.1rem !important;
    color: var(--text-main) !important;
    text-align: left !important;
    border-bottom: 2px solid var(--brand-primary) !important;
    padding-bottom: 8px !important;
    margin-bottom: 14px !important;
    text-transform: none !important;
    letter-spacing: 0px !important;
    font-weight: 600 !important;
    display: inline-block !important;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary,
.btn-hero {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 9px 20px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: background 0.2s !important;
    letter-spacing: 0px !important;
    text-transform: none !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
}

.btn-primary:hover {
    background: var(--brand-dark) !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
    padding: 9px 20px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: background 0.2s !important;
    text-transform: none !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    backdrop-filter: blur(4px) !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: none !important;
}

/* "View All" buttons in panel-box inherit a more neutral style */
.panel-box .btn-secondary,
.panel-box button {
    background: #f8fafc !important;
    color: var(--brand-dark) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 18px !important;
    font-size: 0.82rem !important;
}

.panel-box .btn-secondary:hover,
.panel-box button:hover {
    background: var(--brand-light) !important;
    border-color: var(--brand-primary) !important;
}

/* =============================================
   SCHEME SIDE LIST - Compact
   ============================================= */
.scheme-side-item,
.pop-card-item,
.pop-summary-box-new,
.pop-detailed-box-new {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    transition: border-color 0.2s !important;
}

.scheme-side-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
}

.scheme-side-item:hover,
.pop-card-item:hover,
.pop-summary-box-new:hover,
.pop-detailed-box-new:hover {
    border-color: var(--brand-primary) !important;
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
}

.scheme-side-icon {
    background: var(--bg-main) !important;
    border-radius: 8px !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
}

.scheme-side-item strong,
.pop-card-item strong,
.alert-mini strong {
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.92rem !important;
}

.scheme-side-item div,
.pop-card-item span,
.alert-mini span {
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
}

/* =============================================
   ALERTS
   ============================================= */
.alerts-widget-box {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    justify-content: space-between !important;
    flex-grow: 1 !important;
    height: 100% !important;
}

.alert-mini {
    background: #f9fafb !important;
    border: 1px solid var(--border-color) !important;
    border-left: 4px solid var(--brand-primary) !important;
    padding: 15px 14px !important;
    border-radius: 6px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.alert-mini.urgent {
    border-left-color: #ef4444 !important;
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    border-left-color: #ef4444 !important;
}

/* =============================================
   MEMBER GRID on HOME
   ============================================= */
#member-list-home {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
}

/* =============================================
   FOOTER - Compact
   ============================================= */
.main-footer {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    padding: 28px 0 16px 0 !important;
    margin-top: 20px !important;
}

.footer-col h3 {
    color: var(--text-main) !important;
    font-size: 1rem !important;
    margin-bottom: 14px !important;
    font-weight: 600 !important;
}

.footer-col strong {
    color: var(--text-main) !important;
}

.footer-col p,
.footer-col span,
.footer-col li {
    color: var(--text-muted) !important;
    font-size: 0.88rem !important;
}

/* =============================================
   INNER PAGES - Compact
   ============================================= */
.main-content-grid {
    padding: 0 16px 16px 16px !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
}

.section-heading {
    font-size: 1.8rem !important;
    margin-top: 5px !important;
    margin-bottom: 2px !important;
}

.scheme-detail-box {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 30px 4% !important;
    animation: none !important;
    margin: 0 auto 16px auto !important;
    max-width: 92% !important;
}

.glass-card {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: 10px !important;
    padding: 18px !important;
}

.glass-card:hover {
    box-shadow: var(--shadow-md) !important;
    border-color: var(--brand-primary) !important;
    transform: translateY(-3px) !important;
}

.card-icon-circle {
    background: var(--bg-main) !important;
    color: var(--brand-primary) !important;
    border-radius: 10px !important;
    width: 60px !important;
    height: 60px !important;
    font-size: 1.8rem !important;
    margin-bottom: 10px !important;
}

.glass-card::before,
.scheme-side-item::before {
    display: none !important;
}

.detail-list li,
.pop-card-item {
    border-radius: 6px !important;
}

.pop-vertical-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* =============================================
   SECTION BLOCKS - Remove excessive padding
   ============================================= */
.section-block {
    padding: 1rem 0 !important;
}

.max-w-container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

.center-text {
    text-align: center !important;
    margin-bottom: 1.5rem !important;
}

.heading-underline {
    width: 60px !important;
    height: 4px !important;
    background: var(--brand-primary) !important;
    margin: 0 auto !important;
    border-radius: 10px !important;
}

/* =============================================
   REF TABLE - Inner pages
   ============================================= */
.ref-table-container {
    overflow-x: auto !important;
    margin-bottom: 1rem !important;
}

.ref-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 0.85rem !important;
}

.ref-table th,
.ref-table td {
    padding: 8px 10px !important;
    border: 1px solid var(--border-color) !important;
    text-align: left !important;
}

.ref-table th {
    background: var(--bg-main) !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
}

/* =============================================
   MISC OVERRIDES
   ============================================= */
.main-container {
    animation: none !important;
}

main#main-wrapper {
    animation: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove old stats strip negative margin */
.stats-strip {
    margin-top: 0 !important;
}

/* Reduce member grid gap on inner pages */
.member-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
}

/* Make profile cards compact */
.profile-card,
.member-card {
    padding: 14px !important;
}

/* =============================================
   RESPONSIVE: Mobile
   ============================================= */
@media (max-width: 768px) {
    .hero-wrapper {
        height: 220px !important;
    }

    .hero-content h1 {
        font-size: 1.4rem !important;
    }

    .hero-content {
        padding: 0 20px !important;
    }

    .hero-content .hero-subtitle {
        font-size: 0.85rem !important;
    }

    .home-main-grid {
        grid-template-columns: 1fr !important;
        padding: 10px !important;
        gap: 12px !important;
    }

    .inner-page-spacer {
        display: none !important;
    }

    .minister-marquee-wrapper {
        margin: 0 !important;
    }
}

/* =========================================================================
   HOME PAGE V2 SOFT BROWN TEMPLATE
   ========================================================================= */

.hero-wrapper-v2 {
    position: relative;
    /* Use negative margins to break out of any container padding */
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    height: 82vh;
    overflow: hidden;
    background: #000;
    margin-top: 0;
    /* White space removed */
    display: block;
}

.hero-slider-bg-v2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-slider-bg-v2 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slider-bg-v2 img.active {
    opacity: 1;
}

.hero-overlay-v2 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(40, 30, 93, 0.85), rgba(30, 21, 72, 0.4));
}

.hero-content-v2 {
    position: absolute;
    top: 35%;
    left: 10%;
    transform: translateY(-50%);
    color: #fff;
    max-width: 600px;
    z-index: 10;
}

.hero-content-v2 h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle-v2 {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--brand-light);
    margin-bottom: 30px;
}

.hero-actions-v2 button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 15px;
    transition: all 0.3s;
}

.btn-primary-v2 {
    background: #d7ccc8;
    color: #3e2723;
}

.btn-primary-v2:hover {
    background: #bcaaa4;
    transform: translateY(-2px);
}

.btn-secondary-v2 {
    background: transparent;
    border: 2px solid #d7ccc8 !important;
    color: #fff;
}

.btn-secondary-v2:hover {
    background: rgba(215, 204, 200, 0.2);
    transform: translateY(-2px);
}

.hero-curve {
    position: absolute;
    bottom: -2px;
    /* Pull it slightly to remove gap */
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 15;
}

.hero-curve svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

.hero-curve svg path {
    fill: #f5f2f0;
    /* bg-main */
}

/* Minister Marquee V2 */
.minister-marquee-v2 {
    background: #fff;
    padding: 15px 0;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(93, 64, 55, 0.05);
    margin-bottom: 40px;
}

.minister-track {
    display: flex;
    gap: 30px;
    padding: 0 20px;
    animation: marqueeLeft 30s linear infinite;
    white-space: nowrap;
}

.minister-pill-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #faf8f7;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #d7ccc8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.minister-pill-v2 img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #a1887f;
}

.minister-info {
    display: flex;
    flex-direction: column;
}

.minister-info span {
    font-weight: 700;
    color: #3e2723;
    font-size: 0.95rem;
}

.minister-info small {
    color: #5d4037;
    font-size: 0.75rem;
}

@keyframes marqueeLeft {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-150%);
    }
}

/* Home Grid Layout V2 */
.container-v2 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.home-layout-v2 {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 30px;
    margin-bottom: 30px;
}

.modern-panel-v2 {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 6px 15px rgba(93, 64, 55, 0.08);
    transition: transform 0.3s ease;
}

.border-top-brown {
    border-top: 5px solid #a1887f;
}

.border-top-brown-light {
    border-top: 5px solid #d7ccc8;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.fill-height {
    height: 100%;
}

.panel-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #efebe9;
    padding-bottom: 15px;
}

.title-v2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #3e2723;
    margin: 0;
}

.subtitle-v2 {
    color: #5d4037;
    font-size: 1rem;
}

.center-text {
    text-align: center;
}

.mb-15 {
    margin-bottom: 15px;
}

.btn-outline-v2 {
    background: transparent;
    border: 1px solid #a1887f;
    color: #5d4037;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline-v2:hover {
    background: #a1887f;
    color: #fff;
}

/* Members Grid */
.member-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

/* Alerts */
.alerts-container-v2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reduced gap from 15px */
    flex-grow: 1;
    justify-content: flex-start;
    /* Ensure items stay closely packed */
}

.alert-item-v2 {
    display: flex;
    gap: 12px;
    background: #faf8f7;
    padding: 10px 15px;
    /* Reduced from 15px */
    border-radius: 12px;
    border-left: 4px solid #d7ccc8;
    align-items: center;
}

.alert-urgent {
    border-left: 4px solid #c85a5a;
    background: #fff5f5;
}

.alert-icon {
    font-size: 1.2rem;
    /* Reduced from 1.5rem */
}

.alert-content strong {
    display: block;
    color: #3e2723;
    margin-bottom: 5px;
}

.alert-content span {
    font-size: 0.9rem;
    color: #5d4037;
    line-height: 1.4;
}

/* Schemes Box */
.schemes-list-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.scheme-card-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: #faf8f7;
    border-radius: 12px;
    border: 1px solid #efebe9;
    text-decoration: none;
    transition: all 0.3s ease;
}

.scheme-card-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(93, 64, 55, 0.1);
    border-color: #a1887f;
}

.s-icon-v2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.s-text-v2 strong {
    display: block;
    color: #3e2723;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.s-text-v2 span {
    font-size: 0.85rem;
    color: #5d4037;
}

/* Population Small Box */
.pop-summary-card-v2 {
    padding: 25px;
}

.pop-stats-row {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.stat-box-v2 {
    text-align: center;
}

.stat-val {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #3e2723;
}

.stat-lbl {
    font-size: 0.85rem;
    color: #5d4037;
    font-weight: 500;
}

/* Full Width Panel */
.full-width-panel-v2 {
    width: 100%;
}

.census-grid-v2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.census-card-v2 {
    background: #faf8f7;
    border: 1px solid #d7ccc8;
    border-radius: 12px;
    padding: 20px;
}

.c-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #d7ccc8;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.c-header-v2 strong {
    font-size: 1.2rem;
    color: #3e2723;
}

.badge-v2 {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.c-stats-v2 {
    display: flex;
    justify-content: space-between;
}

.c-stats-v2 span {
    font-size: 1.05rem;
    color: #5d4037;
}

.c-stats-v2 strong {
    font-weight: 800;
    color: #3e2723;
}

/* Mobile Responsiveness for V2 */
@media (max-width: 900px) {
    .home-layout-v2 {
        grid-template-columns: 1fr;
    }

    .hero-content-v2 h1 {
        font-size: 2.2rem;
    }

    .hero-wrapper-v2 {
        height: 500px;
    }

    .census-grid-v2 {
        grid-template-columns: 1fr;
    }

    .schemes-list-v2 {
        grid-template-columns: 1fr;
    }

    .hero-curve svg {
        height: 60px;
    }
}


/* Footer Spacing Fix */
.main-footer {
    padding-left: 30px !important;
    padding-right: 30px !important;
}
/* === Custom Animations Added === */
@keyframes fadeInUpV2 {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(92, 77, 209, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(92, 77, 209, 0); }
    100% { box-shadow: 0 0 0 0 rgba(92, 77, 209, 0); }
}

.hero-content-v2 h1 {
    animation: fadeInUpV2 1s ease-out forwards;
}
.hero-subtitle-v2 {
    animation: fadeInUpV2 1s ease-out 0.3s forwards;
    opacity: 0;
}
.hero-actions-v2 {
    animation: fadeInUpV2 1s ease-out 0.6s forwards;
    opacity: 0;
}
.btn-primary.btn-v2 {
    animation: pulseGlow 2s infinite;
}

.census-item-v2, .scheme-card-v2 {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.census-item-v2:hover, .scheme-card-v2:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(40, 30, 93, 0.1), 0 4px 6px -2px rgba(40, 30, 93, 0.05);
    border-color: var(--brand-accent) !important;
}

/* ============================================================
   DEEP PURPLE PROFESSIONAL GOVERNMENT THEME - OVERRIDE BLOCK
   ============================================================ */

/* --- Root Color Override --- */
:root {
    --brand-primary: #281E5D !important;
    --brand-dark: #1E1548 !important;
    --brand-light: #EBE9FA !important;
    --brand-accent: #5C4DD1 !important;
    --gov-navbar-bg: #281E5D;
    --gov-navbar-text: #fff;
    --gov-card-border: #281E5D;
}

/* --- Header & Logo area - white clean --- */
.main-header {
    background: #fff !important;
    border-bottom: 3px solid #281E5D !important;
    box-shadow: 0 2px 12px rgba(40,30,93,0.10) !important;
}

.village-name {
    color: #281E5D !important;
    -webkit-text-fill-color: #281E5D !important;
}

/* --- Navbar - Deep Purple --- */
.navbar {
    background: #281E5D !important;
}

.navbar::before {
    background: linear-gradient(90deg, #5C4DD1, #fff, #5C4DD1) !important;
    height: 3px !important;
}

.nav-item {
    color: #fff !important;
}

.nav-item:hover,
.nav-item.active {
    background: #1E1548 !important;
    color: #fff !important;
    border-bottom: 3px solid #5C4DD1 !important;
}

/* --- Panel titles & borders -- Purple --- */
.border-top-brown { border-top: 5px solid #281E5D !important; }
.border-top-brown-light { border-top: 5px solid #5C4DD1 !important; }

.title-v2 {
    color: #281E5D !important;
}

.subtitle-v2 {
    color: #444 !important;
}

.btn-outline-v2 {
    border: 1px solid #281E5D !important;
    color: #281E5D !important;
}

.btn-outline-v2:hover {
    background: #281E5D !important;
    color: #fff !important;
}

/* --- Panel header bottom border --- */
.panel-header-v2 {
    border-bottom: 1px solid #EBE9FA !important;
}

/* --- Alert items purple tint --- */
.alert-item-v2 {
    border-left: 4px solid #5C4DD1 !important;
    background: #F4F2FF !important;
}

.alert-urgent {
    border-left: 4px solid #c62828 !important;
    background: #fff5f5 !important;
}

.alert-content strong { color: #281E5D !important; }
.alert-content span { color: #444 !important; }

/* --- Scheme cards purple style --- */
.scheme-card-v2 {
    background: #F8F7FF !important;
    border: 1px solid #EBE9FA !important;
}

.scheme-card-v2:hover {
    border-color: #281E5D !important;
    box-shadow: 0 5px 15px rgba(40,30,93,0.10) !important;
}

.s-text-v2 strong { color: #281E5D !important; }

/* --- Stat box highlight --- */
.stat-val { color: #281E5D !important; }

/* --- Hero Buttons --- */
.btn-primary-v2 {
    background: #281E5D !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
}

.btn-primary-v2:hover {
    background: #5C4DD1 !important;
}

.btn-secondary-v2 {
    background: rgba(255,255,255,0.15) !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

/* --- Heading underline purple --- */
.heading-underline { background: #281E5D !important; }

.panel-title { border-bottom: 2px solid #281E5D !important; }

/* --- Footer deep purple --- */
.main-footer {
    background: #1E1548 !important;
    color: #ddd !important;
    border-top: 3px solid #5C4DD1 !important;
}

.footer-col h3 { color: #fff !important; }
.footer-col strong { color: #EBE9FA !important; }
.footer-col p, .footer-col span, .footer-col li, .footer-col a {
    color: #c5bef9 !important;
}

/* ============================================================
   GP STAFF MEMBERS - 3 CARDS PER ROW LAYOUT
   ============================================================ */
.members-ref-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 1rem 0 !important;
}

@media (max-width: 768px) {
    .members-ref-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .members-ref-grid {
        grid-template-columns: 1fr !important;
    }
}

.member-ref-card {
    background: #fff !important;
    border-radius: 14px !important;
    padding: 1.5rem 1rem !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(40,30,93,0.08) !important;
    border: 1px solid #EBE9FA !important;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.member-ref-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(40,30,93,0.15) !important;
    border-color: #281E5D !important;
}

.member-img-circle {
    width: 110px !important;
    height: 110px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 4px solid #EBE9FA !important;
    margin-bottom: 12px !important;
    display: block;
    box-shadow: 0 2px 8px rgba(40,30,93,0.10) !important;
}

.member-name-ref {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #281E5D !important;
    margin-bottom: 4px !important;
}

.member-role-ref {
    font-size: 0.82rem !important;
    color: #5C4DD1 !important;
    font-weight: 500 !important;
}

/* ============================================================
   CENSUS TABLE IN HOME PAGE
   ============================================================ */
.census-home-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    border: 1px solid #EBE9FA;
    border-radius: 8px;
    overflow: hidden;
}

.census-home-table th {
    background: #281E5D;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.census-home-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #EBE9FA;
    color: #333;
}

.census-home-table tbody tr:nth-child(even) {
    background: #F8F7FF;
}

.census-total-row {
    background: #EBE9FA !important;
    font-weight: 700;
    color: #281E5D !important;
}

.census-total-row td {
    color: #281E5D !important;
    font-weight: 700;
}

/* ============================================================
   CENSUS CARDS - purple style
   ============================================================ */
.census-card-v2 {
    background: #fff;
    border: 1px solid #EBE9FA;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(40,30,93,0.06);
}

.c-header-v2 strong { color: #281E5D; }
.badge-v2 { background: #EBE9FA; color: #281E5D; }

/* ============================================================
   GALLERY - proper image display
   ============================================================ */
.gallery-card {
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(40,30,93,0.10) !important;
    border: 2px solid #EBE9FA !important;
    background: #F8F7FF !important;
}

.gallery-card img {
    width: 100% !important;
    height: 280px !important;
    object-fit: contain !important;
    background: #1a1a3e !important;
    display: block;
}

.gallery-card:hover {
    border-color: #281E5D !important;
    transform: scale(1.02) !important;
}

/* ============================================================
   HERO SLIDER - no crop, contain
   ============================================================ */
.h-slide {
    object-fit: contain !important;
    background-color: #1a1a3e !important;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .home-layout-v2 {
        grid-template-columns: 1fr !important;
    }
    
    .hero-content-v2 h1 {
        font-size: 1.6rem !important;
    }
    
    .hero-wrapper-v2 {
        height: 60vh !important;
    }
    
    .minister-marquee-v2 {
        overflow-x: auto !important;
    }
    
    .schemes-list-v2 {
        grid-template-columns: 1fr !important;
    }
    
    .census-grid-v2 {
        grid-template-columns: 1fr !important;
    }
    
    .census-home-table {
        font-size: 0.72rem !important;
    }
    
    .census-home-table th,
    .census-home-table td {
        padding: 6px 6px !important;
    }
}

/* ============================================================
   SOFT SAGE & IVORY THEME - OVERRIDE BLOCK
   ============================================================ */

/* --- Root Color Override --- */
:root {
    --brand-primary: #6E9B90 !important;
    --brand-dark: #5E8F85 !important;
    --brand-light: #EEF6F2 !important;
    --brand-accent: #D8A54C !important;
    --gov-navbar-bg: #7FA89F !important;
    --gov-navbar-text: #FFFFFF !important;
    --gov-card-border: #6E9B90 !important;
    --text-color: #2F3E46 !important;
    --page-bg: #F5FAF7 !important;
}

body {
    background-color: var(--page-bg) !important;
    color: var(--text-color) !important;
}

/* --- Header & Logo area --- */
.main-header {
    background: #fff !important;
    border-bottom: 3px solid #6E9B90 !important;
    box-shadow: 0 2px 12px rgba(110, 155, 144, 0.10) !important;
}

.village-name { color: #6E9B90 !important; -webkit-text-fill-color: #6E9B90 !important; text-shadow: none; }

/* --- Navbar --- */
.navbar {
    background: #7FA89F !important;
}

.navbar::before {
    background: linear-gradient(90deg, #D8A54C, #fff, #D8A54C) !important;
    height: 3px !important;
}

.nav-item {
    color: #FFFFFF !important;
}

.nav-item:hover,
.nav-item.active {
    background: #5E8F85 !important;
    color: #FFFFFF !important;
    border-bottom: 3px solid #D8A54C !important;
}

/* --- Panel titles & borders --- */
.border-top-brown { border-top: 5px solid #6E9B90 !important; }
.border-top-brown-light { border-top: 5px solid #7FA89F !important; }

.title-v2 {
    color: #2F3E46 !important;
}

.subtitle-v2 {
    color: #2F3E46 !important;
    opacity: 0.8;
}

.btn-outline-v2 {
    border: 1px solid #6E9B90 !important;
    color: #6E9B90 !important;
}

.btn-outline-v2:hover {
    background: #6E9B90 !important;
    color: #FFFFFF !important;
}

/* --- Panel header bottom border --- */
.panel-header-v2 {
    border-bottom: 1px solid #EEF6F2 !important;
}

/* --- Alert items --- */
.alert-item-v2 {
    border-left: 4px solid #D8A54C !important;
    background: #FFFFFF !important;
}

.alert-urgent {
    border-left: 4px solid #c62828 !important;
    background: #fff5f5 !important;
}

.alert-content strong { color: #2F3E46 !important; }
.alert-content span { color: #2F3E46 !important; opacity: 0.8; }

/* --- Scheme cards --- */
.scheme-card-v2 {
    background: #FFFFFF !important;
    border: 1px solid #EEF6F2 !important;
}

.scheme-card-v2:hover {
    border-color: #6E9B90 !important;
    box-shadow: 0 5px 15px rgba(110, 155, 144, 0.10) !important;
}

.s-text-v2 strong { color: #2F3E46 !important; }

/* --- Stat box highlight --- */
.stat-val { color: #2F3E46 !important; }
.stat-lbl { color: #2F3E46 !important; opacity: 0.8; }

/* --- Hero Buttons --- */
.btn-primary-v2 {
    background: #6FA69B !important;
    color: #FFFFFF !important;
    border: none !important;
    font-weight: 700 !important;
}

.btn-primary-v2:hover {
    background: #5E8F85 !important;
}

.btn-secondary-v2 {
    background: rgba(255,255,255,0.15) !important;
    border: 2px solid #FFFFFF !important;
    color: #FFFFFF !important;
}

/* --- Heading underline --- */
.heading-underline { background: #6E9B90 !important; }

.panel-title { border-bottom: 2px solid #6E9B90 !important; }

/* --- Footer --- */
.main-footer {
    background: #5E8F85 !important;
    color: #FFFFFF !important;
    border-top: 3px solid #D8A54C !important;
}

.footer-col h3 { color: #FFFFFF !important; }
.footer-col strong { color: #EEF6F2 !important; }
.footer-col p, .footer-col span, .footer-col li, .footer-col a {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ============================================================
   GP STAFF MEMBERS - 3 CARDS PER ROW LAYOUT
   ============================================================ */
.members-ref-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 1rem 0 !important;
}

@media (max-width: 768px) {
    .members-ref-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .members-ref-grid {
        grid-template-columns: 1fr !important;
    }
}

.member-ref-card {
    background: #FFFFFF !important;
    border-radius: 14px !important;
    padding: 1.5rem 1rem !important;
    text-align: center !important;
    box-shadow: 0 4px 15px rgba(110, 155, 144, 0.08) !important;
    border: 1px solid #EEF6F2 !important;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.member-ref-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(110, 155, 144, 0.15) !important;
    border-color: #6E9B90 !important;
}

.member-img-circle {
    width: 110px !important;
    height: 110px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 4px solid #EEF6F2 !important;
    margin-bottom: 12px !important;
    display: block;
    box-shadow: 0 2px 8px rgba(110, 155, 144, 0.10) !important;
}

.member-name-ref {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #2F3E46 !important;
    margin-bottom: 4px !important;
}

.member-role-ref {
    font-size: 0.82rem !important;
    color: #6E9B90 !important;
    font-weight: 500 !important;
}

/* ============================================================
   CENSUS TABLE IN HOME PAGE
   ============================================================ */
.census-home-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    border: 1px solid #EEF6F2;
    border-radius: 8px;
    overflow: hidden;
}

.census-home-table th {
    background: #6E9B90;
    color: #FFFFFF;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.census-home-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #EEF6F2;
    color: #2F3E46;
}

.census-home-table tbody tr:nth-child(even) {
    background: #F5FAF7;
}

.census-total-row {
    background: #EEF6F2 !important;
    font-weight: 700;
    color: #2F3E46 !important;
}

.census-total-row td {
    color: #2F3E46 !important;
    font-weight: 700;
}

/* ============================================================
   CENSUS CARDS
   ============================================================ */
.census-card-v2 {
    background: #FFFFFF;
    border: 1px solid #EEF6F2;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(110, 155, 144, 0.06);
}

.c-header-v2 strong { color: #2F3E46; }
.badge-v2 { background: #EEF6F2; color: #2F3E46; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-card {
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(110, 155, 144, 0.10) !important;
    border: 2px solid #EEF6F2 !important;
    background: #FFFFFF !important;
}

.gallery-card img {
    width: 100% !important;
    height: 280px !important;
    object-fit: contain !important;
    background: #F5FAF7 !important;
    display: block;
}

.gallery-card:hover {
    border-color: #6E9B90 !important;
    transform: scale(1.02) !important;
}

/* ============================================================
   HERO SLIDER
   ============================================================ */
.h-slide {
    object-fit: contain !important;
    background-color: #F5FAF7 !important;
}

/* ============================================================
   MOBILE HEADER FIX
   ============================================================ */
@media (max-width: 768px) {
    .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
    }
    .main-header .logo-container {
        display: flex;
        align-items: center;
        width: auto;
        justify-content: flex-start;
        flex-grow: 1;
    }
    .main-header .logo {
        height: 40px;
        width: 40px;
        margin-right: 10px;
    }
    .main-header .header-text h1 {
        font-size: 1rem !important;
        margin: 0;
        text-align: left;
    }
    .main-header .header-text p {
        display: none; /* Hide subtitle on very small screens to fit one row */
    }
    .mobile-menu-btn {
        margin-left: 10px;
        display: block;
    }
}

@media (max-width: 768px) {
    .right-logo {
        display: none !important;
    }
    .lang-controls {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }
    #lang-select {
        padding: 5px !important;
        font-size: 0.8rem !important;
    }
    .main-header {
        padding: 10px 15px !important;
        flex-wrap: nowrap !important;
    }
    .main-header .village-name {
        font-size: 1.1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}



/* ============================================================
   MOBILE RESPONSIVENESS FIXES
   ============================================================ */
@media (max-width: 768px) {
    /* 1. Header in one row */
    .main-header {
        flex-wrap: nowrap !important;
        padding: 5px 10px !important;
    }
    .main-header .logo-container {
        flex-shrink: 1;
        min-width: 0;
        margin-right: 5px;
    }
    .main-header .logo {
        height: 35px !important;
        width: 35px !important;
    }
    .main-header .header-text h1 {
        font-size: 0.9rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }
    .main-header .header-text p {
        display: none !important;
    }
    .lang-controls {
        flex-shrink: 0;
        gap: 5px !important;
    }
    #lang-select {
        padding: 3px !important;
        font-size: 0.75rem !important;
        max-width: 80px;
    }

    /* 2. Members Grid */
    .member-grid-v2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .panel-header-v2 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    /* 3. Schemes full width fix */
    .schemes-list-v2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* 4. Hero Content */
    .hero-content-v2 h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    /* 5. Population stats side by side */
    .pop-stats-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .pop-stats-row .stat-box-v2 {
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .member-grid-v2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .schemes-list-v2 {
        grid-template-columns: 1fr !important;
    }
    .main-header .header-text h1 {
        max-width: 110px;
        font-size: 0.85rem !important;
    }
}

/* ============================================================
   HEADER MOBILE FIX (Correct Classes)
   ============================================================ */
@media (max-width: 768px) {
    .header-content {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        gap: 5px !important;
        padding: 5px 10px !important;
    }
    
    .brand-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
        gap: 8px !important;
        width: auto !important;
    }
    
    .logo-container .logo-img {
        width: 35px !important;
        height: 35px !important;
        flex-shrink: 0 !important;
    }
    
    .brand-text {
        display: flex !important;
        flex-direction: column !important;
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
    
    .village-name {
        font-size: 0.85rem !important;
        white-space: normal !important; /* Allow wrapping to 2 lines if needed */
        word-wrap: break-word !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: none !important;
    }
    
    .lgd-code {
        display: none !important; /* Hide LGD ID to save space */
    }
    
    .header-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        gap: 5px !important;
        width: auto !important;
        justify-content: flex-end !important;
        margin-top: 0 !important;
    }
    
    .seal-container {
        display: none !important; /* Hide second logo on mobile */
    }
    
    .lang-selector {
        margin: 0 !important;
    }
    
    #language-select {
        padding: 3px 6px !important;
        font-size: 0.75rem !important;
        height: auto !important;
        border-radius: 4px !important;
        width: auto !important;
        min-width: 0 !important;
    }
    
    .mobile-menu-btn {
        margin: 0 !important;
        padding: 5px !important;
        font-size: 1.2rem !important;
        display: block !important;
        background: transparent !important;
        border: none !important;
        color: #2F3E46 !important;
    }
}

/* ============================================================
   HEADER REFERENCE DESIGN FIX
   ============================================================ */
.main-header {
    background: #4A7C6E !important; /* Dark Sage Green */
    color: #FFFFFF !important;
    border-bottom: none !important;
    padding: 8px 12px !important;
}

.main-header .brand-text {
    flex-direction: column !important;
    align-items: flex-start !important;
}

.main-header .village-name {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    font-size: 1.1rem !important;
    text-shadow: none !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
}

.main-header .lgd-code {
    display: block !important;
    color: #E2E8F0 !important;
    font-size: 0.75rem !important;
    font-weight: normal !important;
    white-space: nowrap !important;
}

.main-header .header-controls {
    gap: 8px !important;
}

.main-header .seal-container {
    display: flex !important;
}

.main-header .seal-img {
    height: 32px !important;
    width: auto !important;
}

#language-select {
    background: transparent !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    border-radius: 20px !important;
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

#language-select option {
    background: #4A7C6E !important;
    color: #FFFFFF !important;
}

.mobile-menu-btn {
    color: #FFFFFF !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    border-radius: 6px !important;
    padding: 4px 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 768px) {
    .main-header {
        padding: 8px 5px !important;
        gap: 3px !important;
    }
    
    .main-header .logo-img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .main-header .village-name {
        font-size: 0.9rem !important;
    }
    
    .main-header .lgd-code {
        font-size: 0.65rem !important;
    }
    
    .main-header .seal-img {
        height: 24px !important;
    }
    
    #language-select {
        font-size: 0.7rem !important;
        padding: 2px 5px !important;
    }
    
    .mobile-menu-btn {
        padding: 3px 5px !important;
        font-size: 1rem !important;
    }
}

/* Fix Mobile Menu Overlap */
.side-menu {
    z-index: 9999 !important;
}
.menu-overlay {
    z-index: 9998 !important;
}

/* Fix GP Members 2 columns */
@media (max-width: 768px) {
    .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .member-card-v2 {
        min-width: 0 !important;
        width: 100% !important;
        padding: 10px !important;
    }
    .m-avatar-v2 {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ============================================================
   THEME 3 - SOFT BLUE & GRAY
   ============================================================ */
:root {
    --brand-primary: #7A9EB8 !important;
    --brand-dark: #6D98B6 !important;
    --brand-light: #EDF4F8 !important;
    --brand-accent: #D9A441 !important;
    --gov-navbar-bg: #8FB0C7 !important;
    --gov-navbar-text: #FFFFFF !important;
    --gov-card-border: #7A9EB8 !important;
    --text-color: #2C3E50 !important;
    --page-bg: #F6F9FC !important;
}

body {
    background-color: var(--page-bg) !important;
    color: var(--text-color) !important;
}

/* --- Desktop Header & Logo area --- */
@media (min-width: 769px) {
    .main-header {
        background: #fff !important;
        border-bottom: 3px solid #7A9EB8 !important;
        box-shadow: 0 2px 12px rgba(122, 158, 184, 0.10) !important;
    }
    .village-name {
        color: #7A9EB8 !important;
        -webkit-text-fill-color: #7A9EB8 !important;
        text-shadow: none !important;
    }
}

/* --- Mobile Header Fix overrides for Theme 3 --- */
@media (max-width: 768px) {
    .main-header {
        background: #7A9EB8 !important;
        color: #FFFFFF !important;
        border-bottom: none !important;
    }
    .main-header .village-name {
        color: #FFFFFF !important;
        -webkit-text-fill-color: #FFFFFF !important;
    }
    #language-select option {
        background: #7A9EB8 !important;
        color: #FFFFFF !important;
    }
}

/* --- Navbar --- */
.navbar {
    background: #8FB0C7 !important;
}
.navbar::before {
    background: linear-gradient(90deg, #D9A441, #fff, #D9A441) !important;
}

/* --- Cards & Panels --- */
.modern-panel-v2, .member-ref-card, .stat-box-v2, .scheme-card-v2, .census-card-v2 {
    background: #FFFFFF !important;
    border-color: #EDF4F8 !important;
    box-shadow: 0 4px 15px rgba(122, 158, 184, 0.08) !important;
}

/* --- Sections --- */
.stat-box-v2[style*="EEF6F2"] { background: #EDF4F8 !important; border-color: #7A9EB8 !important; }
.stat-box-v2[style*="F5FAF7"] { background: #F6F9FC !important; border-color: #D9A441 !important; }

/* --- Buttons --- */
.btn-primary, .btn-outline-v2, .submit-btn, .lang-btn, .action-btn {
    background: #6D98B6 !important;
    border-color: #6D98B6 !important;
    color: #fff !important;
}
.btn-outline-v2:hover, .btn-primary:hover, .submit-btn:hover {
    background: #5C839E !important;
    border-color: #5C839E !important;
}

/* --- Tables --- */
.census-home-table thead, .custom-table-v2 thead th, .tender-table thead {
    background: #7A9EB8 !important;
}
.census-home-table tr:nth-child(even), .custom-table-v2 tbody tr:nth-child(even) {
    background: #EDF4F8 !important;
}

/* --- Footer --- */
footer, .site-footer {
    background: #6A8EA8 !important;
    color: #fff !important;
}

/* --- Slider/Hero --- */
.hero-slider-bg-v2 img {
    background: linear-gradient(135deg, #6A8EA8, #8FB0C7) !important;
}
.hero-overlay-v2 {
    background: linear-gradient(to bottom, rgba(44, 62, 80, 0.4) 0%, rgba(44, 62, 80, 0.1) 50%, #F6F9FC 100%) !important;
}

/* --- Alerts --- */
.alerts-container-v2 {
    background: #EDF4F8 !important;
}
.alert-item-v2 {
    background: #FFFFFF !important;
    border-left: 4px solid #6D98B6 !important;
}
.alert-urgent {
    border-left: 4px solid #D9A441 !important;
    background: #FFF9F0 !important;
}

/* Side Menu active item */
.side-nav-v2 li a.active {
    background: #EDF4F8 !important;
    color: #2C3E50 !important;
    border-left-color: #D9A441 !important;
}


/* ============================================================
   FINAL VISIBILITY & MOBILE FIXES FOR THEME 3
   ============================================================ */
/* 1. Ensure Footer Matches Theme */
.main-footer, footer, .site-footer {
    background: #6A8EA8 !important;
    color: #FFFFFF !important;
    border-top: none !important;
}

.main-footer h3, .main-footer .footer-links a {
    color: #FFFFFF !important;
}

/* 2. Desktop Header Visibility */
@media (min-width: 769px) {
    .main-header {
        background: #FFFFFF !important;
    }
    .village-name {
        color: #7A9EB8 !important;
        -webkit-text-fill-color: #7A9EB8 !important;
        text-shadow: none !important;
    }
}

/* 3. Mobile Header & Menu Visibility */
@media (max-width: 768px) {
    .main-header {
        background: #7A9EB8 !important;
        color: #FFFFFF !important;
        display: flex !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    .village-name {
        color: #FFFFFF !important;
        -webkit-text-fill-color: #FFFFFF !important;
        text-shadow: none !important;
    }
    .lgd-code {
        color: #EDF4F8 !important;
    }
    .mobile-menu-btn {
        color: #FFFFFF !important;
        border-color: rgba(255,255,255,0.5) !important;
        z-index: 999999 !important;
    }
    
    /* Ensure Side Menu looks good on mobile and doesn't break header */
    .side-menu {
        background: #8FB0C7 !important;
        z-index: 100000 !important;
    }
    .side-menu .nav-item {
        color: #FFFFFF !important;
    }
    .side-menu .nav-item.active,
    .side-menu .nav-item:hover {
        background: #6D98B6 !important;
        border-left: 4px solid #D9A441 !important;
        color: #FFFFFF !important;
    }
    .menu-overlay {
        z-index: 99999 !important;
        background: rgba(44, 62, 80, 0.7) !important;
    }
}

/* ============================================================
   BLACK HEADER TEXT & MOBILE ALIGNMENT FIX
   ============================================================ */
/* 1. Universal Header Styling (White Background, Black Text) */
.main-header {
    background: #FFFFFF !important;
    border-bottom: 3px solid #7A9EB8 !important;
}

.main-header .village-name {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    text-shadow: none !important;
}

.main-header .lgd-code {
    color: #333333 !important;
    font-weight: 600 !important;
}

.main-header .logo-img, .main-header .seal-img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.mobile-menu-btn {
    color: #111111 !important;
    border: 1px solid #111111 !important;
}

#language-select {
    color: #111111 !important;
    border: 1px solid #111111 !important;
    background: #F6F9FC !important;
}

/* 2. Mobile Specific Header Alignment */
@media (max-width: 768px) {
    .main-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 8px 5px !important;
        width: 100% !important;
    }
    
    .brand-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
        gap: 8px !important;
    }
    
    .brand-text {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }
    
    .village-name {
        font-size: 0.95rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        line-height: 1.2 !important;
    }
    
    .lgd-code {
        font-size: 0.7rem !important;
        margin-top: 2px !important;
    }
    
    .header-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        gap: 6px !important;
    }
}

/* 3. GP Members Grid Fix - 2 Cards per row on mobile */
@media (max-width: 768px) {
    .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .member-card-v2 {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .m-avatar-v2 {
        width: 50px !important;
        height: 50px !important;
    }
    
    .m-name-v2 {
        font-size: 0.8rem !important;
        text-align: center !important;
    }
    
    .m-role-v2 {
        font-size: 0.65rem !important;
        text-align: center !important;
    }
}

/* ============================================================
   FINAL POLISH: PERFECT DESKTOP HEADER & MOBILE MENU
   ============================================================ */

/* 1. Desktop Header - Center content to remove blank space and make attractive */
@media (min-width: 769px) {
    .main-header {
        background: #FFFFFF !important;
        padding: 15px 20px !important;
    }
    
    .header-content {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 30px !important;
        width: 100% !important;
    }
    
    .brand-section {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        justify-content: center !important;
    }
    
    .village-name {
        font-size: 2rem !important; /* Larger, more attractive heading */
        font-weight: 700 !important;
        color: #2C3E50 !important;
        -webkit-text-fill-color: #2C3E50 !important;
        margin: 0 !important;
    }
    
    .lgd-code {
        display: block !important;
        font-size: 1rem !important;
        color: #6A8EA8 !important;
        margin-top: 5px !important;
        text-align: left !important;
    }
    
    .brand-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .header-controls {
        position: absolute !important;
        right: 20px !important;
    }
}

/* 2. Mobile Menu Fix (Like Reference Image 4) */
@media (max-width: 768px) {
    .main-header {
        position: relative !important;
    }
    
    /* Make the mobile menu a proper clean dropdown */
    .navbar {
        display: none !important;
        flex-direction: column !important;
        width: 100% !important;
        background: #FFFFFF !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        z-index: 100000 !important;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1) !important;
        padding: 0 !important;
    }
    
    .navbar.active {
        display: flex !important;
    }
    
    .nav-links {
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .nav-item {
        color: #2C3E50 !important;
        background: #FFFFFF !important;
        padding: 15px 20px !important;
        border-bottom: 1px solid #EDF4F8 !important;
        width: 100% !important;
        text-align: left !important;
        font-weight: 600 !important;
        font-size: 1.1rem !important;
        justify-content: flex-start !important;
    }
    
    .nav-item.active, .nav-item:hover {
        background: #F6F9FC !important;
        border-left: 5px solid #7A9EB8 !important;
        color: #2C3E50 !important;
    }
}

/* 3. Ensure GP Members in BOTH home and members page are 2 columns on mobile */
@media (max-width: 768px) {
    .member-grid, .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .member-card, .member-card-v2 {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
}

/* ============================================================
   SAWARDIGAR COLOR REFRESH
   ============================================================ */
:root {
    --brand-primary: #176b73 !important;
    --brand-dark: #123f4a !important;
    --brand-light: #e4f4f1 !important;
    --brand-accent: #e59b35 !important;
    --text-main: #18323a !important;
    --text-muted: #526b72 !important;
    --bg-main: #eef6f4 !important;
    --page-bg: #eef6f4 !important;
    --border-color: #c9e0dc !important;
}

body {
    background: #eef6f4 !important;
    color: #18323a !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(228, 244, 241, 0.9)) !important;
}

.main-header {
    background: linear-gradient(120deg, #ffffff 0%, #e7f4f0 100%) !important;
    border-bottom: 3px solid #e59b35 !important;
    box-shadow: 0 8px 24px rgba(18, 63, 74, 0.12) !important;
}

.main-header .header-content {
    border-bottom-color: rgba(23, 107, 115, 0.18) !important;
}

.village-name {
    color: #123f4a !important;
    -webkit-text-fill-color: #123f4a !important;
}

.main-header .lgd-code {
    background: #176b73 !important;
    color: #ffffff !important;
    border-color: #176b73 !important;
}

.navbar {
    background: linear-gradient(100deg, #123f4a, #176b73 58%, #278b87) !important;
    box-shadow: 0 6px 16px rgba(18, 63, 74, 0.18) !important;
}

.navbar::before {
    background: linear-gradient(90deg, #e59b35, #f5c66a, #e59b35) !important;
}

.nav-item:hover,
.nav-item.active {
    background: #e59b35 !important;
    color: #123f4a !important;
    border-bottom-color: #fff4d8 !important;
}

.hero-curve svg path {
    fill: #eef6f4 !important;
}

.minister-marquee-v2,
.minister-marquee-wrapper {
    background: #d9eeea !important;
    border-color: #b9d9d3 !important;
    box-shadow: 0 5px 18px rgba(18, 63, 74, 0.1) !important;
}

.minister-pill-v2,
.minister-pill {
    background: #ffffff !important;
    border-color: #b9d9d3 !important;
}

.minister-info span,
.minister-info small {
    color: #123f4a !important;
}

.modern-panel-v2,
.panel-box,
.scheme-detail-box,
.glass-card,
.member-ref-card,
.contact-ref-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: #c9e0dc !important;
    box-shadow: 0 8px 22px rgba(18, 63, 74, 0.1) !important;
}

.border-top-brown,
.contact-ref-card {
    border-top-color: #e59b35 !important;
}

.title-v2,
.panel-title,
.section-heading,
.contact-role-title,
.member-name-ref {
    color: #123f4a !important;
}

.panel-header-v2 {
    border-bottom-color: #d9eeea !important;
}

.btn-primary,
.btn-primary-v2,
.btn-hero,
.submit-btn,
.action-btn {
    background: #176b73 !important;
    color: #ffffff !important;
    border-color: #176b73 !important;
}

.btn-primary:hover,
.btn-primary-v2:hover,
.submit-btn:hover {
    background: #123f4a !important;
}

.btn-outline-v2,
.btn-secondary-v2 {
    border-color: #e59b35 !important;
    color: #176b73 !important;
}

.btn-outline-v2:hover {
    background: #e59b35 !important;
    color: #123f4a !important;
}

.alert-item-v2,
.scheme-card-v2,
.census-card-v2,
.scheme-side-item,
.pop-card-item,
.pop-summary-box-new,
.pop-detailed-box-new {
    background: #f5fbfa !important;
    border-color: #c9e0dc !important;
}

.alert-urgent {
    background: #fff6e5 !important;
    border-left-color: #e59b35 !important;
}

.alert-content strong,
.alert-content span,
.s-text-v2 strong,
.s-text-v2 span,
.stat-val,
.stat-lbl,
.c-header-v2 strong,
.c-stats-v2 span,
.c-stats-v2 strong {
    color: #18323a !important;
}

.card-icon-circle,
.scheme-side-icon {
    background: #d9eeea !important;
    color: #176b73 !important;
}

.main-footer,
footer,
.site-footer {
    background: linear-gradient(120deg, #123f4a, #176b73) !important;
    color: #eef6f4 !important;
    border-top: 5px solid #e59b35 !important;
}

.main-footer h3,
.main-footer strong,
.main-footer p,
.main-footer span,
.main-footer li,
.main-footer .footer-links a {
    color: #eef6f4 !important;
}

@media (max-width: 768px) {
    .main-header {
        background: linear-gradient(120deg, #123f4a, #176b73) !important;
        border-bottom-color: #e59b35 !important;
    }

    .main-header .village-name {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    .main-header .lgd-code {
        background: transparent !important;
        color: #d9eeea !important;
    }

    .bar {
        background-color: #ffffff !important;
    }

    .navbar,
    .navbar .nav-item {
        background: #123f4a !important;
    }

    .navbar .nav-item {
        color: #ffffff !important;
        border-bottom-color: rgba(255, 255, 255, 0.14) !important;
    }

    .navbar .nav-item.active,
    .navbar .nav-item:hover {
        background: #e59b35 !important;
        color: #123f4a !important;
        border-left-color: #fff4d8 !important;
    }
}


/* ============================================================
   GOVERNMENT PROFESSIONAL THEME & LAYOUT FIXES
   ============================================================ */

/* 1. Desktop Header Layout & Colors */
.main-header {
    background: #FFFFFF !important;
    padding: 10px 20px !important;
    border-bottom: none !important;
}

.header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.brand-section {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    justify-content: flex-start !important;
}

.village-name {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    color: #B85000 !important; /* Professional Saffron/Dark Orange */
    -webkit-text-fill-color: #B85000 !important;
    margin: 0 !important;
    letter-spacing: 0.5px !important;
}

.header-controls {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* 2. Mobile Header Overlap Fix */
@media (max-width: 768px) {
    .main-header {
        padding: 10px 10px !important;
    }
    .header-content {
        flex-wrap: nowrap !important;
    }
    .brand-section {
        gap: 8px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    .village-name {
        font-size: 1.1rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        line-height: 1.2 !important;
    }
    .seal-img {
        display: none !important; /* Hide seal on mobile to prevent overlap */
    }
    .header-controls {
        gap: 5px !important;
        flex-shrink: 0 !important;
    }
}

/* 3. Sub-Header Bar */
.sub-header-bar {
    width: 100%;
}
@media (max-width: 768px) {
    .sub-header-bar .region-info {
        font-size: 0.8rem !important;
    }
    .sub-header-bar .lgd-code {
        font-size: 0.95rem !important;
    }
}

/* 4. GP Members Mobile Fix (Applies to Home and Inner Page) */
@media (max-width: 768px) {
    #member-list-home,
    #members-list-page,
    #admin-list-page,
    .member-grid, 
    .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .member-card, 
    .member-card-v2,
    .member-ref-card {
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 5px !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
    
    .profile-frame,
    .member-img-circle {
        width: 60px !important;
        height: 60px !important;
        margin: 0 auto 10px auto !important;
    }
    
    .profile-img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .profile-name,
    .member-name-ref {
        font-size: 0.85rem !important;
        text-align: center !important;
        word-wrap: break-word !important;
    }
    
    .profile-role,
    .member-role-ref {
        font-size: 0.7rem !important;
        text-align: center !important;
    }
}


/* ============================================================
   ROBUST MOBILE FIXES: HEADER & GP MEMBERS
   ============================================================ */

/* 1. Mobile Header - Absolute Prevention of Overlap */
@media (max-width: 768px) {
    .seal-container, .seal-img {
        display: none !important; /* Force hide the seal on mobile */
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .main-header {
        padding: 8px 5px !important;
    }
    
    .brand-section {
        max-width: 60% !important; /* Leave room for dropdown and menu */
        gap: 5px !important;
    }
    
    .logo-img {
        width: 40px !important;
        height: auto !important;
    }
    
    .village-name {
        font-size: 0.95rem !important;
        line-height: 1.1 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        color: #B85000 !important; /* Enforce Saffron Color */
        -webkit-text-fill-color: #B85000 !important;
    }
    
    .header-controls {
        flex-shrink: 0 !important;
        gap: 5px !important;
    }
    
    /* Make Language dropdown smaller on mobile */
    #language-select {
        padding: 3px 5px !important;
        font-size: 0.8rem !important;
    }
}

/* 2. GP Members Mobile Overflow Fix */
@media (max-width: 768px) {
    #member-list-home,
    #members-list-page,
    #admin-list-page,
    .member-grid, 
    .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* Prevent blowout */
        gap: 8px !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 5px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .member-card, 
    .member-card-v2,
    .member-ref-card {
        width: 100% !important;
        min-width: 0 !important; /* Critical for flex/grid items to shrink */
        padding: 10px 5px !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        margin: 0 !important;
    }
    
    .profile-name,
    .member-name-ref {
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        width: 100% !important;
    }
    
    .profile-role,
    .member-role-ref {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
        white-space: normal !important;
        width: 100% !important;
    }
}


/* ============================================================
   ULTRA-AGGRESSIVE MOBILE OVERLAP FIXES & HERO SLIDER
   ============================================================ */

/* 1. Mobile Header Overlap Fix (Seal Visible, but everything fits) */
@media (max-width: 768px) {
    .main-header {
        padding: 6px 8px !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }
    
    .brand-section {
        flex: 1 !important;
        min-width: 0 !important; /* Crucial for text wrapping */
        gap: 6px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .logo-img {
        width: 36px !important;
        height: auto !important;
        min-width: 36px !important;
        flex-shrink: 0 !important;
    }
    
    .village-name {
        font-size: 0.85rem !important; /* Small enough to fit */
        line-height: 1.2 !important;
        white-space: normal !important; /* Allow wrapping */
        word-wrap: break-word !important;
        margin: 0 !important;
        color: #B85000 !important;
    }
    
    .header-controls {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    
    .seal-img {
        display: block !important;
        width: 32px !important;
        height: auto !important;
        min-width: 32px !important;
    }
    
    #language-select {
        font-size: 0.75rem !important;
        padding: 2px 4px !important;
        height: 28px !important;
    }
    
    .mobile-menu-btn {
        padding: 2px 5px !important;
        height: 28px !important;
    }
    
    .mobile-nav-toggle {
        width: 25px !important;
    }
}

/* 2. Mobile Hero Slider Overlap Fix */
@media (max-width: 768px) {
    .hero-section {
        min-height: 450px !important; /* Give more height so text doesn't hit buttons */
        display: flex !important;
        align-items: center !important;
    }
    
    .hero-content {
        padding: 20px 15px !important;
        padding-bottom: 50px !important;
        width: 100% !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 12px !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
        margin-bottom: 25px !important;
        max-width: 100% !important;
    }
    
    .hero-buttons {
        display: flex !important;
        flex-direction: column !important; /* Stack buttons vertically to save horizontal space if needed, or keep row but ensure fit */
        gap: 10px !important;
    }
}

/* 3. Mobile GP Members Squish Fix (Image 3) */
@media (max-width: 768px) {
    /* Ensure the grid is absolutely 2 columns */
    #member-list-home,
    #members-list-page,
    #admin-list-page,
    .member-grid, 
    .member-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 0 5px !important;
        margin: 0 !important;
    }
    
    /* Shrink the card contents so they don't break the column width */
    .member-card, 
    .member-card-v2,
    .member-ref-card {
        padding: 10px 5px !important;
        box-sizing: border-box !important;
    }
    
    /* Make avatars smaller */
    .profile-frame,
    .member-img-circle {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        margin: 0 auto 8px auto !important;
    }
    
    .profile-img {
        width: 48px !important;
        height: 48px !important;
    }
    
    /* Make text extremely compact */
    .profile-name,
    .member-name-ref {
        font-size: 0.75rem !important;
        line-height: 1.1 !important;
        margin-bottom: 3px !important;
    }
    
    .profile-role,
    .member-role-ref {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
    }
}


/* ============================================================
   ABSOLUTE OVERRIDE FIXES - DESKTOP HEADER & MOBILE GRID
   ============================================================ */

/* 1. Desktop Header (All in one row) */
body .main-header {
    background: #FFFFFF !important;
    padding: 10px 20px !important;
}

body .header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

body .brand-section {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

body .brand-text {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

body .village-name {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    color: #B85000 !important; /* Orange/Saffron */
    -webkit-text-fill-color: #B85000 !important;
    margin: 0 !important;
    line-height: 1.1 !important;
}

body .lgd-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    align-items: center !important;
    margin-top: 5px !important;
}

body .lgd-container .region-info {
    color: #5B6A78 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

body .lgd-container .lgd-code {
    color: #8B2500 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
}

/* 2. Mobile Header Layout (No overlap) */
@media (max-width: 768px) {
    body .main-header {
        padding: 8px !important;
    }
    body .header-content {
        flex-wrap: nowrap !important;
    }
    body .brand-section {
        flex: 1 !important;
        min-width: 0 !important;
        gap: 8px !important;
    }
    body .village-name {
        font-size: 1.2rem !important; /* Smaller for mobile */
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    body .seal-img {
        display: none !important; /* Hide seal unconditionally */
    }
    body .lgd-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    body .lgd-container .region-info,
    body .lgd-container .lgd-code {
        font-size: 0.7rem !important;
    }
}

/* 3. GP Members Blowout Fix (Mobile) */
@media (max-width: 768px) {
    body .member-grid,
    body .member-grid-v2,
    body #member-list-home {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        padding: 0 5px !important;
    }

    body .member-card,
    body .member-card-v2,
    body .member-ref-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important; /* Stop blowout */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 10px 5px !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* Contain contents */
    }

    /* Force images to scale down */
    body .member-card img,
    body .member-ref-card img,
    body .profile-img,
    body .member-img-circle {
        max-width: 100% !important;
        height: auto !important;
        width: 60px !important;
        max-height: 60px !important;
        object-fit: cover !important;
        margin: 0 auto 10px auto !important;
    }

    /* Override the JS injected inline widths */
    body .profile-frame,
    body .initials-placeholder {
        width: 60px !important;
        height: 60px !important;
        max-width: 100% !important;
        margin: 0 auto 10px auto !important;
    }
}


/* ============================================================
   HEADER CENTERING & MOBILE SLIDER FIXES
   ============================================================ */

/* 1. Desktop Header - Center LGD Code */
@media (min-width: 769px) {
    body .header-content {
        position: relative !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    body .brand-section {
        flex: 1 !important;
        justify-content: flex-start !important;
    }

    /* Move LGD Container to absolute center of the header */
    body .lgd-container {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        text-align: center !important;
        margin-top: 0 !important;
    }

    body .header-controls {
        flex: 1 !important;
        justify-content: flex-end !important;
    }
}

/* 2. Mobile Layout - Show Seal and Fix Overlaps */
@media (max-width: 768px) {
    /* Show the yellow seal but make it very small and move it left */
    body .seal-img {
        display: block !important;
        width: 25px !important;
        height: auto !important;
        margin-right: 5px !important; /* Move left / give space before dropdown */
    }

    /* Ensure brand section doesn't overlap the seal/dropdown */
    body .brand-section {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: 50% !important; /* Prevent text from blowing out the row */
        margin-right: auto !important;
    }

    body .village-name {
        font-size: 1rem !important; /* Smaller text so it fits with the seal */
        line-height: 1.1 !important;
    }
    
    body .lgd-container {
        display: none !important; /* Keep hidden on mobile top row if it clashes, wait, let's just make it small */
    }

    body .header-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
    }

    /* 3. Slider Heading Fully Visible on Mobile */
    body .hero-content-v2 {
        padding: 0 10px !important;
        text-align: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: -30px !important; /* Lift it up a bit if it's pushed down */
    }

    body .hero-content-v2 h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    body .hero-subtitle-v2 {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    body .hero-actions-v2 {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    body .hero-actions-v2 button {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
}

/* ============================================================
   ULTIMATE MOBILE FIX & LGD REPOSITION
   ============================================================ */

/* 1. Desktop LGD Position (Below Heading) */
@media (min-width: 769px) {
    body .brand-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    body .lgd-container {
        position: static !important;
        transform: none !important;
        left: auto !important;
        margin-top: 5px !important;
        display: flex !important;
    }
}

/* 2. Mobile Header - Absolute 100% Anti-Overlap (Stacked Rows) */
@media (max-width: 768px) {
    body .main-header {
        padding: 5px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body .header-content {
        display: flex !important;
        flex-direction: column !important; /* Stack rows so they NEVER overlap */
        align-items: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
    }

    body .brand-section {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 10px !important;
    }

    body .village-name {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    
    body .lgd-container {
        display: block !important;
        margin-top: 2px !important;
    }

    body .lgd-code {
        font-size: 0.75rem !important;
        color: #555 !important;
    }

    body .header-controls {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 5px !important;
        border-top: 1px solid #E5E7EB !important; /* Visual separator */
    }
    
    body .seal-img {
        display: block !important;
        width: 35px !important;
        height: auto !important;
    }

    /* 3. Slider Text - Fully Visible Anti-Clip */
    body .hero-slider-bg, 
    body .hero-slider-bg-v2 {
        min-height: 350px !important;
    }

    body .hero-content-v2 {
        padding: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important; /* Perfect center */
        text-align: center !important;
    }

    body .hero-content-v2 h1 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        padding: 0 !important;
        width: 100% !important;
        word-wrap: break-word !important;
    }

    body .hero-subtitle-v2 {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin-bottom: 15px !important;
    }
    
    body .hero-actions-v2 {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        width: 100% !important;
    }
}

/* Final contrast corrections for desktop and mobile header states. */
@media (min-width: 769px) {
    body .main-header {
        background: linear-gradient(120deg, #123f4a, #176b73) !important;
        border-bottom-color: #e59b35 !important;
    }

    body .main-header .village-name {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    body .main-header .lgd-code {
        background: transparent !important;
        color: #ffffff !important;
        border-color: rgba(255, 255, 255, 0.45) !important;
    }
}

body .hero-actions-v2 .btn-secondary-v2 {
    background: rgba(18, 63, 74, 0.86) !important;
    border: 2px solid #f5c66a !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

body .hero-actions-v2 .btn-secondary-v2:hover {
    background: #e59b35 !important;
    border-color: #ffffff !important;
    color: #123f4a !important;
}

@media (max-width: 768px) {
    body .main-header {
        background: #ffffff !important;
        border-bottom: 3px solid #e59b35 !important;
        box-shadow: 0 4px 14px rgba(18, 63, 74, 0.14) !important;
    }

    body .main-header .village-name {
        color: #123f4a !important;
        -webkit-text-fill-color: #123f4a !important;
    }

    body .main-header .lgd-code {
        color: #176b73 !important;
    }

    body .main-header .header-controls {
        border-top-color: #c9e0dc !important;
    }

    body .main-header .mobile-nav-toggle {
        border-color: #176b73 !important;
        background: #e4f4f1 !important;
    }

    body .main-header .mobile-nav-toggle .bar {
        background-color: #176b73 !important;
    }


/* Header finish: clean white surface with high-contrast black content. */
body .main-header {
    background: #ffffff !important;
    border-bottom: 3px solid #e59b35 !important;
}

body .main-header .village-name,
body .main-header .lgd-code,
body .main-header #language-select {
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
}

body .main-header .lgd-code {
    background: transparent !important;
    border-color: #b8c4c6 !important;
}

body .main-header #language-select {
    background: #ffffff !important;
    border-color: #111111 !important;
}

body .main-header .mobile-nav-toggle {
    background: #ffffff !important;
    border-color: #111111 !important;
}

body .main-header .mobile-nav-toggle .bar {
    background-color: #111111 !important;
}

body .main-header .logo-img,
body .main-header .seal-img {
    opacity: 1 !important;
    visibility: visible !important;
}
    body .main-header #language-select {
        color: #123f4a !important;
        border-color: #176b73 !important;
        background: #ffffff !important;
    }

    body .main-header .seal-img,
    body .main-header .logo-img {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ============================================================
   SLIDER WHITE FLASH FIX (Fade-to-dark instead of white)
   ============================================================ */

/* Force dark backgrounds on all slider layers to prevent white bleed during cross-fade */
body .hero-slider-bg,
body .hero-slider-bg-v2 {
    background-color: #111827 !important; /* Very dark slate/black */
}

body .h-slide {
    background-color: #111827 !important;
}

body .hero-slider-bg-v2 img, 
body .hero-slider-bg img {
    background: transparent !important;
    background-color: transparent !important;
}

/* Optimize the transition so it doesn't dip to white */
body .h-slide {
    opacity: 0 !important;
    z-index: 1 !important;
    transition: opacity 1.5s ease-in-out !important;
}

body .h-slide.active {
    opacity: 1 !important;
    z-index: 2 !important;
}

/* Final desktop header finish. */
@media (min-width: 769px) {
    body .main-header {
        background: #ffffff !important;
        border-bottom: 3px solid #e59b35 !important;
    }

    body .main-header .village-name,
    body .main-header .lgd-code {
        color: #111111 !important;
        -webkit-text-fill-color: #111111 !important;
    }

    body .main-header .lgd-code {
        background: transparent !important;
        border-color: #b8c4c6 !important;
    }

    body .main-header #language-select {
        color: #111111 !important;
        background: #ffffff !important;
        border-color: #111111 !important;
    }

    body .main-header .logo-img,
    body .main-header .seal-img {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Scheme detail return actions: separate them from the navigation bar. */
body .back-btn-v2,
body .back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    background: #123f4a !important;
    border: 2px solid #123f4a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

body .back-btn-v2:hover,
body .back-btn:hover {
    background: #176b73 !important;
    border-color: #176b73 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Keep the LGD/Census badge aligned with the navigation color. */
body .main-header .lgd-code {
    background: #123f4a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-color: #123f4a !important;
}
