/* ============================================
   EXAMINATION SYSTEM - COMPLETE STYLESHEET
   ============================================ */

/* Root Variables */
:root {
    --primary-color: #1a237e;
    --primary-light: #534bae;
    --primary-dark: #000051;
    --secondary-color: #0d47a1;
    --accent-color: #2962ff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f4f6f9;
    --dark-bg: #1e1e2d;
    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--light-bg);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

/* ============================================
   ADMIN LAYOUT - FIXED SIDEBAR STRUCTURE
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: #fff;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-color), #536dfe);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.sidebar-brand .brand-text small {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav .nav-section {
    margin-bottom: 20px;
}

.sidebar-nav .nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    padding: 8px 12px;
    margin-bottom: 4px;
    font-weight: 600;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    border-radius: 10px;
    margin-bottom: 2px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.sidebar-nav .nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, var(--accent-color), #536dfe);
    color: #fff;
    box-shadow: 0 4px 15px rgba(41, 98, 255, 0.3);
    font-weight: 600;
}

.sidebar-nav .nav-item .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}

.sidebar-footer .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-footer .user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-footer .user-details .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-details .user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.sidebar-footer .logout-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-footer .logout-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    background: var(--light-bg);
}

.admin-header {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header .header-left h4 {
    margin: 0;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 18px;
}

.admin-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header .header-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.admin-header .header-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.admin-header .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #fff;
}

.admin-content {
    padding: 24px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   STUDENT BODY - MOBILE BOTTOM NAV
   ============================================ */
.student-body {
    padding-bottom: 70px;
    background: var(--light-bg);
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 6px;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-top: 1px solid #eee;
}

.mobile-bottom-nav .nav-item {
    text-decoration: none;
    color: #888;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    transition: var(--transition);
}

.mobile-bottom-nav .nav-item span {
    font-size: 10px;
    letter-spacing: 0.3px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
    background: rgba(26, 35, 126, 0.08);
}

.mobile-bottom-nav .nav-item.active i {
    transform: scale(1.15);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: #fff;
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ============================================
   DASHBOARD STATS CARDS
   ============================================ */
.dash-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.dash-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
    cursor: pointer;
}

.dash-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.dash-stat-icon.blue { background: #eef2ff; color: #2962ff; }
.dash-stat-icon.green { background: #d4edda; color: #28a745; }
.dash-stat-icon.orange { background: #fff3cd; color: #ff9800; }
.dash-stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.dash-stat-icon.red { background: #fde8e8; color: #dc3545; }
.dash-stat-icon.teal { background: #e0f7fa; color: #0097a7; }
.dash-stat-icon.pink { background: #fce4ec; color: #e91e63; }
.dash-stat-icon.indigo { background: #e8eaf6; color: #3f51b5; }

.dash-stat-info .dash-stat-num {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: #1a1a2e;
}

.dash-stat-info .dash-stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.dash-stat-info .dash-stat-sub {
    font-size: 11px;
    color: #888;
}

/* ============================================
   FILTER BAR
   ============================================ */
.dash-filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================
   WELCOME BAR (Dashboard)
   ============================================ */
.welcome-bar {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    color: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-bar::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.welcome-bar h4 { font-weight: 700; margin-bottom: 4px; }
.welcome-bar .date { font-size: 13px; opacity: 0.8; }

.welcome-bar .quick-links {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.welcome-bar .quick-link {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.welcome-bar .quick-link:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================
   SECTION CARDS (Dashboard)
   ============================================ */
.section-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.section-header h6 { margin: 0; font-weight: 700; color: #1a237e; }
.section-body { padding: 20px; }
.section-body.p-0 { padding: 0; }

/* ============================================
   ACTIVITY ITEMS (Dashboard)
   ============================================ */
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: #fafbfd; }

.activity-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.activity-avatar.blue { background: linear-gradient(135deg, #667eea, #764ba2); }
.activity-avatar.green { background: linear-gradient(135deg, #11998e, #38ef7d); }

.activity-info { flex: 1; min-width: 0; }
.activity-info .name { font-weight: 600; font-size: 13px; }
.activity-info .detail { font-size: 12px; color: #888; }
.activity-score { font-weight: 700; font-size: 14px; }

/* ============================================
   TOP STUDENTS RANKING (Dashboard)
   ============================================ */
.top-student-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.top-student-card:last-child { border-bottom: none; }

.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: #f0f0f0; color: #666; }

/* ============================================
   ALERT CARDS (Dashboard)
   ============================================ */
.alert-card {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #333;
}

.alert-card.danger { background: #ffebee; border-left-color: #dc3545; }
.alert-card.success { background: #e8f5e9; border-left-color: #28a745; }

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    position: relative;
    height: 250px;
}

/* ============================================
   COURSE CARDS (Courses Page)
   ============================================ */
.course-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transform: translateY(-3px);
    border-color: #d0d7ff;
}

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.course-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.course-name { font-weight: 700; color: #1a237e; margin-bottom: 6px; font-size: 16px; }
.course-desc { font-size: 12px; color: #666; margin-bottom: 14px; flex-grow: 1; }

.course-stats-row {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
}

.course-stat { text-align: center; flex: 1; }
.course-stat-val { font-size: 18px; font-weight: 700; color: #1a1a2e; }
.course-stat-lbl { font-size: 10px; color: #888; text-transform: uppercase; }
.course-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================
   EXAM CARDS
   ============================================ */
.exam-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.exam-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: #d0d7ff; }

.exam-card .exam-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.exam-card .exam-info { flex: 1; min-width: 200px; }
.exam-card .exam-info h6 { margin: 0 0 4px; font-weight: 700; }
.exam-card .exam-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.exam-card .exam-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* Mini Stat */
.mini-stat { text-align: center; }
.mini-stat .ms-val { font-size: 18px; font-weight: 700; }
.mini-stat .ms-lbl { font-size: 10px; color: #888; text-transform: uppercase; }

/* Status Badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-upcoming { background: #fff3cd; color: #856404; }
.status-live { background: #28a745; color: #fff; animation: pulse 2s infinite; }
.status-completed { background: #e9ecef; color: #495057; }

/* Publish Badge */
.publish-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.publish-badge.published { background: #d4edda; color: #155724; }
.publish-badge.hidden { background: #fff3cd; color: #856404; }

/* ============================================
   STUDENT CARDS
   ============================================ */
.student-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: all 0.2s;
}

.student-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.student-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 250px; }

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.student-avatar.male { background: linear-gradient(135deg, #667eea, #764ba2); }
.student-avatar.female { background: linear-gradient(135deg, #f093fb, #f5576c); }

.student-details h6 { margin: 0; font-size: 15px; font-weight: 600; }
.student-details .meta { font-size: 12px; color: #888; }
.student-details .meta span { margin-right: 10px; }

.student-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.student-stat { text-align: center; }
.student-stat .val { font-size: 18px; font-weight: 700; }
.student-stat .lbl { font-size: 10px; color: #888; text-transform: uppercase; }

.student-detail-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ============================================
   SUBJECT & CHAPTER CARDS
   ============================================ */
.subject-card,
.chapter-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: all 0.2s;
}

.subject-card:hover,
.chapter-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.subject-info h6,
.chapter-info h6 { margin: 0 0 2px; font-weight: 700; color: #1a237e; }
.subject-info .meta,
.chapter-info .meta { font-size: 12px; color: #888; }
.subject-stats,
.chapter-stats { display: flex; gap: 16px; align-items: center; }

/* ============================================
   QUESTION CARDS (Question List)
   ============================================ */
.q-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.q-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: #d0d7ff; }

.q-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.q-meta .badge { font-size: 10px; padding: 4px 8px; font-weight: 500; }
.q-body { display: flex; gap: 12px; }
.q-content { flex: 1; min-width: 0; }

.q-text {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    overflow: hidden;
    position: relative;
}

.q-text:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}

.q-text p { margin: 0; display: inline; }

.q-opts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.q-opt {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 11px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    color: #555;
}

.q-opt.correct { background: #d4edda; border-color: #28a745; color: #155724; font-weight: 600; }
.q-opt .opt-letter { font-weight: 700; }

.q-image-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    background: #f0f4ff;
    color: #2962ff;
    border: 1px solid #d0d7ff;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.q-image-link:hover { background: #dde6ff; }
.q-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ============================================
   QUESTION SELECT ITEMS (Exam Management)
   ============================================ */
.q-select-item {
    padding: 10px 14px;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.q-select-item:hover { border-color: #2962ff; background: #f8faff; }
.q-select-item.selected { border-color: #28a745; background: #f0fff4; }
.q-select-item.assigned { border-color: #2962ff; background: #eef2ff; }

/* ============================================
   BULK ACTION BAR
   ============================================ */
.bulk-bar {
    background: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #e8ecf1;
}

/* ============================================
   RESULT TABLE
   ============================================ */
.result-table th {
    background: #f8f9fc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-table td { vertical-align: middle; font-size: 13px; }

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-link { color: #2962ff; text-decoration: none; }
.breadcrumb-link:hover { text-decoration: underline; }

/* ============================================
   BADGE VARIANTS
   ============================================ */
.badge-id { background: #1a1a2e; color: #fff; }
.badge-normal { background: #e0f0ff; color: #0066cc; }
.badge-ar { background: #fff3cd; color: #856404; }
.badge-sb { background: #f3e8ff; color: #7c3aed; }
.badge-course { background: #f0f4f8; color: #555; border: 1px solid #ddd; }

/* ============================================
   TYPE TABS (Question Modal)
   ============================================ */
.type-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 14px;
    background: #f8f9fc;
    padding: 5px;
    border-radius: 10px;
}

.type-tab {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    background: #fff;
    transition: all 0.2s;
}

.type-tab:hover { background: #f0f4ff; }
.type-tab.active { border-color: #2962ff; background: #eef2ff; color: #2962ff; }

/* ============================================
   OPTION ROW (Question Modal)
   ============================================ */
.opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.opt-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    background: #fff;
    flex-shrink: 0;
    transition: all 0.2s;
}

.opt-circle:hover { border-color: #2962ff; }
.opt-circle.sel { background: #28a745; color: #fff; border-color: #1e7e34; box-shadow: 0 2px 6px rgba(40,167,69,0.3); }

/* ============================================
   AR BOX (Assertion Reason)
   ============================================ */
.ar-box {
    background: #f8f9fc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #2962ff;
}

.ar-box.reason { border-left-color: #ff9800; }
.ar-box label { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 5px; }

/* ============================================
   STATEMENT ROW
   ============================================ */
.stmt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.stmt-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2962ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

/* ============================================
   IMPORT PAGE
   ============================================ */
.import-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

.format-box { background: #f8f9fc; border-radius: 12px; padding: 16px; border: 1px solid #e8ecf1; }
.format-box pre { font-size: 12px; margin: 0; white-space: pre-wrap; }
.history-item { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
.history-item:last-child { border-bottom: none; }

/* ============================================
   ZOOM MODAL
   ============================================ */
#zoomModal .modal-body { padding: 10px; background: #111; }
#zoomModal img { max-width: 95%; max-height: 85vh; border-radius: 10px; object-fit: contain; }

/* ============================================
   PASSWORD FIELD
   ============================================ */
.password-field { position: relative; }
.password-field .toggle-pwd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #888; }

/* ============================================
   MODAL XL
   ============================================ */
.modal-xl2 { max-width: 850px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary { background: var(--accent-color); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(41, 98, 255, 0.3); }
.btn-success { background: var(--success-color); color: #fff; }
.btn-success:hover { background: #218838; box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3); }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-danger:hover { background: #c82333; box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3); }
.btn-warning { background: var(--warning-color); color: #000; }
.btn-info { background: var(--info-color); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn-outline-primary { border: 2px solid var(--accent-color); color: var(--accent-color); background: transparent; }
.btn-outline-primary:hover { background: var(--accent-color); color: #fff; }

/* ============================================
   TABLES
   ============================================ */
.table-container { background: #fff; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--box-shadow); }
.table { margin-bottom: 0; width: 100%; border-collapse: collapse; }
.table thead th { background: #f8f9fc; color: #555; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 16px; border-bottom: 2px solid #e8ecf1; white-space: nowrap; }
.table tbody td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; font-size: 14px; }
.table tbody tr:hover { background: #f8f9fc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select { border-radius: 8px; border: 2px solid #e0e0e0; padding: 10px 14px; font-size: 14px; transition: var(--transition); background: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.1); outline: none; }
.form-label { font-weight: 600; font-size: 13px; color: #555; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================
   MODALS
   ============================================ */
.modal-content { border: none; border-radius: 16px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); }
.modal-header { border-bottom: 1px solid #f0f0f0; padding: 20px 24px; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid #f0f0f0; padding: 16px 24px; }

/* ============================================
   BADGES
   ============================================ */
.badge { padding: 5px 10px; border-radius: 20px; font-weight: 500; font-size: 11px; letter-spacing: 0.3px; }
.badge.bg-primary { background: var(--accent-color) !important; }
.badge.bg-success { background: var(--success-color) !important; color: #fff !important; }
.badge.bg-warning { background: var(--warning-color) !important; color: #000 !important; }
.badge.bg-danger { background: var(--danger-color) !important; color: #fff !important; }
.badge.bg-info { background: var(--info-color) !important; }

/* ============================================
   ALERTS
   ============================================ */
.alert { border: none; border-radius: 10px; padding: 14px 18px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success-color); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger-color); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning-color); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info-color); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes blink { 50% { opacity: 0.5; } }

.fade-in { animation: fadeIn 0.5s ease forwards; }
.slide-up { animation: slideUp 0.6s ease forwards; }
.slide-in-left { animation: slideInLeft 0.4s ease forwards; }
.pulse { animation: pulse 2s infinite; }
.blink { animation: blink 1.5s infinite; }

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ============================================
   PRACTICE EXAM STYLES
   ============================================ */
.info-box { background: linear-gradient(135deg, #f0f4ff, #e8f0fe); border-radius: 12px; padding: 16px 20px; border: 1px solid #d0dfff; }
.range-container { padding: 10px 0; }
.form-range { height: 6px; border-radius: 3px; }
.form-range::-webkit-slider-thumb { background: var(--accent-color); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(41, 98, 255, 0.3); }

/* ============================================
   EXAM SCREEN STYLES
   ============================================ */
.question-content { font-size: 16px; line-height: 1.8; color: #1a1a2e; margin-bottom: 16px; }
.question-content p { margin-bottom: 10px; }
.question-content img { max-width: 100%; max-height: 350px; border-radius: 10px; cursor: pointer; margin: 10px 0; }

.question-image-box { text-align: center; margin: 14px 0; background: #f8f9fc; border-radius: 12px; padding: 14px; border: 1px solid #e8ecf1; }
.question-image-box img { max-width: 100%; max-height: 350px; border-radius: 8px; cursor: pointer; }

.option-item { border: 2px solid #e8e8e8; border-radius: 12px; padding: 14px 18px; margin: 8px 0; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 12px; }
.option-item:hover { border-color: var(--accent-color); background: #f8faff; }
.option-item.selected { border-color: var(--accent-color); background: #eef2ff; box-shadow: 0 2px 8px rgba(41, 98, 255, 0.1); }

.option-label { width: 40px; height: 40px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.option-item.selected .option-label { background: var(--accent-color); color: #fff; }

.zoom-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.9); z-index: 9999; cursor: zoom-out; justify-content: center; align-items: center; }
.zoom-overlay.show { display: flex; }
.zoom-overlay img { max-width: 95%; max-height: 95%; border-radius: 12px; }

/* ============================================
   RESULT PAGE STYLES
   ============================================ */
.result-circle { position: relative; display: inline-block; }
.result-circle svg { transform: rotate(-90deg); }
.result-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }

/* ============================================
   LOADING & SKELETON
   ============================================ */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200px 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 16px; }
.skeleton-card { height: 120px; border-radius: 12px; }

.spinner { width: 40px; height: 40px; border: 3px solid #f0f0f0; border-top: 3px solid var(--accent-color); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 25px 60px rgba(0,0,0,0.3); overflow: hidden; width: 100%; max-width: 440px; }
.auth-header { background: linear-gradient(135deg, #1a237e, #0d47a1); color: #fff; padding: 32px; text-align: center; }
.auth-body { padding: 32px; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); width: 280px; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .question-palette, .side-palette { display: none; }
}

@media (max-width: 768px) {
    .admin-header { padding: 0 16px; }
    .admin-content { padding: 16px; }
    .dash-stats-row { grid-template-columns: 1fr 1fr; }
    .card-body { padding: 16px; }
    .course-card { padding: 16px; }
    .student-card { flex-direction: column; align-items: flex-start; }
    .student-stats { width: 100%; justify-content: space-around; }
    .exam-card .exam-stats { gap: 10px; }
    .table thead { display: none; }
    .table tbody tr { display: block; margin-bottom: 16px; border: 1px solid #eee; border-radius: 8px; padding: 12px; }
    .table tbody td { display: block; text-align: right; padding: 8px 0; border: none; }
    .table tbody td::before { content: attr(data-label); float: left; font-weight: 600; color: #555; }
}

@media (max-width: 576px) {
    .dash-stats-row { grid-template-columns: 1fr; }
    .course-actions { flex-direction: column; }
    .course-actions .btn { width: 100%; }
    .welcome-bar .quick-links { flex-direction: column; }
    .welcome-bar .quick-link { width: 100%; justify-content: center; }
    .auth-card { border-radius: 16px; }
    .auth-header { padding: 24px; }
    .auth-body { padding: 20px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .admin-sidebar, .admin-header, .mobile-bottom-nav, .question-palette, .no-print, .side-palette { display: none !important; }
    .admin-main { margin-left: 0 !important; }
    .admin-content { padding: 0 !important; }
    body { background: #fff !important; }
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root { --light-bg: #1a1a2e; }
    body { background: #1a1a2e; color: #e0e0e0; }
    .card, .stat-card, .question-card, .table-container, .dash-stat-card, .course-card, .exam-card, .student-card, .q-card, .section-card, .import-card, .student-detail-card, .subject-card, .chapter-card { background: #16213e; border-color: #0f3460; }
    .card-header, .section-header { background: #16213e; border-color: #0f3460; }
    .admin-header { background: #16213e; border-color: #0f3460; }
    .admin-header .header-left h4 { color: #e0e0e0; }
    .table thead th { background: #0f3460; }
    .table tbody tr:hover { background: #1a1a3e; }
    .form-control, .form-select { background: #16213e; border-color: #0f3460; color: #e0e0e0; }
    .admin-sidebar { background: #0f0f23; }
    .dash-filter-bar, .filter-bar, .bulk-bar { background: #16213e; border-color: #0f3460; }
    .mobile-bottom-nav { background: #16213e; border-color: #0f3460; }
    .q-text:after { background: linear-gradient(transparent, #16213e); }
}