/* --- Student Dashboard Custom Styles --- */
:root {
    --cbt-blue-950: #0f2b4d;
    --cbt-blue-900: #1e3a5f;
    --cbt-blue-800: #1e40af;
    --cbt-blue-700: #1d4ed8;
    --cbt-blue-600: #2563eb;
    --cbt-blue-500: #3b82f6;
    --cbt-blue-100: #dbeafe;
    --cbt-blue-50: #eff6ff;
    --primary-gradient: linear-gradient(135deg, var(--cbt-blue-900) 0%, var(--cbt-blue-600) 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --info-gradient: linear-gradient(135deg, var(--cbt-blue-500) 0%, var(--cbt-blue-600) 100%);
    --app-page-max-width: 100%;
    --app-page-gutter: 0;
    --app-page-top: 0;
    --app-page-bottom: 2rem;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-content-shell {
    width: 100%;
    max-width: var(--app-page-max-width);
    margin: 0 auto;
    padding: var(--app-page-top) var(--app-page-gutter) var(--app-page-bottom);
    min-width: 0;
}

.admin-main > .flash-stack {
    width: 100%;
    max-width: var(--app-page-max-width);
    margin: 0 auto;
    margin-top: 0;
    padding: var(--app-page-top) var(--app-page-gutter) 0;
}

.admin-main > .flash-stack + .app-content-shell {
    padding-top: 0;
}

.app-content-shell > .max-w-7xl,
.app-content-shell > .max-w-6xl,
.app-content-shell > .max-w-5xl,
.app-content-shell > .max-w-4xl,
.app-content-shell > .max-w-3xl,
.app-content-shell > .max-w-xl,
.app-content-shell > .container,
.app-content-shell > .dashboard-container,
.app-content-shell > .student-dashboard-container {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    min-width: 0 !important;
}

.app-content-shell > .dashboard-container,
.app-content-shell > .student-dashboard-container {
    min-height: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Close top and horizontal spacing on role-specific page shells. */
.app-content-shell > :is(
    .teacher-admin-page,
    .profile-page,
    .manage-users-page,
    .students-page,
    .registration-shell,
    .exams-page,
    .exams-container,
    .class-subjects-shell,
    .assign-page-shell,
    .create-page-shell,
    .session-page-shell,
    .class-edit-shell,
    .edit-user-page,
    .notification-page,
    .subjects-page,
    .exam-view-page,
    .question-create-page,
    .question-edit-page,
    .move-shell
) {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.app-content-shell :is(
    .teacher-admin-shell,
    .profile-shell,
    .subjects-shell,
    .exams-shell,
    .exams-filter-shell,
    .dashboard-shell,
    .move-shell
) {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.overflow-x-auto,
.table-container,
.table-wrap,
.results-table-container,
.teacher-results-table-wrap,
.teacher-table-wrap,
.students-table-wrap {
    -webkit-overflow-scrolling: touch;
}

/* Shared page hero/header treatment */
:root {
    --app-hero-gradient: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    --app-hero-radius: 24px;
    --app-hero-padding: 2.25rem;
    --app-hero-margin-bottom: 1rem;
    --app-hero-shadow: 0 22px 44px -24px rgba(37, 99, 235, 0.55);
    --app-hero-border: rgba(255, 255, 255, 0.16);
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
) {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate !important;
    margin: 0 0 var(--app-hero-margin-bottom) !important;
    padding: var(--app-hero-padding) !important;
    border: 1px solid var(--app-hero-border) !important;
    border-radius: var(--app-hero-radius) !important;
    background: var(--app-hero-gradient) !important;
    box-shadow: var(--app-hero-shadow) !important;
    color: #fff !important;
}

.manage-users-page .users-page-header {
    margin-bottom: var(--app-hero-margin-bottom) !important;
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
)::before {
    content: "" !important;
    position: absolute !important;
    inset: -35% -20% auto auto !important;
    width: 24rem !important;
    height: 24rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 68%) !important;
    pointer-events: none !important;
    z-index: -1 !important;
    animation: none !important;
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
)::after {
    content: "" !important;
    position: absolute !important;
    inset: auto auto -45% -10% !important;
    width: 18rem !important;
    height: 18rem !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%) !important;
    pointer-events: none !important;
    z-index: -1 !important;
    animation: none !important;
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
) > * {
    position: relative;
    z-index: 1;
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
) :is(h1, h2) {
    margin: 0 !important;
    color: #fff !important;
    font-size: 2.15rem !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
}

:is(
    .student-welcome-header,
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero
) p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

:is(
    .assignment-header-meta,
    .create-header-stats,
    .students-hero-meta,
    .question-bank-hero-meta,
    .assign-header-stats,
    .upload-header-meta,
    .edit-header-meta,
    .move-hero-stats,
    .teacher-hero-meta,
    .exams-hero-strip,
    .hero-actions,
    .question-edit-hero-actions
) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.7rem !important;
}

:is(
    .date-badge,
    .assignment-header-pill,
    .students-hero-pill,
    .question-bank-hero-pill,
    .edit-header-pill,
    .exams-hero-chip
) {
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    backdrop-filter: blur(10px);
}

/* Admin-wide hero sizing standard */
.admin-content-shell :is(
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero,
    .users-page-header
) {
    padding: 1rem 1.2rem !important;
    border-radius: 20px !important;
    margin-bottom: 0.9rem !important;
}

.admin-content-shell :is(
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero,
    .users-page-header
) :is(h1, h2) {
    font-size: 1.9rem !important;
    line-height: 1.14 !important;
}

.admin-content-shell :is(
    .welcome-header,
    .registration-hero,
    .assignment-header,
    .assign-header,
    .hero-section,
    .session-header,
    .create-header,
    .move-header,
    .move-hero,
    .students-hero,
    .subjects-hero,
    .subjects-header,
    .header-section,
    .edit-header,
    .edit-user-header,
    .class-edit-hero,
    .page-header,
    .results-header,
    .teacher-hero,
    .exam-view-hero,
    .exams-hero,
    .exams-header,
    .question-create-hero,
    .question-edit-hero,
    .question-bank-hero,
    .upload-header,
    .profile-hero,
    .notification-header,
    .notification-hero,
    .users-page-header
) p {
    font-size: 0.95rem !important;
    line-height: 1.45 !important;
}

.admin-content-shell .exam-container > .exam-header {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate !important;
    margin: 0 0 var(--app-hero-margin-bottom) !important;
    padding: var(--app-hero-padding) !important;
    border: 1px solid var(--app-hero-border) !important;
    border-radius: var(--app-hero-radius) !important;
    background: var(--app-hero-gradient) !important;
    box-shadow: var(--app-hero-shadow) !important;
    color: #fff !important;
}

.admin-content-shell .exam-container > .exam-header::before,
.admin-content-shell .exam-container > .exam-header::after {
    content: "" !important;
    position: absolute !important;
    border-radius: 999px !important;
    pointer-events: none !important;
    z-index: -1 !important;
    animation: none !important;
}

.admin-content-shell .exam-container > .exam-header::before {
    inset: -35% -20% auto auto !important;
    width: 24rem !important;
    height: 24rem !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 68%) !important;
}

.admin-content-shell .exam-container > .exam-header::after {
    inset: auto auto -45% -10% !important;
    width: 18rem !important;
    height: 18rem !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%) !important;
}

.admin-content-shell .exam-container > .exam-header > * {
    position: relative;
    z-index: 1;
}

.admin-content-shell .exam-container > .exam-header :is(h1, h2) {
    margin: 0 !important;
    color: #fff !important;
    font-size: 2.15rem !important;
    line-height: 1.12 !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    text-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
}

.admin-content-shell .exam-container > .exam-header p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

@media (max-width: 768px) {
    :is(
        .student-welcome-header,
        .welcome-header,
        .registration-hero,
        .assignment-header,
        .assign-header,
        .hero-section,
        .session-header,
        .create-header,
        .move-header,
        .move-hero,
        .students-hero,
        .subjects-hero,
        .subjects-header,
        .header-section,
        .edit-header,
        .edit-user-header,
        .class-edit-hero,
        .page-header,
        .results-header,
        .teacher-hero,
        .exam-view-hero,
        .exams-hero,
        .exams-header,
        .question-create-hero,
        .question-edit-hero,
        .question-bank-hero,
        .upload-header,
        .profile-hero,
        .notification-header,
        .notification-hero
    ) {
        padding: 1.35rem !important;
        border-radius: 18px !important;
    }

    :is(
        .student-welcome-header,
        .welcome-header,
        .registration-hero,
        .assignment-header,
        .assign-header,
        .hero-section,
        .session-header,
        .create-header,
        .move-header,
        .move-hero,
        .students-hero,
        .subjects-hero,
        .subjects-header,
        .header-section,
        .edit-header,
        .edit-user-header,
        .class-edit-hero,
        .page-header,
        .results-header,
        .teacher-hero,
        .exam-view-hero,
        .exams-hero,
        .exams-header,
        .question-create-hero,
        .question-edit-hero,
        .question-bank-hero,
        .upload-header,
        .profile-hero,
        .notification-header,
        .notification-hero
    ) :is(h1, h2) {
        font-size: 1.45rem !important;
    }

    .admin-content-shell .exam-container > .exam-header {
        padding: 1.35rem !important;
        border-radius: 18px !important;
    }

    .admin-content-shell .exam-container > .exam-header :is(h1, h2) {
        font-size: 1.45rem !important;
    }

    .admin-content-shell :is(
        .welcome-header,
        .registration-hero,
        .assignment-header,
        .assign-header,
        .hero-section,
        .session-header,
        .create-header,
        .move-header,
        .move-hero,
        .students-hero,
        .subjects-hero,
        .subjects-header,
        .header-section,
        .edit-header,
        .edit-user-header,
        .class-edit-hero,
        .page-header,
        .results-header,
        .teacher-hero,
        .exam-view-hero,
        .exams-hero,
        .exams-header,
        .question-create-hero,
        .question-edit-hero,
        .question-bank-hero,
        .upload-header,
        .profile-hero,
        .notification-header,
        .notification-hero,
        .users-page-header
    ) {
        padding: 0.85rem 0.95rem !important;
        border-radius: 16px !important;
    }

    .admin-content-shell :is(
        .welcome-header,
        .registration-hero,
        .assignment-header,
        .assign-header,
        .hero-section,
        .session-header,
        .create-header,
        .move-header,
        .move-hero,
        .students-hero,
        .subjects-hero,
        .subjects-header,
        .header-section,
        .edit-header,
        .edit-user-header,
        .class-edit-hero,
        .page-header,
        .results-header,
        .teacher-hero,
        .exam-view-hero,
        .exams-hero,
        .exams-header,
        .question-create-hero,
        .question-edit-hero,
        .question-bank-hero,
        .upload-header,
        .profile-hero,
        .notification-header,
        .notification-hero,
        .users-page-header
    ) :is(h1, h2) {
        font-size: 1.3rem !important;
    }
}


.student-dashboard-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    padding: 2rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Welcome Header */
/* Student Dashboard Welcome Header */
.student-welcome-header {
    background: var(--primary-gradient);
    border-radius: 32px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}
.student-welcome-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.welcome-text h1 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.welcome-text p {
    color: rgba(255,255,255,0.95);
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
}
.date-badge {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
}
/* ... (rest of the student dashboard styles from student.html) ... */
/* --- Admin Dashboard Custom Styles --- */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.welcome-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.25rem;
}
.welcome-title p {
    color: #64748b;
    font-size: 1.1rem;
}
.date-badge {
    background: #f1f5f9;
    color: #2563eb;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.07);
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}
.stat-icon {
    font-size: 2rem;
    border-radius: 9999px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: var(--cbt-blue-100); color: var(--cbt-blue-700); }
.stat-icon.yellow { background: #fef9c3; color: #ca8a04; }
.stat-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.quick-actions-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.07);
    padding: 1.25rem 1.5rem;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.action-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.activity-list {
    margin-top: 1rem;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.activity-icon {
    font-size: 1.25rem;
    color: #2563eb;
    background: #dbeafe;
    border-radius: 9999px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-content p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.activity-time {
    color: #64748b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.chart-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.07);
    padding: 1.25rem 1.5rem;
}
.chart-container {
    width: 100%;
    height: 260px;
    position: relative;
}
.health-metrics {
    margin-top: 1rem;
}
.metric-item {
    margin-bottom: 1rem;
}
.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.progress-bar-bg {
    background: #f1f5f9;
    border-radius: 9999px;
    height: 0.5rem;
    width: 100%;
    margin-bottom: 0.25rem;
}
.progress-fill {
    height: 0.5rem;
    border-radius: 9999px;
}
.progress-fill.green { background: #22c55e; }
.progress-fill.blue { background: #3b82f6; }
.progress-fill.purple { background: var(--cbt-blue-600); }
/* --- End Admin Dashboard Custom Styles --- */
/* Admin Dashboard Sidenav Styling */
.side-nav {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    z-index: 30;
    display: none;
}
@media (min-width: 768px) {
    .side-nav {
        display: flex;
        flex-direction: column;
    }
    .main-content-with-sidenav {
        margin-left: 260px;
    }
}

.nav-link-admin {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 0.25rem;
}
.nav-link-admin:hover {
    background: #f1f5f9;
    color: #2563eb;
}
.nav-link-admin.active-admin {
    background: var(--cbt-blue-100);
    color: #2563eb;
    font-weight: 700;
}
/* Side Navigation Bar (Admin Dashboard) */
.side-nav {
    width: 16rem; /* 256px */
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    z-index: 20;
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.main-content-with-sidenav {
    margin-left: 0;
}
@media (min-width: 768px) {
    .main-content-with-sidenav {
        margin-left: 16rem;
    }
}
/* static/css/style.css - Regular CSS version */

/* Navigation */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding-left: 0.25rem;
    padding-top: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

/* Replace this: */
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: transparent;
}

/* With this: */
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: transparent;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link.active {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
}

/* Buttons */
.btn-primary {
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #4b5563;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-secondary:hover {
    background-color: #374151;
}

.btn-success {
    background-color: #16a34a;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Cards */
.dashboard-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.dashboard-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1rem;
    display: flex;
    align-items: center;
}

.stat-icon {
    border-radius: 9999px;
    padding: 0.75rem;
    margin-right: 1rem;
}

.stat-icon-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.stat-icon-green {
    background-color: #dcfce7;
    color: #16a34a;
}

.stat-icon-purple {
    background-color: var(--cbt-blue-100);
    color: var(--cbt-blue-700);
}

.stat-icon-yellow {
    background-color: #fef9c3;
    color: #ca8a04;
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    outline: none;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: transparent;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.table {
    min-width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f9fafb;
}

.table td {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #111827;
}

.table tr:hover {
    background-color: #f9fafb;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Progress Bar */
.progress-bar {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 0.625rem;
}

.progress-bar-fill {
    background-color: #3b82f6;
    height: 0.625rem;
    border-radius: 9999px;
    transition: width 0.3s;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(75, 85, 99, 0.5);
    overflow-y: auto;
    width: 100%;
    z-index: 50;
}

.modal-container {
    position: relative;
    top: 5rem;
    margin: 0 auto;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    width: 24rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    background-color: white;
}

/* Exam Interface */
.question-palette {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.question-palette-item {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.question-palette-item.current {
    border: 2px solid #3b82f6;
}

.question-palette-item.answered {
    background-color: #dcfce7;
    color: #166534;
}

.question-palette-item.marked {
    background-color: #fef3c7;
    color: #92400e;
}

.question-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-card.current {
    border-left: 4px solid #3b82f6;
}

/* Timer */
.timer {
    font-size: 1.5rem;
    font-family: monospace;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.timer-normal {
    background-color: #f3f4f6;
}

.timer-warning {
    background-color: #fee2e2;
    color: #dc2626;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        background-color: #fee2e2;
    }
    50% {
        background-color: #fecaca;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Responsive Design */
@media (max-width: 1366px) {
    html {
        font-size: 15px;
    }

    .student-dashboard-container,
    .student-welcome-header,
    .quick-actions-card,
    .chart-card,
    .stat-card {
        padding: 1.5rem;
    }

    .welcome-text h1,
    .welcome-title h1 {
        font-size: 1.75rem;
    }

    .quick-actions-grid,
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 1100px) {
    html {
        font-size: 14.5px;
    }

    .student-dashboard-container {
        padding: 1.25rem;
    }

    .student-welcome-header {
        border-radius: 24px;
        padding: 1.75rem;
    }

    .welcome-header,
    .welcome-content {
        gap: 0.9rem;
    }

    .welcome-text h1,
    .welcome-title h1 {
        font-size: 1.55rem;
    }

    .welcome-title p,
    .welcome-text p,
    .date-badge,
    .activity-content p,
    .metric-header {
        font-size: 0.95rem;
    }

    .stats-grid,
    .quick-actions-grid,
    .charts-grid {
        gap: 1rem;
    }

    .quick-actions-grid,
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .stat-card,
    .quick-actions-card,
    .chart-card,
    .table-container,
    .question-palette,
    .modal-container {
        border-radius: 0.7rem;
    }

    .table th,
    .table td {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    :root {
        --app-page-gutter: 0;
        --app-page-top: 0;
        --app-page-bottom: 1.5rem;
    }

    html {
        font-size: 14px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="search"],
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .student-dashboard-container,
    .quick-actions-card,
    .chart-card,
    .stat-card {
        padding: 1rem;
    }

    .student-welcome-header {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .welcome-header,
    .welcome-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .welcome-text h1,
    .welcome-title h1 {
        font-size: 1.35rem;
    }

    .table th,
    .table td {
        padding: 0.75rem;
    }

    .modal-container {
        top: 1.5rem;
        width: calc(100% - 1rem);
        padding: 1rem;
    }

    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    .card-grid {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    :root {
        --app-page-max-width: 100%;
        --app-page-gutter: 0;
        --app-page-top: 0;
        --app-page-bottom: 1.25rem;
    }

    .app-content-shell,
    .admin-main > .flash-stack {
        padding-left: var(--app-page-gutter);
        padding-right: var(--app-page-gutter);
    }

    .modal-container {
        width: min(94vw, 32rem);
    }
}

@media (max-width: 768px) {
    :root {
        --app-page-gutter: 0;
        --app-page-top: 0;
        --app-page-bottom: 1rem;
    }

    .app-content-shell,
    .admin-main > .flash-stack {
        padding-left: var(--app-page-gutter);
        padding-right: var(--app-page-gutter);
    }

    :is(
        .student-welcome-header,
        .welcome-header,
        .registration-hero,
        .assignment-header,
        .assign-header,
        .hero-section,
        .session-header,
        .create-header,
        .move-header,
        .move-hero,
        .students-hero,
        .subjects-hero,
        .subjects-header,
        .header-section,
        .edit-header,
        .edit-user-header,
        .class-edit-hero,
        .page-header,
        .results-header,
        .teacher-hero,
        .exam-view-hero,
        .exams-hero,
        .exams-header,
        .question-create-hero,
        .question-edit-hero,
        .question-bank-hero,
        .upload-header,
        .profile-hero,
        .notification-header,
        .notification-hero
    ) {
        margin-bottom: 0.85rem !important;
        padding: clamp(0.95rem, 3.5vw, 1.2rem) !important;
        border-radius: 14px !important;
    }

    .manage-users-page .users-page-header {
        margin-bottom: 0.85rem !important;
    }

    .table,
    .data-table {
        min-width: 640px;
    }

    .overflow-x-auto,
    .table-container,
    .table-wrap,
    .results-table-container,
    .teacher-results-table-wrap,
    .teacher-table-wrap,
    .students-table-wrap {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13.5px;
    }

    :root {
        --app-page-gutter: 0;
    }

    .app-content-shell,
    .admin-main > .flash-stack {
        padding-left: var(--app-page-gutter);
        padding-right: var(--app-page-gutter);
    }

    .modal-container {
        width: calc(100% - 0.8rem);
        top: 1rem;
        padding: 0.85rem;
    }
}

@media (max-width: 390px) {
    html {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 12.5px;
    }

    :root {
        --app-page-gutter: 0;
    }
}

@media (max-width: 320px) {
    html {
        font-size: 12px;
    }

    :root {
        --app-page-gutter: 0;
    }
}

@media (min-width: 1920px) {
    :root {
        --app-page-max-width: 100%;
        --app-page-top: 0;
        --app-page-bottom: 2rem;
    }
}

@media (min-width: 2560px) {
    :root {
        --app-page-max-width: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background-color: #9ca3af;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 10;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: white;
    background-color: #111827;
    border-radius: 0.5rem;
    white-space: nowrap;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
}

/* Loading Skeleton */
.skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
}

.skeleton-text {
    height: 1rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    width: 100%;
}

.skeleton-button {
    height: 2.5rem;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    width: 6rem;
}

/* Dark Mode (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #111827;
        color: white;
    }
}

/* Additional utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border: 1px solid #e5e7eb; }
.border-2 { border-width: 2px; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-l { border-left: 1px solid #e5e7eb; }
.border-r { border-right: 1px solid #e5e7eb; }

.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.bg-yellow-500 { background-color: #eab308; }
.bg-yellow-600 { background-color: #ca8a04; }

.text-white { color: white; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-red-600 { color: #dc2626; }
.text-yellow-600 { color: #ca8a04; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Global density tuning for cleaner cross-screen layout */
:root {
    --app-card-density-pad: clamp(0.85rem, 1.4vw, 1.1rem);
    --app-card-density-pad-lg: clamp(0.95rem, 1.6vw, 1.25rem);
    --app-shell-density-inline: clamp(0.35rem, 0.85vw, 0.9rem);
}

.app-content-shell {
    padding-left: var(--app-shell-density-inline) !important;
    padding-right: var(--app-shell-density-inline) !important;
}

.app-content-shell :is(
    .dashboard-card,
    .stat-card,
    .quick-actions-card,
    .chart-card,
    .section-card,
    .form-card,
    .table-container,
    .results-table-container,
    .profile-card,
    .subjects-stat-card,
    .exams-stat-card,
    .students-stat-card,
    .exam-list-panel,
    .assign-panel,
    .submit-panel,
    .info-box,
    .question-form-card,
    .upload-card
) {
    padding: var(--app-card-density-pad) !important;
}

.app-content-shell :is(
    .users-page-header,
    .results-header,
    .page-header,
    .exams-list-top,
    .form-header,
    .profile-card-header
) {
    padding: var(--app-card-density-pad-lg) !important;
}

@media (max-width: 900px) {
    :root {
        --app-card-density-pad: 0.82rem;
        --app-card-density-pad-lg: 0.95rem;
        --app-shell-density-inline: 0.6rem;
    }
}
