:root {
    /* Academic Precision Design System (Google Stitch) */
    --primary: #3525cd;
    --primary-container: #4f46e5;
    --on-primary: #ffffff;
    --secondary: #515f74;
    --on-secondary: #ffffff;
    --surface: #f7f9fb;
    --on-surface: #191c1e;
    --outline: #e2e8f0;
    
    /* Mapped Layout Variables */
    --bg-main: #f7f9fb;
    --bg-sidebar: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.6);
    --bg-card-hover: rgba(255, 255, 255, 0.8);
    --border-color: var(--outline);
    --text-primary: var(--on-surface);
    --text-secondary: var(--secondary);
    --text-muted: #94a3b8;
    
    --accent-primary: var(--primary-container);
    --accent-secondary: var(--primary);
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ba1a1a;
    
    --radius-md: 0.5rem;
    --shadow-sm: 0 1px 3px rgba(79, 70, 229, 0.08);
    --shadow-md: 0 4px 12px rgba(79, 70, 229, 0.12);
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition-speed: 0.2s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: 160px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.logo-box {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.logo-text {
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-icon {
    min-width: 24px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background var(--transition-speed);
}

.sidebar-toggle:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-primary);
}

.view-container {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    
}

.dashboard-section {
    margin-bottom: 2rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-section-header {
    padding: 1.5rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-section-header i {
    font-size: 0.8rem;
    cursor: pointer;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.nav-item i {
    min-width: 20px;
    font-size: 1.25rem;
}

.nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: var(--accent-primary);
}

.nav-item.active {
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sync-status-box {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sync-icon-container {
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-info {
    display: flex;
    flex-direction: column;
}

.sync-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.manual-sync-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
}

.manual-sync-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

.manual-sync-btn i {
    width: 16px;
    height: 16px;
}

.manual-sync-btn.spinning i {
    animation: spin 1s linear infinite;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #3b82f6;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name-small {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

.btn-signout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-signout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Sync Status Indicator */
.sync-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 2s infinite;
}

.status-indicator.live { background-color: var(--accent-success); }
.status-indicator.live::after { border: 2px solid var(--accent-success); }
.status-indicator.offline { background-color: var(--accent-warning); }
.status-indicator.syncing { background-color: var(--accent-primary); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animation {
    animation: spin 2s linear infinite;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    overflow: hidden;
}

.top-bar {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-area {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Loader */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--accent-primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.role-selector {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background-color: var(--bg-card);
    border-color: var(--accent-secondary);
}

.attendance-options {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
}

.radio-label input {
    accent-color: var(--accent-primary);
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cards & Widgets */
.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.2s, background-color 0.2s;
}

.card:hover {
    background-color: var(--bg-card-hover);
    transform: translateY(-4px);
}

/* Notifications */
.notification-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.notification {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

/* =============================================
   GLOBAL MOBILE OVERFLOW GUARD
   Prevents any element from causing horizontal scroll
   ============================================= */
input, select, textarea, img, video, iframe {
    max-width: 100%;
    box-sizing: border-box;
}

[style*="display:grid"], [style*="display: grid"] {
    min-width: 0;
}

.content-area {
    overflow-x: hidden !important;
}

@media (max-width: 768px) {
    /* Force all inline grids to be single-column friendly */
    [style*="grid-template-columns"] {
        grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)) !important;
    }

    /* Override any pixel-fixed sidebar-style grids */
    [style*="350px"] {
        grid-template-columns: 1fr !important;
    }

    /* Wrap all flex rows */
    [style*="display:flex"], [style*="display: flex"] {
        flex-wrap: wrap;
    }

    /* CBT editor cards */
    .cbt-main-card, .cbt-side-card {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Banner action rows */
    .banner-actions, .banner-flex-container {
        flex-wrap: wrap !important;
    }

    /* Reduce card padding on mobile */
    .card {
        padding: 1rem !important;
    }
}

/* Student Directory Mobile Optimization */

@media (max-width: 1024px) {
    .view-container {
        padding-bottom: 2rem !important;
    }
    .directory-container {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
    }
    .directory-sidebar {
        width: 100% !important;
        border: none !important;
        max-height: none !important;
        height: auto !important;
    }
    #student-sidebar-list {
        max-height: none !important;
        overflow: visible !important;
        padding: 0.5rem !important;
    }
    .directory-main {
        display: none !important;
    }
    .student-item-container {
        margin-bottom: 0.5rem !important;
    }
}


/* Stacked Accordion Support */
.student-item.active {
    background: #fff !important;
    border: 1px solid #2563eb !important;
    box-shadow: 0 4px 12px rgba(37,99,235,0.1) !important;
}

.student-item.active .mobile-detail-accordion {
    max-height: 800px !important;
    opacity: 1 !important;
}

.student-item.active .accordion-arrow {
    transform: rotate(180deg);
    color: #2563eb !important;
    opacity: 1 !important;
}

.stat-box-sm {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-box-sm strong {
    font-size: 0.6rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 2px;
}

/* Subject Accordion */
.subject-accordion-item.active .accordion-content {
    max-height: 400px !important;
}
.subject-accordion-item.active .accordion-trigger i {
    transform: rotate(180deg);
}

.loader-sm {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary { background-color: var(--accent-secondary); color: white; }
.btn-primary:hover { background-color: var(--accent-primary); }

.btn-success { background-color: var(--accent-success); color: white; }
.btn-secondary { background-color: var(--bg-card-hover); color: var(--text-primary); border: 1px solid var(--border-color); }

/* Inputs */
.input {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
}

.input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.data-table tr:hover {
    background-color: var(--bg-card-hover);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success { background-color: rgba(35, 134, 54, 0.15); color: #3fb950; }
.badge.warning { background-color: rgba(210, 153, 34, 0.15); color: #d29922; }

/* Utilities */
.mb-2 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1.5rem; }
.w-100 { width: 100%; }
.stat { font-size: 2.5rem; font-weight: 700; margin: 0.5rem 0; color: var(--accent-primary); }

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-xs:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Mobile Stacked Table View */
@media (max-width: 768px) {
    .mobile-stack-table thead {
        display: none;
    }
    .mobile-stack-table tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 1rem;
        background: white;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    }
    .mobile-stack-table td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 1.5rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
    }
    .mobile-stack-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        color: #94a3b8;
        text-transform: uppercase;
        width: 100px;
        flex-shrink: 0;
        text-align: left;
    }
    .mobile-stack-table td:last-child {
        border-bottom: none;
    }

    /* Attendance Specific Collapsible Card Styles */
    .attendance-row .collapsible-field {
        display: none !important;
    }
    .attendance-row.expanded .collapsible-field {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        padding: 0.75rem 0 !important;
    }
    .attendance-row .mobile-main-header {
        width: 100% !important;
        display: block !important;
        background: #f8fafc;
        border-radius: 12px 12px 0 0;
    }
    .attendance-row.expanded .mobile-main-header {
        border-bottom: 1px solid #f1f5f9 !important;
    }
    .mobile-hide {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
    .attendance-row.expanded .accordion-arrow {
        transform: rotate(180deg);
    }

    /* â”€â”€ Global: Force ALL inline 2-col grids to stack on small screens â”€â”€ */
    .glass-collapse-content > div[style*="grid-template-columns"],
    .view-container div[style*="grid-template-columns: 1fr 1fr"],
    .view-container div[style*="grid-template-columns: 1.5fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* â”€â”€ Faculty Grid: Single column on mobile â”€â”€ */
    .faculty-grid {
        grid-template-columns: 1fr !important;
    }

    .faculty-card {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        padding: 1rem;
        border-radius: 14px;
    }

    .faculty-avatar {
        width: 56px !important;
        height: 56px !important;
        flex-shrink: 0;
    }

    .faculty-avatar img {
        width: 56px !important;
        height: 56px !important;
    }

    .faculty-details h3 {
        font-size: 0.95rem !important;
    }

    .faculty-actions {
        flex-direction: row !important;
        margin-top: 0.75rem !important;
    }

    /* â”€â”€ Attendance: Match score-card collapsible styling â”€â”€ */
    .attendance-row {
        border-radius: 12px;
        border: 1px solid var(--border-color);
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .attendance-row.expanded {
        border-color: #2563eb;
        box-shadow: 0 4px 16px rgba(37,99,235,0.10);
    }

    .attendance-row .mobile-main-header {
        background: #f8fafc !important;
        transition: background 0.2s ease;
        padding: 1rem !important;
    }

    .attendance-row.expanded .mobile-main-header {
        background: #eff6ff !important;
    }

    .attendance-row.expanded .accordion-arrow {
        color: #2563eb !important;
    }

    .attendance-row .collapsible-field {
        animation: slideDown 0.25s ease-out;
    }

    /* â”€â”€ Lessons (Bulk Workload): Stack columns â”€â”€ */
    .view-container .card div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* â”€â”€ Settings & Config: Stack form grids â”€â”€ */
    .glass-collapse-content div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }

    /* â”€â”€ Filter bars: Stack horizontally-laid-out filters â”€â”€ */
    .actions-bar {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .actions-bar > div[style*="display: flex"] {
        width: 100% !important;
    }

    .actions-bar > div[style*="max-width"] {
        max-width: 100% !important;
    }

    /* â”€â”€ Stream cards: Make enrollment stat responsive â”€â”€ */
    .stream-card-body .enrollment-stat {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    /* â”€â”€ Reports filter grid: Stack filters â”€â”€ */
    .filter-grid {
        grid-template-columns: 1fr !important;
    }

    /* â”€â”€ Student directory biodata accordion â”€â”€ */
    .student-biodata-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .student-biodata-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        background: white;
        padding: 0.6rem;
        border-radius: 8px;
        border: 1px solid #f1f5f9;
    }

    .student-biodata-field label {
        font-size: 0.55rem;
        font-weight: 800;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .student-biodata-field span {
        font-weight: 700;
        font-size: 0.85rem;
        color: #1e293b;
    }

    /* â”€â”€ Global: Prevent horizontal overflow â”€â”€ */
    .view-container {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .card, .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* Dashboard Specific Styles */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.stat-icon {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.primary-gradient { background: linear-gradient(135deg, var(--accent-primary), #2563eb); }
.secondary-gradient { background: linear-gradient(135deg, var(--accent-secondary), #7c3aed); }
.accent-gradient { background: linear-gradient(135deg, #f59e0b, #d97706); }
.warning-gradient { background: linear-gradient(135deg, var(--accent-danger), #dc2626); }

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-wrapper {
    padding: 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.bg-success-light { background: rgba(16, 185, 129, 0.1); }
.text-success { color: #10b981; }
.bg-warning-light { background: rgba(245, 158, 11, 0.1); }
.text-warning { color: #f59e0b; }
.bg-primary-light { background: rgba(59, 130, 246, 0.1); }
.bg-accent-light { background: rgba(139, 92, 246, 0.1); }
.text-accent { color: #8b5cf6; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feed-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.feed-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.feed-icon {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
    height: max-content;
}


/* Auth Screen Styles */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1f2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    position: relative;
    background: rgba(30, 36, 51, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: cardFadeIn 0.5s ease-out;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-header h2 {
    margin-bottom: 0.25rem;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.6);
    font-size: 1.25rem;
    text-align: center;
}

.login-header p {
    font-size: 0.85rem;
    color: rgba(100, 116, 139, 0.55);
    text-align: center;
    line-height: 1.4;
}

/* â”€â”€â”€â”€ Orbital Animation Container â”€â”€â”€â”€ */
.login-orbit-container {
    width: 140px;
    height: 140px;
    position: relative;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.orbit-ring-1 {
    width: 100%;
    height: 100%;
    animation: orbitSpin 12s linear infinite;
}
.orbit-ring-2 {
    width: 80%;
    height: 80%;
    animation: orbitSpin 8s linear infinite reverse;
    border-color: rgba(96, 165, 250, 0.15);
}
.orbit-ring-3 {
    width: 115%;
    height: 115%;
    animation: orbitSpin 18s linear infinite;
    border-color: rgba(139, 92, 246, 0.1);
    border-style: dashed;
}

/* Orbit Dots (satellites) */
.orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary, #58a6ff);
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.6);
}

.orbit-dot-1 {
    animation: orbitDot1 12s linear infinite;
}
.orbit-dot-2 {
    animation: orbitDot2 8s linear infinite;
    background: #818cf8;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
}
.orbit-dot-3 {
    animation: orbitDot3 18s linear infinite;
    background: #a78bfa;
    width: 4px;
    height: 4px;
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes orbitDot1 {
    from { transform: rotate(0deg)   translateX(70px) rotate(0deg);   }
    to   { transform: rotate(360deg) translateX(70px) rotate(-360deg); }
}
@keyframes orbitDot2 {
    from { transform: rotate(0deg)   translateX(56px) rotate(0deg);   }
    to   { transform: rotate(-360deg) translateX(56px) rotate(360deg); }
}
@keyframes orbitDot3 {
    from { transform: rotate(0deg)   translateX(80px) rotate(0deg);   }
    to   { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

/* Logo Glow (centre of orbits) */
@keyframes floatAndPulse {
    0%   { transform: translateY(0px);  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3); }
    50%  { transform: translateY(-6px); box-shadow: 0 0 40px rgba(79, 70, 229, 0.7); }
    100% { transform: translateY(0px);  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3); }
}

/* Sync Status Box */
.sync-status-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Status States */
.sync-status-box.live .status-dot {
    background-color: #10b981; /* Green */
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.sync-status-box.offline .status-dot {
    background-color: #ef4444; /* Red */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.sync-status-box.syncing .status-dot {
    background-color: #f59e0b; /* Yellow */
    animation: pulse-yellow 1.5s infinite;
}

@keyframes pulse-yellow {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.sync-info {
    display: flex;
    flex-direction: column;
}

.sync-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.sync-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.login-logo-glow {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #60a5fa, #4f46e5);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.4);
    animation: floatAndPulse 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.login-logo-glow i {
    width: 32px;
    height: 32px;
}

/* â”€â”€â”€â”€ Form Elements â”€â”€â”€â”€ */
.login-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: #64748b;
    width: 18px;
    height: 18px;
    transition: color 0.3s ease;
    z-index: 2;
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.login-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Password input with extra room for toggle */
.login-input-pw {
    padding-right: 3rem;
}

/* Password show/hide toggle button */
.pw-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: color 0.2s;
}

.pw-toggle:hover {
    color: #6366f1;
}

.pw-toggle i {
    width: 18px;
    height: 18px;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-with-icon:focus-within i {
    color: #6366f1;
}

.mb-1-5 {
    margin-bottom: 1.5rem;
}

.forgot-link {
    color: #60a5fa;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.2s;
}

.btn-login:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Center-aligned Create Account / Back to Login link */
.create-account-section {
    margin-top: 1rem;
    text-align: center;
}

.create-account-link {
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.create-account-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Success message styling */
.login-success {
    color: #34d399;
    font-size: 0.85rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Main Layout */
    .app-container {
        position: relative;
        overflow-x: hidden;
    }

    /* Sidebar overlay on mobile */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        transition: left var(--transition-speed) ease;
        box-shadow: none;
    }
    
    .sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    
    /* Mobile Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Top Bar Mobile Adjustments */
    .mobile-menu-btn {
        display: flex !important;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0.25rem;
        border-radius: 4px;
    }
    
    .sidebar-toggle {
        display: none; /* Hide desktop toggle */
    }
    
    /* Dashboard and Cards */
    .dashboard-grid .grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        grid-column: span 1 !important; /* Override Teacher/Parent spans */
    }
    
    .action-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
    }
    
    /* Login Page Adjustments */
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    /* Hide some text to save space in header */
    .user-name, .user-role {
        display: none;
    }
    
    #logout-btn {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }
    
    /* Tables on Mobile */
    .table-container {
        overflow-x: auto;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .action-grid {
        grid-template-columns: 1fr; /* 1 column on tiny screens */
    }
    
    .login-header h2 {
        font-size: 1.25rem;
    }
}


.w-100 {
    width: 100%;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* â”€â”€â”€â”€ Dashboard Premium Layout â”€â”€â”€â”€ */
.dashboard-container {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    background: #f1f5f9;
    min-height: 100%;
}

/* Switch content-area to light when showing dashboard */
.content-area:has(.dashboard-container) {
    background: #f1f5f9;
    padding: 0;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: #64748b;
    font-size: 1rem;
}

.user-highlight {
    color: #4f46e5;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.stat-card-premium {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(241, 245, 249, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.stat-body {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up { background: #f0fdf4; color: #16a34a; }
.trend-stable { background: #f8fafc; color: #64748b; }
.trend-neutral { background: #f5f3ff; color: #7c3aed; }

.stat-icon-bg {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-bg i { width: 24px; height: 24px; }

.icon-blue { background: #eff6ff; color: #3b82f6; }
.icon-green { background: #f0fdf4; color: #22c55e; }
.icon-orange { background: #fff7ed; color: #f97316; }
.icon-purple { background: #f5f3ff; color: #8b5cf6; }

/* Main Dashboard Grid */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.dashboard-col-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Analysis Card */
.card-header-fancy {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.header-icon {
    width: 40px;
    height: 40px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-text h3 { font-size: 1.125rem; font-weight: 700; color: #0f172a; margin: 0; }
.header-text p { font-size: 0.875rem; color: #64748b; margin: 0; }

.analysis-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.sub-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sub-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2rem;
}

.sub-card h4 i { width: 18px; height: 18px; color: #3b82f6; }

.empty-state-simple {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
    color: #10b981;
    font-size: 0.85rem;
}

.status-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

/* â”€â”€â”€ Sidebar Layout (Student Directory) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.directory-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 140px);
    overflow: hidden;
}

.directory-sidebar {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-search-wrap {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.25rem;
}

.student-item:hover {
    background: #f1f5f9;
}

.student-item.active {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.student-item-info {
    display: flex;
    flex-direction: column;
}

.student-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #1e293b;
}

.student-item-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.directory-main {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Internal scroll only */
    padding: 2rem;
}

.empty-state {
    text-align: center;
    max-width: 400px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #cbd5e1;
}

/* â”€â”€â”€ Bulk Import UI â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.import-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.upload-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid #e2e8f0;
}

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s;
    margin: 1.5rem 0;
}

.dropzone:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.log-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.log-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: #475569;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f8fafc;
}

.log-entry.success { color: #10b981; }
.log-entry.error { color: #ef4444; }
.log-entry.info { color: #2563eb; }

/* â”€â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
    .directory-container, .import-grid {
        grid-template-columns: 1fr;
    }
    .directory-container {
        height: auto;
    }
    .page-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }
    .banner-stat-item {
        padding: 0 1rem 0 0;
    }
}

/* Turnout Card */
.turnout-percentage {
    font-size: 3.5rem;
    font-weight: 800;
    color: #4f46e5;
    margin: 0.5rem 0;
}

.turnout-list {
    margin-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.turnout-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

/* Admin Action Buttons */
.admin-action-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-link-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.admin-link-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.admin-link-btn i { width: 18px; height: 18px; color: #4f46e5; }

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .analysis-subgrid {
        grid-template-columns: 1fr;
    }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   ADMIN DASHBOARD â€” New Component Styles
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Generic light-theme dashboard card */
.dash-card {
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    color: #1e293b;
}
.dash-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Chart card section title */
.chart-card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
}
.chart-card-title i { width: 20px; height: 20px; color: #ec4899; }

/* â”€â”€ Attendance Performance Bars â”€â”€ */
.perf-row { margin-bottom: 1rem; }
.perf-row:last-child { margin-bottom: 0; }
.perf-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3rem;
}
.perf-class-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}
.perf-pct { font-size: 0.8rem; font-weight: 700; color: #4f46e5; }
.perf-bar-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}
.perf-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.perf-row-sub { font-size: 0.72rem; color: #94a3b8; margin-top: 0.2rem; }

/* â”€â”€ Gender Ratio Chart â”€â”€ */
.gender-chart-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: center;
    padding: 0.5rem 0;
}
.gender-legend { display: flex; flex-direction: column; gap: 0.75rem; }
.g-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}
.g-legend-item strong {
    margin-left: auto;
    padding-left: 1rem;
    color: #1e293b;
    font-weight: 700;
}
.g-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* â”€â”€ Class Distribution bar chart â”€â”€ */
.bar-chart-wrap { position: relative; height: 200px; width: 100%; }

/* â”€â”€ Empty state for charts â”€â”€ */
.empty-state-chart-label {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
    text-align: center;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    border-radius: 10px;
    margin-top: 0.75rem;
}

/* â”€â”€ Turnout Card â”€â”€ */
.turnout-split {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1rem;
}
.turnout-left { min-width: 120px; }
.turnout-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.turnout-percentage {
    font-size: 3rem;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
    margin: 0.25rem 0;
}
.turnout-present-text { font-size: 0.8rem; font-weight: 600; }

.weekly-section { flex: 1; min-width: 0; }
.weekly-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-align: right;
}
.weekly-chart-wrap { position: relative; height: 80px; width: 100%; }

/* Turnout breakdown rows */
.turnout-item {
    display: grid;
    grid-template-columns: 10px 80px 1fr 30px;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.875rem;
}
.turnout-item:last-child { border-bottom: none; }
.turnout-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ti-label { color: #64748b; font-weight: 500; }
.ti-value { font-weight: 700; color: #1e293b; text-align: right; }
.ti-bar-track {
    height: 5px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}
.ti-bar-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }

/* â”€â”€ Admin actions card â”€â”€ */
.admin-link-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #334155;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.18s ease;
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
}
.admin-link-btn:last-child { margin-bottom: 0; }
.admin-link-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    transform: translateX(3px);
}
.admin-link-btn i { width: 17px; height: 17px; color: #4f46e5; flex-shrink: 0; }

/* â”€â”€ Dashboard col-left spacing â”€â”€ */
.dashboard-col-left { gap: 1.25rem; }

/* â”€â”€â”€ Universal View Container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.view-container {
    background: #f8fafc !important; /* Premium light grey/blue */
    min-height: calc(100vh - 64px);
    padding: 2.5rem 3rem;
    color: #1e293b;
    animation: fadeIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* â”€â”€â”€ Page Banners (Premium Glassmorphism) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.page-banner {
    padding: 0.75rem 1.5rem;
    min-height: 80px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.banner-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.05rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.banner-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    max-width: 450px;
    line-height: 1.2;
}

.banner-stats {
    display: flex;
    gap: 4rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin-top: 0.75rem;
    font-weight: 700;
}

/* â”€â”€â”€ Responsive Sidebar (Half-Desktop Hamburger) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        width: 40px;
        height: 40px;
        cursor: pointer;
    }

    .top-bar {
        padding-left: 1.5rem;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* â”€â”€â”€ Comprehensive Responsive Adjustments â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* Tablet & Half-Desktop Layout (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Dashboard main columns */
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-col-left, .dashboard-col-right {
        width: 100%;
    }
    
    /* Student directory view */
    .directory-container {
        flex-direction: column;
        height: auto !important;
    }
    
    .directory-sidebar {
        width: 100%;
        max-height: 400px;
        overflow-y: auto;
        margin-bottom: 1.5rem;
    }
    
    .directory-main {
        width: 100%;
    }

    /* Wrap banner stats */
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .banner-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

/* Mobile Layout (max-width: 768px) */
@media (max-width: 768px) {
    /* Collapse Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Collapse analysis subgrid */
    .analysis-subgrid {
        grid-template-columns: 1fr;
    }
    
    /* Adjust view container padding */
    .view-container {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
}
    
    .dashboard-container {
        padding: 1rem;
    }
    
    /* Fix typography size for mobile */
    .dashboard-header h1 {
        font-size: 2rem !important;
    }
    
    .banner-title {
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    /* Ensure tables can scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px; /* Force table width so it scrolls instead of squishing */
    }
    
    /* Profile details adjust */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-title-info > div > div:first-child {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Hide specific non-critical buttons to save space */
    .profile-title-info .btn-secondary {
        padding: 0.5rem;
    }
    
    .profile-tabs {
        flex-wrap: wrap;
        gap: 1rem !important;
    }
}

/* ========== MODAL SYSTEM ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-container {
    background: #1e293b;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-overlay.active .modal-container {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #2563eb;
    color: white;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.modal-close:hover {
    color: white;
    background: rgba(255,255,255,0.15);
}
.modal-body {
    padding: 1.5rem;
    background: #1e293b;
    color: white;
}
.modal-body .input,
.modal-body select,
.modal-body textarea {
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.modal-body .input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.modal-body label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    display: block;
}
.modal-footer {
    padding: 1.25rem 1.5rem;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    border-top: 1px solid #334155;
}
.modal-footer .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ========== RESPONSIVE GRIDS & LAYOUTS ========== */
.stats-grid, .dashboard-grid, .profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Removed redundant directory-container definition */

.actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.profile-stats {
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Screen Size Adjustments */
@media (max-width: 1200px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }
    
    .directory-container {
        grid-template-columns: 300px 1fr !important;
    }
}

@media (max-width: 992px) {
    .directory-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    
    .directory-sidebar {
        height: 400px;
        overflow-y: auto;
    }
    
    .directory-main {
        min-height: 500px;
    }

    .stream-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

.profile-header {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        width: 280px;
        background-color: var(--bg-sidebar);
        border-right: 1px solid var(--border-color);
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }

    .sidebar.mobile-open {
        display: flex !important;
        animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    @keyframes slideInLeft {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        width: 44px;
        height: 44px;
        color: var(--text-primary);
        cursor: pointer;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100vw !important;
    }

    .view-container {
        padding: 1rem !important;
    }

    .stats-grid, .action-grid, .profile-stats, .modal-grid, .dashboard-main-grid, .dashboard-grid, .info-grid, .profile-stats, .grid {
        grid-template-columns: 1fr !important;
    }
    
    .stats-grid > div, .dashboard-main-grid > div, .dashboard-grid > div, .info-grid > div, .grid > div {
        grid-column: span 1 !important;
    }

    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem !important;
    }
    
    .actions-bar > div {
        width: 100% !important;
        max-width: none !important;
    }

    .page-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
    
    .banner-stats {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 2rem !important;
    }
    
    .stat-icon-bg {
        display: none !important;
    }

    .profile-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 2rem !important;
    }
    
    .profile-avatar-big {
        margin: 0 auto !important;
    }

    .profile-title-info h1 {
        font-size: 1.75rem !important;
    }
}

.stat-card-premium {
    position: relative;
    background: white;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.05);
}

.spinning { 
    animation: spin 1s linear infinite; 
} 
@keyframes spin { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}  

/* Mobile Responsive Scoring & UI Components */
@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Hide the middle action bar on tablet/mobile (duplicates exist at bottom) */
    .action-bar-container { display: none !important; }

    /* â”€â”€ Unified Collapsible Card Pattern â”€â”€ */
    .score-card,
    .mobile-collapse-card {
        background: white;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        margin-bottom: 0.75rem;
        box-shadow: var(--shadow-sm);
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .score-card:not(.collapsed),
    .mobile-collapse-card:not(.collapsed) {
        border-color: #2563eb;
        box-shadow: 0 4px 16px rgba(37,99,235,0.10);
    }
    
    .score-card.collapsed .score-card-content,
    .mobile-collapse-card.collapsed .collapse-card-content {
        display: none;
    }
    
    .score-card-header,
    .collapse-card-header {
        padding: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        background: #f8fafc;
        border-radius: 12px;
        transition: background 0.2s ease;
    }

    .score-card:not(.collapsed) .score-card-header,
    .mobile-collapse-card:not(.collapsed) .collapse-card-header {
        background: #eff6ff;
        border-radius: 12px 12px 0 0;
    }
    
    .score-card-title,
    .collapse-card-title {
        font-weight: 700;
        font-size: 0.95rem;
        color: var(--text-primary);
    }

    /* Chevron rotation on expand */
    .score-card-header i[data-lucide="chevron-down"],
    .collapse-card-header i[data-lucide="chevron-down"] {
        transition: transform 0.3s ease;
        opacity: 0.5;
    }

    .score-card:not(.collapsed) .score-card-header i[data-lucide="chevron-down"],
    .mobile-collapse-card:not(.collapsed) .collapse-card-header i[data-lucide="chevron-down"] {
        transform: rotate(180deg);
        opacity: 1;
        color: #2563eb;
    }
    
    .score-card-content,
    .collapse-card-content {
        padding: 1.25rem;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        border-top: 1px solid var(--border-color);
        animation: slideDown 0.25s ease-out;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    
    .score-field {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .score-field label {
        font-size: 0.6rem;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .score-field input {
        width: 100%;
        padding: 0.6rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        font-weight: 700;
        font-size: 1rem;
        text-align: center;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .score-field input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
        outline: none;
    }

    .action-bar-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        display: flex;
        gap: 1rem;
        z-index: 900;
    }
    
    /* Ensure action bar buttons are visible */
    .action-bar-mobile .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (min-width: 1025px) {
    .desktop-only { display: table-row-group !important; }
    .mobile-only { display: none !important; }
    .action-bar-mobile { display: none !important; }
}

/* Data Table Styling Refinement */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #f8fafc;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}


.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Floating Action Button for Mobile */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

@media (max-width: 768px) {
    .fab-container {
        display: flex;
    }
    
    /* Removed banner-actions hiding to keep 'New Enrolment' button visible */
    .banner-actions {
        display: flex !important;
        width: 100%;
        justify-content: flex-start;
    }
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.fab:active {
    transform: scale(0.9);
}

/* Enhanced Table Contrast */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f1f5f9;
}

.data-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* --- Premium Design Tokens & Components --- */

/* Biodata Header Premium */
.biodata-header-premium {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 2.5rem;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.biodata-header-premium::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.03) 0%, transparent 70%);
    z-index: 0;
}

/* Stats Strip */
.stats-strip {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.stat-mini-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.stat-mini-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
}

.stat-mini-card .stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Faculty Grid & Cards */
.faculty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.faculty-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.faculty-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: var(--accent-primary);
}

.faculty-avatar {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: #f1f5f9;
    margin-bottom: 1.25rem;
    padding: 4px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.faculty-card:hover .faculty-avatar {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.faculty-details h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.faculty-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    display: inline-block;
    margin-bottom: 1rem;
}

.faculty-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.meta-label { color: var(--text-muted); font-weight: 600; }
.meta-value { color: var(--text-secondary); font-weight: 700; }

.faculty-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.faculty-actions button {
    flex: 1;
}

/* Mastersheet Table */
.mastersheet-container {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

.mastersheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.mastersheet-table th, 
.mastersheet-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #f1f5f9;
    text-align: center;
}

.mastersheet-table th {
    background: #f8fafc;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mastersheet-table td:first-child,
.mastersheet-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: white;
    z-index: 11;
    font-weight: 700;
    border-right: 2px solid #f1f5f9;
}

.mastersheet-table th:first-child { background: #f8fafc; }

.mastersheet-table tr:hover td {
    background: #f1f5f9;
}

.score-cell {
    font-weight: 600;
}

.total-cell-premium {
    background: #eff6ff !important;
    font-weight: 800 !important;
    color: var(--accent-primary) !important;
}

.grade-cell-premium {
    font-weight: 800;
}

.grade-A { color: #059669; }
.grade-C { color: #d97706; }
.grade-F { color: #dc2626; }

/* Dashboard Premium Widgets */
.teacher-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.timetable-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.timetable-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.time-slot {
    min-width: 80px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}


/* CBT Specific Styles */
.cbt-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.cbt-main-card {
    flex: 2;
}

.cbt-side-card {
    flex: 1;
    position: sticky;
    top: 1rem;
}

.question-preview-list {
    margin-top: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.question-preview-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.2s;
}

.question-preview-item:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.question-preview-item .q-num {
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
}

.cbt-form-group {
    margin-bottom: 1.25rem;
}

.cbt-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.cbt-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cbt-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

@media (max-width: 1024px) {
    .cbt-container {
        flex-direction: column;
    }
    .cbt-side-card {
        position: static;
        width: 100%;
    }
}

/* Desktop Branding & Header Tweaks */
@media (min-width: 1025px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    #view-title {
        display: none !important;
    }
    
    #desktop-school-name {
        display: block !important;
        font-family: 'Outfit', sans-serif;
        font-size: 1.35rem;
        font-weight: 800;
        color: var(--school-theme-color, #060495);
        letter-spacing: 0.04em;
        text-align: center;
        text-transform: uppercase;
        white-space: nowrap;
    }
}

/* Sidebar Logo Adjustments */
#sidebar-school-name {
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar.collapsed #sidebar-school-name {
    display: none;
}

/* ==========================================================================
   REPORTS INTELLIGENCE DASHBOARD
   ========================================================================== */
.biodata-header-premium {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 2rem 1.5rem 3rem 1.5rem;
    border-radius: 0 0 24px 24px;
    margin-bottom: -2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.report-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.report-header-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.analytics-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.analytics-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

.analytics-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.analytics-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.9;
}

.control-console-cards {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

/* â”€â”€ Mobile overrides: Reports, Pins, Student modules â”€â”€ */
@media (max-width: 768px) {
    .biodata-header-premium {
        padding: 1.25rem 1rem 2.5rem 1rem;
    }
    .analytics-container {
        width: 100%;
        justify-content: flex-start;
    }
    .analytics-box {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem 0.75rem;
    }
    .analytics-value {
        font-size: 1.25rem;
    }
    .control-console-cards {
        padding: 0 0.75rem;
    }
    .console-card {
        min-width: 140px;
        flex: 1 1 140px;
    }
    /* Student dashboard: force single column on mobile */
    .student-dashboard-grid {
        grid-template-columns: 1fr !important;
    }
    /* Fees / attendance portal: tighten glass header padding */
    .glass-header {
        padding: 1.25rem !important;
        font-size: 0.9rem;
    }
    /* Pins table: hide "Used By" column on tiny screens */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: none;
    }
    /* Student banner title responsive font */
    .banner-title {
        font-size: clamp(1.3rem, 5vw, 2rem) !important;
    }
}

.console-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    flex: 1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.console-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.console-card-header i {
    width: 14px;
    height: 14px;
    color: var(--accent-primary);
}

.console-input {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.console-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.console-input-wrapper::after {
    content: '\\25BC';
    font-size: 0.6rem;
    color: var(--text-muted);
    position: absolute;
    right: 0;
    pointer-events: none;
}

.btn-sync-generate {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
}

.btn-sync-generate:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.archive-standby {
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    margin: 0 1.5rem;
}

.archive-standby i {
    width: 48px;
    height: 48px;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.archive-standby-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.archive-standby-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 300px;
    margin: 0 auto;
}

.grade-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.grade-gold { background: #fef3c7; color: #d97706; }
.grade-silver { background: #f1f5f9; color: #475569; }
.grade-bronze { background: #ffedd5; color: #c2410c; }
.grade-danger { background: #fee2e2; color: #b91c1c; }

.avg-pass { color: #10b981; font-weight: 800; }
.avg-fail { color: #ef4444; font-weight: 800; }

/* ==========================================================================
   GLASSMORPHISM COLLAPSIBLE CONTAINER (Mobile/Tablet Friendly)
   ========================================================================== */

.glass-collapse-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

/* Hide checkbox */
.glass-collapse-checkbox {
    display: none;
}

/* Header label â€“ clickable */
.glass-collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    border-radius: 1.5rem;
    user-select: none;
    transition: background 0.2s;
}

.glass-collapse-header:hover {
    background: rgba(255, 255, 255, 0.3);
}

.glass-collapse-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chevron icon */
.glass-collapse-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    color: var(--text-secondary);
}

.glass-collapse-chevron svg {
    width: 20px;
    height: 20px;
}

/* Content wrapper â€“ collapsible part */
.glass-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease-out, padding 0.3s ease, opacity 0.3s ease;
    padding: 0 1.5rem;
    opacity: 0;
    border-top: 1px solid transparent;
}

/* CHECKED STATE: expand content + rotate chevron */
.glass-collapse-checkbox:checked ~ .glass-collapse-content {
    max-height: 1000px;
    padding: 0 1.5rem 1.5rem 1.5rem;
    opacity: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-collapse-checkbox:checked + .glass-collapse-header .glass-collapse-chevron {
    transform: rotate(180deg);
}

/* â”€â”€ Registry Grouped Cards â”€â”€ */
.registry-toggle:checked ~ .registry-content {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

.registry-toggle:checked ~ label .chevron-icon {
    transform: rotate(180deg);
}

.mobile-collapse-card label:hover {
    background: #f1f5f9 !important;
}

/* Stacking for console cards on mobile */
@media (max-width: 768px) {
    .control-console-cards {
        flex-direction: column !important;
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    .console-card {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* â”€â”€ Nested Registry Grouping â”€â”€ */
.registry-content div[style*="background: #fcfdfe"] {
    transition: all 0.2s ease;
}

.registry-content div[style*="background: #fcfdfe"]:hover {
    border-color: #2563eb !important;
    background: #f8fafc !important;
}

/* â”€â”€ Form Checkbox Lists â”€â”€ */
/* â”€â”€ Glass-Collapse-Card Design System â”€â”€ */
.glass-collapse-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    margin-bottom: 0.75rem;
}

.glass-collapse-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

.glass-collapse-checkbox {
    display: none;
}

.glass-collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    width: 100%;
}

.glass-collapse-checkbox:checked + .glass-collapse-header {
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.glass-collapse-chevron {
    transition: transform 0.3s ease;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-collapse-checkbox:checked ~ .glass-collapse-header .glass-collapse-chevron {
    transform: rotate(180deg);
    color: #2563eb;
}

.glass-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(248, 250, 252, 0.5);
}

.glass-collapse-checkbox:checked ~ .glass-collapse-content {
    max-height: 2000px;
}

/* Attendance Module Specifics */
.attendance-card {
    border-left: 4px solid #e2e8f0;
}

.attendance-card.active {
    border-left-color: #2563eb;
}

@media (max-width: 640px) {
    .attendance-card .glass-collapse-header > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }
    
    .attendance-card .glass-collapse-header .badge-container {
        margin-top: 0.5rem;
    }
}

/* Ensure date picker inputs feel premium */
input[type="date"].console-input {
    cursor: pointer;
    position: relative;
}

input[type="date"].console-input::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}/* Student Dashboard Premium Styles */
.student-universe-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
}

.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.live-ticker-container {
    width: 100%;
    overflow: hidden;
    background: #1e293b;
    color: #38bdf8;
    padding: 0.6rem 0;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    position: relative;
    border-radius: 0 0 16px 16px;
    margin-top: -1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 40s linear infinite;
}

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

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

.kpi-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.kpi-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Stacked Notices */
@media (max-width: 768px) {
    .student-notices-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .notice-card {
        background: white;
        border-radius: 20px;
        padding: 1.5rem;
        border: 1px solid #e2e8f0;
        box-shadow: var(--shadow-sm);
        position: relative;
    }
    .notice-card::before {
        content: '';
        position: absolute;
        left: 0;
        top: 20%;
        height: 60%;
        width: 4px;
        background: var(--accent-primary);
        border-radius: 0 4px 4px 0;
    }
}

.locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    text-align: center;
    padding: 1rem;
}

.lock-icon {
    width: 48px;
    height: 48px;
    color: #ef4444;
    margin-bottom: 0.5rem;
    animation: shake 0.5s ease-in-out infinite alternate;
}

@keyframes shake {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

/* --- Premium Design Utilities --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.universe-banner {
    background: radial-gradient(circle at top right, #4f46e5 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
}

.universe-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-45c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm17 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm41-26c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-74-32c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM24 75c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm54-46c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM42 13c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm57 25c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM20 51c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm50 35c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM8 36c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm54 14c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM46 62c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm15 17c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM5 56c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm65-38c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM39 48c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm31 26c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM25 21c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm52 6c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM7 13c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm15 65c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm57 19c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM15 42c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm81-7c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM82 85c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-50-56c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM48 25c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM95 92c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM79 61c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-61 17c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm11-48c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm62 13c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM39 95c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM60 94c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM6 82c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm21-22c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm37 1c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm28 2c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM82 17c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-54-7c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm40 2c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm19 6c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM11 50c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm60-11c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-48 10c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm40 10c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM38 80c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm25-70c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM9 25c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm80 35c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-52 20c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm24-70c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM13 10c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm66 10c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-40 59c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm29 10c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM28 26c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm67 7c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM2 30c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm94 39c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM21 97c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm28-38c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm56-38c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm-81 47c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm50-20c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm40-38c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM36 80c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm14-9c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM95 94c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM7 66c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zm92-33c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM71 11c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1zM3 18c.553 0 1-.447 1-1s-.447-1-1-1-1 .447-1 1 .447 1 1 1z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 2s linear infinite;
}

/* --- Student Dashboard Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .student-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .banner-title {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 768px) {
    .kpi-visualization-grid {
        grid-template-columns: 1fr !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }

    /* Staff Directory & Detail Mobile Fixes */
    .staff-directory-banner {
        padding: 1.5rem !important;
        text-align: center;
    }

    .banner-flex-container {
        justify-content: center !important;
        text-align: center;
    }

    .banner-actions {
        justify-content: center !important;
        width: 100%;
        flex-direction: column;
    }
    
    .broadcast-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .notice-composer-mobile {
        order: -1; /* Put composer at top on mobile */
        margin-bottom: 2rem;
    }

    .btn-onboard-mobile {
        width: 100%;
        justify-content: center;
        height: auto !important;
        padding: 1rem !important;
    }
    
    .banner-actions > * {
        flex: 1;
        min-width: 140px;
    }

    .staff-detail-header {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 1.5rem !important;
    }

    .staff-detail-header > div {
        width: 100%;
        flex-direction: column;
        align-items: center;
        display: flex;
        gap: 0.75rem !important;
    }

    .staff-detail-header button {
        width: 100%;
        justify-content: center;
    }

    .staff-detail-grid, .attendance-filters {
        grid-template-columns: 1fr !important;
    }

    .profile-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem !important;
    }

    .profile-title-info {
        text-align: center !important;
        width: 100%;
    }

    .profile-title-info > div {
        flex-direction: column !important;
        align-items: center !important;
    }

    .staff-bio-card {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* Collapsible composer logic */
    .composer-collapse-content {
        display: none;
    }
    .composer-collapse-content.active {
        display: block;
    }
    
    #composer-mobile-trigger {
        display: flex !important;
    }

    .broadcast-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .passport-editable {
        cursor: pointer;
        position: relative;
    }
    
    .passport-editable:hover .camera-overlay {
        opacity: 1 !important;
    }
    
    .camera-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: inherit;
        z-index: 10;
    }

.desktop-only { display: inline-flex; }
.mobile-only { display: none; }

/* Collapsable Logic */
.collapse-toggle:checked ~ .collapse-content {
    display: block !important;
    max-height: 2000px;
    opacity: 1;
    transition: all 0.5s ease;
}

.collapse-toggle:not(:checked) ~ .collapse-content {
    display: none !important;
    max-height: 0;
    opacity: 0;
}

.collapse-toggle:checked ~ label .collapse-icon {
    transform: rotate(180deg);
}

.collapse-icon {
    transition: transform 0.3s ease;
}

.collapsable-section label:hover {
    background: #f8fafc;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PASSPORT PHOTO UPLOAD OVERLAY
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.passport-editable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.passport-editable .camera-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.passport-editable:hover .camera-overlay {
    opacity: 1;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   NOTICE BOARD - MOBILE RESPONSIVE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Composer collapse behaviour */
.composer-collapse-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.composer-collapse-content.active {
    max-height: 1200px;
    opacity: 1;
}

@media (max-width: 1024px) {
    /* Stack the broadcast grid on mobile */
    .broadcast-grid {
        grid-template-columns: 1fr !important;
    }

    /* Show the mobile composer trigger */
    #composer-mobile-trigger {
        display: flex !important;
    }

    /* Hide the desktop-only title */
    .notice-composer-mobile .desktop-only {
        display: none !important;
    }

    /* Collapse the composer by default on mobile */
    .composer-collapse-content {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
    }
    .composer-collapse-content.active {
        max-height: 1200px;
        opacity: 1;
    }

    /* Notice card mobile polish */
    .notice-card {
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }

    .notice-card h2 {
        font-size: 1.15rem !important;
    }
}

@media (min-width: 1025px) {
    /* On desktop, composer is always visible */
    .composer-collapse-content {
        max-height: none !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    #composer-mobile-trigger {
        display: none !important;
    }
}

/* Staff Detail Mobile Optimization */
@media (max-width: 768px) {
    .staff-detail-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }
    
    .staff-bio-card {
        padding: 1.25rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .staff-bio-card h2 {
        font-size: 1.3rem !important;
        word-break: break-word !important;
    }

    .staff-bio-card .passport-editable {
        width: 120px !important;
        height: 120px !important;
        border-radius: 24px !important;
    }
    
    #btn-staff-repair-auth {
        font-size: 0.7rem !important;
        padding: 0.75rem !important;
        white-space: normal !important;
        height: auto !important;
        line-height: 1.3 !important;
        width: 100% !important;
    }

.cbt-exam-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background: #f8fafc;
    overflow: hidden;
    z-index: 9999;
}

.cbt-exam-header {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cbt-exam-content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cbt-question-card {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 800px;
    margin-bottom: 0.5rem;
}

.cbt-question-map {
    flex-shrink: 0;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    border-top: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
}

.q-map-item {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.q-map-item.active {
    background: #4338ca;
    color: white;
    border-color: #4338ca;
}

.q-map-item.answered {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.cbt-exam-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .staff-bio-card > div {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .banner-flex-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }

    .banner-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .banner-actions button, .banner-actions div {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0.5rem !important;
        font-size: 0.8rem !important;
        min-height: 44px !important;
    }
    
    .banner-actions div {
        grid-column: span 2;
    }

    /* Teacher Dashboard Mobile Grid */
    .teacher-dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }

/* --- EXAM MODE & SINGLE SCREEN LAYOUT --- */
body.exam-mode {
    overflow: hidden !important;
    height: 100vh;
    width: 100vw;
}

body.exam-mode .sidebar, 
body.exam-mode .top-bar {
    display: none !important;
}

body.exam-mode main {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh;
    background: #f8fafc;
}

.cbt-exam-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background: #f8fafc;
    overflow: hidden;
    z-index: 9999;
}

.cbt-exam-header {
    flex: 0 0 auto;
    padding: 0.75rem 1.25rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.cbt-exam-timer-box {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: #4338ca;
    background: #eef2ff;
    padding: 0.4rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #c7d2fe;
}

.cbt-exam-content-area {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cbt-question-card {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 800px;
    margin-bottom: 1rem; /* Small margin instead of huge one */
}

.cbt-exam-footer {
    flex: 0 0 auto;
    padding: 0.75rem 1.25rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

/* Mobile Specific Tweaks */
@media (max-width: 640px) {
    .cbt-exam-header {
        padding: 0.75rem 1rem;
    }
    .cbt-exam-timer-box {
        font-size: 1.2rem;
    }
    .cbt-exam-content-area {
        padding: 1rem;
    }
    .cbt-question-card {
        padding: 1.25rem;
        border-radius: 16px;
    }
    .cbt-exam-footer {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .cbt-exam-footer button {
        padding: 0 1rem !important;
        font-size: 0.85rem !important;
        height: 44px !important;
    }
}

    .teacher-dashboard-main-grid > div {
        width: 100% !important;
    }

    .kpi-visualization-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .faculty-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .faculty-card {
        padding: 1.25rem !important;
    }

    .student-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .student-dashboard-grid > div {
        width: 100% !important;
        box-sizing: border-box;
    }

    .card {
        border-radius: 20px !important;
        padding: 1.5rem !important;
    }

    .banner-title {
        font-size: 1.5rem !important;
    }
}

/* Ticker Animation */
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.live-ticker-container {
    display: flex;
    align-items: center;
}

.live-ticker-container div {
    display: inline-block;
    padding-left: 20px; /* Small gap before start */
    animation: ticker 25s linear infinite;
    min-width: 100%;
}

.live-ticker-container:hover div {
    animation-play-state: paused;
}

/* Exam Mode - Full Screen Focus */
body.exam-mode #sidebar {
    transform: translateX(-100%);
    width: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.exam-mode .main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

body.exam-mode #mobile-menu-btn,
body.exam-mode .topbar {
    display: none !important;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   CBT PARTICIPANT CARDS - COLLAPSIBLE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.cbt-participant-card .participant-details {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.cbt-participant-card.expanded .participant-details {
    max-height: 500px;
    padding: 0 1.5rem;
}

.cbt-participant-card.expanded [data-lucide="chevron-down"] {
    transform: rotate(180deg);
}

.cbt-participant-card [data-lucide="chevron-down"] {
    transition: transform 0.3s ease;
}

/* Fix for white-on-white inputs in CBT modules */
.cbt-input {
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    font-weight: 600 !important;
}

.cbt-input:focus {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #4338ca !important;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1) !important;
}

.cbt-input option {
    color: #1e293b !important;
    background: #ffffff !important;
}

/* Ensure modal body text doesn't turn inputs white */
.modal-body select.cbt-input,
.modal-body textarea.cbt-input,
.modal-body input.cbt-input {
    color: #1e293b !important;
    background-color: #ffffff !important;
}



/* -----------------------------------------------------------
   GRADING INTELLIGENCE MODULE
   ----------------------------------------------------------- */
.insights-tab-bar { background:#f1f5f9; border-radius:16px; padding:6px; display:flex; gap:4px; flex-wrap:wrap; }
.insights-tab-btn { flex:1; min-width:120px; padding:.6rem 1rem; border:none; border-radius:12px; background:transparent; color:#94a3b8; font-weight:700; font-size:.8rem; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:.5rem; transition:all .3s cubic-bezier(.4,0,.2,1); white-space:nowrap; }
.insights-tab-btn.active { background:white; color:#1e3a8a; box-shadow:0 10px 15px -3px rgba(0,0,0,.1); }
.kpi-stat-card { background:white; border-radius:20px; padding:1.5rem; border:1px solid #f1f5f9; position:relative; overflow:hidden; transition:transform .2s ease,box-shadow .2s ease; }
.kpi-stat-card:hover { transform:translateY(-3px); box-shadow:0 12px 24px -6px rgba(0,0,0,.08); }
.kpi-stat-card .kpi-icon { width:48px; height:48px; border-radius:14px; display:flex; align-items:center; justify-content:center; margin-bottom:1rem; }
.kpi-stat-card .kpi-corner { position:absolute; top:1rem; right:1rem; color:#e2e8f0; }
.kpi-stat-card .kpi-value { font-size:2rem; font-weight:900; color:#1e293b; line-height:1; margin-bottom:.25rem; font-family:'Outfit',sans-serif; }
.kpi-stat-card .kpi-label { font-size:.75rem; font-weight:800; color:#94a3b8; text-transform:uppercase; letter-spacing:.05em; }
.kpi-stat-card .kpi-sub { font-size:.7rem; color:#cbd5e1; margin-top:.25rem; font-weight:600; }
.insights-progress-track { background:#f1f5f9; border-radius:99px; overflow:hidden; }
.insights-progress-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#1e3a8a,#3b82f6); box-shadow:0 0 12px rgba(59,130,246,.35); transition:width 1.5s cubic-bezier(.4,0,.2,1); }
.insights-progress-fill.complete { background:linear-gradient(90deg,#065f46,#10b981); }
.stream-sub-card { background:#f8fafc; border-radius:16px; padding:1.25rem; border:1px solid #e2e8f0; }
.btn-glass { background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.3); color:white; border-radius:10px; padding:.4rem 1rem; font-weight:700; font-size:.78rem; cursor:pointer; backdrop-filter:blur(4px); transition:all .2s; display:inline-flex; align-items:center; gap:.4rem; }
.btn-glass:hover { background:rgba(255,255,255,.25); }
.btn-premium { background:#1e3a8a; color:white; border:none; border-radius:10px; padding:.4rem 1rem; font-weight:700; font-size:.78rem; cursor:pointer; transition:all .2s; display:inline-flex; align-items:center; gap:.4rem; }
.btn-premium:hover { background:#1e40af; }
.comp-ok { color:#10b981; } .comp-missing { color:#cbd5e1; }
@keyframes insights-spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
.insights-spin { animation:insights-spin 1s linear infinite; }
@media(max-width:768px){.insights-tab-btn{font-size:.72rem;padding:.5rem .6rem;min-width:80px;}.kpi-stat-card .kpi-value{font-size:1.5rem;}}

 / *   C B T   E x a m   P r o t e c t i o n   * / 
 b o d y . e x a m - m o d e   { 
         u s e r - s e l e c t :   n o n e   ! i m p o r t a n t ; 
         - w e b k i t - u s e r - s e l e c t :   n o n e   ! i m p o r t a n t ; 
         - m o z - u s e r - s e l e c t :   n o n e   ! i m p o r t a n t ; 
         - m s - u s e r - s e l e c t :   n o n e   ! i m p o r t a n t ; 
 } 
 
 b o d y . e x a m - m o d e   . c b t - e x a m - c o n t a i n e r   { 
         f i l t e r :   n o n e ; 
         t r a n s i t i o n :   f i l t e r   0 . 3 s   e a s e ; 
 } 
 
 / *   B l u r   c o n t e n t   i f   w i n d o w   l o s e s   f o c u s   t o   d e t e r   s c r e e n s h o t s   * / 
 w i n d o w - b l u r r e d   b o d y . e x a m - m o d e   . c b t - e x a m - c o n t a i n e r   { 
         f i l t e r :   b l u r ( 1 5 p x ) ; 
 } 
  
 
/* CBT Exam Protection */
body.exam-mode {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

body.exam-mode .cbt-exam-container {
    filter: none;
    transition: filter 0.3s ease;
}

/* Blur content if window loses focus to deter screenshots */
body.window-blurred.exam-mode .cbt-exam-container {
    filter: blur(15px);
}

/* =============================================
   PREMIUM SPLASH SCREEN
   ============================================= */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1e40af 0%, #1e1b4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.splash-logo {
    position: relative;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.splash-logo i {
    width: 48px;
    height: 48px;
    color: white;
}

.splash-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid white;
    border-radius: 24px;
    animation: splash-ripple 2s infinite;
    opacity: 0;
}

@keyframes splash-ripple {
    0% { width: 100%; height: 100%; opacity: 0.5; }
    100% { width: 180%; height: 180%; opacity: 0; }
}

.splash-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.splash-loader-bar {
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: white;
    animation: splash-loading 1.5s infinite ease-in-out;
}

@keyframes splash-loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
