/* ===== CSS VARIABLES ===== */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}


/* ===== RESET & BASE ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: var(--dark);
    line-height: 1.5;
}


/* ===== LOGIN SCREEN ===== */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
}

.login-logo p {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 4px;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--gray);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}


/* ===== LAYOUT ===== */

.app {
    display: flex;
    min-height: 100vh;
}


/* ===== SIDEBAR ===== */

.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 100;
}

.student-sidebar {
    background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 100%);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h1 i {
    color: var(--secondary);
}

.sidebar-header p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

.nav-menu {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.2);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}


/* ===== MAIN CONTENT ===== */

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}


/* ===== TOP BAR ===== */

.top-bar {
    background: white;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--dark);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 16px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 300px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--gray);
    cursor: pointer;
}

.notification-btn .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}


/* ===== CONTENT AREA ===== */

.content {
    padding: 28px;
}


/* ===== PAGE HEADER ===== */

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.page-header p {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 4px;
}


/* ===== STATS GRID ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.secondary {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    font-size: 0.875rem;
    color: var(--gray);
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
}

.stat-change.up {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}


/* ===== CARDS ===== */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px 24px;
}


/* ===== BUTTONS ===== */

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: var(--dark);
}

.btn-outline:hover {
    background: var(--light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ===== FORM STYLES ===== */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.readonly-input {
    background: #f8fafc !important;
    color: var(--gray) !important;
    cursor: not-allowed;
}


/* ===== TABLE ===== */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.875rem;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tr {
    border-bottom: 1px solid #f1f5f9;
}

tr:hover {
    background: #f8fafc;
}

.student-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}


/* ===== BADGES ===== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.badge-gray {
    background: rgba(100, 116, 139, 0.1);
    color: var(--gray);
}


/* ===== ACTION BUTTONS ===== */

.action-btns {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn.edit {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn.view {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.action-btn.start {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.action-btn:hover {
    transform: scale(1.1);
}


/* ===== MODAL ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


/* ===== TABS ===== */

.tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: fit-content;
}

.tab {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--gray);
    transition: all 0.2s;
}

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}


/* ===== TEST CARDS ===== */

.test-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}

.test-card.secondary {
    border-left-color: var(--secondary);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.test-title {
    font-weight: 600;
    font-size: 1rem;
}

.test-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 6px;
    flex-wrap: wrap;
}

.test-meta i {
    margin-right: 4px;
}

.test-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.test-stat {
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.test-stat h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.test-stat p {
    font-size: 0.75rem;
    color: var(--gray);
}


/* ===== QUESTION CARDS ===== */

.question-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border-left: 4px solid #8b5cf6;
}

.question-text {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--dark);
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.question-option {
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.875rem;
}

.question-option strong {
    color: var(--primary);
    margin-right: 4px;
}

.question-answer {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}


/* ===== EXAM INTERFACE (ANTI-CHEAT) ===== */

#examInterface {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.exam-header {
    background: var(--dark);
    color: white;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.exam-header h2 {
    font-size: 1.25rem;
}

.exam-header p {
    font-size: 0.875rem;
    color: #94a3b8;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warning);
}

.exam-timer i {
    font-size: 1rem;
}

.exam-progress {
    font-size: 0.875rem;
    color: #94a3b8;
}

.exam-body {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.exam-question-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.exam-question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 32px;
    line-height: 1.6;
    color: var(--dark);
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exam-option {
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.exam-option:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.exam-option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.exam-option-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--gray);
    flex-shrink: 0;
}

.exam-option.selected .exam-option-letter {
    background: var(--primary);
    color: white;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.exam-warning {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: shake 0.5s ease;
    z-index: 10000;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(-50%) translateX(0);
    }
    25% {
        transform: translateX(-50%) translateX(-10px);
    }
    75% {
        transform: translateX(-50%) translateX(10px);
    }
}


/* ===== RESULT MODAL ===== */

.result-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 auto;
}

.result-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.result-detail span {
    color: var(--gray);
}

.result-detail strong {
    color: var(--dark);
}


/* ===== GRADE DISPLAY ===== */

.grade {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.grade-a {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.grade-b {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}

.grade-c {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.grade-d {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.grade-f {
    background: rgba(100, 116, 139, 0.1);
    color: var(--gray);
}


/* ===== TOAST NOTIFICATIONS ===== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


/* ===== PAGE SECTIONS ===== */

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}


/* ===== DASHBOARD GRID ===== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ===== FILTER BAR ===== */

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
}


/* ===== PROGRESS BAR ===== */

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}


/* ===== EMPTY STATE ===== */

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state p {
    font-size: 0.875rem;
}


/* ===== STUDENT DETAIL ===== */

.student-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.student-detail-left {
    text-align: center;
}

.student-detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.student-detail-info p {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.student-detail-info p strong {
    color: var(--dark);
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.student-detail-right h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.score-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.score-item-subject {
    font-weight: 500;
}

.score-item-score {
    font-weight: 700;
}

.score-item-score.excellent {
    color: var(--success);
}

.score-item-score.good {
    color: var(--secondary);
}

.score-item-score.average {
    color: var(--warning);
}

.score-item-score.poor {
    color: var(--danger);
}


/* ===== SETTINGS ===== */

.settings-card {
    margin-top: 20px;
}

.data-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.report-card {
    margin-top: 20px;
}


/* ===== GRADE DISTRIBUTION ===== */

.grade-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.grade-bar-label {
    width: 30px;
    font-weight: 600;
    text-align: center;
}

.grade-bar-track {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.grade-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.grade-bar-count {
    width: 40px;
    text-align: right;
    font-weight: 600;
}


/* ===== STUDENT TEST CARD ===== */

.student-test-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.student-test-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.student-test-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.student-test-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--gray);
    flex-wrap: wrap;
}

.student-test-meta i {
    margin-right: 4px;
}


/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .search-box input {
        width: 200px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .test-stats {
        grid-template-columns: 1fr 1fr;
    }
    .content {
        padding: 16px;
    }
    .search-box {
        display: none;
    }
    .student-detail {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }
    .exam-body {
        padding: 20px;
    }
    .exam-question-container {
        padding: 24px;
    }
    .question-options {
        grid-template-columns: 1fr;
    }
    .student-test-card {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .login-box {
        padding: 24px;
    }
    .exam-header {
        flex-direction: column;
        text-align: center;
    }
}


/* ===== PRINT STYLES ===== */

@media print {
    .sidebar,
    .top-bar,
    .btn,
    .action-btns,
    .login-screen {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    #examInterface {
        position: static;
    }
}


/* ===== MARGIN HELPERS ===== */

.mb-4 {
    margin-bottom: 20px;
}


/* ===== TEACHER SIDEBAR ===== */

.teacher-sidebar {
    background: linear-gradient(180deg, #5b21b6 0%, #4c1d95 100%);
}


/* ===== SHORTCUT GRID ===== */

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.shortcut-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shortcut-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.shortcut-btn i {
    font-size: 2rem;
    color: var(--primary);
}

.shortcut-btn span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
}

.shortcut-btn small {
    color: var(--gray);
    font-size: 0.8rem;
}


/* ===== ATTENDANCE GRID ===== */

.attendance-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.attendance-student {
    display: flex;
    align-items: center;
    gap: 12px;
}

.attendance-toggle {
    display: flex;
    gap: 8px;
}

.att-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.att-btn.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.att-btn.active[data-status="Absent"] {
    background: var(--danger);
    border-color: var(--danger);
}

.att-btn.active[data-status="Late"] {
    background: var(--warning);
    border-color: var(--warning);
}


/* ===== THEORY BULK GRID ===== */

.theory-bulk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.theory-bulk-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
}

.theory-bulk-student {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.theory-bulk-score {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}


/* ===== THEORY SCORE INPUTS ===== */

.theory-score-input,
.theory-remark-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 100%;
    font-size: 0.875rem;
}

.theory-score-input {
    max-width: 100px;
    text-align: center;
    font-weight: 600;
}


/* ===== ACTIVITY LIST ===== */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.activity-icon.success {
    background: var(--success);
}

.activity-icon.danger {
    background: var(--danger);
}

.activity-text {
    font-size: 0.875rem;
    color: var(--dark);
}

.activity-text strong {
    font-weight: 600;
}


/* ===== INFO BUTTON ===== */

.btn-info {
    background: #8b5cf6;
    color: white;
}

.btn-info:hover {
    background: #7c3aed;
}


/* ===== TEACHER CHECKLISTS ===== */

.subjects-checklist,
.classes-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 4px;
}

.check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}


/* ===== TEACHER PROFILE CARD ===== */

.teacher-profile-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.teacher-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.teacher-profile-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.teacher-profile-info p {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.teacher-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.teacher-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.teacher-badge.class-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
}


/* ===== ASSIGNED CLASSES LIST ===== */

.assigned-class-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.assigned-class-item:last-child {
    margin-bottom: 0;
}

.assigned-class-name {
    font-weight: 600;
    color: var(--dark);
}

.assigned-class-subjects {
    font-size: 0.8rem;
    color: var(--gray);
}

.assigned-class-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}