:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --background: #f3f4f6;
    --surface: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1360px;
    margin: 28px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-weight: 700;
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.card {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

/* ========================================================
   REMIX ICON MODERN STYLING & MICRO-INTERACTIONS
   ======================================================== */
i[class^="ri-"], i[class*=" ri-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.15em;
    line-height: 1;
    font-size: 1.15em;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
}

button:hover i[class^="ri-"], button:hover i[class*=" ri-"],
.btn-primary:hover i, .btn-outline:hover i, .btn-success:hover i {
    transform: scale(1.15);
}

/* Nút bấm & Inputs */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; width: 100%; margin-top: 15px; }
.btn-success:hover { background: var(--success-hover); }

.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-muted); }
.btn-outline.active { border-color: var(--primary); color: var(--primary); background: #eff6ff; }

/* CSS cho hình ảnh bóc tách từ Word */
.quiz-image {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    margin: 4px;
    display: inline-block;
}

input[type="text"]:not(.input), input[type="password"]:not(.input), input[type="file"], textarea, .editable-box {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.editable-box {
    background: var(--surface);
    min-height: 45px;
    line-height: 1.5;
}

input[type="text"]:not(.input):focus, textarea:focus, .editable-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Chế độ xem & Bố cục */
.mode-switch {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    display: none; /* Ánh xạ từ JS cũ */
}

.question-box {
    border-left: 6px solid var(--primary);
    transition: transform 0.2s ease;
    overflow-x: auto; /* Ngăn công thức toán MathJax dài làm vỡ chiều ngang trang */
}

.question-box:hover {
    transform: translateX(4px);
}

.question-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 15px;
    word-break: break-word; /* Ngăn text hoặc link quá dài làm vỡ layout */
}

/* Đáp án */
.option-wrapper {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.option-practice {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
    margin-bottom: 8px;
}

.option-practice:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.option-practice input[type="radio"] {
    display: none;
}

/* Khối hiển thị A B C D (Tách riêng biệt) */
.opt-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #e5e7eb;
    color: var(--text-main);
    font-weight: 700;
    border-radius: 8px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-practice:hover .opt-badge {
    background-color: #d1d5db;
}

.option-practice.selected {
    border-color: var(--primary);
    background-color: #eff6ff;
}

.option-practice.selected .opt-badge {
    background-color: var(--primary);
    color: white;
}

.correct .opt-badge {
    background-color: #10b981 !important;
    color: white !important;
    border: none;
}

.incorrect .opt-badge {
    background-color: #ef4444 !important;
    color: white !important;
    border: none;
}

.opt-text {
    flex-grow: 1;
    line-height: 1.5;
    word-break: break-word;
}

/* Trạng thái chấm điểm */
.correct { background-color: #d1fae5 !important; border-color: #34d399 !important; color: #065f46; font-weight: 600; }
.incorrect { background-color: #fee2e2 !important; border-color: #f87171 !important; color: #991b1b; text-decoration: line-through; }

#score-board {
    display: none;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px dashed var(--primary);
}

.navbar {
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--surface); padding: 15px 20px; border-radius: var(--radius); 
    box-shadow: var(--shadow); margin-bottom: 24px; border: 1px solid var(--border);
}

@keyframes pulse-red {
    0% { background-color: var(--danger); }
    50% { background-color: #991b1b; }
    100% { background-color: var(--danger); }
}

.upload-section { text-align: center; }
.upload-section p { margin-bottom: 15px; font-weight: 600; }

/* --- GIAO DIỆN CHIA ĐÔI MÀN HÌNH (EDIT MODE) --- */
.wide-container {
    max-width: 1400px !important;
    transition: max-width 0.3s ease;
}

.split-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.preview-pane, .editor-pane {
    flex: 1;
    width: 50%;
    height: 75vh;
    overflow-y: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 20px 20px 20px;
}

body.editor-fullscreen .preview-pane,
body.editor-fullscreen .editor-pane {
    height: 85vh; /* Mở rộng tối đa khi full màn hình */
}

.preview-pane::-webkit-scrollbar, .editor-pane::-webkit-scrollbar { width: 8px; }
.preview-pane::-webkit-scrollbar-thumb, .editor-pane::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

@media (max-width: 900px) {
    .split-layout { flex-direction: column; }
    .preview-pane { width: 100%; flex: none; height: 45vh; max-height: none; }
    .editor-pane { width: 100%; flex: none; height: 55vh; max-height: none; min-height: 400px; }
}

/* --- CHẾ ĐỘ TOÀN MÀN HÌNH (EDITOR FULLSCREEN) --- */
body.editor-fullscreen .navbar,
body.editor-fullscreen .header {
    display: none !important;
}

body.editor-fullscreen {
    padding: 15px;
}

/* --- MODAL CẤU HÌNH XUẤT BẢN --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000;
}

.modal-content {
    width: 90%; max-width: 500px;
    background: var(--surface); border-radius: var(--radius);
    padding: 25px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: modal-pop 0.3s ease-out; border: 1px solid var(--border);
}

@keyframes modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================================
   CHẾ ĐỘ THI TỐI GIẢN & PHÒNG THI HỌC SINH (STUDENT EXAM)
   ======================================================== */
body.minimal-mode {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8fafc;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

body.minimal-mode #azotaNavbar,
body.minimal-mode .azota-navbar,
body.minimal-mode .header,
body.minimal-mode .navbar,
body.minimal-mode #studentDashboard,
body.minimal-mode #creationHub,
body.minimal-mode #teacherDashboard {
    display: none !important;
}

body.minimal-mode:not(.quiz-completed) #leaderboard,
body.minimal-mode:not(.quiz-completed) #resultNavTabs,
body.minimal-mode .app-footer {
    display: none !important;
}

body.minimal-mode #mainAppContainer {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 12px 20px 40px 20px;
    box-sizing: border-box;
}

@media (max-width: 960px) {
    body.minimal-mode #mainAppContainer {
        padding: 0 10px 95px 10px;
    }
}

/* --- STICKY EXAM HEADER CHO HỌC SINH --- */
.azota-student-header, #studentHeader {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--azota-border);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 10px;
    z-index: 1000;
    transition: all 0.2s ease;
}

.azota-student-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.azota-student-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.btn-exit-minimal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
    flex-shrink: 0;
    touch-action: manipulation;
}

.btn-exit-minimal:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.azota-student-title-wrap {
    min-width: 0;
    flex: 1;
}

.azota-student-title-wrap .quiz-title-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.azota-student-meta-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 3px;
    font-size: 0.84rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.azota-student-meta-strip .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* --- Hiệu ứng chạy chữ mượt mà liên tục cho Tên thí sinh quá dài --- */
.student-name-marquee-box {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    vertical-align: middle;
    mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
}

.student-name-marquee-track {
    display: inline-block;
    white-space: nowrap;
    animation: studentNameTicker 10s linear infinite;
    will-change: transform;
}

.student-name-marquee-track:hover {
    animation-play-state: paused;
}

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

.azota-student-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Đồng hồ đếm thời gian: dòng chữ nhẹ nhàng thanh lịch, không tốn diện tích */
.exam-sticky-timer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e11d48;
    padding: 2px 0 !important;
    border-radius: 0 !important;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    user-select: none;
}

.exam-sticky-timer i {
    font-size: 1.1rem;
    color: #e11d48;
    line-height: 1;
}

.exam-sticky-timer span {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-weight: 700;
    color: #e11d48;
}

@media (max-width: 960px) {
    .azota-student-header, #studentHeader {
        top: 0;
        left: 0;
        right: 0;
        border-radius: 0 0 16px 16px;
        padding: 8px 12px;
        margin-bottom: 12px;
        border-top: none;
        border-left: none;
        border-right: none;
    }
    
    .desktop-only-submit {
        display: none !important;
    }
    
    .azota-student-title-wrap .quiz-title-text {
        font-size: 0.96rem;
        max-width: 170px;
    }
    
    .exam-sticky-timer {
        padding: 0 !important;
        font-size: 0.88rem;
        gap: 3px;
    }
    .exam-sticky-timer i {
        font-size: 0.98rem;
    }
    
    .student-name-marquee-box {
        max-width: 170px;
    }
    
    .btn-exit-minimal {
        padding: 6px 10px;
        font-size: 0.84rem;
    }
    .btn-exit-minimal .exit-text {
        display: none;
    }
    
    .azota-student-meta-strip {
        gap: 8px;
        font-size: 0.76rem;
    }
}

/* ========================================================
   MOBILE EXAM BOTTOM BAR & DRAWER (BẢNG CÂU HỎI DI ĐỘNG)
   ======================================================== */
.azota-mobile-exam-bar {
    display: none;
}

@media (max-width: 960px) {
    body.minimal-mode .azota-mobile-exam-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 62px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(226, 232, 240, 0.9);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        padding: 0 14px;
        align-items: center;
        justify-content: space-between;
        z-index: 1200;
        box-sizing: border-box;
    }
    
    body.quiz-completed .azota-mobile-exam-bar {
        display: none !important;
    }
    
    .btn-mobile-nav-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #f1f5f9;
        border: 1.5px solid #cbd5e1;
        border-radius: 12px;
        padding: 8px 14px;
        cursor: pointer;
        color: #1e293b;
        font-size: 0.95rem;
        transition: all 0.15s ease;
        touch-action: manipulation;
    }
    
    .btn-mobile-nav-toggle:active {
        background: #e2e8f0;
        transform: scale(0.98);
    }
    
    .mobile-nav-text-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .mobile-nav-label {
        font-size: 0.84rem;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.2;
    }
    
    .mobile-nav-sub {
        font-size: 0.72rem;
        font-weight: 600;
        color: #4f46e5;
        line-height: 1.2;
    }
    
    .btn-mobile-submit {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 12px;
        font-weight: 800;
        font-size: 0.95rem;
        cursor: pointer;
        box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
        touch-action: manipulation;
        transition: transform 0.15s ease;
    }
    
    .btn-mobile-submit:active {
        transform: scale(0.96);
    }
}

/* Bottom Sheet Overlay & Drawer */
.azota-mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.azota-mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.azota-mobile-nav-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    padding: 12px 18px 24px 18px;
    max-height: 78vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.azota-mobile-nav-sheet.open {
    transform: translateY(0);
}

.mobile-sheet-drag-handle {
    display: flex;
    justify-content: center;
    padding: 4px 0 10px 0;
    cursor: pointer;
}

.sheet-pill {
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #cbd5e1;
}

.mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.mobile-nav-badge-pill {
    font-size: 0.8rem;
    background: #eff6ff;
    color: #4f46e5;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-sheet-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 14px 0;
    max-height: 48vh;
    overflow-y: auto;
}

@media (max-width: 400px) {
    .mobile-sheet-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mobile-sheet-footer {
    margin-top: 14px;
    padding-bottom: 8px;
}

/* Khi hoàn thành bài, cho phép cuộn toàn trang */
body.minimal-mode.quiz-completed {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
}

body.minimal-mode.quiz-completed #mainAppContainer {
    overflow: visible;
}

body.minimal-mode.quiz-completed #quiz-container {
    overflow-y: visible;
    padding-bottom: 30px;
}

/* ========================================================
   HOCNHANHTN BRAND LOADING SYSTEM (Chuẩn hieuung.html)
   ======================================================== */

.hntn-page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.hntn-page-preloader.hntn-loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hntn-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: hntnFadeIn 0.25s ease-out;
    transition: opacity 0.25s ease;
}

@keyframes hntnFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hntn-loading-card, .hntn-preloader-card {
    background: #ffffff !important;
    border-radius: 24px !important;
    padding: 38px 32px 32px 32px !important;
    width: 100% !important;
    max-width: 460px !important;
    text-align: center !important;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.8) !important;
    animation: hntnCardScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

@keyframes hntnCardScale {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hntn-loading-card::before, .hntn-preloader-card::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #00d2ff, #2d79f3, #2d4af3) !important;
}

.hntn-loader-wrapper {
    position: relative;
    width: 124px;
    height: 124px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hntn-loader-glow {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(45, 121, 243, 0.22) 0%, rgba(0, 229, 255, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    animation: hntnGlowPulse 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hntnGlowPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.5; }
    50% { transform: scale(1.22); opacity: 0.85; }
}

.hntn-loader-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
    filter: drop-shadow(0 6px 14px rgba(45, 121, 243, 0.18));
}

/* Kịch bản chuyển động logo HocNhanhTN (Tương thích 100% với hieuung.html) */
@keyframes fadeAndSlideDownDisappear {
    0% { opacity: 1; transform: translateY(0px); }
    35% { opacity: 1; transform: translateY(0px); }
    60% { opacity: 0.5; transform: translateY(35px); }
    90%, 100% { opacity: 0; transform: translateY(90px); visibility: hidden; }
}

.disappearing-elements {
    animation: fadeAndSlideDownDisappear 1.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes checkmarkKickUp {
    0% { transform: translateY(0px) rotate(0deg); }
    10% { transform: translateY(6px) rotate(-2deg); }
    24% { transform: translateY(-24px) rotate(5deg) scale(1.05); }
    40% { transform: translateY(-4px) rotate(1deg); }
    55%, 100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes capKickedJumpSpin {
    0% { transform: translateY(0px) rotate(0deg) scale(1); }
    10% { transform: translateY(4px) rotate(-1deg) scale(1.01, 0.98); }
    26% { transform: translateY(-56px) rotate(90deg) scale(1.12); }
    48% { transform: translateY(-44px) rotate(240deg) scale(1.08); }
    68% { transform: translateY(3px) rotate(360deg) scale(0.97, 1.03); }
    78% { transform: translateY(-5px) rotate(360deg) scale(1.01); }
    88%, 100% { transform: translateY(0px) rotate(360deg) scale(1); }
}

.tick-interactive-group {
    transform-box: view-box;
    transform-origin: 250px 280px;
    animation: checkmarkKickUp 2.2s cubic-bezier(0.34, 1.3, 0.64, 1) infinite;
    animation-delay: 1.1s;
}

.cap-kicked-group {
    transform-box: view-box;
    transform-origin: 250px 185px;
    animation: capKickedJumpSpin 2.2s cubic-bezier(0.34, 1.25, 0.64, 1) infinite;
    animation-delay: 1.1s;
}

.hntn-loading-title {
    color: #0f172a !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: normal !important;
    text-shadow: none !important;
}

.hntn-loading-sub {
    color: #64748b !important;
    font-size: 0.88rem !important;
    margin: 0 !important;
    max-width: 380px !important;
    line-height: 1.5 !important;
}

.hntn-progress-percent {
    font-size: 1.85rem !important;
    font-weight: 800 !important;
    color: #2563eb !important;
    text-shadow: none !important;
    margin: 0 0 8px 0 !important;
    letter-spacing: -0.5px !important;
    font-variant-numeric: tabular-nums !important;
}

.hntn-progress-bar-bg {
    width: 100% !important;
    max-width: 380px !important;
    height: 8px !important;
    background: #f1f5f9 !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    margin: 0 auto 18px auto !important;
    border: 1px solid #e2e8f0 !important;
}

.hntn-progress-bar-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #00d2ff 0%, #2d79f3 50%, #2d4af3 100%) !important;
    border-radius: 999px !important;
    transition: width 0.4s ease !important;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.45) !important;
}

.hntn-progress-bar-bg, .progress-bar-container {
    width: 100%;
    max-width: 380px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 18px auto;
}

.hntn-progress-bar-fill, .progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff 0%, #2d79f3 50%, #2d4af3 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.45);
}

.hntn-loading-title {
    margin: 0 0 6px 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
}

.hntn-loading-sub {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Inline Loading Component */
.hntn-inline-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    width: 100%;
}

.hntn-inline-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary, #2563eb);
    margin-bottom: 4px;
}

.hntn-inline-sub {
    font-size: 0.88rem;
    color: #64748b;
}

/* Fallback spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid #e2e8f0;
    border-top: 3.5px solid var(--primary, #2563eb);
    border-radius: 50%;
    animation: hntnSpinFallback 0.8s linear infinite;
    display: inline-block;
}
@keyframes hntnSpinFallback {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =======================================================
   CSS CHO BẢNG RÀ SOÁT & THỐNG KÊ LỖI ĐỀ THI AI
   ======================================================= */
.ai-dashboard {
    background: linear-gradient(135deg, #fdf4ff 0%, #f5f3ff 50%, #eff6ff 100%);
    border: 2px solid #c084fc;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px -5px rgba(147, 51, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.ai-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9d5ff;
}

.ai-dashboard-title {
    margin: 0;
    color: #6b21a8;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.ai-stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #e9d5ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.1);
}

.ai-stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 6px;
}
.ai-stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0 20px 0;
}
.ai-cat-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.ai-summary-banner {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #c084fc;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.06);
}
.ai-summary-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #6b21a8;
}
.ai-summary-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #3b0764;
}

.ai-cat-knowledge { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.ai-cat-answer { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.ai-cat-grammar { background: #fefce8; border-color: #fde047; color: #854d0e; }
.ai-cat-format { background: #f8fafc; border-color: #cbd5e1; color: #475569; }
.ai-cat-delete { background: #fef2f2; border-color: #f87171; color: #b91c1c; font-weight: 700; }
.ai-cat-restructure { background: #faf5ff; border-color: #c084fc; color: #7e22ce; font-weight: 700; }

.btn-ai-delete {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.btn-ai-delete:hover {
    background: #dc2626 !important;
    transform: translateY(-1px);
}

.btn-ai-restructure {
    background: #8b5cf6 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.btn-ai-restructure:hover {
    background: #7c3aed !important;
    transform: translateY(-1px);
}

.ai-error-list-container {
    max-height: 380px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px;
}

.ai-error-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 8px;
    transition: background-color 0.15s;
}
.ai-error-item:last-child {
    border-bottom: none;
}
.ai-error-item:hover {
    background-color: #faf5ff;
}

@keyframes errorGlowPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); transform: scale(1.01); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); transform: scale(1); }
}

.ai-target-highlight {
    animation: errorGlowPulse 1.2s ease-in-out 3;
    border: 2px solid #ef4444 !important;
    background-color: #fff1f2 !important;
    border-radius: 12px;
}

/* ========================================================
   GOOGLE SIGN-IN & AUTH STYLES
   ======================================================== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 16px 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    outline: none;
    font-family: inherit;
}

.btn-google:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 2px 5px 0 rgba(60, 64, 67, 0.15), 0 1px 3px 1px rgba(60, 64, 67, 0.1);
    transform: translateY(-1px);
}

.btn-google:active {
    background-color: #f3f4f6;
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-google .google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========================================================
   STYLED WRAPPER FORM (EXACT SPECIFICATION)
   ======================================================== */
.styled-auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 85vh;
  width: 100%;
  padding: 20px 10px;
  box-sizing: border-box;
}

.styled-auth-wrapper[style*="display: none"],
.styled-auth-wrapper[style*="display:none"],
#authContainer[style*="display: none"],
#authContainer[style*="display:none"],
#authContainer.hidden {
  display: none !important;
}

.styled-auth-wrapper .form {
  display: flex;
  flex-direction: column !important;
  gap: 10px !important;
  background-color: #ffffff !important;
  padding: 30px !important;
  width: 450px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
  margin: auto !important;
  border: 1px solid #ededef !important;
}

.styled-auth-wrapper .form[style*="display: none"],
.styled-auth-wrapper .form[style*="display:none"],
.styled-auth-wrapper .form.hidden {
  display: none !important;
}

.styled-auth-wrapper ::placeholder {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
  color: #9ca3af !important;
}

.styled-auth-wrapper .form button {
  align-self: flex-end;
}

.styled-auth-wrapper .flex-column {
  display: flex !important;
  flex-direction: column !important;
}

.styled-auth-wrapper .flex-column > label {
  color: #151717 !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  display: block !important;
  margin-bottom: 2px !important;
}

.styled-auth-wrapper .inputForm {
  border: 1.5px solid #ecedec !important;
  border-radius: 10px !important;
  height: 50px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  box-sizing: border-box !important;
  transition: 0.2s ease-in-out !important;
  background-color: #ffffff !important;
  width: 100% !important;
  margin: 0 !important;
}

.styled-auth-wrapper .inputForm svg {
  flex-shrink: 0 !important;
  fill: #71717a !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.styled-auth-wrapper .inputForm .input {
  margin-left: 10px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  border-radius: 10px !important;
  border: none !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 14px !important;
  color: #151717 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.styled-auth-wrapper .inputForm .input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.styled-auth-wrapper .inputForm:focus-within {
  border: 1.5px solid #2d79f3 !important;
}

.styled-auth-wrapper .flex-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  justify-content: space-between !important;
  width: 100% !important;
  margin-top: 2px !important;
  box-sizing: border-box !important;
}

.styled-auth-wrapper .flex-row > div {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.styled-auth-wrapper .flex-row > div > input[type="radio"],
.styled-auth-wrapper .flex-row > div > input[type="checkbox"] {
  margin: 0 !important;
  width: auto !important;
  cursor: pointer !important;
}

.styled-auth-wrapper .flex-row > div > label {
  font-size: 14px !important;
  color: black !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.styled-auth-wrapper .span {
  font-size: 14px !important;
  margin-left: 5px !important;
  color: #2d79f3 !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
}

.styled-auth-wrapper .span:hover {
  color: #1a56db !important;
  text-decoration: underline !important;
}

.styled-auth-wrapper .button-submit {
  margin: 20px 0 10px 0 !important;
  background-color: #151717 !important;
  border: none !important;
  color: white !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  border-radius: 10px !important;
  height: 50px !important;
  width: 100% !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease-in-out, transform 0.1s !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}

.styled-auth-wrapper .button-submit:hover {
  background-color: #25282a !important;
  transform: translateY(-1px) !important;
}

.styled-auth-wrapper .button-submit:active {
  transform: translateY(0) !important;
}

.styled-auth-wrapper .p {
  text-align: center !important;
  color: black !important;
  font-size: 14px !important;
  margin: 5px 0 !important;
  width: 100% !important;
}

.styled-auth-wrapper .p.line {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #71717a !important;
  font-size: 13px !important;
  margin: 12px 0 6px 0 !important;
}

.styled-auth-wrapper .p.line::before,
.styled-auth-wrapper .p.line::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background-color: #ecedec !important;
  margin: 0 10px !important;
}

.styled-auth-wrapper .btn {
  margin-top: 10px !important;
  width: 100% !important;
  flex: 1 !important;
  height: 50px !important;
  border-radius: 10px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  font-weight: 500 !important;
  gap: 10px !important;
  border: 1px solid #ededef !important;
  background-color: white !important;
  cursor: pointer !important;
  transition: 0.2s ease-in-out !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
  color: #151717 !important;
  padding: 0 !important;
}

.styled-auth-wrapper .btn:hover {
  border: 1px solid #2d79f3 !important;
  background-color: #f8faff !important;
}

.styled-auth-wrapper .btn svg {
  flex-shrink: 0 !important;
}

/* ========================================================
   ROLE SELECTION & PENDING APPROVAL CARDS (FIRST LOGIN)
   ======================================================== */
.styled-auth-wrapper .google-user-banner {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: #f8fafc !important;
  border: 1.5px solid #edf2f7 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  margin-bottom: 2px !important;
}

.styled-auth-wrapper .google-user-avatar-box {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #4f46e5, #06b6d4) !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.styled-auth-wrapper .google-user-avatar-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.styled-auth-wrapper .google-user-meta {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  text-align: left !important;
  gap: 2px !important;
}

.styled-auth-wrapper .google-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.styled-auth-wrapper .google-email {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 310px !important;
}

.styled-auth-wrapper .role-selector-row {
  display: flex !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 2px 0 !important;
}

.styled-auth-wrapper .role-selector-item {
  flex: 1 !important;
  border: 1.5px solid #ecedec !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  background: #ffffff !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  box-sizing: border-box !important;
  user-select: none !important;
}

.styled-auth-wrapper .role-selector-item:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.styled-auth-wrapper .role-selector-item.selected#chooseStudentCard {
  border-color: #2d79f3 !important;
  background: #f0f7ff !important;
  box-shadow: 0 0 0 1px #2d79f3 !important;
}

.styled-auth-wrapper .role-selector-item.selected#chooseTeacherCard {
  border-color: #6366f1 !important;
  background: #f5f3ff !important;
  box-shadow: 0 0 0 1px #6366f1 !important;
}

.styled-auth-wrapper .role-selector-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
}

.styled-auth-wrapper .role-emoji {
  font-size: 18px !important;
  line-height: 1 !important;
}

.styled-auth-wrapper .role-name {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  flex: 1 !important;
  margin-left: 6px !important;
}

.styled-auth-wrapper .role-check-icon {
  font-size: 16px !important;
  color: #cbd5e1 !important;
  transition: color 0.2s ease !important;
}

.styled-auth-wrapper .role-selector-item.selected#chooseStudentCard .role-check-icon {
  color: #2d79f3 !important;
}

.styled-auth-wrapper .role-selector-item.selected#chooseTeacherCard .role-check-icon {
  color: #6366f1 !important;
}

.styled-auth-wrapper .role-badge-text {
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  display: inline-block !important;
  align-self: flex-start !important;
}

.styled-auth-wrapper .role-badge-text.instant {
  background: #dcfce7 !important;
  color: #15803d !important;
}

.styled-auth-wrapper .role-badge-text.pending {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

.btn-role-action.teacher-btn {
  background: #4f46e5;
  color: #ffffff;
}

.btn-role-action.teacher-btn:hover {
  background: #4338ca;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.35);
}

/* Pending Approval Icon Pulse */
.pending-icon-pulse {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 16px;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  animation: pendingPulse 2s infinite;
}

@keyframes pendingPulse {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }
  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 16px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.btn-check-approval {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-check-approval:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn-cancel-pending {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-cancel-pending:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ========================================================
   HOCNHANHTN MODERN PRO THEME & DESIGN SYSTEM
   ======================================================== */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-soft: #f5f3ff;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  
  --azota-primary: #4f46e5;
  --azota-primary-hover: #4338ca;
  --azota-primary-light: #eef2ff;
  --azota-primary-soft: #f5f3ff;
  
  --accent-cyan: #06b6d4;
  --accent-purple: #7c3aed;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --azota-accent: #06b6d4;
  --azota-success: #10b981;
  --azota-danger: #f43f5e;
  --azota-warning: #f59e0b;
  --azota-purple: #7c3aed;
  
  --azota-bg: #f8fafc;
  --azota-surface: #ffffff;
  --azota-text: #0f172a;
  --azota-text-muted: #64748b;
  --azota-border: #e2e8f0;
  --azota-radius: 16px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --azota-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  --azota-shadow-hover: 0 14px 28px -4px rgba(79, 70, 229, 0.14), 0 6px 12px -2px rgba(15, 23, 42, 0.04);
}

/* ========================================================
   TOP BRAND NAVBAR (CLEAN WHITE PRO SAAS STYLE)
   ======================================================== */
.azota-navbar {
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.azota-nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.azota-brand, .azota-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.azota-brand-logo {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1.5px solid rgba(2, 132, 199, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18);
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
  box-sizing: border-box;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.azota-brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.azota-brand:hover .azota-brand-logo,
.azota-nav-brand:hover .azota-brand-logo {
  transform: rotate(-6deg) scale(1.05);
}

.azota-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.azota-brand-title span {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}

.azota-brand-sub {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.azota-nav-tabs, .azota-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.azota-nav-tab {
  background: transparent;
  color: #64748b;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.azota-nav-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.azota-nav-tab.active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.azota-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.azota-user-pill, .azota-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  padding: 5px 12px 5px 6px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.azota-avatar-circle, .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 1.5px solid #c7d2fe;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
  white-space: nowrap;
}

.azota-role-tag, .azota-role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4338ca;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.azota-btn-nav-logout, .azota-user-badge .btn-azota-sub {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.azota-btn-nav-logout:hover, .azota-user-badge .btn-azota-sub:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* ========================================================
   CREATION HUB (3 BENTO CARDS)
   ======================================================== */
.azota-creation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.azota-create-card {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--azota-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.azota-create-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--azota-shadow-hover);
  border-color: #c7d2fe;
}

.azota-create-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.azota-create-card#uploadBox::before {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.azota-create-card#aiGenerateBox::before {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.azota-create-card#studioQuickBox::before {
  background: linear-gradient(90deg, #059669, #34d399);
}

.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 16px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.azota-create-card:hover .card-icon-wrap {
  transform: scale(1.1);
}

.card-icon-wrap.blue { background: #eff6ff; color: #0284c7; }
.card-icon-wrap.purple { background: #f5f3ff; color: #7c3aed; }
.card-icon-wrap.emerald { background: #ecfdf5; color: #059669; }

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.card-desc {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ========================================================
   TEACHER MANAGEMENT DASHBOARD
   ======================================================== */
#teacherDashboard {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--azota-shadow);
}

.azota-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .azota-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.azota-stats-strip .azota-stat-box {
  background: #f8fafc;
  border: 1px solid var(--azota-border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.azota-stats-strip .azota-stat-box:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.azota-stats-strip .azota-stat-box .val {
  font-size: 2rem;
  font-weight: 900;
  color: #4f46e5;
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.azota-stats-strip .azota-stat-box .lbl {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

/* Toolbar (Search + Filter Tabs) */
.azota-toolbar {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--azota-shadow);
}

.azota-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.azota-search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.azota-search-input,
.azota-search-box input {
  width: 100% !important;
  padding: 12px 18px 12px 46px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  font-size: 0.94rem !important;
  margin: 0 !important;
  background: #f8fafc !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  color: #0f172a !important;
}

.azota-search-input:focus,
.azota-search-box input:focus {
  background: #ffffff !important;
  border-color: #4f46e5 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.azota-filter-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.azota-tab-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.azota-tab-btn:hover {
  color: #0f172a;
}

.azota-tab-btn.active {
  background: #ffffff;
  color: #4f46e5;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.azota-tab-count,
.azota-tab-btn span {
  font-size: 0.76rem;
  background: #e2e8f0;
  color: #475569;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.azota-tab-btn.active span {
  background: #eef2ff;
  color: #4f46e5;
}

/* Quiz Cards Grid */
.azota-quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.azota-quiz-card {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--azota-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.azota-quiz-card:hover {
  border-color: #c7d2fe;
  transform: translateY(-3px);
  box-shadow: var(--azota-shadow-hover);
}

.quiz-card-head, .azota-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.quiz-card-title, .azota-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.2px;
}

.quiz-status-pill, .azota-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quiz-status-pill.open, .azota-badge-open {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.quiz-status-pill.closed, .azota-badge-locked {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.quiz-card-meta, .azota-card-meta {
  display: flex;
  gap: 14px;
  color: #64748b;
  font-size: 0.86rem;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.quiz-meta-item, .azota-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

/* Card Action Buttons */
.btn-azota-copy {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  margin-bottom: 10px;
}

.btn-azota-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

.azota-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.azota-btn-row .btn-azota-sub {
  flex: 1 1 auto;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.azota-btn-row .btn-azota-sub:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
  transform: translateY(-1px);
}

/* ========================================================
   STUDENT EXAM ROOM (SPLIT LAYOUT & QUESTION NAVIGATOR)
   ======================================================== */
.azota-exam-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: flex-start;
  margin-top: 15px;
  width: 100%;
}

@media (max-width: 960px) {
  .azota-exam-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0;
  }
  .azota-exam-col-main {
    width: 100% !important;
    max-width: 100% !important;
  }
  .azota-exam-col-side {
    display: none !important;
  }
}

#examStickyTimer {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #e11d48;
  padding: 2px 0 !important;
  border-radius: 0 !important;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.3px;
}

.btn-azota-submit-big {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  width: 100%;
}

.btn-azota-submit-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Question Cards */
.azota-q-card, .azota-question-card, .question-box {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--azota-shadow);
  transition: border-color 0.2s ease;
  position: relative;
}

.azota-q-card:hover, .azota-question-card:hover {
  border-color: #c7d2fe;
}

.azota-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.azota-q-num, .azota-q-num-badge {
  font-weight: 800;
  color: #4f46e5;
  background: #eef2ff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
}

.azota-btn-flag {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.azota-btn-flag:hover, .azota-btn-flag.active {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.15);
}

.question-title, .azota-q-text {
  font-size: 1.08rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Option List */
.azota-opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.azota-opt-item, .option-practice {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.98rem;
  color: #1e293b;
}

.azota-opt-item:hover, .option-practice:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.azota-opt-item.selected, .option-practice.selected {
  background: #eef2ff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 1px #4f46e5 !important;
  color: #312e81 !important;
  font-weight: 600 !important;
}

.azota-opt-badge, .opt-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.azota-opt-item.selected .azota-opt-badge,
.option-practice.selected .opt-badge {
  background: #4f46e5;
  color: white;
}

.azota-opt-item.correct, .option-practice.correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
}

.azota-opt-item.correct .azota-opt-badge,
.option-practice.correct .opt-badge {
  background: #10b981 !important;
  color: white !important;
}

.azota-opt-item.incorrect, .option-practice.incorrect {
  background: #fff1f2 !important;
  border-color: #f43f5e !important;
  color: #881337 !important;
}

.azota-opt-item.incorrect .azota-opt-badge,
.option-practice.incorrect .opt-badge {
  background: #f43f5e !important;
  color: white !important;
}

/* Responsive polish cho Question Cards & Options trên điện thoại */
@media (max-width: 768px) {
  .azota-q-card, .azota-question-card, .question-box {
    padding: 16px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 14px !important;
  }
  
  .azota-q-header {
    margin-bottom: 12px !important;
  }
  
  .azota-q-num, .azota-q-num-badge {
    font-size: 0.88rem !important;
    padding: 3px 10px !important;
  }
  
  .btn-flag-q, .azota-btn-flag {
    padding: 5px 10px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
  }
  
  .question-title, .azota-q-text {
    font-size: 1.02rem !important;
    line-height: 1.55 !important;
    margin-bottom: 14px !important;
  }
  
  .azota-opt-item, .option-practice {
    padding: 11px 14px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
    touch-action: manipulation;
  }
  
  .azota-opt-badge, .opt-badge {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 0.92rem !important;
    margin-right: 12px !important;
  }
  
  .opt-text {
    font-size: 0.96rem !important;
    line-height: 1.45 !important;
  }
  
  /* Giới hạn công thức MathJax không tràn màn hình */
  mjx-container, .MathJax {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }
  
  /* Ảnh trong câu hỏi */
  .azota-q-text img, .question-title img, .question-box img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    display: block !important;
    margin: 8px auto !important;
    object-fit: contain !important;
  }
}

/* Question Navigator Palette */
.azota-navigator-card {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--azota-shadow);
  position: sticky;
  top: 84px;
}

.azota-nav-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.azota-nav-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  border: 1px solid #f1f5f9;
}

.azota-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot, .azota-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.green, .azota-legend-dot.green { background: #4f46e5; }
.legend-dot.gray, .azota-legend-dot.gray { background: #cbd5e1; }
.legend-dot.red, .azota-legend-dot.red, .legend-dot.amber { background: #f59e0b; }

.azota-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
}

.azota-nav-num {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.azota-nav-num:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.azota-nav-num.answered {
  background: #4f46e5 !important;
  color: white !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.azota-nav-num.flagged {
  background: #f59e0b !important;
  color: white !important;
  border-color: #f59e0b !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

/* ========================================================
   RESULT & SCORE SCREEN
   ======================================================== */
.azota-result-card {
  background: #ffffff;
  border: 1px solid var(--azota-border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--azota-shadow-hover);
  margin-bottom: 24px;
}

.azota-result-title {
  color: var(--azota-primary);
  margin: 0 0 8px 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
}

.azota-result-subtitle {
  color: #64748b;
  font-size: 1.05rem;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.azota-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 6px solid #4f46e5;
  color: #4f46e5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.22);
}

.azota-score-circle .big-num {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
}

.azota-score-circle .scale {
  font-size: 0.88rem;
  font-weight: 700;
  color: #6366f1;
}

.azota-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .azota-result-card {
    padding: 20px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
  }
  .azota-result-title {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
    margin-bottom: 6px !important;
  }
  .azota-result-subtitle {
    font-size: 0.9rem !important;
    margin-bottom: 16px !important;
    line-height: 1.45 !important;
  }
  .azota-score-circle {
    width: 96px !important;
    height: 96px !important;
    margin: 0 auto 12px auto !important;
    border-width: 4px !important;
  }
  .azota-score-circle .big-num {
    font-size: 2rem !important;
  }
  .azota-score-circle .scale {
    font-size: 0.76rem !important;
  }
  .azota-result-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin: 16px 0 !important;
  }
  .azota-res-tile {
    padding: 10px 6px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 72px !important;
  }
  .azota-res-tile .val {
    font-size: 1.35rem !important;
    line-height: 1.15 !important;
  }
  .azota-res-tile.tile-time .val {
    font-size: 1.15rem !important;
    white-space: nowrap !important;
  }
  .azota-res-tile .desc {
    font-size: 0.72rem !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
  }
}

.azota-res-tile {
  background: #f8fafc;
  border: 1px solid var(--azota-border);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}

.azota-res-tile.green { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.azota-res-tile.red { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.azota-res-tile.gray { background: #f8fafc; border-color: #e2e8f0; color: #475569; }
.azota-res-tile.blue { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }

.azota-res-tile .val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
}

.azota-res-tile .desc {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ========================================================
   FLOATING TOAST NOTIFICATIONS
   ======================================================== */
.azota-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
  pointer-events: none;
}

.azota-toast {
  pointer-events: auto;
  background: #0f172a;
  color: white;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.azota-toast.toast-success { background: #064e3b; border-left: 5px solid #10b981; }
.azota-toast.toast-error { background: #881337; border-left: 5px solid #f43f5e; }
.azota-toast.toast-info { background: #1e1b4b; border-left: 5px solid #6366f1; }
.azota-toast.toast-warning { background: #78350f; border-left: 5px solid #f59e0b; }

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


/* ========================================================
   CẤU TRÚC ĐỀ THI MỚI BỘ GD&ĐT: ĐÚNG / SAI & TRẢ LỜI NGẮN
   ======================================================== */
.azota-tf-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.azota-tf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--azota-bg, #f8fafc);
  border: 1.5px solid var(--azota-border, #e2e8f0);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.azota-tf-row:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
.azota-tf-statement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.98rem;
  color: var(--azota-text, #0f172a);
  line-height: 1.5;
  flex: 1;
}
.azota-tf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.azota-tf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.azota-tf-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.azota-tf-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}
.azota-tf-btn.selected-true {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.azota-tf-btn.selected-false {
  background: #f43f5e !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}
.azota-tf-btn.correct-state {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
}
.azota-tf-btn.wrong-state {
  background: #f43f5e !important;
  color: #ffffff !important;
  border-color: #e11d48 !important;
}

/* Dạng trả lời ngắn */
.azota-sa-box {
  margin-top: 14px;
  padding: 16px;
  background: var(--azota-bg, #f8fafc);
  border: 1.5px dashed var(--azota-border, #cbd5e1);
  border-radius: 12px;
}
.azota-sa-input {
  width: 100%;
  max-width: 320px;
  padding: 10px 14px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--azota-text, #0f172a);
  background: #ffffff;
  border: 2px solid var(--azota-border, #e2e8f0);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}
.azota-sa-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.azota-sa-input.correct {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
}
.azota-sa-input.incorrect {
  border-color: #f43f5e !important;
  background: #fff1f2 !important;
  color: #be123c !important;
}

/* ========================================================
   WEBLLM ON-DEVICE AI TUTOR STYLING
======================================================== */
@keyframes webllm-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes webllm-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes webllm-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* TẠM THỜI ẨN GIAO DIỆN WEBLLM THEO YÊU CẦU (Bật lại bằng cách xóa display:none hoặc bật ENABLE_WEBLLM) */
.webllm-status-pill,
.webllm-explain-card,
.btn-webllm-explain,
.webllm-feedback-container,
.webllm-modal-backdrop {
  display: none !important;
}

/* Floating Status Pill */
.webllm-status-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 30px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.webllm-status-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
}

.webllm-status-pill .pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.3s;
}

.webllm-status-pill.loading .pill-dot {
  background: #f59e0b;
  animation: webllm-pulse 1.4s infinite;
}

.webllm-status-pill.ready .pill-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.webllm-status-pill.generating .pill-dot {
  background: #6366f1;
  animation: webllm-pulse 0.8s infinite;
}

.webllm-status-pill.error .pill-dot {
  background: #ef4444;
}

.webllm-status-pill.unsupported .pill-dot {
  background: #64748b;
}

.webllm-status-pill .pill-icon {
  font-size: 1.05rem;
}

.webllm-explain-card {
  animation: webllm-fade-in 0.3s ease-out;
}

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

.webllm-model-card:hover {
  border-color: #6366f1 !important;
}

@media (max-width: 640px) {
  .webllm-status-pill {
    bottom: 74px; /* Tránh đè lên bottom navigation bar của điện thoại */
    right: 12px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* ========================================================
   GIAO DIỆN BẢNG XẾP HẠNG & XEM LẠI BÀI THI HIỆN ĐẠI
   ======================================================== */

/* --- LEADERBOARD CARD --- */
.azota-leaderboard-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.azota-leaderboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #f59e0b, #eab308, #6366f1, #3b82f6);
}

.azota-lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1.5px solid #f1f5f9;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.azota-lb-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.azota-lb-badge {
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
}

.azota-lb-refresh-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.05rem;
}

.azota-lb-refresh-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.azota-lb-refresh-btn.rotating {
  animation: lbSpin 0.6s linear infinite;
}

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

/* PODIUM TOP 3 */
.azota-lb-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin: 15px auto 28px auto;
  max-width: 650px;
}

.azota-podium-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s;
}

.azota-podium-slot:hover {
  transform: translateY(-4px);
}

.azota-podium-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.azota-podium-crown {
  position: absolute;
  top: -16px;
  font-size: 1.4rem;
}

.azota-podium-slot.rank-1 .azota-podium-avatar {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #fef08a 0%, #facc15 100%);
  color: #854d0e;
  border: 3px solid #eab308;
}

.azota-podium-slot.rank-2 .azota-podium-avatar {
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
  color: #334155;
  border: 3px solid #94a3b8;
}

.azota-podium-slot.rank-3 .azota-podium-avatar {
  background: linear-gradient(135deg, #ffedd5 0%, #fdba74 100%);
  color: #9a3412;
  border: 3px solid #f97316;
}

.azota-podium-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
  margin-bottom: 2px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.azota-podium-score {
  font-weight: 800;
  font-size: 1.1rem;
  color: #2563eb;
}

.azota-podium-time {
  font-size: 0.78rem;
  color: #64748b;
}

.azota-podium-bar {
  width: 100%;
  border-radius: 12px 12px 4px 4px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
}

.azota-podium-slot.rank-1 .azota-podium-bar {
  height: 80px;
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.35);
}

.azota-podium-slot.rank-2 .azota-podium-bar {
  height: 60px;
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

.azota-podium-slot.rank-3 .azota-podium-bar {
  height: 44px;
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
}

/* LEADERBOARD TABLE */
.azota-lb-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.azota-lb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  min-width: 520px;
}

.azota-lb-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1.5px solid #e2e8f0;
  text-align: left;
}

.azota-lb-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.azota-lb-table tr:last-child td {
  border-bottom: none;
}

.azota-lb-table tr:hover td {
  background: #f8fafc;
}

.azota-lb-table tr.is-current-user td {
  background: #fefce8 !important;
  font-weight: 700;
  border-top: 1.5px solid #fef08a;
  border-bottom: 1.5px solid #fef08a;
}

.azota-lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
}

.azota-lb-you-tag {
  background: #22c55e;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  display: inline-block;
}

/* Đảm bảo tuyệt đối: Khi chưa nộp bài hoặc đang làm bài thi, BỘ LỌC CÂU HỎI & TAB KẾT QUẢ & BẢNG ĐIỂM KHÔNG BAO GIỜ HIỂN THỊ */
body:not(.quiz-completed) #reviewFilterBarContainer,
body:not(.quiz-completed) #resultNavTabs,
body:not(.quiz-completed) #score-board {
  display: none !important;
}

/* --- BỘ LỌC CÂU HỎI SAU KHI NỘP BÀI (REVIEW FILTER TABS) --- */
.azota-review-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 16px 0;
  flex-wrap: wrap;
  padding: 6px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.azota-review-filter-bar .filter-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.azota-filter-tab {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.azota-filter-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.azota-filter-tab.active {
  background: #1976d2 !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.azota-filter-tab.tab-wrong.active {
  background: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.azota-filter-tab.tab-correct.active {
  background: #10b981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.azota-filter-tab.tab-skipped.active {
  background: #f59e0b !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.azota-filter-tab .tab-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.azota-filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* --- THẺ CÂU HỎI REVIEW SAU NỘP BÀI (REVIEW QUESTION CARD) --- */
.review-question-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  position: relative;
}

.review-question-card.status-correct {
  border-left: 6px solid #10b981 !important;
}

.review-question-card.status-wrong {
  border-left: 6px solid #ef4444 !important;
}

.review-question-card.status-skipped {
  border-left: 6px solid #f59e0b !important;
}

.review-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.review-q-number {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-status-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.review-status-badge.correct {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.review-status-badge.wrong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.review-status-badge.skipped {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.review-q-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #1e293b;
  margin-bottom: 18px;
  font-weight: 500;
}

/* POST-SUBMISSION VIEW TABS (NAVIGATOR GIỮA BÀI LÀM VÀ BẢNG XẾP HẠNG) */
.azota-result-nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 24px auto;
  max-width: 720px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
}

.azota-res-tab-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.azota-res-tab-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
}

.azota-res-tab-btn.active {
  background: #ffffff !important;
  color: #1d4ed8 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

.azota-res-tab-btn#tabBtnLeaderboard.active {
  color: #b45309 !important;
}

.azota-res-tab-badge {
  background: #e2e8f0;
  color: #475569;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s;
}

.azota-res-tab-btn.active .azota-res-tab-badge {
  background: #dbeafe;
  color: #1e40af;
}

.azota-res-tab-btn#tabBtnLeaderboard.active .azota-res-tab-badge {
  background: #fef08a;
  color: #854d0e;
}

/* QUICK ANSWER SUMMARY BANNER */
.review-quick-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

.review-quick-banner.is-correct {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}

.review-quick-banner.is-wrong {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}

.review-quick-banner.is-skipped {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #92400e;
}

.review-quick-banner .highlight-correct {
  color: #15803d;
  font-weight: 800;
}

.review-quick-banner .highlight-wrong {
  color: #dc2626;
  font-weight: 800;
}

/* REVIEW MCQ OPTIONS */
.review-opt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.review-opt-item {
  display: flex;
  align-items: flex-start;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #1e293b;
  gap: 12px;
}

.review-opt-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.review-opt-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

/* KHI LÀ ĐÁP ÁN ĐÚNG */
.review-opt-item.is-correct {
  background: #f0fdf4 !important;
  border: 2px solid #16a34a !important;
  color: #14532d !important;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.12) !important;
}

.review-opt-item.is-correct .review-opt-badge {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #15803d !important;
}

/* KHI LÀ LỰA CHỌN SAI CỦA HỌC SINH */
.review-opt-item.is-user-wrong {
  background: #fef2f2 !important;
  border: 2px solid #ef4444 !important;
  color: #7f1d1d !important;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.1) !important;
}

.review-opt-item.is-user-wrong .review-opt-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.review-opt-tag {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.review-opt-tag.tag-correct {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.review-opt-tag.tag-wrong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* REVIEW EXPLANATION CARD */
.review-explain-box {
  margin-top: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
  border-left: 5px solid #16a34a;
  border-radius: 12px;
  border-top: 1px solid #dcfce7;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.review-explain-box.fallback {
  background: #f8fafc;
  border-left-color: #94a3b8;
  border-top-color: #e2e8f0;
}

.review-explain-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #15803d;
  font-size: 0.96rem;
}

.review-explain-box.fallback .review-explain-title {
  color: #475569;
}

.review-explain-body {
  font-size: 0.96rem;
  line-height: 1.65;
  color: #1e293b;
}

/* ========================================================
   POST-SUBMISSION REVIEW - SEMANTIC & RESPONSIVE DESIGN
   ======================================================== */

/* TRUE / FALSE QUESTION ITEMS */
.review-tf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.review-tf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  gap: 12px;
  transition: all 0.2s ease;
}

.review-tf-item.is-correct {
  border-color: #86efac;
  background: #f0fdf4;
}

.review-tf-item.is-wrong {
  border-color: #fca5a5;
  background: #fef2f2;
}

.review-tf-item.is-skipped {
  border-color: #e2e8f0;
  background: #ffffff;
}

.review-tf-text {
  flex: 1;
  font-size: 0.96rem;
  color: #1e293b;
  line-height: 1.5;
  word-break: break-word;
}

.review-tf-char {
  color: var(--azota-primary);
  margin-right: 6px;
}

.review-tf-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  flex-shrink: 0;
}

.review-tf-user-pick {
  color: #64748b;
}

.review-tf-user-pick.correct b { color: #16a34a; }
.review-tf-user-pick.wrong b { color: #dc2626; }
.review-tf-user-pick.skipped b { color: #64748b; }

.review-tf-correct-ans {
  background: #f0fdf4;
  color: #166534;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  border: 1px solid #bbf7d0;
  font-size: 0.82rem;
}

.review-tf-icon {
  font-size: 1.05rem;
}

/* SHORT ANSWER QUESTION ITEMS */
.review-sa-box {
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-sa-box.is-correct { border-color: #86efac; background: #f0fdf4; }
.review-sa-box.is-wrong { border-color: #fca5a5; background: #fef2f2; }

.review-sa-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.review-sa-label {
  color: #64748b;
  font-weight: 600;
  font-size: 0.9rem;
}

.review-sa-val {
  font-weight: 800;
  font-size: 1.02rem;
  word-break: break-word;
}

.review-sa-val.correct { color: #16a34a; }
.review-sa-val.wrong { color: #dc2626; }
.review-sa-val.skipped { color: #64748b; }
.review-sa-val.highlight { text-decoration: underline; color: #15803d; }
.review-sa-icon { font-size: 1.05rem; }

/* MCQ OPTIONS CONTENT */
.review-opt-content {
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
}

/* LEADERBOARD TABLE COLUMNS */
.col-rank { width: 56px; }
.col-name { min-width: 140px; }
.col-score { width: 130px; }
.col-time { width: 120px; }
.lb-student-name { font-weight: 700; color: #1e293b; }
.lb-score-main { font-weight: 800; color: #2563eb; font-size: 1.02rem; }
.lb-score-sub { font-size: 0.82rem; color: #64748b; }
.lb-time-text { font-size: 0.88rem; color: #64748b; white-space: nowrap; }

/* KHI HOÀN THÀNH BÀI: ẨN ĐỒNG HỒ TRÊN HEADER ĐỂ TRÁNH RỐI MẮT */
body.quiz-completed #examStickyTimer,
body.quiz-completed .exam-sticky-timer {
  display: none !important;
}

/* ========================================================
   RESPONSIVE POLISH CHO ĐIỆN THOẠI (MOBILE ≤ 640px)
   ======================================================== */
@media (max-width: 640px) {
  /* 1. Nav Tabs */
  .azota-result-nav-tabs {
    margin: 12px 0 16px 0 !important;
    gap: 6px !important;
    padding: 4px !important;
    border-radius: 12px !important;
    max-width: 100% !important;
  }
  .azota-res-tab-btn {
    padding: 9px 8px !important;
    font-size: 0.84rem !important;
    gap: 4px !important;
    border-radius: 9px !important;
  }
  .azota-res-tab-badge {
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
  }

  /* 2. Review Filter Chips (Vuốt ngang mượt mà, không bao giờ vỡ dòng) */
  .azota-review-filter-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 2px !important;
    gap: 6px !important;
    margin: 12px 0 14px 0 !important;
    border-radius: 10px !important;
  }
  .azota-review-filter-bar::-webkit-scrollbar {
    display: none !important;
  }
  .azota-review-filter-bar .filter-title {
    display: none !important;
  }
  .azota-filter-tab {
    padding: 7px 11px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    gap: 4px !important;
  }
  .azota-filter-tab .tab-count {
    font-size: 0.72rem !important;
    padding: 1px 5px !important;
  }

  /* 3. Thẻ câu hỏi Review (Vừa vặn, thẩm mĩ, không bung) */
  .review-question-card {
    padding: 14px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 14px !important;
    border-left-width: 4px !important;
  }
  .review-q-header {
    margin-bottom: 10px !important;
    gap: 6px !important;
  }
  .review-q-number {
    font-size: 0.95rem !important;
    gap: 6px !important;
  }
  .review-status-badge {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
    gap: 3px !important;
  }
  .review-q-text {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin-bottom: 12px !important;
  }

  /* 4. MCQ Options trên điện thoại (Tối ưu 100% diện tích đọc đề) */
  .review-opt-list {
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  .review-opt-item {
    display: flex !important;
    flex-wrap: wrap !important;
    padding: 9px 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }
  .review-opt-badge {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    font-size: 0.82rem !important;
    border-radius: 6px !important;
  }
  .review-opt-content {
    flex: 1 1 calc(100% - 36px) !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  .review-opt-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: fit-content !important;
    max-width: calc(100% - 34px) !important;
    margin-left: 34px !important;
    margin-right: 0 !important;
    margin-top: 3px !important;
    padding: 3px 9px !important;
    font-size: 0.74rem !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
  }

  /* 5. Đúng / Sai trên điện thoại */
  .review-tf-item {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 9px 10px !important;
    gap: 6px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .review-tf-text {
    width: 100% !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
    box-sizing: border-box !important;
    word-break: break-word !important;
  }
  .review-tf-badges {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 0.78rem !important;
    border-top: 1px dashed #e2e8f0;
    padding-top: 5px !important;
    box-sizing: border-box !important;
  }
  .review-tf-correct-ans,
  .review-tf-user-pick {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* 6. Trả lời ngắn trên điện thoại */
  .review-sa-box {
    padding: 10px 12px !important;
    border-radius: 10px !important;
    font-size: 0.88rem !important;
    gap: 6px !important;
  }
  .review-sa-val {
    font-size: 0.92rem !important;
  }

  /* 7. Banner tóm tắt câu trả lời */
  .review-quick-banner {
    padding: 8px 10px !important;
    font-size: 0.84rem !important;
    border-radius: 8px !important;
    margin-bottom: 12px !important;
    gap: 6px !important;
    line-height: 1.4 !important;
  }
  .review-quick-banner i {
    font-size: 1rem !important;
    margin-top: 1px !important;
  }

  /* 8. Lời giải chi tiết */
  .review-explain-box {
    padding: 12px 12px !important;
    border-radius: 10px !important;
    margin-top: 12px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .review-explain-title {
    font-size: 0.88rem !important;
    margin-bottom: 6px !important;
    gap: 6px !important;
  }
  .review-explain-body {
    font-size: 0.88rem !important;
    line-height: 1.55 !important;
  }

  /* 9. Bảng xếp hạng & Bục vinh danh */
  .azota-leaderboard-card {
    padding: 14px 10px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }
  .azota-lb-header {
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
    gap: 6px !important;
  }
  .azota-lb-title {
    font-size: 0.95rem !important;
    gap: 6px !important;
  }
  .azota-lb-title i {
    font-size: 1.15rem !important;
  }
  .azota-lb-badge {
    padding: 2px 7px !important;
    font-size: 0.72rem !important;
  }
  .azota-lb-podium {
    gap: 5px !important;
    margin: 8px auto 14px auto !important;
  }
  .azota-podium-avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 0.9rem !important;
  }
  .azota-podium-crown {
    top: -12px !important;
    font-size: 1rem !important;
  }
  .azota-podium-slot.rank-1 .azota-podium-avatar {
    width: 48px !important;
    height: 48px !important;
  }
  .azota-podium-name {
    max-width: 65px !important;
    font-size: 0.74rem !important;
  }
  .azota-podium-score {
    font-size: 0.88rem !important;
  }
  .azota-podium-time {
    font-size: 0.68rem !important;
  }
  .azota-podium-slot.rank-1 .azota-podium-bar {
    height: 48px !important;
    font-size: 0.85rem !important;
  }
  .azota-podium-slot.rank-2 .azota-podium-bar {
    height: 36px !important;
    font-size: 0.78rem !important;
  }
  .azota-podium-slot.rank-3 .azota-podium-bar {
    height: 28px !important;
    font-size: 0.72rem !important;
  }

  /* 10. Bảng xếp hạng danh sách trên điện thoại */
  .azota-lb-table {
    min-width: 100% !important;
    font-size: 0.82rem !important;
  }
  .azota-lb-table th {
    padding: 7px 4px !important;
    font-size: 0.7rem !important;
  }
  .azota-lb-table td {
    padding: 8px 4px !important;
    font-size: 0.8rem !important;
  }
  .col-rank { width: 34px !important; }
  .col-score { width: 75px !important; }
  .col-time { width: 68px !important; }
  .azota-lb-rank-badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.76rem !important;
  }
  .lb-score-main {
    font-size: 0.9rem !important;
  }
  .lb-score-sub {
    font-size: 0.7rem !important;
    display: block !important;
  }
  .lb-time-text {
    font-size: 0.72rem !important;
  }
}

/* ========================================================
   CHỐNG TRÀN VÀ PHÌNH NGANG CHO TOÀN BỘ PHẦN TỬ TRÊN MOBILE
   ======================================================== */
.review-question-card,
.azota-result-card,
.azota-leaderboard-card,
#quiz-container,
.review-q-text,
.review-explain-box,
.review-opt-content {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.review-question-card img,
.review-q-text img,
.review-explain-box img,
.review-opt-content img,
#studentDetailsBody img,
.student-detail-card img {
  max-width: 100% !important;
  max-height: 380px !important;
  height: auto !important;
  border-radius: 8px;
  display: block;
  margin: 8px auto;
  object-fit: contain;
}

.katex-display,
.MathJax_Display {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 2px 0 !important;
}




/* ========================================================
   TEACHER MANAGEMENT & CREATION HUB - MOBILE RESPONSIVENESS
   ======================================================== */
.index-mobile-editor-tabs {
  display: none;
}

.index-mobile-float-toggle {
  display: none;
}

@media (max-width: 860px) {
  /* --- TOP BRAND NAVBAR TRÊN ĐIỆN THOẠI CHO GIÁO VIÊN --- */
  .azota-navbar {
    height: auto !important;
    padding: 8px 12px !important;
  }

  .azota-navbar-inner {
    padding: 0 !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .azota-brand-sub {
    display: none !important;
  }

  .azota-brand-logo {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  .azota-brand-title {
    font-size: 1.15rem !important;
  }

  .azota-user-badge {
    padding: 4px 8px 4px 4px !important;
    gap: 6px !important;
  }

  .azota-user-badge .user-name,
  .azota-user-badge .azota-role-pill {
    display: none !important;
  }

  .azota-user-badge .btn-azota-sub {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
    margin-left: 0 !important;
  }

  .azota-nav-links {
    width: 100% !important;
    order: 3 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px !important;
    gap: 4px !important;
    border-radius: 10px !important;
  }

  .azota-nav-links::-webkit-scrollbar {
    display: none;
  }

  .azota-nav-tab {
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* --- CHẾ ĐỘ SOẠN THẢO TRÊN TRANG CHÍNH (INDEX SPLIT LAYOUT) --- */
  .index-mobile-editor-tabs {
    display: flex !important;
    gap: 6px;
    margin-bottom: 12px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }

  .index-m-tab-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    font-family: inherit;
  }

  .index-m-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  .split-layout {
    display: block !important;
    height: auto !important;
  }

  .split-layout.idx-tab-code .preview-pane {
    display: none !important;
  }

  .split-layout.idx-tab-code .editor-pane {
    display: flex !important;
    width: 100% !important;
    height: calc(100dvh - 200px) !important;
    min-height: 460px !important;
  }

  .split-layout.idx-tab-preview .preview-pane {
    display: block !important;
    width: 100% !important;
    height: calc(100dvh - 200px) !important;
    min-height: 460px !important;
  }

  .split-layout.idx-tab-preview .editor-pane {
    display: none !important;
  }

  .index-mobile-float-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 24px;
    right: 18px;
    z-index: 999;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.4);
    cursor: pointer;
    font-family: inherit;
  }
}

@media (max-width: 768px) {
  /* --- CREATION HUB (3 BENTO CARDS) TRÊN ĐIỆN THOẠI --- */
  .azota-creation-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
  }

  .azota-create-card {
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }

  .card-icon-wrap {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.45rem !important;
    margin-bottom: 12px !important;
    border-radius: 12px !important;
  }

  .card-title {
    font-size: 1.15rem !important;
    margin-bottom: 6px !important;
  }

  .card-desc {
    font-size: 0.88rem !important;
    margin-bottom: 14px !important;
  }

  /* --- TEACHER DASHBOARD (QUẢN LÝ ĐỀ THI) TRÊN ĐIỆN THOẠI --- */
  #teacherDashboard {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    margin-top: 10px !important;
  }

  .azota-stats-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .azota-stats-strip .azota-stat-box {
    padding: 12px 10px !important;
    border-radius: 12px !important;
  }

  .azota-stats-strip .azota-stat-box .val {
    font-size: 1.5rem !important;
    margin-bottom: 2px !important;
  }

  .azota-stats-strip .azota-stat-box .lbl {
    font-size: 0.78rem !important;
  }

  .azota-toolbar {
    padding: 12px !important;
    border-radius: 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }

  .azota-search-box {
    min-width: 0 !important;
    width: 100% !important;
  }

  .azota-search-input {
    padding: 10px 14px 10px 40px !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
  }

  .azota-filter-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px !important;
    gap: 4px !important;
    border-radius: 10px !important;
  }

  .azota-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .azota-tab-btn {
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .azota-quiz-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }

  .azota-quiz-card {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  .quiz-card-title, .azota-card-title {
    font-size: 1.05rem !important;
  }

  .azota-btn-row {
    gap: 6px !important;
  }

  .azota-btn-row .btn-azota-sub {
    flex: 1 1 calc(33.33% - 6px) !important;
    padding: 7px 6px !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
  }

  #monitorDashboard,
  #quizStatsDashboard {
    padding: 16px 14px !important;
    margin-top: 14px !important;
    border-radius: 14px !important;
  }
}

@media (max-width: 640px) {
  .container {
    margin: 12px auto !important;
    padding: 0 12px !important;
  }

  .card {
    padding: 18px 14px !important;
    border-radius: 14px !important;
    margin-bottom: 16px !important;
  }

  .mode-switch {
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  .mode-switch button {
    flex: 1 1 calc(50% - 6px) !important;
    padding: 9px 12px !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
  }

  .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    padding: 20px 16px !important;
    border-radius: 16px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 420px) {
  .azota-btn-row .btn-azota-sub {
    flex: 1 1 calc(50% - 6px) !important;
  }
}

/* ========================================================
   RESULT ACTION BUTTONS (MOBILE FRIENDLY)
   ======================================================== */
.result-action-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.result-btn-row {
    display: flex;
    gap: 12px;
}
.result-action-btns button {
    padding: 12px 20px;
    font-weight: 700;
    border-radius: 12px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.result-action-btns .result-btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(25, 118, 210, 0.3);
}
.result-action-btns .result-btn-primary:hover {
    background: #1565c0;
    box-shadow: 0 6px 18px rgba(25, 118, 210, 0.4);
    transform: translateY(-1px);
}
.result-action-btns .result-btn-lb {
    border: 1.5px solid #fde047;
    color: #a16207;
    background: #fefce8;
}
.result-action-btns .result-btn-lb:hover {
    background: #fef08a;
    transform: translateY(-1px);
}
.result-action-btns .result-btn-retry {
    border: 1.5px solid #cbd5e1;
    color: #334155;
    background: #f8fafc;
}
.result-action-btns .result-btn-retry:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}
.result-action-btns .result-btn-exit {
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    background: transparent;
}
.result-action-btns .result-btn-exit:hover {
    background: #f1f5f9;
    color: #0f172a;
}

@media (max-width: 640px) {
    .result-action-btns {
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 16px !important;
    }
    .result-action-btns .result-btn-primary {
        width: 100% !important;
        padding: 13px !important;
        font-size: 0.95rem !important;
        border-radius: 12px !important;
    }
    .result-btn-row {
        display: flex !important;
        width: 100% !important;
        gap: 8px !important;
    }
    .result-btn-row button {
        flex: 1 1 50% !important;
        padding: 11px 6px !important;
        font-size: 0.86rem !important;
        border-radius: 10px !important;
    }
    .result-action-btns .result-btn-exit {
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.86rem !important;
        border-radius: 10px !important;
    }
}



/* =========================================
   UI GIÁM SÁT REAL-TIME (LIVE INDICATOR)
========================================= */
.live-indicator {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-live 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-live {
    to {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}


/* ========================================================
   GLOBAL MOBILE COMPREHENSIVE FIXES
   ======================================================== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
    }
    table, pre, code {
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        box-sizing: border-box !important;
    }
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    .flex-row {
        flex-wrap: wrap !important;
    }
    .azota-brand-sub {
        display: none !important;
    }
    .container, .card, .azota-navbar-inner {
        padding-left: 14px !important;
        padding-right: 14px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

button, .btn {
    touch-action: manipulation;
}

/* ========================================================
   STUDENT HISTORY & DASHBOARD STYLES
   ======================================================== */
.student-dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--azota-border);
    box-shadow: var(--azota-shadow);
    padding: 24px;
    margin-top: 12px;
}

.student-history-card {
    background: #ffffff;
    border: 1px solid var(--azota-border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.student-history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.student-history-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 260px;
}

.student-score-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 800;
    min-width: 74px;
    text-align: center;
    flex-shrink: 0;
}

.student-score-badge.high {
    background: #ecfdf5;
    color: #059669;
    border: 1.5px solid #a7f3d0;
}

.student-score-badge.medium {
    background: #fffbeb;
    color: #d97706;
    border: 1.5px solid #fde68a;
}

.student-score-badge.low {
    background: #fef2f2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
}

.student-score-badge .score-num {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.student-score-badge .score-scale {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 3px;
}

.student-history-info {
    flex: 1;
}

.student-history-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.student-history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #64748b;
}

.student-history-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.student-history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-history-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-history-review {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.btn-history-review:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.btn-history-retry {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.btn-history-retry:hover {
    background: #dcfce7;
    border-color: #86efac;
    transform: translateY(-1px);
}

.btn-history-delete {
    background: #ffffff;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
}
.btn-history-delete:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.student-history-empty {
    text-align: center;
    padding: 48px 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1.5px dashed #cbd5e1;
    margin: 16px 0;
}

.student-history-empty-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 14px auto;
}

@media (max-width: 680px) {
    .student-history-card {
        flex-direction: column;
        align-items: stretch;
    }
    .student-history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

