/* ==========================================================================
   CAMDEMICS — COMPREHENSIVE RESPONSIVE & MOBILE ERGONOMICS SYSTEM
   Breakpoints: 1400 / 1200 / 992 / 768 / 576 / 380 / 320
   Covers: Landing Page & All Themes, Auth Pages, Public Portals, and Dashboards
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════════════════
   1. GLOBAL TOUCH & FLUID RESET
   ══════════════════════════════════════════════════════════════════════════════ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    -webkit-text-size-adjust: 100%;
}

img, svg, video, canvas, iframe {
    max-width: 100%;
    height: auto;
}

/* ══════════════════════════════════════════════════════════════════════════════
   2. PUBLIC LANDING PAGE & ALL THEMES (DEFAULT, CLASSIC, COLLEGIATE, HERITAGE, MODERN)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Top Notice Bar & Announcements */
.topHeader {
    width: 100%;
    overflow-x: hidden;
}
.top-header-notices {
    min-width: 0;
    flex: 1 1 auto;
}
.notice-text-carousel {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Hero Section (Default & Classic & Modern & Collegiate) */
.heroSection,
.cs-hero-carousel,
.cg-hero-section,
.hr-hero,
.mt-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-slide-item,
.cs-slide-item {
    background-size: cover;
    background-position: center center;
    position: relative;
}

/* Hero Headings Clamp Scaling */
.heroSection .display-4,
.heroSection h1,
.cs-slide-title,
.cg-hero-title,
.hr-hero-title,
.mt-hero-title {
    font-size: clamp(1.75rem, 4.5vw, 3.2rem) !important;
    line-height: 1.18 !important;
    word-break: break-word;
}

.heroSection .lead,
.heroSection p,
.cs-slide-desc,
.cg-hero-sub,
.hr-hero-sub,
.mt-hero-sub {
    font-size: clamp(0.95rem, 2vw, 1.2rem) !important;
    line-height: 1.6 !important;
}

/* Top Feature & Pillar Overlapping Cards */
.top-cards-overlay,
.cg-ribbon-container {
    position: relative;
    z-index: 70 !important;
    overflow: visible !important;
}

.feature-card-item,
.cg-ribbon-box,
.cs-program-card,
.hr-feature-card,
.mt-program-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    word-break: break-word;
}

/* Proportional About Us Multi-image Composition */
.about-multi-img-wrap {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

/* Statistics Counters Banner */
.stat-icon-circle {
    transition: transform 0.3s ease;
}

/* Interactive Tabs & Filter Pills */
.program-filter-pill,
.category-filter-pill,
.theme-filter-pill {
    white-space: nowrap;
    user-select: none;
    touch-action: manipulation;
}

/* ══════════════════════════════════════════════════════════════════════════════
   3. LARGE SCREENS & DESKTOP (≥ 992px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media screen and (min-width: 992px) {
    .top-cards-overlay {
        margin-top: -4.5rem;
    }
    .cg-ribbon-container {
        margin-top: -55px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   4. TABLETS & SMALL LAPTOPS (< 992px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 991.98px) {

    /* ── PUBLIC NAVBAR & HEADER ── */
    .web-navbar .listItems:not(.offcanvas-body .listItems) {
        display: none !important;
    }
    .web-navbar .nav-wing {
        display: none !important;
    }
    .web-navbar .hamburg {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .web-navbar .mobile-nav-brand {
        display: flex !important;
        align-items: center !important;
    }
    .web-navbar {
        padding: 8px 0 !important;
    }
    .web-navbar .navbarWrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    .web-navbar .navLogo img,
    .web-navbar .mobile-nav-brand img {
        height: 40px !important;
        max-height: 40px !important;
        width: auto !important;
        max-width: 185px !important;
        object-fit: contain !important;
    }
    .web-navbar .nav-floating-crest-badge {
        display: none !important;
    }
    .topHeader {
        padding: 5px 0 !important;
        min-height: 36px !important;
    }
    .top-header-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    .topHeader .top-header-notices {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .topHeader .notice-ticker-wrapper {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }
    .topHeader .notice-ticker-title {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        display: inline-block !important;
        font-size: 12px !important;
    }
    .topHeader .notice-action-pill {
        display: none !important;
    }
    .topHeader .top-header-contact {
        display: none !important;
    }
    .topHeader .socialIcons,
    .topHeader .top-header-social a {
        display: none !important;
    }
    .topHeader .top-header-right {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        margin-left: auto !important;
    }
    .topHeader .lang-toggle-wrap {
        margin-left: 0 !important;
    }

    /* ── HERO & OVERLAYS ── */
    .heroSection .item,
    .hero-slide-item,
    .cs-slide-item {
        min-height: 440px !important;
        height: auto !important;
        padding-top: 40px !important;
        padding-bottom: 50px !important;
    }
    .cg-hero-section {
        min-height: 420px !important;
        padding: 40px 0 70px !important;
    }
    .cg-hero-slanted-overlay {
        clip-path: none !important;
        background: linear-gradient(180deg, rgba(7, 22, 44, 0.95) 0%, rgba(7, 22, 44, 0.85) 100%) !important;
        width: 100% !important;
    }

    /* Overlay Cards Stack Gracefully with Generous Clearance for Top Emblem */
    .top-cards-overlay {
        margin-top: 2rem !important;
        padding-top: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    .top-cards-grid-row {
        row-gap: 58px !important;
    }
    .top-card-col {
        margin-top: 28px !important;
        margin-bottom: 12px !important;
    }
    .cg-ribbon-container {
        margin-top: 2rem !important;
    }
    .feature-card-item {
        margin-top: 15px !important;
        padding: 48px 18px 18px 18px !important;
        min-height: 200px !important;
    }
    .school-card-emblem-wrap {
        width: 80px !important;
        height: 80px !important;
        top: -40px !important;
        border-radius: 20px !important;
    }
    .school-card-emblem-wrap img {
        max-height: 58px !important;
        max-width: 58px !important;
    }

    /* ── ABOUT US COMPOSITION ── */
    .aboutUs .position-relative[style*="min-height"] {
        min-height: 360px !important;
        max-width: 440px;
        margin: 0 auto 30px;
    }
    .aboutUs div[style*="width: 310px"] {
        width: 70% !important;
        height: 260px !important;
    }
    .aboutUs div[style*="width: 260px"] {
        width: 60% !important;
        height: 220px !important;
        right: 0 !important;
    }

    /* ── DASHBOARD CORE & SIDEBAR ── */
    .content-wrapper {
        padding: 14px 12px 88px 12px !important;
        min-height: calc(100vh - 56px) !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -280px !important;
        width: 280px !important;
        max-width: 84vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1060 !important;
        background: #ffffff !important;
        transform: none !important;
        transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    body.sidebar-open .sidebar,
    .sidebar.active,
    body.sidebar-icon-only .sidebar.active {
        left: 0 !important;
        box-shadow: 8px 0 30px rgba(15, 23, 42, 0.25) !important;
    }
    body:not(.sidebar-open) .sidebar:not(.active) {
        left: -280px !important;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 0;
        height: 0;
        z-index: -1;
        display: none !important;
        pointer-events: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    body.sidebar-open .sidebar-backdrop,
    .sidebar-backdrop.show {
        display: block !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 100vw !important;
        height: 100vh !important;
        inset: 0 !important;
        z-index: 1055 !important;
    }

    .main-panel,
    .page-body-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .navbar {
        left: 0 !important;
        width: 100% !important;
    }
    .navbar .navbar-brand-wrapper {
        width: auto !important;
        min-width: auto !important;
    }
    .navbar .navbar-menu-wrapper {
        width: 100% !important;
        padding: 0 10px !important;
    }
    .navbar-toggler {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        margin-bottom: 12px !important;
    }
    .page-header .page-title {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    .page-header .breadcrumb {
        padding: 0 !important;
        margin: 0 !important;
        font-size: 0.8rem !important;
    }

    /* ── Dashboard top banner ── */
    .card-body > .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
    }
    .card-body > .d-flex.flex-column.flex-md-row > .d-flex.align-items-center {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .floating-banner-logo {
        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
        max-height: 68px !important;
        border-radius: 16px !important;
        padding: 5px !important;
        margin: -14px 0 -14px 0 !important;
        background: #ffffff !important;
        border: 2.5px solid rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 10px 24px -2px rgba(0, 0, 0, 0.32), 0 4px 10px rgba(0, 0, 0, 0.16) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    .floating-banner-logo-img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }
    [data-theme="dark"] .floating-banner-logo {
        background: #1e293b !important;
        border-color: #334155 !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
    }
    .card-body > .d-flex.flex-column.flex-md-row > .d-flex.align-items-center > div:last-child {
        text-align: center !important;
        width: 100% !important;
    }
    .card-body > .d-flex.flex-column.flex-md-row > .d-flex.align-items-center > div:last-child h3 {
        text-align: center !important;
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
    }
    .card-body > .d-flex.flex-column.flex-md-row > .d-flex.align-items-center > div:last-child .d-flex.flex-wrap {
        justify-content: center !important;
        gap: 6px !important;
    }
    .card-body > .d-flex.flex-column.flex-md-row > .d-flex.flex-column.align-items-md-end {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        gap: 4px !important;
    }

    /* ── Tables & Data Grids Responsive Overhaul ── */
    .table-responsive,
    .bootstrap-table .fixed-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px !important;
        margin-bottom: 12px;
    }
    .bootstrap-table .fixed-table-container .fixed-table-body {
        max-height: 62vh !important;
        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .bootstrap-table .fixed-table-toolbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 8px 0 !important;
    }
    .bootstrap-table .fixed-table-toolbar .bs-bars,
    .bootstrap-table .fixed-table-toolbar #toolbar,
    .bootstrap-table .fixed-table-toolbar .search,
    .bootstrap-table .fixed-table-toolbar .columns {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
    }
    /* Comprehensive Toolbar Responsive Stacking (in-table and standalone) */
    #toolbar,
    .bootstrap-table .fixed-table-toolbar #toolbar,
    .bootstrap-table .bs-bars #toolbar,
    .table-toolbar {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
        float: none !important;
        margin: 0 0 10px 0 !important;
    }
    #toolbar > .row,
    #toolbar > .col,
    #toolbar > [class*="col-"],
    #toolbar .row,
    #toolbar .col,
    #toolbar [class*="col-"],
    .bootstrap-table .fixed-table-toolbar #toolbar .row,
    .bootstrap-table .fixed-table-toolbar #toolbar .col,
    .bootstrap-table .fixed-table-toolbar #toolbar [class*="col-"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 4px !important;
    }
    #toolbar select,
    #toolbar input,
    #toolbar .form-control,
    #toolbar .form-select,
    #toolbar .select2-container,
    .bootstrap-table .fixed-table-toolbar #toolbar select,
    .bootstrap-table .fixed-table-toolbar #toolbar input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .bootstrap-table .fixed-table-toolbar .search input {
        width: 100% !important;
        font-size: 14px !important;
        height: 40px !important;
        border-radius: 8px !important;
    }
    .bootstrap-table .fixed-table-toolbar .columns {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
    }
    .bootstrap-table .fixed-table-toolbar .columns .btn-group {
        display: inline-flex !important;
    }
    .bootstrap-table .fixed-table-toolbar .columns .dropdown-menu {
        max-width: calc(100vw - 32px) !important;
        left: 0 !important;
        right: auto !important;
    }
    .bootstrap-table table {
        font-size: 12.5px !important;
    }
    .bootstrap-table table th,
    .bootstrap-table table td {
        padding: 8px 10px !important;
        white-space: nowrap;
    }
    .fixed-table-pagination {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 10px 0 !important;
        text-align: center !important;
    }
    .fixed-table-pagination .pagination-detail,
    .fixed-table-pagination .pagination {
        float: none !important;
        margin: 0 !important;
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    .fixed-table-pagination .pagination-info {
        margin-right: 0 !important;
        font-size: 12px !important;
    }
    .fixed-table-pagination .page-list {
        display: inline-block !important;
        margin-top: 4px !important;
    }

    /* ── Coordinated Floating Controls Stack (< 992px) — Zero Collision & Zero Dock Overlap ── */
    #camdemics-whatsapp-widget,
    .cam-wa-wrapper {
        bottom: 86px !important;
        right: 16px !important;
        left: auto !important;
        z-index: 1025 !important;
    }
    .cam-wa-launcher-btn {
        width: 48px !important;
        height: 48px !important;
    }
    .cam-wa-popup {
        bottom: 144px !important;
        right: 16px !important;
        max-width: calc(100vw - 32px) !important;
        z-index: 1035 !important;
    }
    .cam-wa-callout {
        display: none !important;
    }

    .back-to-top-btn {
        bottom: 144px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 1024 !important;
    }

    #darkModeToggleBtn,
    .theme-toggle-circle {
        bottom: 194px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 1023 !important;
    }

    #globalFullscreenBtn {
        bottom: 244px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 13px !important;
        z-index: 1022 !important;
    }

    /* ── Tab navigation ── */
    .nav-tabs,
    .nav-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .nav-tabs::-webkit-scrollbar,
    .nav-pills::-webkit-scrollbar {
        display: none !important;
    }
    .nav-tabs .nav-link,
    .nav-pills .nav-link {
        white-space: nowrap !important;
        font-size: 0.85rem !important;
        padding: 8px 14px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   5. MOBILE PHONES (< 768px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 767.98px) {

    /* ── Public Landing Page Ergonomics ── */
    .heroSection,
    .cs-hero-carousel,
    .cg-hero-section,
    .hr-hero,
    .mt-hero {
        min-height: 420px !important;
    }
    .hero-slide-item,
    .cs-slide-item {
        min-height: 420px !important;
        padding: 36px 0 50px 0 !important;
    }
    .hero-slide-text-wrapper {
        text-align: center;
        padding: 0 10px;
    }
    .hero-slide-text-wrapper .hero-badge {
        margin: 0 auto 10px !important;
    }
    .hero-slide-text-wrapper .d-flex.flex-wrap {
        justify-content: center !important;
    }
    .hero-slide-text-wrapper .btn {
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto;
    }

    /* Top Feature Cards Grid */
    .top-cards-overlay {
        margin-top: 2rem !important;
        padding-top: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    .top-cards-grid-row {
        row-gap: 58px !important;
    }
    .top-card-col {
        margin-top: 28px !important;
        margin-bottom: 12px !important;
    }
    .feature-card-item {
        margin-top: 15px !important;
        padding: 48px 16px 18px 16px !important;
        border-radius: 20px !important;
        min-height: 205px !important;
    }
    .school-card-emblem-wrap {
        width: 80px !important;
        height: 80px !important;
        top: -40px !important;
        border-radius: 20px !important;
    }
    .school-card-emblem-wrap img {
        max-height: 58px !important;
        max-width: 58px !important;
    }

    /* Stats Grid */
    .stats-banner-section {
        margin-top: 2rem !important;
        padding: 2rem 0 !important;
    }
    .stats-banner-section .stat-icon-circle {
        width: 56px !important;
        height: 56px !important;
        font-size: 1.4rem !important;
    }
    .stats-banner-section h2 {
        font-size: 1.9rem !important;
    }

    /* Programs & Course Cards */
    .colorful-program-card,
    .course-card-premium {
        border-radius: 16px !important;
    }
    .course-card-premium .position-relative[style*="height: 220px"] {
        height: 180px !important;
    }

    /* Video Vault & Photos */
    .ourPhotos .card,
    .ourVideos .card {
        border-radius: 14px !important;
    }
    .ourPhotos .card div[style*="height: 220px"],
    .ourVideos .card div[style*="height: 220px"] {
        height: 170px !important;
    }

    /* Public Footer */
    footer.commonMT {
        padding-top: 40px !important;
    }
    footer.commonMT .companyInfoWrapper {
        margin-bottom: 24px;
        text-align: center;
    }
    footer.commonMT .socialIcons {
        justify-content: center !important;
    }
    footer.commonMT .linksWrapper {
        margin-bottom: 24px;
        text-align: center;
    }
    footer.commonMT .linksWrapper ul {
        padding-left: 0;
    }
    footer.commonMT .usefulLinksDiv {
        text-align: center;
    }

    /* ── AUTH PAGES (LOGIN / RESET / FORGOT) ── */
    body.bg-image {
        background-attachment: scroll !important;
        background-position: center center !important;
    }
    .overlay {
        padding: 16px 12px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .auth-container-box {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .auth .auth-form-light {
        padding: 22px 16px !important;
        border-radius: 18px !important;
        box-shadow: 0 15px 35px rgba(15, 23, 42, 0.2) !important;
    }
    .auth-service-btn {
        height: 34px !important;
        font-size: 11.5px !important;
        padding: 0 8px !important;
    }

    /* ── REGISTRATION WIZARD ON MOBILE ── */
    .reg-hero-banner {
        padding: 30px 14px 60px !important;
    }
    .reg-hero-banner h1 {
        font-size: 1.65rem !important;
    }
    .reg-container {
        padding: 0 10px !important;
        margin-top: -40px !important;
    }
    .wizard-stepper {
        padding: 14px 10px !important;
    }
    .step-number {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 / 1 !important;
        font-size: 0.8rem !important;
    }
    .step-text {
        display: none !important;
    }
    .step-panel {
        padding: 18px 12px !important;
    }
    .official-form-preview {
        padding: 16px 12px !important;
    }
    .official-form-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px;
    }
    .official-passport-frame {
        margin: 10px auto 0 !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   6. SMALL MOBILE PHONES (< 576px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 575.98px) {

    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .content-wrapper {
        padding: 10px 8px 86px 8px !important;
    }

    /* Section Headings */
    .section-main-heading {
        font-size: 1.5rem !important;
        line-height: 1.28 !important;
    }
    .section-tag-badge {
        font-size: 0.76rem !important;
        padding: 4px 12px !important;
    }
    .section-subtext {
        font-size: 0.88rem !important;
    }

    /* Form Elements Ergonomics (44px min-height for touch & iOS 16px font-size) */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    select,
    textarea,
    .form-control,
    .form-select,
    .input-group .form-control,
    .select2-search__field {
        font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
        height: 44px !important;
        min-height: 44px !important;
        padding: 8px 12px !important;
    }
    textarea.form-control,
    textarea {
        height: auto !important;
        min-height: 84px !important;
    }
    input[type="checkbox"].form-control,
    input[type="radio"].form-control,
    .form-check-input.form-control {
        width: 19px !important;
        height: 19px !important;
        min-width: 19px !important;
        min-height: 19px !important;
        padding: 0 !important;
    }

    /* Universal Select2 Container Scaling */
    .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    .select2-container .select2-selection--single {
        height: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 15px !important;
    }
    .select2-container .select2-selection--single .select2-selection__arrow {
        height: 42px !important;
    }

    /* Buttons */
    .btn {
        font-size: 0.88rem !important;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-lg {
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 10px 18px !important;
    }

    /* Page Header & Action Stacks on Mobile */
    .page-header,
    .page-header-container,
    .content-wrapper > .d-flex.justify-content-between.align-items-center,
    .card-header.d-flex.justify-content-between.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .page-header > div:last-child,
    .page-header .d-flex.align-items-center.gap-2,
    .content-wrapper > .d-flex.justify-content-between.align-items-center > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 8px !important;
    }
    .page-header .btn,
    .content-wrapper > .d-flex.justify-content-between.align-items-center .btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-height: 40px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Quick action buttons stack */
    .quick-action-row .btn,
    .quick-actions-card .btn {
        width: 100% !important;
        margin-bottom: 6px !important;
        justify-content: center !important;
    }

    /* Universal Mobile Modal Architecture */
    .modal {
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .modal-dialog {
        margin: 8px auto !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        min-height: auto !important;
    }
    .modal-content {
        border-radius: 18px !important;
        max-height: calc(100dvh - 20px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .modal-header {
        padding: 12px 16px !important;
        flex-shrink: 0 !important;
    }
    .modal-header .modal-title {
        font-size: 1.05rem !important;
        line-height: 1.25 !important;
    }
    .modal-body {
        padding: 14px 14px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overscroll-behavior: contain !important;
    }
    .modal-footer {
        padding: 10px 14px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .modal-footer .btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-height: 42px !important;
        font-size: 14px !important;
        margin: 0 !important;
    }

    /* Dropdown Menus */
    .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   7. TINY PHONES & NARROW SCREENS (< 380px)
   ══════════════════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 380px) {
    .content-wrapper {
        padding: 8px 6px 80px 6px !important;
    }
    .heroSection .display-4,
    .heroSection h1 {
        font-size: 1.45rem !important;
    }
    .floating-banner-logo {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
        max-height: 60px !important;
        margin: -10px 0 -10px 0 !important;
        border-radius: 14px !important;
        padding: 4px !important;
        border-width: 2px !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    .card-body h3 {
        font-size: 0.92rem !important;
    }
    .auth .auth-form-light {
        padding: 18px 12px !important;
    }
    .auth-service-btn {
        font-size: 10.5px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   8. ADMISSION APPLICATION FLOATING STICKY FOOTER & FORM ALIGNMENT
   ══════════════════════════════════════════════════════════════════════════════ */
.wizard-footer {
    position: -webkit-sticky !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 36px !important;
    padding: 16px 24px !important;
    border-top: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 -8px 25px -6px rgba(15, 23, 42, 0.1) !important;
    border-radius: 0 0 20px 20px !important;
    transition: all 0.25s ease !important;
}

[data-theme="dark"] .wizard-footer {
    background: rgba(15, 23, 42, 0.96) !important;
    border-top-color: #334155 !important;
    box-shadow: 0 -8px 25px -6px rgba(0, 0, 0, 0.5) !important;
}

@media screen and (max-width: 768px) {
    .wizard-footer {
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 12px 16px !important;
    }
    .wizard-footer .btn-wizard {
        flex: 1 !important;
        width: auto !important;
        justify-content: center !important;
    }
    .wizard-footer .btn-wizard-prev {
        flex: 0 0 auto !important;
        min-width: 85px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   9. UNIVERSAL APPLICATION DATA-TABLE & HORIZONTAL SCROLL ARCHITECTURE
   Covers all Dashboard Tables, Academic Structures, Finance, Registrations & Portals
   ══════════════════════════════════════════════════════════════════════════════ */

.table-responsive,
.table-responsive-sm,
.table-responsive-md,
.table-responsive-lg,
.table-responsive-xl,
.bootstrap-table .fixed-table-container,
.academic-table-scroll {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative !important;
    box-sizing: border-box !important;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* Styled Sleek Apple Scrollbars */
.table-responsive::-webkit-scrollbar,
.table-responsive-sm::-webkit-scrollbar,
.table-responsive-md::-webkit-scrollbar,
.table-responsive-lg::-webkit-scrollbar,
.table-responsive-xl::-webkit-scrollbar,
.bootstrap-table .fixed-table-container::-webkit-scrollbar,
.bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar,
.academic-table-scroll::-webkit-scrollbar {
    height: 9px !important;
    width: 9px !important;
}

.table-responsive::-webkit-scrollbar-track,
.bootstrap-table .fixed-table-container::-webkit-scrollbar-track,
.bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-track,
.academic-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 6px !important;
}

.table-responsive::-webkit-scrollbar-thumb,
.bootstrap-table .fixed-table-container::-webkit-scrollbar-thumb,
.bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-thumb,
.academic-table-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8 !important;
    border-radius: 6px !important;
    border: 2px solid transparent !important;
    background-clip: content-box !important;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.bootstrap-table .fixed-table-container::-webkit-scrollbar-thumb:hover,
.bootstrap-table .fixed-table-container .fixed-table-body::-webkit-scrollbar-thumb:hover,
.academic-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b !important;
    background-clip: content-box !important;
}

.table-responsive,
.bootstrap-table .fixed-table-container,
.bootstrap-table .fixed-table-container .fixed-table-body,
.academic-table-scroll {
    scrollbar-width: thin !important;
    scrollbar-color: #94a3b8 #f1f5f9 !important;
}

/* Universal Table Header & Row Rules */
.table-responsive > .table,
.bootstrap-table .table,
.academic-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
}

.table-responsive > .table thead th,
.bootstrap-table .table thead th,
.academic-table thead th {
    white-space: nowrap !important;
    vertical-align: middle !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 12px 14px !important;
    border-top: none !important;
}

.table-responsive > .table tbody td,
.bootstrap-table .table tbody td,
.academic-table tbody td {
    vertical-align: middle !important;
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
}

/* Column Type Safeguards (Prevent Squishing) */
.table th.col-cb,
.table td.col-cb,
.table th[data-field="id"],
.table td[data-field="id"],
.table th[data-field="no"],
.table td[data-field="no"],
.table th:first-child:has(input[type="checkbox"]),
.table td:first-child:has(input[type="checkbox"]) {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 54px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.table th[data-field*="date"],
.table td[data-field*="date"],
.table th[data-field*="created_at"],
.table td[data-field*="created_at"],
.table th[data-field*="updated_at"],
.table td[data-field*="updated_at"] {
    min-width: 120px !important;
    white-space: nowrap !important;
}

.table td .badge,
.bootstrap-table td .badge {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
}

/* Action Controls Protection */
.table th[data-field="operate"],
.table td[data-field="operate"],
.table th[data-field="action"],
.table td[data-field="action"],
.table th.col-actions,
.table td.col-actions,
.table th.actions-col,
.table td.actions-col {
    min-width: 110px !important;
    white-space: nowrap !important;
    text-align: right !important;
}

.table td[data-field="operate"] .btn,
.table td[data-field="action"] .btn,
.table td.col-actions .btn,
.table td.actions-col .btn,
.table td:last-child .btn-group {
    white-space: nowrap !important;
}

/* Sticky Action Column across all tables with .table-sticky-actions */
.table-sticky-actions th:last-child,
.table-sticky-actions td:last-child,
.academic-table th.col-actions,
.academic-table td.col-actions {
    position: -webkit-sticky !important;
    position: sticky !important;
    right: 0 !important;
    z-index: 5 !important;
}

html:not([data-theme="dark"]) .table-sticky-actions th:last-child,
html:not([data-theme="dark"]) .academic-table th.col-actions {
    background-color: #f8fafc !important;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05) !important;
}

html:not([data-theme="dark"]) .table-sticky-actions td:last-child,
html:not([data-theme="dark"]) .academic-table td.col-actions {
    background-color: #ffffff !important;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05) !important;
}

html:not([data-theme="dark"]) .table-sticky-actions tr:hover td:last-child,
html:not([data-theme="dark"]) .academic-table tr:hover td.col-actions {
    background-color: #f8fafc !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   10. UNIVERSAL PORTAL, FILTER BAR & TOUCH ERGONOMICS OVERHAUL
   Covers Student/Teacher Portals, Academic Structure, Forms & Card Layouts
   ══════════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 767.98px) {
    /* Form Filter Bars (Academic Structure, Results, Attendance, Fees) */
    form.row.align-items-end,
    form.row.align-items-center,
    .filter-form,
    .filter-card {
        padding: 12px 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    form.row.align-items-end > [class*="col-"],
    form.row.align-items-center > [class*="col-"],
    .filter-form > [class*="col-"],
    .filter-card > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 8px !important;
    }

    /* Filter button clusters on mobile */
    .filter-buttons-wrapper,
    form .col-auto.ml-md-auto,
    form [class*="col-"] > .btn,
    form .d-flex.align-items-end > .btn {
        width: 100% !important;
        margin-top: 4px !important;
        display: flex !important;
        gap: 8px !important;
    }
    form .col-auto.ml-md-auto .btn,
    form [class*="col-"] .btn-theme,
    form [class*="col-"] .btn-outline-secondary {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Portal KPI & Stat Cards */
    .portal-kpi-card,
    .stat-card-premium,
    .dashboard-kpi-card {
        margin-bottom: 8px !important;
        border-radius: 14px !important;
    }
    .portal-kpi-card .card-body {
        padding: 14px 12px !important;
    }
    .portal-kpi-card h2 {
        font-size: 1.4rem !important;
    }

    /* Timetable Week Tabs on Mobile */
    .pulse-week-nav {
        gap: 6px !important;
        padding: 6px 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .pulse-day-tab {
        min-width: 72px !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
}

@media screen and (max-width: 380px) {
    .page-header .btn,
    .content-wrapper > .d-flex.justify-content-between.align-items-center .btn,
    .modal-footer .btn {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
}

/* ── Radio Card / Tab / Pill Elements: Visually hide native radio circles to show only the styled tab/card ── */
.radio-card-option input[type="radio"],
.gender-pill-option input[type="radio"],
.gender-pill-group input[type="radio"],
.option-card-radio input[type="radio"],
.hero-style-card input[type="radio"],
.radio-group-cards input[type="radio"],
input[type="radio"].radio-card-input,
input[type="radio"].gender-pill-input,
input[type="radio"].sr-only {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    display: inline !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    z-index: -1 !important;
}

.radio-card-option input[type="radio"]::after,
.gender-pill-option input[type="radio"]::after,
.gender-pill-group input[type="radio"]::after,
.option-card-radio input[type="radio"]::after,
.hero-style-card input[type="radio"]::after,
.radio-group-cards input[type="radio"]::after,
input[type="radio"].radio-card-input::after,
input[type="radio"].gender-pill-input::after,
input[type="radio"].sr-only::after {
    display: none !important;
    content: none !important;
}

