/* ============================================================
   css/admindashboard.css
   OPTIMIZED FAST DASHBOARD STYLES - NO GLASSMORPHISM
   ============================================================ */

/* ============================================================
   ROOT VARIABLES
   ============================================================ */
:root {
    --primary: #0A3D62;
    --primary-light: #1a5a7a;
    --primary-dark: #052538;
    --primary-gradient: linear-gradient(135deg, #0A3D62 0%, #1a5a7a 50%, #2d7a9e 100%);
    --accent: #FDB913;
    --accent-gradient: linear-gradient(135deg, #FDB913, #f59e0b);
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --purple: #8B5CF6;
    --pink: #EC4899;
    --indigo: #6366F1;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f4f8;
    background-image:
        radial-gradient(ellipse at 10% 20%, rgba(10, 61, 98, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(253, 185, 19, 0.03) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    color: #1a1a2e;
}

/* ============================================================
   ANIMATIONS - LIGHTWEIGHT
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseRed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SIDEBAR - FAST (No Glassmorphism)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 270px;
    height: 100vh;
    background: linear-gradient(180deg, #0A3D62 0%, #073450 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable Sidebar Area */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 6px 8px 6px;
    scroll-behavior: smooth;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 3px;
}
.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Sidebar Brand - Simple & Fast */
.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(10, 61, 98, 0.98);
    position: sticky;
    top: 0;
    z-index: 5;
}

.sidebar-brand .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #0A3D62;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(253, 185, 19, 0.2);
}

.sidebar-brand .brand-text h2 {
    color: white;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.sidebar-brand .brand-text h2 span {
    color: var(--accent);
}
.sidebar-brand .brand-text small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

/* Sidebar Menu - Fast */
.sidebar-menu {
    list-style: none;
    padding: 6px 4px;
    margin: 0;
}

.sidebar-menu .menu-label {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px 4px;
    font-weight: 700;
    position: sticky;
    top: 0;
    background: rgba(10, 61, 98, 0.95);
    z-index: 2;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    font-size: 0.78rem;
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.sidebar-menu li a i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.sidebar-menu li a.active {
    background: rgba(253, 185, 19, 0.1);
    color: var(--accent);
}

.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

/* Sidebar Badges - Fast */
.badge-sidebar {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.5rem;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.08);
    flex-shrink: 0;
}
.badge-sidebar.success {
    background: rgba(16, 185, 129, 0.15);
    color: #6EE7B7;
    border-color: rgba(16, 185, 129, 0.08);
}
.badge-sidebar.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #FCD34D;
    border-color: rgba(245, 158, 11, 0.08);
}

/* Sidebar Footer - Fast */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    background: rgba(10, 61, 98, 0.98);
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
}

.user-card .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0A3D62;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.user-card .info .name {
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}
.user-card .info .role {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.55rem;
}

.logout-btn-sidebar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xs);
    color: rgba(255, 255, 255, 0.35);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn-sidebar:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.08);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}
.sidebar-overlay.active {
    display: block;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: 270px;
    padding: 20px 28px 32px;
    min-height: 100vh;
    width: 100%;
    flex: 1;
}

/* ============================================================
   TOP HEADER - FAST (No Blur)
   ============================================================ */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.page-title h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0A3D62;
    letter-spacing: -0.3px;
}
.page-title h1 i {
    color: var(--primary);
    margin-right: 6px;
}
.page-title p {
    font-size: 0.7rem;
    color: #94A3B8;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-toggle {
    display: none;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-xs);
    width: 36px;
    height: 36px;
    font-size: 1rem;
    color: #0A3D62;
    cursor: pointer;
    transition: var(--transition);
}
.mobile-toggle:hover {
    background: #F8FAFC;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #F8FAFC;
    border-radius: 50px;
    border: 1px solid #E2E8F0;
}
.admin-profile .admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}
.admin-profile .admin-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1a1a2e;
}
.admin-profile .admin-email {
    font-size: 0.6rem;
    color: #94A3B8;
}

/* Notification Bell - Fast */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.notification-bell:hover {
    background: #F1F5F9;
}
.notification-bell i {
    font-size: 0.95rem;
    color: #64748B;
}
.notification-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.45rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification Panel */
.notification-panel {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    width: 360px;
    max-height: 420px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    overflow: hidden;
}
.notification-panel.show {
    display: block;
    animation: slideDown 0.25s ease;
}
.notification-header {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.85rem;
}
.notification-list {
    max-height: 340px;
    overflow-y: auto;
}
.notification-item {
    padding: 10px 14px;
    border-bottom: 1px solid #E2E8F0;
    cursor: pointer;
}
.notification-item:hover {
    background: #F8FAFC;
}
.notification-item.unread {
    background: #FEF3C7;
    border-left: 3px solid #F59E0B;
}
.notification-item.critical {
    background: #FEE2E2;
    border-left: 3px solid #DC2626;
}
.notification-title {
    font-weight: 700;
    font-size: 0.75rem;
}
.notification-detail {
    font-size: 0.65rem;
    color: #64748B;
}
.notification-time {
    font-size: 0.55rem;
    color: #94A3B8;
    margin-top: 2px;
}
.mark-read-btn {
    font-size: 0.6rem;
    background: none;
    border: none;
    color: #3B82F6;
    cursor: pointer;
    margin-top: 2px;
}

/* ============================================================
   SECTION CONTAINER
   ============================================================ */
.section-container {
    display: none;
    animation: fadeIn 0.3s ease;
}
.section-container.active {
    display: block;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stat-card .icon.blue { background: #DBEAFE; color: #1E40AF; }
.stat-card .icon.green { background: #D1FAE5; color: #065F46; }
.stat-card .icon.yellow { background: #FEF3C7; color: #92400E; }
.stat-card .icon.purple { background: #EDE9FE; color: #5B21B6; }
.stat-card .icon.red { background: #FEE2E2; color: #991B1B; }
.stat-card .icon.indigo { background: #E0E7FF; color: #3730A3; }

.stat-card .info .number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0A3D62;
    line-height: 1.2;
}
.stat-card .info .label {
    font-size: 0.65rem;
    color: #94A3B8;
    font-weight: 500;
}

/* ============================================================
   FILTERS - FAST
   ============================================================ */
.filters-container {
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.filter-group {
    display: flex;
    flex-direction: column;
}
.filter-group label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.7rem;
}
.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.8rem;
}
.filter-group select:focus,
.filter-group input:focus {
    border-color: #FDB913;
    outline: none;
}
.search-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   BUTTONS - FAST
   ============================================================ */
.btn {
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--primary-gradient); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(10, 61, 98, 0.2); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; transform: translateY(-1px); }
.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #2563EB; transform: translateY(-1px); }
.btn-release { background: var(--purple); color: white; }
.btn-release:hover { background: #7C3AED; transform: translateY(-1px); }
.btn-secondary { background: #F1F5F9; color: #475569; }
.btn-secondary:hover { background: #E2E8F0; }
.btn-reset-student { background: var(--danger); color: white; }
.btn-reset-student:hover { background: #DC2626; transform: translateY(-1px); }
.btn-sm { padding: 3px 8px; font-size: 0.6rem; border-radius: 6px; }

/* ============================================================
   TABLES - FAST
   ============================================================ */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 8px;
}
.table-header h2 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0A3D62;
}
.table-header h2 i {
    margin-right: 6px;
    color: var(--primary);
}
.table-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow-x: auto;
}
.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.table-wrap th {
    background: #F8FAFC;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1.5px solid #E2E8F0;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.table-wrap td {
    padding: 8px 12px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
    color: #1a1a2e;
}
.table-wrap tbody tr:hover {
    background: #F8FAFC;
}

/* Status Badges - Fast */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 600;
}
.status-badge.active { background: #D1FAE5; color: #064E3B; }
.status-badge.pending { background: #FEF3C7; color: #92400E; }
.status-badge.completed { background: #E2E8F0; color: #475569; }
.status-badge.passed { background: #D1FAE5; color: #064E3B; }
.status-badge.failed { background: #FEE2E2; color: #991B1B; }
.status-badge.critical { background: #FEE2E2; color: #991B1B; animation: pulseRed 1.5s infinite; }

.status-pass { background: #D1FAE5; color: #065F46; padding: 2px 8px; border-radius: 20px; display: inline-block; font-size: 0.6rem; font-weight: 600; }
.status-fail { background: #FEE2E2; color: #7F1D1D; padding: 2px 8px; border-radius: 20px; display: inline-block; font-size: 0.6rem; font-weight: 600; }
.status-pending { background: #DBEAFE; color: #1E40AF; padding: 2px 8px; border-radius: 20px; display: inline-block; font-size: 0.6rem; font-weight: 600; }

.student-id-badge {
    font-family: monospace;
    background: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #475569;
}

/* Action Buttons */
.action-btn {
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    margin: 1px;
    transition: all 0.2s;
}
.btn-view { background: #4299E1; color: white; }
.btn-view:hover { background: #3182CE; }
.btn-edit { background: #F59E0B; color: white; }
.btn-edit:hover { background: #D97706; }
.btn-delete { background: #DC2626; color: white; }
.btn-delete:hover { background: #B91C1C; }
.btn-assign { background: #38A169; color: white; }
.btn-assign:hover { background: #2F855A; }
.btn-reset { background: #8B5CF6; color: white; }
.btn-reset:hover { background: #7C3AED; }

/* Exam Type Badges */
.exam-type-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 600;
}
.badge-cat { background: #FEF3C7; color: #92400E; }
.badge-exam { background: #DBEAFE; color: #1E40AF; }

/* Exam Status Toggle */
.exam-status-toggle {
    display: flex;
    gap: 4px;
    background: #F1F5F9;
    padding: 3px;
    border-radius: 30px;
}
.status-toggle-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.65rem;
    transition: all 0.2s;
}
.status-toggle-btn.active {
    background: #0A3D62;
    color: white;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 3px;
    background: #F1F5F9;
    padding: 3px;
    border-radius: 30px;
}
.view-toggle-btn {
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.65rem;
    transition: all 0.2s;
    color: #64748B;
}
.view-toggle-btn.active {
    background: #0A3D62;
    color: white;
}
.view-toggle-btn:hover:not(.active) {
    background: #E2E8F0;
}

/* Publish Toggle */
.publish-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.publish-toggle input {
    width: 32px;
    height: 16px;
    appearance: none;
    background: #CBD5E1;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}
.publish-toggle input:checked {
    background: #10B981;
}
.publish-toggle input::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}
.publish-toggle input:checked::before {
    left: 18px;
}

/* Clickable Scores */
.clickable-score, .clickable-percentage {
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}
.clickable-score:hover, .clickable-percentage:hover {
    background: #DBEAFE;
}

/* Timers */
.exam-timer-cell {
    min-width: 80px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.page-btn {
    padding: 3px 10px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}
.page-btn:hover {
    background: #F1F5F9;
}
.page-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* ============================================================
   MODALS - FAST
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
    width: 90%;
}
.close-modal {
    float: right;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s;
}
.close-modal:hover {
    color: #DC2626;
}

/* ============================================================
   FORM GROUPS
   ============================================================ */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.8rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.8rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #FDB913;
    outline: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.reset-info-card {
    background: #F0FDF4;
    padding: 12px;
    border-radius: 10px;
    margin-top: 12px;
    border-left: 3px solid #10B981;
}
.reset-error-card {
    background: #FEE2E2;
    padding: 12px;
    border-radius: 10px;
    margin-top: 12px;
    border-left: 3px solid #DC2626;
    color: #B91C1C;
}

/* ============================================================
   LOADING & EMPTY STATE
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #94A3B8;
    gap: 8px;
    font-size: 0.8rem;
}
.loading i {
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 30px 16px;
    color: #94A3B8;
}
.empty-state i {
    font-size: 2rem;
    color: #CBD5E1;
    margin-bottom: 8px;
    display: block;
}
.empty-state h3 {
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}
.empty-state p {
    font-size: 0.8rem;
}

/* ============================================================
   ATTENDANCE SHEET - FAST
   ============================================================ */
.attendance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.attendance-stat-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    border: 1px solid #E2E8F0;
}
.attendance-stat-card .stat-icon {
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.attendance-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}
.attendance-stat-card .stat-label {
    font-size: 0.6rem;
    color: #94A3B8;
    font-weight: 500;
}
.attendance-stat-card .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0A3D62;
}
.attendance-stat-card.present .stat-value { color: #38A169; }
.attendance-stat-card.absent .stat-value { color: #DC2626; }
.attendance-stat-card.in-progress .stat-value { color: #F59E0B; }
.attendance-stat-card.completed .stat-value { color: #0A3D62; }
.attendance-stat-card.live .stat-value { color: #3B82F6; }

.attendance-filters {
    padding: 10px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.attendance-filters select,
.attendance-filters input {
    padding: 6px 10px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    min-width: 120px;
}
.attendance-filters select:focus,
.attendance-filters input:focus {
    outline: none;
    border-color: #0A3D62;
}
.attendance-filters label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.attendance-summary-bar {
    padding: 8px 16px;
    background: #F0FDF4;
    border-bottom: 1px solid #D1FAE5;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.attendance-summary-bar .summary-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
}
.attendance-summary-bar .summary-item .num {
    font-weight: 700;
    color: #0A3D62;
}
.attendance-summary-bar .summary-item .num.present { color: #38A169; }
.attendance-summary-bar .summary-item .num.absent { color: #DC2626; }
.attendance-summary-bar .summary-item .num.in-progress { color: #F59E0B; }
.attendance-summary-bar .summary-item .num.live { color: #3B82F6; }

.progress-bar-attendance {
    height: 4px;
    background: #E2E8F0;
    border-radius: 3px;
    overflow: hidden;
    flex: 1;
    min-width: 80px;
}
.progress-bar-attendance .progress-fill-attendance {
    height: 100%;
    background: linear-gradient(90deg, #38A169, #0A3D62);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.attendance-table-wrap {
    overflow-x: auto;
    padding: 0 16px 16px;
}
.attendance-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.attendance-table-wrap th {
    background: #F8FAFC;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}
.attendance-table-wrap td {
    padding: 6px 10px;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}
.attendance-table-wrap tbody tr:hover {
    background: #F8FAFC;
}

.attendance-empty {
    text-align: center;
    padding: 30px;
    color: #94A3B8;
}
.attendance-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.status-badge-attendance {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 600;
}
.status-badge-attendance.present { background: #D1FAE5; color: #064E3B; }
.status-badge-attendance.absent { background: #FEE2E2; color: #991B1B; }
.status-badge-attendance.in-progress { background: #FEF3C7; color: #92400E; }
.status-badge-attendance.signed-in { background: #DBEAFE; color: #1E40AF; }
.status-badge-attendance.completed { background: #D1FAE5; color: #064E3B; }

/* ============================================================
   LIVE VIDEO - FAST
   ============================================================ */
.live-video-container {
    width: 180px;
    height: 120px;
    background: #1a1a2e;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.live-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a2e;
}
.live-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(0, 0, 0, 0.7);
    color: #4ADE80;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
    gap: 3px;
}
.live-badge .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #4ADE80;
    border-radius: 50%;
    animation: pulse-dot 1s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.video-controls {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    display: flex;
    gap: 3px;
    justify-content: center;
}
.video-controls button {
    padding: 1px 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.5rem;
    cursor: pointer;
}
.video-controls button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-placeholder {
    width: 180px;
    height: 120px;
    background: #F8FAFC;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 2px dashed #E2E8F0;
}
.video-placeholder i {
    font-size: 1.5rem;
    color: #94A3B8;
}
.video-placeholder span {
    font-size: 0.55rem;
    color: #94A3B8;
}

/* ============================================================
   LIVE FEED CARDS - FAST
   ============================================================ */
.live-feed-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}
.live-feed-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.live-feed-card.violation {
    border-color: #DC2626;
}
.live-feed-card.warning {
    border-color: #F59E0B;
}

.live-feed-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.live-feed-card .student-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-feed-card .student-info .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.live-feed-card .student-info .name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #0A3D62;
}
.live-feed-card .student-info .details {
    font-size: 0.6rem;
    color: #94A3B8;
}

.live-feed-card .card-body {
    position: relative;
    background: #1a1a2e;
    min-height: 180px;
}
.live-feed-card .card-body img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.live-feed-card .no-camera {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: white;
    flex-direction: column;
    gap: 10px;
    background: #1a1a2e;
}
.live-feed-card .no-camera i {
    font-size: 2.5rem;
    opacity: 0.5;
}
.live-feed-card .no-camera p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.live-feed-card .progress-bar-container {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.live-feed-card .progress-track {
    height: 3px;
    background: #E2E8F0;
    border-radius: 3px;
    overflow: hidden;
}
.live-feed-card .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.live-feed-card .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #94A3B8;
    margin-top: 2px;
}

.live-feed-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #F8FAFC;
    flex-wrap: wrap;
    gap: 6px;
}
.live-feed-card .card-footer .info-item {
    font-size: 0.65rem;
    color: #64748B;
}
.live-feed-card .card-footer .info-item i {
    margin-right: 3px;
}
.live-feed-card .actions {
    display: flex;
    gap: 4px;
}
.live-feed-card .btn-view-cam {
    padding: 3px 10px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: var(--transition);
}
.live-feed-card .btn-view-cam:hover {
    transform: scale(1.05);
}
.live-feed-card .btn-alert {
    padding: 3px 6px;
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.overlay-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.55rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}
.overlay-badge.camera-on {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}
.overlay-badge.camera-off {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}
.overlay-badge.violation {
    background: rgba(220, 38, 38, 0.9);
    color: white;
    animation: pulseRed 1.5s infinite;
}

/* ============================================================
   NO RESULTS
   ============================================================ */
.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: #94A3B8;
}
.no-results i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ============================================================
   RESPONSIVE - OPTIMIZED
   ============================================================ */
@media (max-width: 1024px) {
    .main-content {
        padding: 14px 18px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 10px 12px;
    }
    .mobile-toggle {
        display: block;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .admin-profile .admin-email {
        display: none;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 12px 14px;
    }
    .stat-card .info .number {
        font-size: 1rem;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .table-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .attendance-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 8px 10px;
    }
    .attendance-stat-card {
        padding: 6px 10px;
    }
    .attendance-stat-card .stat-value {
        font-size: 0.9rem;
    }
    .live-video-container {
        width: 120px;
        height: 80px;
    }
    .video-placeholder {
        width: 120px;
        height: 80px;
    }
    .attendance-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .attendance-filters select,
    .attendance-filters input {
        width: 100%;
        min-width: unset;
    }
    .attendance-summary-bar {
        gap: 6px;
        font-size: 0.65rem;
    }
    .live-feed-card .card-body img {
        height: 130px;
    }
    .live-feed-card .no-camera {
        height: 130px;
    }
    .notification-panel {
        width: 300px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card .icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .page-title h1 {
        font-size: 0.9rem;
    }
    .admin-profile {
        padding: 2px 8px 2px 2px;
    }
    .admin-profile .admin-name {
        font-size: 0.6rem;
    }
    .attendance-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .live-feed-card .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .live-feed-card .actions {
        width: 100%;
        justify-content: flex-start;
    }
}
/* ============================================================
   MODERN TABLES - Automatic Upgrade
   ============================================================ */

/* All tables inside main-content get modern styling */
.main-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
    font-size: 0.82rem;
}

/* Modern Table Headers */
.main-content table thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    background: transparent;
    border-bottom: 2px solid rgba(10, 61, 98, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.main-content table thead th i {
    margin-right: 6px;
    color: #0A3D62;
    opacity: 0.6;
}

/* Modern Table Rows - Card Style */
.main-content table tbody tr {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: default;
    /* Rows must never depend on an animation to become visible. */
    animation: none;
    opacity: 1;
    visibility: visible;
}

.main-content table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(10, 61, 98, 0.08);
    background: white;
}

.main-content table tbody td {
    padding: 14px 18px;
    vertical-align: middle;
    border-bottom: none;
    background: transparent;
}

/* First cell - rounded left corner */
.main-content table tbody tr td:first-child {
    border-radius: 14px 0 0 14px;
    padding-left: 20px;
}

/* Last cell - rounded right corner */
.main-content table tbody tr td:last-child {
    border-radius: 0 14px 14px 0;
    padding-right: 20px;
}

/* Row animation delays */
.main-content table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.main-content table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.main-content table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.main-content table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.main-content table tbody tr:nth-child(5) { animation-delay: 0.10s; }
.main-content table tbody tr:nth-child(6) { animation-delay: 0.12s; }
.main-content table tbody tr:nth-child(7) { animation-delay: 0.14s; }
.main-content table tbody tr:nth-child(8) { animation-delay: 0.16s; }
.main-content table tbody tr:nth-child(9) { animation-delay: 0.18s; }
.main-content table tbody tr:nth-child(10) { animation-delay: 0.20s; }

/* Modern Status Badges */
.main-content table .status-pass {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #064E3B;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.main-content table .status-fail {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.main-content table .status-pending {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(245, 158, 11, 0.15);
    animation: pulse-gold 2s infinite;
}

/* Modern Student ID */
.main-content table .student-id-badge {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.7rem;
    background: rgba(10, 61, 98, 0.04);
    padding: 2px 10px;
    border-radius: 6px;
    color: #0A3D62;
    letter-spacing: 0.3px;
    border: 1px solid rgba(10, 61, 98, 0.04);
}

/* Modern Score */
.main-content table .clickable-score,
.main-content table .clickable-percentage {
    font-weight: 700;
    color: #0A3D62;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(10, 61, 98, 0.03);
    display: inline-block;
    font-size: 0.85rem;
    transition: all 0.2s;
    cursor: pointer;
}

.main-content table .clickable-score:hover,
.main-content table .clickable-percentage:hover {
    background: rgba(10, 61, 98, 0.06);
    transform: scale(1.02);
}

/* Modern Action Buttons */
.main-content table .action-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.main-content table .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.main-content table .btn-view {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD);
    color: #1E40AF;
}

.main-content table .btn-edit {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.main-content table .btn-delete {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
}

.main-content table .btn-assign {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #064E3B;
}

.main-content table .btn-reset {
    background: linear-gradient(135deg, #EDE9FE, #C4B5FD);
    color: #5B21B6;
}

.main-content table .btn-info {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD);
    color: #1E40AF;
}

.main-content table .btn-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.main-content table .btn-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #064E3B;
}

.main-content table .btn-reset-student {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
}

/* Modern Exam Type Badge */
.main-content table .exam-type-badge {
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.6rem;
    font-weight: 600;
    display: inline-block;
}

.main-content table .badge-cat {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.main-content table .badge-exam {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD);
    color: #1E40AF;
}

/* Modern Timer */
.main-content table .exam-timer-cell {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 8px;
    display: inline-block;
    background: rgba(10, 61, 98, 0.03);
    border: 1px solid rgba(10, 61, 98, 0.06);
}

/* Status Classes */
.main-content table .status-active {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #064E3B;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.main-content table .status-completed {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD);
    color: #1E40AF;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.main-content table .status-critical {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #991B1B;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(239, 68, 68, 0.15);
    animation: pulse-red 1.5s infinite;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-gold {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
/* ============================================================
   ULTRA MODERN TABLES - FIX FOR YOUR DASHBOARD
   ============================================================ */

/* Target tables inside main-content */
.main-content .table-container table,
.main-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.82rem;
}

/* --- MODERN HEADERS --- */
.main-content .table-container table thead th,
.main-content table thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
    background: transparent !important;
    border-bottom: none !important;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.main-content .table-container table thead th i,
.main-content table thead th i {
    margin-right: 6px;
    color: #0A3D62;
    opacity: 0.5;
}

/* Remove old header background */
.main-content .table-container table thead tr,
.main-content table thead tr {
    background: transparent !important;
}

/* --- MODERN ROWS AS CARDS --- */
.main-content .table-container table tbody tr,
.main-content table tbody tr {
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
    transition: box-shadow 0.2s ease, background-color 0.2s ease !important;
    /* Do not hide rows while waiting for slideUp animation. */
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    border-bottom: none !important;
}

.main-content .table-container table tbody tr:hover,
.main-content table tbody tr:hover {
    transform: translateY(-4px) scale(1.005) !important;
    box-shadow: 0 12px 40px rgba(10, 61, 98, 0.08) !important;
    background: white !important;
}

/* Remove old row borders */
.main-content .table-container table tbody tr td,
.main-content table tbody tr td {
    border-bottom: none !important;
    padding: 14px 18px;
    vertical-align: middle;
    background: transparent !important;
}

/* --- ROUNDED CORNERS --- */
.main-content .table-container table tbody tr td:first-child,
.main-content table tbody tr td:first-child {
    border-radius: 16px 0 0 16px !important;
    padding-left: 22px !important;
}

.main-content .table-container table tbody tr td:last-child,
.main-content table tbody tr td:last-child {
    border-radius: 0 16px 16px 0 !important;
    padding-right: 22px !important;
}

/* --- STATUS BADGES - GRADIENT --- */
.main-content table .status-pass,
.main-content table .status-pass.status-badge {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0) !important;
    color: #064E3B !important;
    padding: 4px 16px !important;
    border-radius: 50px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    border: 1px solid rgba(16, 185, 129, 0.15) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08) !important;
}

.main-content table .status-fail,
.main-content table .status-fail.status-badge {
    background: linear-gradient(135deg, #FEE2E2, #FECACA) !important;
    color: #991B1B !important;
    padding: 4px 16px !important;
    border-radius: 50px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08) !important;
}

.main-content table .status-pending,
.main-content table .status-pending.status-badge {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A) !important;
    color: #92400E !important;
    padding: 4px 16px !important;
    border-radius: 50px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    border: 1px solid rgba(245, 158, 11, 0.15) !important;
    animation: pulse-gold 2s infinite !important;
}

/* --- STUDENT ID BADGE --- */
.main-content table .student-id-badge {
    font-family: 'Courier New', monospace !important;
    font-weight: 600 !important;
    font-size: 0.7rem !important;
    background: rgba(10, 61, 98, 0.04) !important;
    padding: 4px 12px !important;
    border-radius: 8px !important;
    color: #0A3D62 !important;
    letter-spacing: 0.3px !important;
    border: 1px solid rgba(10, 61, 98, 0.06) !important;
    display: inline-block !important;
}

/* --- SCORE & PERCENTAGE --- */
.main-content table .clickable-score,
.main-content table .clickable-percentage {
    font-weight: 700 !important;
    color: #0A3D62 !important;
    padding: 4px 14px !important;
    border-radius: 10px !important;
    background: rgba(10, 61, 98, 0.03) !important;
    display: inline-block !important;
    font-size: 0.85rem !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
    border: 1px solid rgba(10, 61, 98, 0.04) !important;
}

.main-content table .clickable-score:hover,
.main-content table .clickable-percentage:hover {
    background: rgba(10, 61, 98, 0.06) !important;
    transform: scale(1.03) !important;
    box-shadow: 0 2px 12px rgba(10, 61, 98, 0.06) !important;
}

/* --- ACTION BUTTONS --- */
.main-content table .action-btn {
    padding: 5px 14px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    letter-spacing: 0.3px !important;
    margin: 2px !important;
}

.main-content table .action-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Button variants */
.main-content table .btn-view {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD) !important;
    color: #1E40AF !important;
}

.main-content table .btn-edit {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A) !important;
    color: #92400E !important;
}

.main-content table .btn-delete {
    background: linear-gradient(135deg, #FEE2E2, #FECACA) !important;
    color: #991B1B !important;
}

.main-content table .btn-assign {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0) !important;
    color: #064E3B !important;
}

.main-content table .btn-reset {
    background: linear-gradient(135deg, #EDE9FE, #C4B5FD) !important;
    color: #5B21B6 !important;
}

.main-content table .btn-info {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD) !important;
    color: #1E40AF !important;
}

.main-content table .btn-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A) !important;
    color: #92400E !important;
}

.main-content table .btn-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0) !important;
    color: #064E3B !important;
}

.main-content table .btn-reset-student {
    background: linear-gradient(135deg, #FEE2E2, #FECACA) !important;
    color: #991B1B !important;
}

.main-content table .btn-release {
    background: linear-gradient(135deg, #EDE9FE, #C4B5FD) !important;
    color: #5B21B6 !important;
}

/* --- EXAM TYPE BADGES --- */
.main-content table .exam-type-badge {
    padding: 2px 14px !important;
    border-radius: 50px !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin-left: 4px !important;
}

.main-content table .badge-cat {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A) !important;
    color: #92400E !important;
}

.main-content table .badge-exam {
    background: linear-gradient(135deg, #DBEAFE, #93C5FD) !important;
    color: #1E40AF !important;
}

/* --- TIMER --- */
.main-content table .exam-timer-cell {
    font-family: 'Courier New', monospace !important;
    font-weight: 700 !important;
    font-size: 0.7rem !important;
    padding: 4px 14px !important;
    border-radius: 10px !important;
    display: inline-block !important;
    background: rgba(10, 61, 98, 0.03) !important;
    border: 1px solid rgba(10, 61, 98, 0.06) !important;
}

/* --- ANIMATIONS --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse-gold {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .main-content .table-container table,
    .main-content table {
        font-size: 0.7rem;
    }
    
    .main-content .table-container table tbody td,
    .main-content table tbody td {
        padding: 10px 12px !important;
    }
    
    .main-content .table-container table tbody tr td:first-child,
    .main-content table tbody tr td:first-child {
        padding-left: 14px !important;
    }
    
    .main-content .table-container table tbody tr td:last-child,
    .main-content table tbody tr td:last-child {
        padding-right: 14px !important;
    }
    
    .main-content table .action-btn {
        padding: 3px 10px !important;
        font-size: 0.55rem !important;
    }
}


/* ============================================================
   GLOBAL MOBILE TABLE SAFETY
   All admin modules share this stylesheet. Keep table content
   visible and let wide tables scroll inside their own containers.
   ============================================================ */
.main-content table tbody,
.main-content table tbody tr,
.main-content table tbody td{
  visibility:visible!important;
}
.main-content table tbody tr{
  opacity:1!important;
  animation:none!important;
  transform:none;
}
.main-content .table-wrap,
.main-content .attendance-table-wrap,
.main-content .table-container,
.main-content [style*="overflow-x: auto"],
.main-content [style*="overflow-x:auto"]{
  max-width:100%;
  -webkit-overflow-scrolling:touch;
}
@media(max-width:768px){
  .main-content table{
    max-width:none;
  }
  .main-content table tbody tr:hover{
    transform:none!important;
  }
  .main-content .table-wrap,
  .main-content .attendance-table-wrap,
  .main-content .table-container,
  .main-content [style*="overflow-x: auto"],
  .main-content [style*="overflow-x:auto"]{
    overflow-x:auto!important;
    overflow-y:visible;
  }
}
