/* --- FONTS loaded via <link> in base.html (avoid CSS @import RTT) --- */

/* --- 1. COLOR PALETTE DEFINITIONS (Wins Group) --- */
:root {
    --wins-blue: #0F4C81;
    --wins-blue-dark: #0a2f4f;
    --wins-blue-light: #1a6bb0;
    --wins-pink: #FFB7C5;
    --wins-pink-soft: #ffe4ea;

    /* Legacy aliases mapped to Wins (for residual CSS) */
    --yim-blue: var(--wins-blue);
    --yim-blue-light: var(--wins-blue-light);
    --yif-green: var(--wins-blue);
    --yif-green-light: var(--wins-blue-light);
    --yip-yellow: var(--wins-pink);
    --yip-yellow-dark: var(--wins-blue);
    --yip-red: var(--wins-blue);
    --yip-red-light: var(--wins-blue-light);
    --parliament-green: var(--wins-blue);
    --parliament-gold: var(--wins-pink);
    --parliament-dark: var(--wins-blue-dark);

    --text-grey: #333;
    --light-bg: #f8f9fa;
}

/* --- 2. THEME: WINS (all portals) --- */
body.theme-wins .main-navbar,
body .main-navbar {
    background-color: var(--wins-blue) !important;
}
body.theme-wins .brand-title,
body .brand-title {
    color: var(--wins-blue);
}
body.theme-wins .feature-card:hover {
    border-top-color: var(--wins-pink);
}
body.theme-wins footer,
body .site-footer {
    border-top: 5px solid var(--wins-pink);
}
/* Bootstrap 5–safe Wins buttons (set BS CSS variables + concrete props) */
body.theme-wins .btn-primary,
.btn-wins {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wins-blue);
    --bs-btn-border-color: var(--wins-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wins-blue-dark);
    --bs-btn-hover-border-color: var(--wins-blue-dark);
    --bs-btn-focus-shadow-rgb: 15, 76, 129;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--wins-blue-dark);
    --bs-btn-active-border-color: var(--wins-blue-dark);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--wins-blue);
    --bs-btn-disabled-border-color: var(--wins-blue);
    color: #fff !important;
    background-color: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
    font-weight: 600;
}
body.theme-wins .btn-primary:hover,
body.theme-wins .btn-primary:focus,
.btn-wins:hover,
.btn-wins:focus {
    color: #fff !important;
    background-color: var(--wins-blue-dark) !important;
    border-color: var(--wins-blue-dark) !important;
}
body.theme-wins .btn-outline-wins,
.btn-outline-wins {
    --bs-btn-color: var(--wins-blue);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--wins-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wins-blue);
    --bs-btn-hover-border-color: var(--wins-blue);
    --bs-btn-focus-shadow-rgb: 15, 76, 129;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--wins-blue);
    --bs-btn-active-border-color: var(--wins-blue);
    --bs-btn-disabled-color: var(--wins-blue);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--wins-blue);
    color: var(--wins-blue) !important;
    background-color: transparent !important;
    border: 1px solid var(--wins-blue) !important;
    font-weight: 600;
}
body.theme-wins .btn-outline-wins:hover,
body.theme-wins .btn-outline-wins:focus,
.btn-outline-wins:hover,
.btn-outline-wins:focus {
    color: #fff !important;
    background-color: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
}
.mobile-branch-chip.chip-wins.is-active {
    background: var(--wins-blue);
    color: #fff;
    border-color: var(--wins-blue);
}
.mobile-tab.is-active {
    color: var(--wins-blue) !important;
}
.text-wins { color: var(--wins-blue) !important; }
.bg-wins { background-color: var(--wins-blue) !important; }
.bg-wins-pink { background-color: var(--wins-pink) !important; }
.border-wins { border-color: var(--wins-blue) !important; }

/* --- 3. UNIVERSAL FIXES --- */
/* Ensure the "Gold" accent uses the variable of the current theme */
.brand-header { border-bottom: 4px solid currentColor; }

/* --- GLOBAL LAYOUT --- */
html, body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-grey);
    background-color: white;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: 'Playfair Display', serif;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- HEADER & NAVIGATION --- */
.top-bar {
    background-color: var(--parliament-dark);
    color: white;
    font-size: 0.85rem;
    padding: 8px 0;
}
.top-bar.desktop-top-bar {
    background-color: var(--wins-blue-dark);
}

.branch-link {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 15px;
    padding-bottom: 2px;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.branch-link:hover,
.branch-link.active,
.branch-link.is-active {
    color: #fff;
    border-bottom-color: var(--wins-pink);
}

.brand-header {
    background: white;
    padding: 20px 0;
    border-bottom: 4px solid var(--parliament-gold);
}

.brand-title {
    color: var(--parliament-green);
    font-weight: 700;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.brand-subtitle {
    color: #666;
    font-style: italic;
    font-family: 'Playfair Display', serif;
}

.main-navbar {
    background-color: var(--parliament-green);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.main-navbar .nav-link {
    color: white !important;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 15px 20px !important;
    transition: background 0.3s;
}

.main-navbar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--parliament-gold) !important;
}

/* --- HERO & CARDS --- */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    background: linear-gradient(to right, rgba(11, 61, 11, 0.9), rgba(11, 61, 11, 0.4));
    color: white;
    padding: 100px 0;
}

.feature-card {
    border: none;
    border-radius: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 3px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-top: 3px solid var(--parliament-gold);
}

footer {
    background-color: #111;
    border-top: 5px solid var(--parliament-gold);
    color: #888;
}

/* --- DIRECTORY (MEMBERS LIST) --- */
.mp-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    background: white;
}
.mp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-bottom: 4px solid var(--parliament-gold);
}
.mp-img-container {
    height: 260px;
    overflow: hidden;
    background-color: #f0f2f5;
    position: relative;
}
.mp-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps directory photos uniform */
    transition: transform 0.4s ease;
}
.mp-card:hover .mp-img-container img {
    transform: scale(1.05);
}
.mp-party-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 10px;
    background: rgba(255,255,255,0.95);
    color: var(--parliament-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- PROFILE PAGE STYLES --- */
.profile-hero {
    background: linear-gradient(135deg, var(--parliament-green) 0%, #052605 100%);
    color: white;
    padding-top: 60px;
    padding-bottom: 100px; 
    position: relative;
    z-index: 1; /* Lower layer */
}
.profile-card-floating {
    margin-top: -80px; 
    background: white;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 4px;
    position: relative;
    z-index: 10; /* CRITICAL FIX: Forces card to sit ON TOP of the green banner */
}
.stat-box {
    border-left: 3px solid var(--parliament-gold);
    padding-left: 15px;
    margin-bottom: 20px;
}
.nav-tabs .nav-link {
    color: #666;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 25px;
}
.nav-tabs .nav-link.active {
    color: var(--parliament-green);
    border-bottom: 3px solid var(--parliament-gold);
    background: transparent;
}

/* --- MOBILE LOGO DEFAULT --- */
.mobile-logo {
    height: 80px;
    width: auto;
}

/* =========================================
   MOBILE RESPONSIVE FIXES
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Force the container to stack vertically */
    .brand-header .container .row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* 2. Force the TEXT to wrap and shrink */
    .brand-title {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        width: 100% !important;
        display: block !important;
        margin-top: 10px !important;
    }

    /* 3. Force the Coat of Arms to fit */
    .mobile-logo {
        height: 50px !important; 
        max-width: 100% !important;
        margin-bottom: 5px !important;
    }

    /* 4. Fix the Top Bar */
    .top-bar { 
        font-size: 0.7rem !important; 
    }

    /* 5. Fix Profile Page Overlap */
    .profile-hero {
        padding-top: 20px !important;
        padding-bottom: 50px !important;
    }
    .profile-card-floating {
        margin-top: -30px !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    /* 6. FORCE PROFILE IMAGE VISIBILITY (Mobile) */
    .profile-card-floating img {
        width: 100% !important;
        max-width: 300px !important; /* Prevents it from being too huge */
        height: auto !important;
        object-fit: contain !important; /* Shows full face */
        display: block !important;
        margin: 0 auto 10px auto !important;
    }
}
/* --- OFFICIAL PORTRAITS (members / leadership) ---
   Tall media uploads (e.g. 574×1020 speaker photos) crop cleanly
   into circles or cards without stretching. */
.portrait-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: #f1f3f5;
    border: 4px solid #ffc107;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.portrait-circle--lg {
    width: 168px;
    height: 168px;
    border-width: 5px;
}

.portrait-circle--sm {
    width: 72px;
    height: 72px;
    border-width: 2px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
}

.portrait-card {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 15%;
    display: block;
    background: #e9ecef;
}

.portrait-frame {
    overflow: hidden;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 4px solid #ffc107;
}

.portrait-frame--rounded {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* --- MAIN NAV (dark bar: white links + Wins pink hover) --- */
.main-navbar.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.92) !important;
    font-weight: 600;
    transition: color 0.3s ease, background 0.3s ease;
}
.main-navbar.navbar-dark .navbar-nav .nav-link:hover,
.main-navbar.navbar-dark .navbar-nav .nav-link:focus,
.main-navbar.navbar-dark .navbar-nav .nav-link.active {
    color: var(--wins-pink) !important;
}
.main-navbar .nav-cta-pill {
    background: var(--wins-pink) !important;
    color: var(--wins-blue-dark) !important;
    border-radius: 999px !important;
    padding: 0.45rem 1rem !important;
    margin: 0.35rem 0;
    font-weight: 700 !important;
}
.main-navbar .nav-cta-pill:hover,
.main-navbar .nav-cta-pill:focus {
    background: #ffc9d4 !important;
    color: var(--wins-blue-dark) !important;
}

/* =========================================
   MOBILE APP SHELL
   ========================================= */
html {
    -webkit-text-size-adjust: 100%;
}
body.has-mobile-shell {
    overflow-x: hidden;
}
.site-main {
    min-height: 50vh;
}
.mobile-logo {
    height: 70px;
    width: auto;
    border-radius: 8px;
    object-fit: cover;
}

.mobile-branch-chips {
    background: #111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem 0;
}
.mobile-branch-chips__scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 1rem;
    scrollbar-width: none;
}
.mobile-branch-chips__scroll::-webkit-scrollbar {
    display: none;
}
.mobile-branch-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
}
.mobile-branch-chip.chip-yim.is-active,
.mobile-branch-chip.chip-yim:active {
    border-color: var(--yim-blue);
    background: rgba(0, 51, 102, 0.45);
    color: #fff;
}
.mobile-branch-chip.chip-yif.is-active,
.mobile-branch-chip.chip-yif:active {
    border-color: var(--yif-green);
    background: rgba(11, 61, 11, 0.55);
    color: #fff;
}
.mobile-branch-chip.chip-yip.is-active,
.mobile-branch-chip.chip-yip:active {
    border-color: var(--yip-yellow);
    background: rgba(218, 165, 32, 0.25);
    color: #fff;
}
.mobile-branch-chip.chip-all {
    opacity: 0.85;
}

.mobile-tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tab-bar__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    max-width: 640px;
    margin: 0 auto;
    min-height: 60px;
}
.mobile-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 56px;
    padding: 0.35rem 0.2rem;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
}
.mobile-tab i {
    font-size: 1.15rem;
    line-height: 1;
}
.mobile-tab.is-active {
    color: #ffc107;
}
body.theme-movement .mobile-tab.is-active {
    color: #6eb5ff;
}
body.theme-foundation .mobile-tab.is-active {
    color: #6fcf97;
}
.mobile-tab:active {
    opacity: 0.75;
}
.mobile-more-sheet {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}
.mobile-more-list .list-group-item {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    body.has-mobile-shell {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .desktop-top-bar {
        display: none !important;
    }
    .brand-header {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    .brand-header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 0.65rem;
    }
    .brand-logo-col {
        flex: 0 0 auto;
    }
    .brand-title-col {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left !important;
    }
    .mobile-logo {
        height: 40px !important;
        width: 40px !important;
        border-radius: 10px;
    }
    .brand-title {
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .main-navbar {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    .main-navbar .navbar-brand {
        font-size: 0.85rem;
        letter-spacing: 0.06em;
    }
    .site-main {
        min-height: 40vh;
    }
    .site-footer {
        padding-top: 2rem !important;
        padding-bottom: 1.5rem !important;
    }
    .site-footer .col-md-4 {
        margin-bottom: 1rem !important;
    }
    .btn,
    .page-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-sm {
        min-height: 38px;
    }
    .hero-section [style*="min-height: 600px"],
    .hero-overlay[style*="min-height: 600px"] {
        min-height: 360px !important;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 992px) {
    .mobile-branch-chips,
    .mobile-tab-bar,
    .mobile-more-sheet {
        display: none !important;
    }
    body.has-mobile-shell {
        padding-bottom: 0;
    }
}

/* --- Talk show episode list thumbnails --- */
.episode-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.episode-card:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1) !important;
}
.episode-thumb {
    position: relative;
    overflow: hidden;
    background: #111;
}
@media (min-width: 768px) {
    .episode-card .episode-thumb {
        border-radius: 0;
        min-height: 100%;
        height: 100%;
    }
    .episode-card .row {
        min-height: 140px;
    }
}
.episode-thumb__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}
.episode-thumb__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    background: linear-gradient(135deg, #0d2137, #1a3a5c);
}
.episode-thumb__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    transition: background 0.2s ease;
    z-index: 1;
}
.episode-thumb__play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    padding-left: 3px; /* optical center for play icon */
    transition: transform 0.15s ease, background 0.15s ease;
}
.episode-card:hover .episode-thumb__play {
    background: rgba(0, 0, 0, 0.4);
}
.episode-card:hover .episode-thumb__play-btn {
    transform: scale(1.06);
    background: #0d6efd;
}
.episode-card .stretched-link-safe {
    position: relative;
    z-index: 2;
}


/* ============================================================
   WINS PORTAL � PROFESSIONAL UI LAYER
   ============================================================ */

:root {
    --wins-shadow: 0 10px 40px rgba(15, 76, 129, 0.12);
    --wins-shadow-lg: 0 24px 60px rgba(10, 47, 79, 0.18);
    --wins-radius: 1.25rem;
    --wins-radius-sm: 0.85rem;
}

body.theme-wins {
    background: #f6f8fb;
}

.site-main {
    min-height: 50vh;
}

/* Brand header polish */
.brand-header {
    background: #fff;
    border-bottom: 3px solid var(--wins-pink) !important;
    box-shadow: 0 1px 0 rgba(15, 76, 129, 0.04);
}
.mobile-logo {
    height: 64px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 76, 129, 0.15);
}
.brand-title {
    letter-spacing: 0.04em;
}
.main-navbar {
    box-shadow: 0 8px 24px rgba(10, 47, 79, 0.18) !important;
}
.main-navbar .nav-link {
    letter-spacing: 0.04em;
    font-size: 0.82rem !important;
    padding: 0.95rem 1rem !important;
    border-radius: 0.5rem;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    background: rgba(255, 183, 197, 0.12) !important;
}

/* Cinematic hero */
.wins-hero {
    position: relative;
    min-height: clamp(420px, 72vh, 640px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
    /* Do not use background shorthand — it would wipe inline background-image */
    background-color: #0a2f4f;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.wins-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(10, 47, 79, 0.75) 0%, rgba(15, 76, 129, 0.55) 48%, rgba(15, 76, 129, 0.28) 100%),
        linear-gradient(to top, rgba(10, 47, 79, 0.7) 0%, transparent 55%);
    z-index: 1;
    pointer-events: none;
}
.wins-hero > .container {
    position: relative;
    z-index: 2;
    padding-top: 4rem;
    padding-bottom: 3.5rem;
}
.wins-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 183, 197, 0.45);
    color: #fff;
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 0.4rem 0.95rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.wins-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.12;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.wins-hero .lead {
    max-width: 36rem;
    color: rgba(255, 255, 255, 0.88) !important;
}
.wins-hero-actions .btn {
    min-width: 9.5rem;
    font-weight: 600;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.btn-wins-pink {
    --bs-btn-color: var(--wins-blue-dark);
    --bs-btn-bg: var(--wins-pink);
    --bs-btn-border-color: var(--wins-pink);
    --bs-btn-hover-color: var(--wins-blue-dark);
    --bs-btn-hover-bg: #ffc9d4;
    --bs-btn-hover-border-color: #ffc9d4;
    --bs-btn-focus-shadow-rgb: 255, 183, 197;
    --bs-btn-active-color: var(--wins-blue-dark);
    --bs-btn-active-bg: #ffc9d4;
    --bs-btn-active-border-color: #ffc9d4;
    --bs-btn-disabled-color: var(--wins-blue-dark);
    --bs-btn-disabled-bg: var(--wins-pink);
    --bs-btn-disabled-border-color: var(--wins-pink);
    color: var(--wins-blue-dark) !important;
    background-color: var(--wins-pink) !important;
    border: 1px solid var(--wins-pink) !important;
    font-weight: 700;
}
.btn-wins-pink:hover,
.btn-wins-pink:focus {
    background-color: #ffc9d4 !important;
    border-color: #ffc9d4 !important;
    color: var(--wins-blue-dark) !important;
}

/* Stats strip */
.wins-stats {
    margin-top: -2.5rem;
    position: relative;
    z-index: 3;
}
.wins-stat-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-radius: var(--wins-radius);
    box-shadow: var(--wins-shadow);
    padding: 1.35rem 1.25rem;
    border: 1px solid rgba(15, 76, 129, 0.08);
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wins-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--wins-shadow-lg);
}
.wins-stat-card .stat-value {
    font-family: "Playfair Display", serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--wins-blue);
    line-height: 1.1;
}
.wins-stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.35rem;
}
.wins-stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wins-blue), #1a6bb0);
    color: var(--wins-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}

/* Section chrome */
.wins-section {
    padding: 4.5rem 0;
}
.wins-section-sm {
    padding: 3rem 0;
}
.wins-section-title {
    font-size: clamp(1.6rem, 2.5vw, 2.15rem);
    font-weight: 700;
    color: var(--wins-blue);
    margin-bottom: 0.35rem;
}
.wins-section-kicker {
    display: inline-block;
    color: var(--wins-blue);
    background: var(--wins-pink-soft);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.wins-section-sub {
    color: #6b7280;
    max-width: 34rem;
}

/* Feature / image cards */
.wins-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid rgba(15, 76, 129, 0.08);
    border-radius: var(--wins-radius);
    box-shadow: var(--wins-shadow);
    overflow: hidden;
    height: 100%;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.wins-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--wins-shadow-lg);
}
.wins-card-img {
    display: block;
    height: 200px;
    object-fit: cover;
    width: 100%;
    flex: 0 0 auto;
    background: #eef2f6;
}
.wins-card-img-tall {
    height: 240px;
}
.wins-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.4rem 1.5rem;
    min-width: 0;
}
.wins-card .card-body > .btn,
.wins-card .card-body > a.btn {
    margin-top: auto;
    align-self: flex-start;
}
.wins-card .card-title {
    font-weight: 700;
    color: #0f172a;
}
.wins-card.p-4,
.wins-card[class*="p-"] {
    /* padding utility cards (parent portal): keep flex layout without clipping focus rings */
    overflow: hidden;
}

/* Parent portal list panels — prevent horizontal overflow */
.wins-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.wins-panel-list {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.wins-panel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.wins-panel-row__main {
    flex: 1 1 10rem;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.wins-panel-row__meta {
    flex: 0 1 auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
    text-align: right;
}
.wins-panel .btn {
    max-width: 100%;
    white-space: normal;
}
.wins-pill {
    display: inline-block;
    background: var(--wins-pink-soft);
    color: var(--wins-blue);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

/* About split */
.wins-about-media {
    position: relative;
    border-radius: var(--wins-radius);
    overflow: hidden;
    box-shadow: var(--wins-shadow-lg);
    min-height: 360px;
}
.wins-about-media img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
}
.wins-about-float {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 42%;
    border-radius: var(--wins-radius-sm);
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.wins-about-float img {
    min-height: 0;
    height: 140px;
    object-fit: cover;
}
.wins-check-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}
.wins-check-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    color: #374151;
}
.wins-check-list li i {
    color: var(--wins-blue);
    margin-top: 0.2rem;
}

/* Mosaic gallery */
.wins-mosaic {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 120px;
    gap: 0.75rem;
}
.wins-mosaic figure {
    margin: 0;
    border-radius: var(--wins-radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: var(--wins-shadow);
}
.wins-mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.wins-mosaic figure:hover img {
    transform: scale(1.06);
}
.wins-mosaic .m1 { grid-column: span 5; grid-row: span 2; }
.wins-mosaic .m2 { grid-column: span 3; grid-row: span 2; }
.wins-mosaic .m3 { grid-column: span 4; grid-row: span 1; }
.wins-mosaic .m4 { grid-column: span 4; grid-row: span 1; }
.wins-mosaic .m5 { grid-column: span 4; grid-row: span 2; }
.wins-mosaic .m6 { grid-column: span 4; grid-row: span 2; }
.wins-mosaic .m7 { grid-column: span 4; grid-row: span 2; }
@media (max-width: 767.98px) {
    .wins-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
    }
    .wins-mosaic .m1,
    .wins-mosaic .m2,
    .wins-mosaic .m3,
    .wins-mosaic .m4,
    .wins-mosaic .m5,
    .wins-mosaic .m6,
    .wins-mosaic .m7 {
        grid-column: span 1;
        grid-row: span 1;
    }
    .wins-mosaic .m1 { grid-column: span 2; grid-row: span 2; }
}

/* Leadership portraits */
.wins-person-card {
    text-align: center;
    background: #fff;
    border-radius: var(--wins-radius);
    box-shadow: var(--wins-shadow);
    overflow: hidden;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wins-person-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--wins-shadow-lg);
}
.wins-person-card .photo {
    height: 230px;
    background: linear-gradient(180deg, #e8eef5, #d5e0ec);
    overflow: hidden;
}
.wins-person-card .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.wins-person-card .body {
    padding: 1.1rem 1rem 1.25rem;
}
.wins-person-card .role {
    color: var(--wins-blue);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* CTA band */
.wins-cta {
    /* Keep photo via inline background-image; do not use background shorthand */
    background-color: #0a2f4f;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #fff;
    border-radius: 0;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.wins-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Strong Wins blue overlay so CTA text stays legible on photos */
    background:
        linear-gradient(
            115deg,
            rgba(10, 47, 79, 0.92) 0%,
            rgba(15, 76, 129, 0.88) 55%,
            rgba(15, 76, 129, 0.82) 100%
        ),
        linear-gradient(to top, rgba(7, 31, 52, 0.75) 0%, transparent 55%);
    z-index: 0;
    pointer-events: none;
}
.wins-cta .container {
    position: relative;
    z-index: 1;
}
.wins-cta h2,
.wins-cta p,
.wins-cta .lead {
    color: #fff !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.wins-cta .text-white-50 {
    color: rgba(255, 255, 255, 0.9) !important;
}
/* Extra-dark overlay for busy school photos on Montessori CTA */
.wins-cta--montessori::before {
    background:
        linear-gradient(
            115deg,
            rgba(10, 47, 79, 0.94) 0%,
            rgba(15, 76, 129, 0.9) 50%,
            rgba(10, 47, 79, 0.88) 100%
        ),
        linear-gradient(to top, rgba(7, 31, 52, 0.85) 0%, rgba(7, 31, 52, 0.35) 60%, transparent 100%);
}

/* Page banner (inner pages) */
.wins-page-banner {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    color: #fff;
    background-color: #0a2f4f;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}
.wins-page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(10, 47, 79, 0.78), rgba(15, 76, 129, 0.45));
    pointer-events: none;
}
.wins-page-banner .container {
    position: relative;
    z-index: 1;
    padding: 3rem 0 2.25rem;
    width: 100%;
}
/* Mobile: comfortable padding on all page banners site-wide */
@media (max-width: 767.98px) {
    .wins-page-banner {
        min-height: 0 !important;
        align-items: stretch;
        padding: 0.25rem 0 0.35rem;
    }
    .wins-page-banner .container {
        padding-top: 1.35rem !important;
        padding-bottom: 1.5rem !important;
        padding-left: max(1.15rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(1.15rem, env(safe-area-inset-right, 0px)) !important;
    }
    .wins-page-banner .container.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0.85rem !important;
    }
    .wins-page-banner .wins-banner-back {
        margin-bottom: 0.35rem;
    }
    .wins-page-banner .eyebrow {
        margin-bottom: 0.55rem !important;
    }
    .wins-page-banner .display-5,
    .wins-page-banner .display-6,
    .wins-page-banner h1 {
        font-size: clamp(1.4rem, 6vw, 1.75rem) !important;
        line-height: 1.3 !important;
        margin-bottom: 0.45rem !important;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        max-width: 100%;
    }
    .wins-page-banner .lead,
    .wins-page-banner .opacity-75 {
        font-size: 0.95rem !important;
        line-height: 1.45 !important;
        max-width: 100%;
    }
    .wins-page-banner .lead.mb-0,
    .wins-page-banner p.mb-0 {
        margin-bottom: 0 !important;
    }
}

/* Banner back / secondary links (parent portal, detail pages) */
.wins-banner-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 183, 197, 0.75);
    background: rgba(255, 255, 255, 0.08);
    color: #FFB7C5 !important;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    line-height: 1.2;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wins-banner-back:hover,
.wins-banner-back:focus {
    background: var(--wins-pink);
    border-color: var(--wins-pink);
    color: var(--wins-blue-dark) !important;
    outline: none;
}

/* Footer polish */
.site-footer {
    background: linear-gradient(180deg, #0a2f4f 0%, #071f34 100%) !important;
    border-top: 4px solid var(--wins-pink) !important;
}
.site-footer a:hover {
    color: var(--wins-pink) !important;
}
.site-footer .wins-footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0.4rem 1rem;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: var(--wins-pink);
    color: var(--wins-blue-dark) !important;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    border: 2px solid var(--wins-pink);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.site-footer .wins-footer-cta:hover,
.site-footer .wins-footer-cta:focus {
    background: #ffc9d4;
    border-color: #ffc9d4;
    color: var(--wins-blue-dark) !important;
}

/* Landing gateway upgrades */
.landing-portal-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.35rem;
    min-height: 320px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: var(--wins-shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}
.landing-portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
    color: #fff;
}
.landing-portal-card .bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}
.landing-portal-card:hover .bg {
    transform: scale(1.06);
}
.landing-portal-card .shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 47, 79, 0.95) 10%, rgba(15, 76, 129, 0.35) 70%, rgba(15, 76, 129, 0.2));
}
.landing-portal-card .content {
    position: relative;
    z-index: 1;
    padding: 1.75rem;
}
.landing-portal-card .tag {
    display: inline-block;
    background: rgba(255, 183, 197, 0.2);
    color: var(--wins-pink);
    border: 1px solid rgba(255, 183, 197, 0.4);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    margin-bottom: 0.75rem;
}

/* Soft surfaces */
.bg-wins-soft {
    background: linear-gradient(180deg, #f6f8fb 0%, #eef3f9 100%);
}
.bg-white-section {
    background: #fff;
}

/* Program icon tile */
.wins-program-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wins-pink-soft), #fff);
    border: 1px solid rgba(255, 183, 197, 0.6);
    color: var(--wins-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

/* ---- Montessori polish: forms, empty states, articles ---- */
.wins-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.wins-enquiry-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.wins-enquiry-form .form-label {
    color: #0f172a;
    font-size: 0.9rem;
}
.wins-enquiry-form .form-control,
.wins-enquiry-form .form-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 0.65rem;
    border-color: rgba(15, 76, 129, 0.15);
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
}
.contact-card {
    height: auto !important;
}
.contact-layout .wins-section-title {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
}
.wins-contact-details .wins-panel-row {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}
.wins-enquiry-form .form-control:focus,
.wins-enquiry-form .form-select:focus {
    border-color: var(--wins-blue);
    box-shadow: 0 0 0 0.2rem rgba(15, 76, 129, 0.15);
}
.wins-enquiry-form .btn {
    max-width: 100%;
    white-space: normal;
}
.wins-contact-details {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}
.wins-contact-details a {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.wins-about-media--compact {
    min-height: 160px !important;
    max-width: 100%;
    border-radius: var(--wins-radius-sm, 0.85rem);
}
.wins-about-media--compact img {
    min-height: 160px !important;
    height: 160px;
    width: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}
.contact-layout {
    width: 100%;
    max-width: 100%;
}
.contact-layout > [class*="col-"] {
    min-width: 0;
}
@media (min-width: 576px) {
    .w-sm-auto {
        width: auto !important;
    }
}

/* Password show/hide toggle */
.password-field {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
}
.password-field .form-control {
    padding-right: 3rem;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--wins-blue);
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}
.password-toggle:hover,
.password-toggle:focus {
    background: rgba(91, 44, 111, 0.08);
    color: var(--wins-blue-dark, #3B1A4A);
    outline: none;
}
.password-toggle:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(91, 44, 111, 0.2);
}
body:not(.theme-montessori) .password-toggle {
    color: var(--wins-blue);
}
body:not(.theme-montessori) .password-toggle:hover,
body:not(.theme-montessori) .password-toggle:focus {
    background: rgba(15, 76, 129, 0.08);
}

/* ============================================================
   PARENT FAMILY HUB
   ============================================================ */
/* Desktop parent hub banner (mobile uses global .wins-page-banner rules) */
.parent-hub-banner {
    min-height: 200px;
}
.parent-hub-banner .container {
    padding-top: 2.25rem;
    padding-bottom: 2rem;
}
.parent-hub-banner__copy {
    max-width: 40rem;
}
@media (max-width: 767.98px) {
    .parent-hub-banner__copy {
        width: 100%;
        max-width: 100%;
    }
}
.parent-hub {
    background: linear-gradient(180deg, #f8f3fb 0%, #fff 40%);
}
body:not(.theme-montessori) .parent-hub {
    background: linear-gradient(180deg, #f6f8fb 0%, #fff 40%);
}
.parent-kpi {
    background: #fff;
    border: 1px solid rgba(91, 44, 111, 0.1);
    border-radius: var(--wins-radius-sm, 0.85rem);
    box-shadow: var(--wins-shadow, 0 8px 24px rgba(15, 76, 129, 0.08));
    padding: 1rem 1.1rem;
    height: 100%;
    min-width: 0;
}
.parent-kpi__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}
.parent-kpi__value {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--wins-blue);
    line-height: 1.15;
    margin: 0.25rem 0;
}
.parent-kpi__hint {
    font-size: 0.78rem;
    color: #6b7280;
}
.parent-alerts {
    border-left: 4px solid var(--wins-pink);
}
.parent-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(15, 76, 129, 0.08);
}
.parent-alert:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.parent-alert:first-child {
    padding-top: 0;
}
.parent-alert__title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}
.parent-alert__detail {
    font-size: 0.85rem;
    color: #6b7280;
}
.ward-card {
    padding: 1.15rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}
.ward-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.ward-card__identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1 1 12rem;
}
.ward-card__photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid rgba(255, 183, 197, 0.65);
    background: #f3eef6;
}
.ward-card__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--wins-blue);
    background: linear-gradient(135deg, #f0e4f7, #fff);
    border: 3px solid rgba(255, 183, 197, 0.65);
    text-transform: uppercase;
}
.ward-fee-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.ward-fee-badge--paid {
    background: #ecfdf5;
    color: #047857;
}
.ward-fee-badge--outstanding {
    background: #fff7ed;
    color: #c2410c;
}
.ward-card__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
@media (max-width: 420px) {
    .ward-card__metrics {
        grid-template-columns: 1fr;
    }
}
.ward-metric {
    min-width: 0;
    background: rgba(91, 44, 111, 0.04);
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
}
body:not(.theme-montessori) .ward-metric {
    background: rgba(15, 76, 129, 0.04);
}
.ward-metric__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
}
.ward-metric__value {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--wins-blue);
    margin: 0.15rem 0;
}
.ward-metric__hint {
    font-size: 0.75rem;
    color: #6b7280;
}
.ward-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.1);
    overflow: hidden;
    margin: 0.35rem 0;
}
.ward-progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--wins-blue), var(--wins-pink));
    max-width: 100%;
}
.ward-card__section {
    min-width: 0;
}
.ward-score-list {
    overflow: hidden;
}
.ward-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 0.25rem;
}
.ward-card__actions .btn {
    max-width: 100%;
}
.parent-news-chip {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.parent-news-chip:hover {
    transform: translateY(-3px);
    box-shadow: var(--wins-shadow-lg);
}

/* ============================================================
   PARENT FEE CHECKOUT
   ============================================================ */
.pay-checkout {
    background: linear-gradient(180deg, #f8f3fb 0%, #fff 45%);
}
.pay-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}
.pay-steps__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
}
.pay-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 800;
}
.pay-steps__item.is-active {
    color: var(--wins-blue);
}
.pay-steps__item.is-active .pay-steps__num {
    background: var(--wins-blue);
    color: #fff;
}
.pay-steps__item.is-done {
    color: #047857;
}
.pay-steps__item.is-done .pay-steps__num {
    background: #d1fae5;
    color: #047857;
}
.pay-summary,
.pay-panel {
    height: auto !important;
    min-width: 0;
}
.pay-summary__school {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}
.pay-summary__meta li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(15, 76, 129, 0.06);
}
.pay-summary__meta li:last-child {
    border-bottom: 0;
}
.pay-summary__lines {
    background: rgba(91, 44, 111, 0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
}
body:not(.theme-montessori) .pay-summary__lines {
    background: rgba(15, 76, 129, 0.05);
}
.pay-summary__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
    padding: 0.3rem 0;
    color: #374151;
}
.pay-summary__row--total {
    margin-top: 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(91, 44, 111, 0.2);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--wins-blue);
}
.pay-amount .input-group-text {
    font-weight: 700;
    color: var(--wins-blue);
    background: #f8f3fb;
    border-color: rgba(91, 44, 111, 0.15);
}
.pay-amount .form-control {
    border-color: rgba(91, 44, 111, 0.15);
    font-weight: 700;
}
.pay-trust {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.8rem;
    color: #6b7280;
    background: rgba(15, 76, 129, 0.04);
    border-radius: 0.65rem;
    padding: 0.65rem 0.8rem;
}
.pay-trust i {
    color: var(--wins-blue);
    margin-top: 0.1rem;
}
.pay-panel .btn {
    max-width: 100%;
}

/* Parent child — receipts always visible and scannable */
.parent-receipts-card {
    border-left: 4px solid var(--wins-pink);
    height: auto !important;
}
.parent-receipts-card .wins-panel-row:last-child {
    border-bottom: 0 !important;
}

/* Parent bill-driven fees */
.parent-bill-panel {
    height: auto !important;
}
.parent-bill-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (max-width: 575.98px) {
    .parent-bill-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.parent-bill-summary > div {
    background: rgba(91, 44, 111, 0.05);
    border-radius: 0.65rem;
    padding: 0.55rem 0.65rem;
    min-width: 0;
}
.parent-bill-summary span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
}
.parent-bill-summary strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.92rem;
    color: #111827;
    word-break: break-word;
}
.parent-bill-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    white-space: nowrap;
}
.bill-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}
.bill-status--paid { background: #ecfdf5; color: #047857; }
.bill-status--pending,
.bill-status--partial { background: #fff7ed; color: #c2410c; }
.bill-status--not_posted { background: #f3f4f6; color: #6b7280; }
.bill-status--waived { background: #eff6ff; color: #1d4ed8; }
.bill-status--info { background: #f8f3fb; color: #5B2C6F; }
.table-warning-soft {
    background: rgba(255, 183, 197, 0.12);
}
.wins-empty-state__icon {
    width: 64px;
    height: 64px;
    border-radius: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wins-blue), #1a6bb0);
    color: var(--wins-pink);
    font-size: 1.35rem;
}
.wins-page-banner .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 183, 197, 0.45);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.wins-article-body {
    font-size: 1.05rem;
    line-height: 1.8;
}
.wins-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.15rem;
    font-size: 0.95rem;
    color: #1a1a1a;
}
.wins-article-body table th,
.wins-article-body table td {
    border: 1px solid #d1d5db;
    padding: 0.45rem 0.6rem;
    vertical-align: top;
}
.wins-article-body table th {
    background: #f7e8ef;
    color: #5B2C6F;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.wins-article-body table td:first-child,
.wins-article-body table th:first-child {
    text-align: center;
    width: 3rem;
}
.wins-article-body table td:last-child,
.wins-article-body table th:last-child {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.wins-article-img {
    max-height: 420px;
    object-fit: cover;
}

/* Hero phrase highlight (Montessori) */
.hero-highlight-yellow {
    color: #F5C518 !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* ============================================================
   WINS MONTESSORI — PURPLE BRAND THEME
   Applied when body.theme-montessori (all /montessori/ pages)
   Remaps --wins-blue* so existing utilities/components go purple.
   ============================================================ */
body.theme-montessori {
    --wins-blue: #5B2C6F;
    --wins-blue-dark: #3B1A4A;
    --wins-blue-light: #7D3C98;
    --wins-purple: #5B2C6F;
    --wins-purple-dark: #3B1A4A;
    --wins-purple-deeper: #2A1236;
    --wins-purple-light: #8E44AD;
    --wins-purple-soft: #f0e4f7;
    --wins-shadow: 0 10px 40px rgba(91, 44, 111, 0.14);
    --wins-shadow-lg: 0 24px 60px rgba(59, 26, 74, 0.2);
    --parliament-green: var(--wins-blue);
    --parliament-dark: var(--wins-blue-dark);
    --yim-blue: var(--wins-blue);
    --yim-blue-light: var(--wins-blue-light);
    background: #f8f3fb;
}

body.theme-montessori .top-bar.desktop-top-bar {
    background: var(--wins-purple-deeper) !important;
}

body.theme-montessori .main-navbar {
    background-color: var(--wins-blue) !important;
    box-shadow: 0 8px 24px rgba(59, 26, 74, 0.22) !important;
}

body.theme-montessori .brand-title {
    color: var(--wins-blue) !important;
}

body.theme-montessori .brand-header {
    border-bottom-color: var(--wins-pink) !important;
}

body.theme-montessori .site-footer {
    background: linear-gradient(180deg, var(--wins-blue-dark) 0%, var(--wins-purple-deeper) 100%) !important;
    border-top-color: var(--wins-pink) !important;
}

body.theme-montessori .text-wins { color: var(--wins-blue) !important; }
body.theme-montessori .bg-wins { background-color: var(--wins-blue) !important; }
body.theme-montessori .border-wins { border-color: var(--wins-blue) !important; }

/* Montessori: brand vars already remapped; reinforce BS button vars */
body.theme-montessori .btn-wins,
body.theme-montessori .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wins-blue);
    --bs-btn-border-color: var(--wins-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wins-blue-dark);
    --bs-btn-hover-border-color: var(--wins-blue-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--wins-blue-dark);
    --bs-btn-active-border-color: var(--wins-blue-dark);
    --bs-btn-focus-shadow-rgb: 91, 44, 111;
    background-color: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
    color: #fff !important;
}
body.theme-montessori .btn-wins:hover,
body.theme-montessori .btn-wins:focus,
body.theme-montessori .btn-primary:hover,
body.theme-montessori .btn-primary:focus {
    background-color: var(--wins-blue-dark) !important;
    border-color: var(--wins-blue-dark) !important;
    color: #fff !important;
}
body.theme-montessori .btn-outline-wins {
    --bs-btn-color: var(--wins-blue);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--wins-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wins-blue);
    --bs-btn-hover-border-color: var(--wins-blue);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--wins-blue);
    --bs-btn-active-border-color: var(--wins-blue);
    --bs-btn-focus-shadow-rgb: 91, 44, 111;
    color: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
    background: transparent !important;
}
body.theme-montessori .btn-outline-wins:hover,
body.theme-montessori .btn-outline-wins:focus {
    background: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
    color: #fff !important;
}
body.theme-montessori .btn-wins-pink {
    --bs-btn-color: var(--wins-blue-dark);
    --bs-btn-bg: var(--wins-pink);
    --bs-btn-border-color: var(--wins-pink);
    color: var(--wins-blue-dark) !important;
}
body.theme-montessori .wins-card {
    border-color: rgba(91, 44, 111, 0.1);
}

body.theme-montessori .mobile-branch-chip.chip-wins.is-active {
    background: var(--wins-blue) !important;
    border-color: var(--wins-blue) !important;
    color: #fff !important;
}
body.theme-montessori .mobile-tab.is-active {
    color: var(--wins-blue) !important;
}

body.theme-montessori .wins-section-title,
body.theme-montessori .wins-section-kicker {
    color: var(--wins-blue) !important;
}
body.theme-montessori .wins-section-kicker {
    background: var(--wins-purple-soft) !important;
}
body.theme-montessori .wins-pill {
    background: var(--wins-purple-soft) !important;
    color: var(--wins-blue) !important;
}
body.theme-montessori .bg-wins-soft {
    background: linear-gradient(180deg, #f8f3fb 0%, #efe4f5 100%) !important;
}
body.theme-montessori .wins-check-list li i {
    color: var(--wins-blue) !important;
}
body.theme-montessori .wins-program-icon {
    color: var(--wins-blue) !important;
    background: linear-gradient(135deg, var(--wins-purple-soft), #fff) !important;
    border-color: rgba(255, 183, 197, 0.55) !important;
}
body.theme-montessori .wins-stat-card .stat-value {
    color: var(--wins-blue) !important;
}
body.theme-montessori .wins-stat-card .stat-icon {
    background: linear-gradient(135deg, var(--wins-blue), var(--wins-blue-light)) !important;
    color: var(--wins-pink) !important;
}
body.theme-montessori .wins-hero {
    background-color: var(--wins-blue-dark) !important;
}
body.theme-montessori .wins-hero::before {
    background:
        linear-gradient(120deg, rgba(42, 18, 54, 0.78) 0%, rgba(91, 44, 111, 0.58) 48%, rgba(91, 44, 111, 0.3) 100%),
        linear-gradient(to top, rgba(42, 18, 54, 0.72) 0%, transparent 55%) !important;
}
body.theme-montessori .wins-page-banner {
    background-color: var(--wins-blue-dark) !important;
}
body.theme-montessori .wins-page-banner::before {
    background: linear-gradient(100deg, rgba(42, 18, 54, 0.82), rgba(91, 44, 111, 0.48)) !important;
}
body.theme-montessori .wins-cta,
body.theme-montessori .wins-cta--montessori {
    background-color: var(--wins-blue-dark) !important;
}
body.theme-montessori .wins-cta::before,
body.theme-montessori .wins-cta--montessori::before {
    background:
        linear-gradient(115deg, rgba(42, 18, 54, 0.94) 0%, rgba(91, 44, 111, 0.9) 50%, rgba(42, 18, 54, 0.88) 100%),
        linear-gradient(to top, rgba(42, 18, 54, 0.85) 0%, rgba(42, 18, 54, 0.35) 60%, transparent 100%) !important;
}
body.theme-montessori .wins-cta-overlay {
    background: linear-gradient(115deg, rgba(42, 18, 54, 0.94) 0%, rgba(91, 44, 111, 0.9) 50%, rgba(42, 18, 54, 0.88) 100%) !important;
}
body.theme-montessori .mobile-logo {
    box-shadow: 0 4px 14px rgba(91, 44, 111, 0.2) !important;
}
body.theme-montessori .wins-card:hover {
    box-shadow: var(--wins-shadow-lg);
}
body.theme-montessori .main-navbar .nav-link:hover,
body.theme-montessori .main-navbar .nav-link:focus,
body.theme-montessori .main-navbar .nav-link.active {
    color: var(--wins-pink) !important;
    background: rgba(255, 183, 197, 0.14) !important;
}
body.theme-montessori .main-navbar .nav-cta-pill {
    background: var(--wins-pink) !important;
    color: var(--wins-blue-dark) !important;
}
body.theme-montessori .branch-link.is-active {
    border-bottom-color: var(--wins-pink) !important;
}
body.theme-montessori .wins-empty-state__icon {
    background: linear-gradient(135deg, var(--wins-blue), var(--wins-blue-light)) !important;
    color: var(--wins-pink) !important;
}
body.theme-montessori .wins-enquiry-form .form-control:focus,
body.theme-montessori .wins-enquiry-form .form-select:focus {
    border-color: var(--wins-blue) !important;
    box-shadow: 0 0 0 0.2rem rgba(91, 44, 111, 0.18) !important;
}

/* Leadership pages (inline styles remapped via variables) */
body.theme-montessori .ldr-hero {
    background-color: var(--wins-blue-dark) !important;
}
body.theme-montessori .ldr-hero::before {
    background: linear-gradient(105deg, rgba(42,18,54,.94) 0%, rgba(91,44,111,.78) 55%, rgba(91,44,111,.45) 100%) !important;
}
body.theme-montessori .ldp-hero {
    background: linear-gradient(120deg, var(--wins-blue-dark) 0%, var(--wins-blue) 100%) !important;
}

/* ============================================================
   DIGITAL LIBRARY
   ============================================================ */
.lib-toolbar .form-control,
.lib-toolbar .form-select {
    border-radius: 0.85rem;
    border-color: rgba(91, 44, 111, 0.15);
}
.lib-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.lib-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--wins-blue, #5B2C6F);
    background: #fff;
    border: 1px solid rgba(91, 44, 111, 0.15);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lib-chip:hover,
.lib-chip.is-active {
    background: var(--wins-blue, #5B2C6F);
    border-color: var(--wins-blue, #5B2C6F);
    color: #fff;
}
.lib-card {
    background: #fff;
    border-radius: var(--wins-radius, 1.25rem);
    box-shadow: var(--wins-shadow, 0 10px 40px rgba(91, 44, 111, 0.12));
    overflow: hidden;
    border: 1px solid rgba(91, 44, 111, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.lib-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--wins-shadow-lg, 0 20px 50px rgba(59, 26, 74, 0.18));
    color: inherit;
}
.lib-card-cover {
    position: relative;
    height: 160px;
    background: linear-gradient(145deg, #3B1A4A, #5B2C6F 55%, #7D3C98);
    overflow: hidden;
}
.lib-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lib-card-cover-fallback {
    height: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB7C5;
    font-size: 2rem;
    background: linear-gradient(145deg, #3B1A4A, #5B2C6F 55%, #7D3C98);
}
.lib-card-body {
    padding: 1.15rem 1.25rem 1.35rem;
}
.lib-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    color: #3B1A4A;
    background: #FFB7C5;
}
.lib-badge-lock {
    left: auto;
    right: 0.65rem;
    color: #fff;
    background: rgba(42, 18, 54, 0.75);
}
.lib-badge-feat {
    background: #fff;
    color: #5B2C6F;
}
.lib-badge-new + .lib-badge-lock,
.lib-badge-feat + .lib-badge-lock {
    top: 2.4rem;
}
body.theme-montessori .lib-chip.is-active,
body.theme-montessori .lib-chip:hover {
    background: var(--wins-blue);
    border-color: var(--wins-blue);
}

/* ---- Admission portal ---- */
.admission-steps { display: flex; flex-direction: column; gap: 1rem; }
.admission-step {
    display: flex; gap: 0.9rem; align-items: flex-start;
    padding: 0.85rem 1rem; border-radius: 0.85rem;
    background: #f8fafc; border: 1px solid #e2e8f0;
}
.admission-step__num {
    flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 999px;
    background: var(--wins-blue, #0F4C81); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.9rem;
}
body.theme-montessori .admission-step__num { background: #5B2C6F; }
.admission-fee-box {
    background: linear-gradient(135deg, #f8f3fb, #fff);
    border: 1px solid rgba(255, 183, 197, 0.55);
    border-radius: 0.85rem; padding: 1rem 1.15rem;
}
.admission-side-card .admission-fee-box { margin-top: 0.25rem; }
.admission-declaration-text {
    background: #f8fafc; border-left: 4px solid #FFB7C5;
    border-radius: 0.5rem; padding: 0.85rem 1rem;
}
.admission-application-form .form-control,
.admission-application-form .form-select { max-width: 100%; }

/* Passport photo widget */
.passport-photo-widget {
    display: flex; flex-direction: column; align-items: center; gap: 0.65rem;
}
.passport-photo-widget__frame {
    width: 120px; height: 150px; border: 2px dashed #cbd5e1; border-radius: 0.5rem;
    background: #f8fafc; display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.passport-photo-widget__preview {
    width: 100%; height: 100%; object-fit: cover; display: none;
}
.passport-photo-widget__preview.is-visible { display: block; }
.passport-photo-widget__placeholder {
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    color: #94a3b8; font-size: 0.75rem;
}
.passport-photo-widget__placeholder i { font-size: 1.75rem; }
.passport-photo-widget__actions {
    display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center;
}
.passport-photo-widget__native {
    position: absolute !important; width: 1px !important; height: 1px !important;
    opacity: 0 !important; pointer-events: none !important; overflow: hidden !important;
}
.passport-camera-modal {
    position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, 0.72);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.passport-camera-modal__panel {
    background: #fff; border-radius: 1rem; padding: 1rem 1.15rem 1.25rem;
    width: min(100%, 22rem); box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.passport-camera-modal__head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;
}
.passport-camera-modal__close {
    border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #64748b;
}
.passport-camera-modal__video {
    width: 100%; border-radius: 0.65rem; background: #0f172a; aspect-ratio: 3/4; object-fit: cover;
}
.passport-camera-modal__actions {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem;
}
.passport-camera-modal__hint { margin: 0.5rem 0 0; }

/* ---- Office student portal ---- */
.office-portal,
.office-portal__main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.office-portal .container {
    max-width: 100%;
    min-width: 0;
}
.office-portal .row > [class*="col-"] {
    min-width: 0;
    max-width: 100%;
}
.office-portal .wins-card,
.office-portal .wins-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.office-portal .wins-card.p-3,
.office-portal .wins-card.p-4,
.office-portal .wins-panel.p-3,
.office-portal .wins-panel.p-4,
.office-portal .wins-panel.p-md-5 {
    /* Keep padding cards from clipping focus rings too tightly on controls */
    overflow: hidden;
}
.office-portal .table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0; /* critical: flex item may otherwise expand with table intrinsic width */
    flex: 1 1 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
/* Table inside a card: scroll stays inside the rounded box */
.office-portal .office-table-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0 !important;
}
.office-portal .office-table-card > * {
    min-width: 0;
    max-width: 100%;
}
.office-portal .office-table-card .table-responsive {
    margin: 0;
    border-radius: 0 0 inherit inherit;
    max-width: 100%;
    min-width: 0;
}
.office-portal .office-table-card .table {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}
.office-portal .office-table-card .table th,
.office-portal .office-table-card .table td {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    vertical-align: middle;
}
/* Compact stacked rows (attendance / simple lists) — bounded height, scroll inside */
.office-record-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: min(16rem, 42vh);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.office-record-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0.95rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.office-record-list__item:first-child {
    border-top: 0;
}
.office-record-list__main {
    flex: 1 1 8rem;
    min-width: 0;
    max-width: 100%;
}
.office-record-list__meta {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}
.office-record-list__main .wins-pill,
.office-record-list__meta .wins-pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
}
.office-record-list__empty {
    padding: 0.85rem 0.95rem 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}
/* Student hub: keep right column from stretching the page endlessly */
.office-portal .office-hub-side {
    min-width: 0;
    max-width: 100%;
    padding-bottom: 0.5rem;
}
.office-portal .office-hub-side .office-table-card {
    max-height: none;
}
.office-portal .office-student-hub__grid {
    align-items: flex-start; /* do not stretch overview to match list cards */
}
.office-portal .office-student-hub {
    /* Clear last card fully before footer starts */
    margin-bottom: 1rem;
    padding-bottom: 4.5rem !important;
}
.office-portal .wins-section-sm {
    padding-bottom: 3rem;
}
/*
 * Do NOT raise footer z-index above office content — that hid Recent attendance
 * under the footer. Keep normal document flow stacking.
 */
.office-portal {
    position: relative;
    z-index: auto;
    padding-bottom: 3rem;
}
.office-portal__main {
    position: relative;
    z-index: auto;
    padding-bottom: 1.5rem;
}
body.office-portal-body .site-footer {
    position: relative;
    z-index: auto;
    clear: both;
    margin-top: 0;
}
/* Mobile: fixed bottom tab bar (~60px) — pad footer so content is not covered */
@media (max-width: 991.98px) {
    body.office-portal-body .site-footer {
        padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .office-portal {
        padding-bottom: 1.25rem;
    }
    .office-portal .office-student-hub {
        padding-bottom: 3rem !important;
    }
    .office-record-list {
        max-height: min(11rem, 30vh);
    }
}
.office-portal .text-break-office,
.office-portal .wins-panel p,
.office-portal .wins-panel strong,
.office-portal h1,
.office-portal h2,
.office-portal h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
.office-portal .form-control,
.office-portal .form-select,
.office-portal .btn {
    max-width: 100%;
}
.office-portal .parent-kpi {
    overflow: hidden;
}
.office-portal .parent-kpi__label {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}
.office-portal .parent-kpi__value {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(1.15rem, 4vw, 1.75rem);
}
.office-shell-bar {
    background: var(--wins-blue-dark, #0a2f4f);
    color: #fff;
    border-bottom: 3px solid var(--wins-pink, #FFB7C5);
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}
body.theme-montessori .office-shell-bar {
    background: #2a1236;
}
.office-shell-bar__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    max-width: 100%;
    min-width: 0;
}
.office-shell-bar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    min-width: 0;
    flex: 1 1 10rem;
    max-width: 100%;
}
.office-shell-bar__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
    flex: 1 1 auto;
}
.office-shell-brand {
    color: #fff !important;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.office-shell-user {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    max-width: min(12rem, 40vw);
    min-width: 0;
}
.office-shell-pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
}
.office-class-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    max-width: 100%;
}
.office-class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(91, 44, 111, 0.12);
}
.office-class-card h3,
.office-class-card p {
    max-width: 100%;
    overflow-wrap: anywhere;
}
.office-attendance-grid {
    width: 100%;
    min-width: 18rem; /* allow horizontal scroll inside card, not page */
}
.office-attendance-grid select,
.office-attendance-grid input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.office-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-width: 100%;
    min-width: 0;
}
.office-action-row .btn {
    flex: 0 1 auto;
    white-space: normal;
    text-align: center;
}
@media (max-width: 575.98px) {
    .office-shell-bar .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.65rem;
    }
    .office-portal .parent-kpi {
        padding: 0.75rem 0.85rem;
    }
    .office-portal .parent-kpi__label {
        font-size: 0.65rem;
    }
    .office-portal .wins-section-sm .container,
    .office-portal .wins-section .container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}


/* ---- Admission form info panels (fee bill + toiletries) ---- */
.admission-info-panels {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.admission-info-collapse {
    overflow: hidden;
    max-width: 100%;
}
.admission-info-collapse__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
    border: 0;
    background: linear-gradient(135deg, #f8f3fb, #fff);
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    color: inherit;
}
.admission-info-collapse__btn:hover,
.admission-info-collapse__btn:focus {
    background: #f3eaf7;
    outline: none;
}
.admission-info-collapse__kicker {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.15rem;
}
.admission-info-collapse__title {
    display: block;
    font-weight: 700;
    color: var(--wins-blue, #5B2C6F);
    font-size: 1rem;
}
.admission-info-collapse__chevron {
    flex-shrink: 0;
    color: var(--wins-blue, #5B2C6F);
    transition: transform 0.2s ease;
}
.admission-info-collapse__btn:not(.collapsed) .admission-info-collapse__chevron {
    transform: rotate(180deg);
}
.admission-info-collapse__body {
    padding: 0 1.1rem 1.15rem;
    border-top: 1px solid rgba(91, 44, 111, 0.08);
    max-width: 100%;
    min-width: 0;
}
.admission-bill-table {
    font-size: 0.875rem;
    width: 100%;
    max-width: 100%;
}
.admission-bill-table th {
    background: #f8f3fb;
    color: #5B2C6F;
    white-space: nowrap;
}
.admission-bill-table td,
.admission-bill-table th {
    vertical-align: middle;
}
.admission-bill-table__total td {
    background: #faf7fc;
    border-top: 2px solid rgba(91, 44, 111, 0.2);
}
.admission-toiletries-list li {
    margin-bottom: 0.25rem;
}
@media (max-width: 575.98px) {
    .admission-bill-table {
        font-size: 0.78rem;
    }
    .admission-info-collapse__btn {
        padding: 0.75rem 0.9rem;
    }
    .admission-info-collapse__body {
        padding: 0 0.9rem 1rem;
    }
}

/* ---- Office hub UI upgrade (dashboard / students / classes) ---- */
.office-hub {
    background: linear-gradient(180deg, #f8f3fb 0%, #f6f8fb 35%, #fff 70%);
    min-height: 50vh;
}
.office-hero-banner {
    background: linear-gradient(120deg, #2a1236 0%, #5B2C6F 55%, #3d1a4f 100%) !important;
    background-color: #2a1236 !important;
}
.office-hero-banner__copy { max-width: 36rem; }

.office-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.office-shell-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.45rem;
    background: #FFB7C5;
    color: #2a1236;
    font-size: 0.85rem;
    font-weight: 900;
}
.office-shell-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    line-height: 1.2;
}
.office-shell-pill--scoped {
    background: rgba(255, 183, 197, 0.2);
    color: #ffd6e0;
    border: 1px solid rgba(255, 183, 197, 0.45);
}
.office-shell-pill--full {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.office-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.office-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}
.office-nav-link.is-active {
    background: #FFB7C5;
    color: #2a1236 !important;
    border-color: #FFB7C5;
}
.office-nav-link--muted {
    opacity: 0.9;
}

.office-kpi {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid rgba(91, 44, 111, 0.1);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(91, 44, 111, 0.06);
    padding: 1rem 1.05rem;
    height: 100%;
    min-width: 0;
    max-width: 100%;
}
.office-kpi__icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8f3fb, #ffe4ea);
    color: #5B2C6F;
    font-size: 0.95rem;
}
.office-kpi__body { min-width: 0; flex: 1 1 auto; }
.office-kpi__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
    line-height: 1.25;
}
.office-kpi__value {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #5B2C6F;
    line-height: 1.15;
    margin: 0.15rem 0;
}
.office-kpi__hint {
    font-size: 0.75rem;
    color: #94a3b8;
}

.office-search-card,
.office-filter-card {
    border: 1px solid rgba(91, 44, 111, 0.08);
    box-shadow: 0 10px 28px rgba(91, 44, 111, 0.06);
}

.office-class-tile {
    display: flex;
    background: #fff;
    border: 1px solid rgba(91, 44, 111, 0.1);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(91, 44, 111, 0.06);
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.office-class-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(91, 44, 111, 0.12);
}
.office-class-tile__accent {
    width: 5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #FFB7C5, #5B2C6F);
}
.office-class-tile__body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.15rem 1.2rem 1.2rem;
}
.office-count-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1rem;
    font-weight: 800;
    font-size: 0.95rem;
    color: #5B2C6F;
    background: #f8f3fb;
    border: 1px solid rgba(91, 44, 111, 0.12);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    flex-shrink: 0;
}
.office-count-badge__cap {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

.office-student-card {
    background: #fff;
    border: 1px solid rgba(91, 44, 111, 0.1);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(91, 44, 111, 0.06);
    padding: 1rem 1.1rem 1.15rem;
    max-width: 100%;
    min-width: 0;
}
.office-student-card__head {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    min-width: 0;
}
.office-student-card__photo {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #ffe4ea;
}
.office-student-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #5B2C6F;
    background: linear-gradient(145deg, #f8f3fb, #ffe4ea);
    border: 2px solid #ffe4ea;
}
.office-student-card__avatar--sm {
    width: 40px;
    height: 40px;
    font-size: 0.72rem;
}

.office-students-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 700;
    background: #faf7fc;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.office-students-table tbody tr:hover {
    background: #fdf9fc;
}
.office-table-card--students {
    border: 1px solid rgba(91, 44, 111, 0.1);
    box-shadow: 0 10px 28px rgba(91, 44, 111, 0.06);
}

.office-empty-state {
    text-align: center;
    background: #fff;
    border: 1px dashed rgba(91, 44, 111, 0.2);
    border-radius: 1rem;
    padding: 2rem 1.25rem;
    max-width: 100%;
}
.office-empty-state__icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f3fb;
    color: #5B2C6F;
    font-size: 1.15rem;
}

@media (max-width: 575.98px) {
    .office-kpi {
        padding: 0.8rem 0.85rem;
        gap: 0.55rem;
    }
    .office-kpi__icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
    .office-kpi__value {
        font-size: 1.2rem;
    }
    .office-nav-link {
        padding: 0.3rem 0.65rem;
        font-size: 0.72rem;
    }
}
