/* ==========================================================================
   polish.css - visual refinement layer (loaded after mobile.css).
   One consistent scale for type, spacing, radius, elevation and colour so the
   site reads as a single product: calm navy, one accent, generous whitespace.
   ========================================================================== */

:root {
    --ink: #0f1b2d;
    --ink-soft: #4a5568;
    --ink-mute: #718096;
    --line: rgba(15, 27, 45, .08);
    --surface: #ffffff;
    --surface-alt: #f6f8fb;
    --brand: #002855;
    --brand-deep: #001a3a;
    --accent: #c41e3a;
    --gold-ui: #ffd23f;
    --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
    --elev-1: 0 1px 2px rgba(15,27,45,.06), 0 2px 8px rgba(15,27,45,.04);
    --elev-2: 0 4px 12px rgba(15,27,45,.08), 0 12px 32px rgba(15,27,45,.06);
    --space-section: clamp(48px, 8vw, 96px);
}

html {
    font-size: 15px;
    scroll-behavior: auto;
}
@media (max-width: 768px) {
    html {
        font-size: 14px !important;
    }
}
body { color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { color: var(--brand); letter-spacing: -.01em; text-wrap: balance; }
p { text-wrap: pretty; }

/* ---- Buttons --------------------------------------------------------------- */
body .btn { border-radius: var(--r-md); font-weight: 600; letter-spacing: .005em; box-shadow: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
body .btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(196,30,58,.25), 0 6px 14px rgba(196,30,58,.18); }
body .btn-primary:hover { background: #a8182f; border-color: #a8182f; }
body .btn-outline-light { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.55); color: #fff; backdrop-filter: blur(4px); }
body .btn-outline-light:hover { background: #fff; color: var(--brand); }
body .btn-large { padding: 14px 24px; font-size: 1rem; }

/* ---- Section rhythm ---------------------------------------------------------- */
body .welcome-section, body .programs-section, body .news-section, body .mvg-slideshow, body .cta-section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
body .section-title { font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.2; margin-bottom: 10px; }
body .section-subtitle { color: var(--ink-soft); font-size: clamp(.98rem, 2.6vw, 1.1rem); max-width: 620px; margin: 0 auto 36px; line-height: 1.6; }
body .title-underline, body .section-title::after { height: 3px; width: 56px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--gold-ui)); }

/* ---- Cards ------------------------------------------------------------------------ */
body .program-card, body .news-card, body.is-auth .stat-box, body .card { border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--elev-1); background: var(--surface); }
body .program-card:hover, body .news-card:hover { box-shadow: var(--elev-2); }

/* ---- Core Pillars (Replaces redundant stats) --------------------------- */
body .core-pillars-section {
    background: linear-gradient(135deg, var(--brand, #002855) 0%, var(--brand-deep, #001a3a) 100%) !important;
    padding: 56px 0 !important;
    margin: 0 !important;
    color: #fff !important;
    border-top: 3px solid var(--gold-ui, #ffd23f) !important;
    border-bottom: 3px solid var(--gold-ui, #ffd23f) !important;
}
body .core-pillars-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
body .core-pillars-section .pillars-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    text-align: center !important;
}
body .core-pillars-section .pillar-card {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: var(--r-lg, 14px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    padding: 28px 18px !important;
    text-align: center !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease !important;
}
body .core-pillars-section .pillar-card:hover {
    transform: translateY(-5px) !important;
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}
body .core-pillars-section .pillar-icon {
    width: 56px !important;
    height: 56px !important;
    margin: 0 auto 14px !important;
    background: rgba(255, 210, 63, 0.16) !important;
    border: 1px solid rgba(255, 210, 63, 0.35) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.5rem !important;
    color: var(--gold-ui, #ffd23f) !important;
}
body .core-pillars-section .pillar-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 8px !important;
    line-height: 1.3 !important;
}
body .core-pillars-section .pillar-desc {
    font-size: 0.86rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.55 !important;
    margin: 0 !important;
}

@media (max-width: 991px) {
    body .core-pillars-section .pillars-grid,
    .core-pillars-section .pillars-grid,
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}
@media (max-width: 768px) {
    body .core-pillars-section,
    .core-pillars-section {
        padding: 36px 0 !important;
    }
    body .core-pillars-section .pillars-grid,
    .core-pillars-section .pillars-grid,
    .pillars-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
    }
    body .core-pillars-section .pillar-card,
    .core-pillars-section .pillar-card,
    .pillar-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 24px 20px !important;
    }
}

/* Backward compatibility for quick-stats if any page references it */
body .quick-stats {
    background: linear-gradient(135deg, var(--brand, #002855) 0%, var(--brand-deep, #001a3a) 100%) !important;
    padding: 56px 0 !important;
    margin: 0 !important;
    color: #fff !important;
    border-top: 3px solid var(--gold-ui, #ffd23f);
    border-bottom: 3px solid var(--gold-ui, #ffd23f);
}
body .quick-stats .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
body .quick-stats .stats-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    text-align: center !important;
    background: transparent !important;
    padding: 0 !important;
}
body .quick-stats .stat-box {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: var(--r-lg, 14px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    padding: 32px 20px !important;
    text-align: center !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease !important;
}
body .quick-stats .stat-box:hover {
    transform: translateY(-5px) !important;
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}
body .quick-stats .stat-box i {
    font-size: 2.2rem !important;
    color: var(--gold-ui, #ffd23f) !important;
    margin-bottom: 12px !important;
    display: inline-block !important;
    background: none !important;
    width: auto !important;
    height: auto !important;
}
body .quick-stats .stat-box .number {
    font-size: 2.4rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.1 !important;
    margin-bottom: 6px !important;
    display: block !important;
}
body .quick-stats .stat-box .label {
    font-size: 0.85rem !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.85) !important;
    display: block !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

@media (max-width: 991px) {
    body .quick-stats .stats-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

/* ---- Footer ---------------------------------------------------------------------------- */
body .main-footer { background: var(--brand-deep); }
body .footer-bottom { border-top: 1px solid rgba(255,255,255,.1); }
body.in-portal .main-footer, body .main-footer.footer-minimal { padding: 18px 0 !important; }
body.in-portal .footer-grid, body .main-footer.footer-minimal .footer-grid { display: none !important; }
body.in-portal .footer-bottom, body .main-footer.footer-minimal .footer-bottom { border-top: none !important; padding-top: 0 !important; }

/* ---- Portal Header & Sidebar ------------------------------------------- */
body .sidebar .sidebar-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

body .sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding-bottom: 2px;
}

body .sidebar .sidebar-brand img.sidebar-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

body .sidebar .sidebar-brand-text .school-name {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

body .sidebar .sidebar-brand-text small {
    color: var(--gold, #ffd700);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

body .sidebar .sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body .sidebar .sidebar-title-row h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold, #ffd700);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Portal desktop: remove top blue navbar, full-height sidebar starting at top: 0 */
@media (min-width: 992px) {
    body.in-portal .main-nav {
        display: none !important;
    }
    body.in-portal .sidebar {
        top: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }
    body.in-portal .dashboard-main {
        padding-top: 24px !important;
    }
}

body.in-portal .main-nav .dropdown {
    display: none !important;
}

/* Hide public links in portal navigation */
body.in-portal .nav-menu > li:not(.dropdown):not(.nav-item):not(.nav-portal):not(.nav-portal-section):not(.nav-portal-direct) {
    display: none !important;
}

/* ---- Dashboard Header & User Profile Dropdown ---------------------------- */
body .dashboard-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

body .dashboard-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand, #002855);
}

.user-dropdown-wrapper {
    position: relative;
    margin-left: auto;
    display: inline-flex;
    z-index: 999;
}

.user-dropdown-wrapper.open {
    z-index: 1000;
}

.user-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    padding: 6px 16px 6px 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.user-dropdown-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 40, 85, 0.08);
    transform: translateY(-1px);
}

.user-dropdown-toggle .user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 40, 85, 0.08);
    color: var(--navy, #002855);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.user-dropdown-toggle .user-meta-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-dropdown-toggle .user-display-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.user-dropdown-toggle .user-display-role {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
}

.user-dropdown-toggle .user-dropdown-caret {
    font-size: 0.72rem;
    color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
    margin-left: 4px;
}

.user-dropdown-wrapper.open .user-dropdown-caret {
    transform: rotate(180deg);
    color: #002855;
}

.user-dropdown-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10001;
}

.user-dropdown-wrapper.open .user-dropdown-popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.user-popover-header {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-popover-header .popover-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 40, 85, 0.08);
    color: var(--navy, #002855);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.user-popover-header .popover-details {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.user-popover-header .popover-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.user-popover-header .popover-role {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 600;
    color: #002855;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-popover-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 6px 0;
}

.user-popover-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-popover-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    color: #64748b;
    transition: color 0.15s ease;
}

.user-popover-link:hover {
    background: #f8fafc;
    color: #002855;
}

.user-popover-link:hover i {
    color: #002855;
}

.user-popover-link.logout {
    color: #dc2626;
}

.user-popover-link.logout i {
    color: #dc2626;
}

.user-popover-link.logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.user-popover-link.logout:hover i {
    color: #b91c1c;
}

/* ---- Professional Stats Cards (3 Columns Desktop, scoped to portal/dashboards) ---- */
body.in-portal .stats-grid,
.dashboard-main .stats-grid,
.dashboard-main .stats-grid:has(> :nth-child(6):last-child),
.dashboard-main .stats-grid.six {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 24px !important;
}

@media (max-width: 1100px) {
    body.in-portal .stats-grid,
    .dashboard-main .stats-grid,
    .dashboard-main .stats-grid:has(> :nth-child(6):last-child),
    .dashboard-main .stats-grid.six {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 640px) {
    body.in-portal .stats-grid,
    .dashboard-main .stats-grid,
    .dashboard-main .stats-grid:has(> :nth-child(6):last-child),
    .dashboard-main .stats-grid.six {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* ---- Public Homepage Hero Stats (strictly 4 items on desktop, 2x2 on tablets & mobile) ---- */
.hero-stats .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 24px !important;
    margin-bottom: 0 !important;
}

@media (max-width: 991px) {
    .hero-stats .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 575px) {
    .hero-stats .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
}

body .stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 20px 22px !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02) !important;
    min-width: 0 !important;
    border-bottom: 3px solid transparent !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

body .stat-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0, 40, 85, 0.08) !important;
    border-bottom-color: var(--gold, #ffd700) !important;
}

body .stat-card .stat-icon {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    flex-shrink: 0 !important;
}

body .stat-card .stat-content {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
}

body .stat-card .stat-content h3 {
    margin: 0 !important;
    font-size: clamp(1.35rem, 1.8vw, 1.65rem) !important;
    font-weight: 800 !important;
    color: var(--navy, #002855) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.02em !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body .stat-card .stat-content p {
    margin: 4px 0 0 !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* ==========================================================================
   Phones
   ========================================================================== */
@media (max-width: 767px) {
    /* Header: logo + wordmark, compact and aligned */
    body .main-nav { height: 60px; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 16px rgba(0,16,40,.25); }
    body .nav-container { padding: 0 14px; }
    body .logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
    body .logo img { height: 40px; width: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
    body .logo .school-name { display: block !important; color: #fff; font-family: inherit; font-weight: 700; font-size: .82rem; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; }
    body .logo .school-name small { display: block; font-weight: 500; font-size: .66rem; opacity: .75; letter-spacing: .06em; text-transform: none; margin-top: 2px; }
    body .mobile-menu-toggle { min-width: 44px; min-height: 44px; font-size: 1.35rem; border-radius: var(--r-sm); }
    body .mobile-menu-toggle:active { background: rgba(255,255,255,.1); }
    body .nav-menu li a { border-radius: var(--r-sm); font-weight: 500; justify-content: flex-start; padding: 0 14px; }
    body .nav-menu li.active > a { background: rgba(255,255,255,.1); color: var(--gold-ui); }
    body .nav-menu .nav-buttons { padding-top: 10px; margin-top: 6px; border-top: 1px solid rgba(255,255,255,.12); }

    /* Hero: content-sized, left aligned, clear hierarchy */
    body .hero-section, body .hero-slider { min-height: 0 !important; height: auto !important; }
    body .hero-slide { position: relative !important; opacity: 1 !important; display: none; padding: 48px 0 44px; align-items: flex-start; min-height: 0 !important; height: auto !important; }
    body .hero-slide.active { display: block; }
    body .hero-content { text-align: left; max-width: 100%; padding: 0 4px; }
    body .hero-subtitle { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-ui); padding: 6px 12px; border: 1px solid rgba(255,210,63,.4); border-radius: 999px; margin-bottom: 16px; }
    body .hero-title { font-size: clamp(1.7rem, 7.4vw, 2.1rem) !important; line-height: 1.15 !important; letter-spacing: -.015em; color: #fff; margin: 0 0 14px; text-shadow: none; }
    body .hero-title span { color: var(--gold-ui); }
    body .hero-motto { font-size: 1rem; color: rgba(255,255,255,.92); margin: 0 0 6px; font-style: normal; font-weight: 500; line-height: 1.45; }
    body .hero-translation { font-size: .9rem; color: rgba(255,255,255,.7); margin: 0 0 26px; line-height: 1.5; }
    body .hero-buttons { display: flex; flex-direction: column; gap: 10px; }
    body .hero-buttons .btn { width: 100%; }

    /* Stats: compact 2x2 band */
    body .quick-stats { padding: 0; margin-top: 0; background: var(--brand-deep); }
    body .stats-container { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1px !important; background: rgba(255,255,255,.08); padding: 0 !important; }
    body .stat-box { background: var(--brand); border: 0; border-radius: 0; box-shadow: none; padding: 20px 12px; text-align: center; backdrop-filter: none; }
    body .stat-box i { font-size: 1.15rem; color: var(--gold-ui); margin-bottom: 6px; display: block; background: none; width: auto; height: auto; }
    body .stat-box .number { font-size: 1.7rem; font-weight: 800; color: #fff; line-height: 1.1; }
    body .stat-box .label { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-top: 4px; }

    /* Welcome */
    body .welcome-section .section-label, body .welcome-section .section-tag { font-size: .72rem; letter-spacing: .16em; }
    body .welcome-content, body .welcome-text { text-align: left; }
    body .welcome-text p, body .welcome-content p { font-size: 1rem; line-height: 1.7; color: var(--ink-soft); }
    body .feature-item, body .features-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
    body .feature-item:last-child { border-bottom: 0; }
    body .welcome-image img, body .history-image img { border-radius: var(--r-lg); box-shadow: var(--elev-2); }

    /* Programs: horizontal media rows read faster than tall centred cards */
    body .programs-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
    body .program-card { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; row-gap: 2px; text-align: left; padding: 16px; align-items: start; }
    body .program-icon { grid-row: 1 / span 4; width: 52px; height: 52px; font-size: 1.25rem; margin: 0; border-radius: var(--r-md); }
    body .program-card h3 { margin: 0; font-size: 1.1rem; }
    body .program-age { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
    body .program-desc { margin: 4px 0 6px; font-size: .92rem; line-height: 1.5; color: var(--ink-soft); }
    body .program-card .btn-link { font-size: .9rem; font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }

    /* News */
    body .news-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
    body .news-card { overflow: hidden; padding: 0; }
    body .news-image { aspect-ratio: 16 / 9; overflow: hidden; position: relative; }
    body .news-image img { width: 100%; height: 100%; object-fit: cover; }
    body .news-content { padding: 16px; }
    body .news-content h3 { font-size: 1.08rem; line-height: 1.3; margin: 0 0 8px; }
    body .news-content h3 a { color: var(--brand); text-decoration: none; }
    body .news-content p { font-size: .92rem; color: var(--ink-soft); line-height: 1.55; }

    /* Slideshow controls */
    body .mvg-slideshow .slide-controls button, body .slideshow-controls button { width: 44px; height: 44px; }

    /* Call to action */
    body .cta-section { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); text-align: left; }
    body .cta-content h2 { color: #fff; font-size: 1.6rem; line-height: 1.2; }
    body .cta-content p { color: rgba(255,255,255,.8); }
    body .cta-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
    body .cta-buttons .btn { width: 100%; }


    /* Footer */
    body .footer-container { padding-left: 20px; padding-right: 20px; }
    body .footer-grid { text-align: left; gap: 28px; }
    body .footer-info h3 { font-size: 1rem; line-height: 1.35; }
    body .footer-links h4, body .footer-social h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ui); margin-bottom: 10px; }
    body .footer-links a { display: inline-block; padding: 6px 0; color: rgba(255,255,255,.8); }
    body .social-icons { display: flex; gap: 10px; }
    body .social-icons a { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.1); }
    body .footer-bottom, body .footer-bottom p { text-align: center !important; font-size: .8rem; opacity: .85; margin: 0 auto !important; }

    /* Inner pages */
    body .page-header { padding: 36px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); }
    body .page-header h1 { font-size: 1.6rem !important; letter-spacing: -.01em; }
    body .breadcrumb { font-size: .8rem; }
}

/* ==========================================================================
   Dashboards: calmer, denser, consistent
   ========================================================================== */
body.is-auth { background: var(--surface-alt); }
body .dashboard-header h1 { color: var(--brand); letter-spacing: -.01em; }
body .stat-card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--elev-1); }
body .card-header { background: var(--surface); border-bottom: 1px solid var(--line); }
body table th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); font-weight: 700; }
body table td { color: var(--ink); }
body .badge { border-radius: 999px; font-weight: 600; }
body .form-control, body select, body input[type="text"], body input[type="email"], body input[type="password"], body input[type="date"], body input[type="number"], body textarea { border-radius: var(--r-md); border-color: #d6dde8; }
body .form-control:focus, body input:focus, body select:focus, body textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,40,85,.12); outline: 0; }
@media (max-width: 991px) {
    body .sidebar-toggle-mobile { font-size: .95rem; }
    body .sidebar { background: linear-gradient(180deg, var(--brand), var(--brand-deep)); }
}

/* ---- Landing hero (phones): slides flow in the page, stats sit beneath ---- */
@media (max-width: 767px) {
    body .hero-section { overflow: visible !important; display: block; }
    body .hero-slider { position: relative; }
    body .hero-slide { background-position: center; }
    body .slider-prev, body .slider-next { display: none !important; }
    body .slider-dots { position: static !important; display: flex; justify-content: center; gap: 8px; padding: 0 0 16px; background: transparent; }
    body .hero-slider .slider-dots { margin-top: -28px; position: relative !important; z-index: 5; }
    body .hero-stats { position: static !important; padding: 0 !important; border-top: 3px solid var(--gold-ui); background: var(--brand-deep); backdrop-filter: none; }
    body .hero-stats .container { padding: 0; max-width: 100%; }
    body .hero-stats .stats-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1px !important; background: rgba(255,255,255,.1); }
    body .hero-stats .stat-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 8px; background: var(--brand); }
    body .hero-stats .stat-icon { width: auto; height: auto; background: none; font-size: 1.1rem; color: var(--gold-ui); }
    body .hero-stats .stat-content { display: flex; flex-direction: column; align-items: center; }
    body .hero-stats .stat-number { font-size: 1.65rem; font-weight: 800; color: #fff; line-height: 1.1; text-align: center; }
    body .hero-stats .stat-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.72); text-align: center; }
}
@media (max-width: 767px) { body .slider-controls { display: none !important; } }
@media (max-width: 767px) {
    body .welcome-section h2, body .welcome-section .section-title { text-align: left; }
    body .welcome-section .title-underline, body .welcome-section h2::after { margin-left: 0; }
}
@media (min-width:768px) and (max-width:991px){ body .stat-card, body .stat-content { min-width:0; } body .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }

/* Tables: every table (including plain class="table") shares one look; headers align with their columns */
body table { border-collapse: collapse; }
body .table, body .data-table { width: 100%; border-collapse: collapse; }
body table th, body table td { text-align: left; vertical-align: middle; }
body .table th, body .table td { padding: 12px 14px; border-bottom: 1px solid var(--line, #e5e9f0); }
body .table thead th { background: #f4f7fb; border-bottom: 2px solid var(--line, #e5e9f0); white-space: nowrap; }
body .table tbody tr:hover { background: #f8fafd; }
body .table td.text-center, body .table th.text-center { text-align: center; }
body .table td.text-right, body .table th.text-right { text-align: right; }
body .table-responsive { width: 100%; max-width: 100%; overflow-x: auto; }

/* Universal DataTables Controls Spacing & Aesthetics: Prevents controls from touching table */
.dataTables_wrapper,
body .dataTables_wrapper {
    position: relative !important;
    width: 100% !important;
    margin-top: 6px !important;
    margin-bottom: 24px !important;
    clear: both !important;
}

body .dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_length {
    float: left !important;
    margin-bottom: 18px !important;
    padding-bottom: 4px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
}

body .dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    margin: 0 8px !important;
    outline: none !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body .dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

body .dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_filter {
    float: right !important;
    text-align: right !important;
    margin-bottom: 18px !important;
    padding-bottom: 4px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    display: inline-flex !important;
    align-items: center !important;
}

body .dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

body .dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    margin-left: 6px !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    min-width: 220px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body .dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Ensure the table itself clears both floats and maintains generous top and bottom spacing */
body .dataTables_wrapper table.dataTable,
body .dataTables_wrapper table.data-table,
.dataTables_wrapper table.dataTable,
.dataTables_wrapper table.data-table,
body .dataTables_wrapper .table-responsive {
    clear: both !important;
    margin-top: 18px !important;
    margin-bottom: 18px !important;
}

/* Footer: Information & Pagination */
body .dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_info {
    float: left !important;
    padding-top: 14px !important;
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 500 !important;
}

body .dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_paginate {
    float: right !important;
    text-align: right !important;
    padding-top: 10px !important;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
    padding: 5px 11px !important;
    margin: 0 2px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #334155 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #002855 !important;
    color: #ffffff !important;
    border-color: #002855 !important;
}

body .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled),
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

[hidden] { display: none !important; }
.location-picker .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
body .location-picker .form-row > .form-group { flex: none; min-width: 0; margin-bottom: 14px; }
.location-picker > .form-group, .location-picker .loc-foreign > .form-group { margin-bottom: 14px; }
.location-picker select, .location-picker input { width: 100%; box-sizing: border-box; }


/* ==========================================================================
   Responsive Navbar & Logo Protection (Fixes Overlap on Desktop/Laptops)
   ========================================================================== */
.nav-container {
    max-width: 1540px !important;
    width: 100% !important;
    padding: 0 clamp(16px, 2vw, 36px) !important;
    gap: clamp(12px, 1.5vw, 24px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.logo {
    flex-shrink: 0 !important;
    min-width: max-content !important;
    z-index: 2;
}

.logo a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
}

.logo .school-name {
    white-space: nowrap !important;
    font-size: clamp(0.92rem, 1.1vw, 1.15rem) !important;
    line-height: 1.15 !important;
}

.logo .school-name small {
    white-space: nowrap !important;
    font-size: clamp(0.68rem, 0.72vw, 0.78rem) !important;
}

@media (min-width: 1121px) {
    .main-nav .nav-menu {
        display: flex !important;
        align-items: center !important;
        gap: clamp(2px, 0.35vw, 8px) !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 1 !important;
    }

    .main-nav .nav-menu li {
        flex-shrink: 0 !important;
    }

    .main-nav .nav-menu li a {
        padding: 0.5rem clamp(8px, 0.65vw, 13px) !important;
        font-size: clamp(0.82rem, 0.82vw, 0.88rem) !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
        min-height: auto !important;
    }

    .main-nav .nav-menu .dropdown-toggle {
        padding: 0.5rem clamp(8px, 0.7vw, 14px) !important;
        font-size: clamp(0.82rem, 0.82vw, 0.88rem) !important;
    }
}

/* ---- Expanded Responsive Footer Grid (Policies, Info & Hours) ---- */
body .footer-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 32px 24px !important;
    margin-bottom: 32px !important;
}

@media (min-width: 1200px) {
    body .footer-grid {
        grid-template-columns: 1.35fr 1fr 1fr 1.15fr 1.1fr !important;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    body .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 28px 24px !important;
    }
}

@media (max-width: 767px) {
    body .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* ---- Hero Write-up Vertical Position (Move up 2 steps above slider controls) ---- */
@media (min-width: 768px) {
    body .hero-slide {
        padding-bottom: 150px !important;
        box-sizing: border-box !important;
    }
    body .hero-content {
        margin-top: -40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   GLOBAL ACCESSIBLE MODAL SYSTEM (Clean, Modern, Centered Dialogs)
   - Guaranteed hidden by default: NEVER dumps inline into document flow!
   - Fixed full-screen overlay with smooth dark backdrop blur
   - Elegant rounded dialog card with shadow, animations & high contrast
   - ZERO border-left colors anywhere (strict compliance)
   ========================================================================== */
.modal,
.admin-modal,
.modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(10, 25, 47, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 99999 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    align-items: center;
    justify-content: center;
}

/* Modal activation states */
.modal[style*="display: block"],
.modal[style*="display: flex"],
.modal.show,
.modal.active,
.modal.open,
.modal-overlay.open,
.admin-modal.active {
    display: flex !important;
    animation: modalBackdropFadeIn 0.2s ease forwards;
}

/* Modal Dialog Card */
.modal-content,
.modal-dialog,
.modal-content-card {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 60px -12px rgba(0, 20, 50, 0.45), 0 0 0 1px rgba(15, 27, 45, 0.08) !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: auto !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    border: none !important;
}

.modal-content.modal-lg,
.modal-dialog.lg,
.modal-content-card.modal-lg {
    max-width: 860px !important;
}

.modal-content.modal-sm,
.modal-dialog.sm,
.modal-content-card.modal-sm {
    max-width: 380px !important;
}

/* Modal Header */
.modal-header,
.modal-header-bar {
    padding: 18px 24px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-left: none !important;
    border-top: none !important;
    border-right: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header-bar h3 {
    margin: 0 !important;
    font-size: 1.18rem !important;
    font-weight: 700 !important;
    color: #002855 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    letter-spacing: -0.01em !important;
}

/* Modal Close Button */
.modal-header .close,
.modal-header button.close,
.modal-close,
.modal-close-btn,
button.close {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #64748b !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.18s ease !important;
    outline: none !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.modal-header .close:hover,
.modal-close:hover,
.modal-close-btn:hover,
button.close:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    transform: rotate(90deg) !important;
}

/* Modal Body */
.modal-body,
.modal-body-content {
    padding: 24px !important;
    color: #334155 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    overflow-y: auto !important;
    max-height: calc(85vh - 140px) !important;
}

.modal-body p {
    margin-bottom: 12px !important;
}

.modal-body p:last-child {
    margin-bottom: 0 !important;
}

/* High Contrast Alert Callouts inside modals (Strictly NO border-left color) */
.modal-body .text-warning,
.modal-body .alert-warning {
    color: #92400e !important;
    background: #fef3c7 !important;
    border: 1px solid #fde68a !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.4 !important;
}

.modal-body .text-warning::before {
    content: "\f071";
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    color: #d97706 !important;
    font-size: 1rem !important;
    flex-shrink: 0;
}

.modal-body .text-danger,
.modal-body .alert-danger {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border: 1px solid #fecaca !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    line-height: 1.4 !important;
}

.modal-body .text-danger::before {
    content: "\f06a";
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    color: #dc2626 !important;
    font-size: 1rem !important;
    flex-shrink: 0;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
}

.modal-footer form {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
}

.modal-footer .btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.modal-footer .btn-secondary,
.modal-footer .btn-outline {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-outline:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
}

.modal-footer .btn-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25) !important;
}

.modal-footer .btn-danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

.modal-footer .btn-warning {
    background: #ea580c !important;
    color: #ffffff !important;
    border: 1px solid #ea580c !important;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.25) !important;
}

.modal-footer .btn-warning:hover {
    background: #c2410c !important;
    border-color: #c2410c !important;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   GLOBAL BRANDED PAGE TRANSITION SPINNER (St. Benedict's Crest)
   - Rotates official school crest in 3D perspective with radiant gold aura
   - Smooth 1-2s transition before navigating to target page
   - Fully accessible, touch-friendly, high performance
   ========================================================================== */
.stb-page-preloader {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000000 !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.stb-page-preloader.is-active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.stb-page-preloader.is-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.stb-preloader-backdrop {
    position: absolute !important;
    inset: 0 !important;
    background: radial-gradient(circle at center, rgba(0, 40, 85, 0.94) 0%, rgba(0, 16, 38, 0.98) 100%) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.stb-preloader-content {
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 30px !important;
    max-width: 90vw !important;
}

.stb-crest-spin-container {
    position: relative !important;
    width: 135px !important;
    height: 165px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    perspective: 1000px !important;
    margin-bottom: 22px !important;
}

.stb-crest-aura {
    position: absolute !important;
    width: 175px !important;
    height: 175px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.38) 0%, rgba(0, 102, 255, 0.22) 50%, transparent 70%) !important;
    animation: stbAuraPulse 1.8s ease-in-out infinite alternate !important;
    pointer-events: none !important;
}

.stb-crest-ring {
    position: absolute !important;
    width: 155px !important;
    height: 155px !important;
    border-radius: 50% !important;
    border: 2px dashed rgba(255, 215, 0, 0.45) !important;
    border-top-color: #ffd700 !important;
    border-bottom-color: #0066ff !important;
    animation: stbRingRotate 4s linear infinite !important;
    pointer-events: none !important;
}

.stb-crest-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55)) !important;
    transform-style: preserve-3d !important;
    animation: stb3dSpin 1.35s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite !important;
}

.stb-preloader-school {
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
    margin: 0 0 6px 0 !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
}

.stb-preloader-motto {
    color: #ffd700 !important;
    font-size: 0.88rem !important;
    font-style: italic !important;
    font-weight: 500 !important;
    letter-spacing: 0.8px !important;
    margin: 0 0 20px 0 !important;
    opacity: 0.95 !important;
}

.stb-preloader-loader-bar {
    width: 160px !important;
    height: 4px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    position: relative !important;
}

.stb-loader-fill {
    display: block !important;
    height: 100% !important;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #0066ff, #ffd700) !important;
    background-size: 200% 100% !important;
    border-radius: 999px !important;
    animation: stbBarFill 1.35s ease-in-out infinite !important;
}

@keyframes stb3dSpin {
    0% {
        transform: perspective(700px) rotateY(0deg) scale(0.96);
    }
    50% {
        transform: perspective(700px) rotateY(180deg) scale(1.06);
    }
    100% {
        transform: perspective(700px) rotateY(360deg) scale(0.96);
    }
}

@keyframes stbAuraPulse {
    0% { transform: scale(0.85); opacity: 0.4; }
    100% { transform: scale(1.2); opacity: 0.85; }
}

@keyframes stbRingRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes stbBarFill {
    0% { width: 0%; transform: translateX(-100%); }
    50% { width: 80%; transform: translateX(0%); }
    100% { width: 100%; transform: translateX(100%); }
}

/* ---- Mobile Responsive Polish: Stacked Dashboard Header, Clean Forms, & 2x2 Stats Grid ---- */
@media (max-width: 768px) {
    body .dashboard-header,
    .dashboard-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 14px !important;
        padding-bottom: 12px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        gap: 10px !important;
    }

    body .dashboard-header h1,
    .dashboard-header h1 {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        color: var(--brand, #002147) !important;
        margin: 0 !important;
        text-align: left !important;
        line-height: 1.25 !important;
        letter-spacing: -0.01em !important;
        word-break: break-word !important;
    }

    body .dashboard-header .header-right-cluster,
    .dashboard-header .header-right-cluster,
    body .dashboard-header .header-actions,
    .dashboard-header .header-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 0 !important;
        justify-content: flex-start !important;
    }

    body .dashboard-header .header-actions .btn,
    body .dashboard-header .header-actions a.btn,
    body .dashboard-header .header-actions button,
    .dashboard-header .header-actions .btn,
    .dashboard-header .header-actions a.btn,
    .dashboard-header .header-actions button,
    .header-right-cluster .header-actions .btn,
    .header-right-cluster .header-actions a.btn,
    .header-right-cluster .header-actions button {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 38px !important;
        padding: 0 10px !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        text-align: center !important;
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    body .dashboard-header .header-actions > :only-child,
    .dashboard-header .header-actions > :only-child,
    .header-right-cluster .header-actions > :only-child {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* On mobile view (< 769px): completely hide the user dropdown pill so header is clean and native app-like */
    body .dashboard-header .user-dropdown-wrapper,
    .dashboard-header .user-dropdown-wrapper,
    #userDropdownWrapper {
        display: none !important;
    }

    body .dashboard-header .header-right-cluster:empty,
    .dashboard-header .header-right-cluster:empty,
    body .dashboard-header .header-actions:empty,
    .dashboard-header .header-actions:empty {
        display: none !important;
    }

    /* Mobile Viewport & Container Zero-Overflow Protection */
    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body .dashboard-container,
    .dashboard-container {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    body .dashboard-main,
    .dashboard-main {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        padding: 14px 12px 60px 12px !important;
    }

    body .card,
    .card {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body .card-body,
    .card-body {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Form Grids collapse to single clean column on mobile */
    body form [style*="grid-template-columns"],
    form [style*="grid-template-columns"],
    body .form-row,
    body .form-grid,
    .form-row,
    .form-grid,
    .expense-form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    body form [style*="grid-column"],
    form [style*="grid-column"],
    body .form-row > div,
    body .form-row > .form-group,
    body .form-grid > div,
    body .form-grid > .form-group,
    .expense-form-grid .form-group,
    body [class*="col-md-"],
    body [class*="col-lg-"],
    body [class*="col-sm-"] {
        grid-column: span 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
        box-sizing: border-box !important;
    }

    body .form-control,
    body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
    body select,
    body textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body form .btn[type="submit"],
    body form button[type="submit"],
    .expense-form-actions .btn {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Hide empty spacer labels in filter forms on mobile */
    body .filter-btn-spacer,
    .filter-btn-spacer {
        display: none !important;
    }

    /* Mobile 2x2 Stats Grid */
    body.in-portal .stats-grid,
    .dashboard-main .stats-grid,
    body .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    body.in-portal .stats-grid > :last-child:nth-child(odd),
    .dashboard-main .stats-grid > :last-child:nth-child(odd),
    body .stats-grid > :last-child:nth-child(odd) {
        grid-column: span 2 / -1 !important;
    }

    /* Tables scroll within table-responsive, never shifting page */
    body .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 12px !important;
        display: block !important;
    }

    body .dataTables_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: visible !important;
        box-sizing: border-box !important;
    }

    body .dataTables_length,
    body .dataTables_filter {
        float: none !important;
        text-align: left !important;
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    body .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        box-sizing: border-box !important;
    }

    body .dataTables_info,
    body .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    body .dataTables_paginate {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    body .stats-grid .stat-card {
        padding: 12px !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 3px rgba(0, 33, 71, 0.05) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        min-width: 0 !important;
    }

    body .stats-grid .stat-card .stat-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.95rem !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 2px !important;
    }

    body .stats-grid .stat-card .stat-content h3 {
        font-size: 1.35rem !important;
        font-weight: 800 !important;
        margin: 0 !important;
        color: #0f172a !important;
        line-height: 1.1 !important;
    }

    body .stats-grid .stat-card .stat-content p {
        font-size: 0.68rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.03em !important;
        color: #64748b !important;
        margin: 2px 0 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* ==========================================================================
   BACKEND FOOTER REMOVAL & DESKTOP FIXED SIDEBAR (INDEPENDENT SCROLL)
   ========================================================================== */

/* 1. Remove footer completely from all backend & authenticated portals */
body.is-auth .main-footer,
body.in-portal .main-footer,
.dashboard-container ~ .main-footer,
.dashboard-main ~ .main-footer,
.modern-school-sidebar ~ .main-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* 2. Desktop Fixed Sidebar (>= 992px): Scrolling main content up/down NEVER affects the sidebar */
@media (min-width: 992px) {
    .dashboard-container {
        display: flex !important;
        min-height: 100vh !important;
        position: relative !important;
        background: #f8fafc !important;
    }

    aside.sidebar,
    aside.modern-school-sidebar,
    .sidebar.modern-school-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 270px !important;
        z-index: 1050 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    body .dashboard-main,
    body.is-auth .dashboard-main,
    body.in-portal .dashboard-main,
    .dashboard-main {
        flex: 1 1 auto !important;
        margin-left: 270px !important;
        width: calc(100% - 270px) !important;
        max-width: calc(100% - 270px) !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        box-sizing: border-box !important;
    }
}

/* 3. Desktop User Dropdown Header Pill (>= 769px): Visible at top-right on ALL desktop pages */
@media (min-width: 769px) {
    body .dashboard-header,
    .dashboard-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 16px !important;
    }

    body .dashboard-header .header-right-cluster,
    .dashboard-header .header-right-cluster {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 12px !important;
        margin-left: auto !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        width: auto !important;
    }

    body .dashboard-header .header-actions,
    .dashboard-header .header-actions {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        flex-shrink: 0 !important;
        flex-wrap: nowrap !important;
    }

    body .dashboard-header .header-actions .btn,
    body .dashboard-header .header-actions a.btn,
    body .dashboard-header .header-actions button,
    .dashboard-header .header-actions .btn,
    .dashboard-header .header-actions a.btn,
    .dashboard-header .header-actions button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        height: 38px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        margin: 0 !important;
        width: auto !important;
        flex: 0 0 auto !important;
        box-sizing: border-box !important;
    }

    body .dashboard-header .user-dropdown-wrapper,
    .dashboard-header .user-dropdown-wrapper {
        display: inline-flex !important;
        position: relative !important;
        margin: 0 !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        width: auto !important;
    }

    body .dashboard-header .user-dropdown-toggle,
    .dashboard-header .user-dropdown-toggle {
        display: inline-flex !important;
        align-items: center !important;
        gap: 10px !important;
        height: 38px !important;
        padding: 4px 14px 4px 6px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
}

/* 4. MVG Slideshow Compact Spacing: Eliminate blank gap between Mission/Vision/Goal and buttons */
body .mvg-slideshow {
    padding: 36px 0 !important;
}

body .mvg-container {
    min-height: 0 !important;
    height: auto !important;
}

body .mvg-controls {
    margin-top: 14px !important;
}

@media (max-width: 768px) {
    body .mvg-slideshow {
        padding: 24px 0 !important;
    }

    body .mvg-container {
        min-height: 0 !important;
        height: auto !important;
    }

    body .mvg-slide {
        padding: 22px 16px !important;
    }

    body .mvg-icon {
        width: 64px !important;
        height: 64px !important;
        font-size: 1.8rem !important;
        margin: 0 auto 10px !important;
    }

    body .mvg-slide h2 {
        font-size: 1.35rem !important;
        margin-bottom: 8px !important;
    }

    body .mvg-slide p {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
    }

    body .mvg-controls {
        margin-top: 12px !important;
    }
}

/* 5. Footer Copyright & Privacy Notice: Perfectly centered on mobile and all viewports */
body .footer-bottom,
body .footer-bottom p,
.footer-bottom,
.footer-bottom p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}


