:root {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #cbd5e1;
    --border-highlight: #a21d20;

    --primary: #a21d20;
    --primary-hover: #801215;
    --primary-glow: rgba(162, 29, 32, 0.25);
    --secondary: #c42b2f;
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.25);
    --warning: #d97706;
    --danger: #dc2626;
    --review: #7c3aed;

    --text-main: #0f172a;
    --text-muted: #334155;
    --text-subtle: #64748b;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    --sidebar-width: 320px;
    --header-height: 64px;
}

.hirecamp-crt-plugin-wrapper,
.hirecamp-crt-plugin-wrapper * {
    box-sizing: border-box;
}

.hirecamp-crt-plugin-wrapper {
    font-family: var(--font-sans);
    color: var(--text-main);
    line-height: 1.5;
    width: 100%;
    position: relative;
}

/* Utility Scrollbars */
.hirecamp-crt-plugin-wrapper ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.hirecamp-crt-plugin-wrapper ::-webkit-scrollbar-track {
    background: var(--bg-base);
}

.hirecamp-crt-plugin-wrapper ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.hirecamp-crt-plugin-wrapper ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Screen Wrapper Views */
.view-screen {
    display: none;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.view-screen.active {
    display: block;
    width: 100%;
}

/* ONLY live proctored exam gets fixed full-screen viewport layout */
.hirecamp-crt-plugin-wrapper #screen-exam.active,
#screen-exam.active {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: var(--bg-base) !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #a21d20, #801215) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(162, 29, 32, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #801215, #5f0c0f) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(162, 29, 32, 0.4);
}

.btn-secondary {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

.btn-secondary:hover {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1e3a8a !important;
}

.btn-secondary i,
.btn-secondary:hover i {
    color: inherit !important;
}

.btn-primary i,
.btn-primary:hover i {
    color: #ffffff !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #15803d) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--success-glow);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #b45309) !important;
    color: #ffffff !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c) !important;
    color: #ffffff !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-indigo {
    background: #ffe4e6;
    color: #a21d20;
    border: 1px solid #fecdd3;
}

.badge-green {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-amber {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-red {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-purple {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

/* ==================== 1. PRE-EXAM SYSTEM VERIFICATION SCREEN ==================== */
#screen-registration,
#screen-instructions,
#screen-preexam,
#screen-analytics,
#screen-admin {
    background: var(--bg-base);
    box-sizing: border-box;
    padding: 24px 16px;
}

#screen-registration.active,
#screen-instructions.active,
#screen-preexam.active,
#screen-analytics.active,
#screen-admin.active {
    display: block !important;
    width: 100%;
}

.preexam-card {
    width: 100%;
    max-width: 1040px;
    margin: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    color: #0f172a;
    box-sizing: border-box;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #a21d20;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #a21d20, #801215);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: 0 4px 12px rgba(162, 29, 32, 0.3);
}

.brand-title h1 {
    font-size: 22px;
    font-weight: 800;
    color: #a21d20;
    letter-spacing: -0.3px;
}

.brand-title p {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .check-grid {
        grid-template-columns: 1fr;
    }
}

.check-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 18px;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.check-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #a21d20;
}

.webcam-preview-box {
    width: 100%;
    height: 180px;
    background: #0f172a;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.webcam-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.face-overlay-guide {
    position: absolute;
    width: 110px;
    height: 140px;
    border: 2px dashed rgba(22, 163, 74, 0.8);
    border-radius: 50%;
    pointer-events: none;
}

.mic-meter-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.mic-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
    transition: width 0.1s ease;
}

.sys-check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: #334155;
}

.sys-check-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}

.rules-callout {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #a21d20;
    padding: 18px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #334155;
}

.rules-callout strong {
    color: #a21d20;
}

.rules-callout ul {
    margin-left: 20px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ==================== 2. MAIN EXAM INTERFACE ==================== */
#screen-exam {
    background: var(--bg-base);
}

/* Header */
.exam-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 2px solid #a21d20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title-area h2 {
    font-size: 17px;
    font-weight: 800;
    color: #a21d20;
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffe4e6;
    border: 1px solid #fecdd3;
    padding: 6px 16px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: #a21d20;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.timer-box.warning {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
    animation: pulse-amber 1.5s infinite;
}

.timer-box.danger {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
    animation: pulse-red 0.8s infinite;
}

@keyframes pulse-amber {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.4);
    }
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }

    50% {
        box-shadow: 0 0 16px 6px rgba(239, 68, 68, 0.6);
    }
}

.proctor-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.proctor-status-pill.flagged {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.exam-body {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Left Drawer / Sidebar */
.exam-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-section-select {
    padding: 16px;
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
}

.section-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-tab-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.section-tab-btn:hover {
    color: #a21d20;
    background: #ffe4e6;
    border-color: #fecdd3;
}

.section-tab-btn.active {
    background: #ffe4e6;
    border-color: #a21d20;
    color: #a21d20;
    font-weight: 800;
}

.sidebar-grid-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #ffffff;
}

.grid-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}

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

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.q-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.q-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.q-btn:hover {
    border-color: #a21d20;
    color: #a21d20;
    background: #fff5f5;
}

.q-btn.current {
    border: 2px solid #a21d20 !important;
    box-shadow: 0 0 0 3px rgba(162, 29, 32, 0.25);
}

.q-btn.answered {
    background: #16a34a;
    color: white;
    border-color: #15803d;
}

.q-btn.visited {
    background: #dc2626;
    color: white;
    border-color: #b91c1c;
}

.q-btn.review {
    background: #7c3aed;
    color: white;
    border-color: #6d28d9;
    border-radius: 50%;
}

.q-btn.answered-review {
    background: linear-gradient(135deg, #16a34a 50%, #7c3aed 50%);
    color: white;
    border-color: #6d28d9;
}

.sidebar-camera-widget {
    padding: 12px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
}

.widget-cam-box {
    width: 100%;
    height: 110px;
    background: #0f172a;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.widget-cam-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cam-live-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Main Question Area */
.exam-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    overflow: hidden;
}

.question-header-bar {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.q-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.q-num-title {
    font-size: 16px;
    font-weight: 800;
    color: #a21d20;
}

.question-content-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f8fafc;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.65;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.code-block-preview {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #f8fafc;
    overflow-x: auto;
    white-space: pre;
    margin-top: 12px;
    user-select: text;
    -webkit-user-select: text;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.option-item:hover {
    background: #f1f5f9;
    border-color: #2563eb;
}

.option-item.selected {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.option-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    background: #ffffff;
}

.option-item.selected .option-radio {
    border-color: #2563eb;
    background: #2563eb;
}

.option-item.selected .option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option-text {
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
    flex: 1;
}

/* IDE Layout for Coding Challenges */
.ide-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 100%;
    min-height: 500px;
}

@media (max-width: 1024px) {
    .ide-container {
        grid-template-columns: 1fr;
    }
}

.ide-problem-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
}

.ide-editor-panel {
    background: #0D1117;
    border: 1px solid #30363D;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-top-bar {
    padding: 10px 16px;
    background: #161B22;
    border-bottom: 1px solid #30363D;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lang-select {
    background: #21262D;
    border: 1px solid #30363D;
    color: #C9D1D9;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.editor-textarea-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    background: #0D1117;
}

.line-numbers {
    width: 40px;
    padding: 12px 0;
    background: #161B22;
    color: #484F58;
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: right;
    padding-right: 10px;
    user-select: none;
    line-height: 1.5;
}

.code-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #E6EDE3;
    font-family: var(--font-mono);
    font-size: 13.5px;
    padding: 12px;
    line-height: 1.5;
    resize: none;
    white-space: pre;
    tab-size: 4;
    user-select: text;
    -webkit-user-select: text;
}

.editor-console {
    height: 160px;
    background: #161B22;
    border-top: 1px solid #30363D;
    display: flex;
    flex-direction: column;
}

.console-header {
    padding: 6px 12px;
    background: #21262D;
    font-size: 11px;
    font-weight: 700;
    color: #8B949E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.console-output {
    flex: 1;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #C9D1D9;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Action Footer */
.question-footer-bar {
    padding: 14px 24px;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0 !important;
    z-index: 100;
}

/* ==================== 3. STUDENT ANALYTICS DASHBOARD ==================== */
#screen-analytics {
    background: var(--bg-base);
    overflow-y: auto;
    padding: 40px 20px;
    align-items: center;
}

.analytics-container {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.score-hero-card {
    background: linear-gradient(135deg, #ffffff, #ffe4e6);
    border: 2px solid #a21d20;
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(162, 29, 32, 0.08);
    color: #0f172a;
}

@media (max-width: 768px) {
    .score-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.score-circle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-big-num {
    font-size: 56px;
    font-weight: 800;
    color: #a21d20;
    line-height: 1;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.metric-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.metric-card .val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

.metric-card .lbl {
    font-size: 12px;
    color: var(--text-muted);
}

.section-breakdown-card,
.review-questions-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.breakdown-table th,
.breakdown-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-table th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #a21d20;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.review-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-item.correct {
    border-left: 4px solid var(--success);
}

.review-item.incorrect {
    border-left: 4px solid var(--danger);
}

.review-item.unanswered {
    border-left: 4px solid var(--warning);
}

/* ==================== 4. ADMIN MONITORING DASHBOARD ==================== */
#screen-admin {
    background: var(--bg-base);
    overflow-y: auto;
    padding: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.candidate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.candidate-table th,
.candidate-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.log-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 12px;
}

.log-entry {
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 3px solid var(--warning);
}

/* Modal Overlays */
.modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 10000000 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--danger);
    border-radius: 16px;
    padding: 28px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(239, 68, 68, 0.3);
    animation: modal-shake 0.4s ease;
}

@keyframes modal-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

/* ==================== PRINT & PDF EXPORT STYLES ==================== */
@media print {
    @page {
        size: portrait;
        margin: 8mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #0f172a !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .top-bar,
    .exam-header,
    .btn,
    #permission-modal,
    #screen-preexam,
    #screen-exam,
    #screen-admin {
        display: none !important;
    }

    #screen-analytics {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    .analytics-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 14px !important;
    }

    .score-hero-card {
        padding: 16px 20px !important;
        border: 2px solid #a21d20 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        background: #fff5f5 !important;
        grid-template-columns: 160px 1fr !important;
        gap: 20px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .score-circle-wrapper {
        text-align: center !important;
    }

    .score-big-num {
        font-size: 42px !important;
        line-height: 1 !important;
    }

    .metrics-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    .metric-card {
        padding: 8px 10px !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }

    .metric-card .val {
        font-size: 16px !important;
    }

    .metric-card .lbl {
        font-size: 10px !important;
    }

    .section-breakdown-card {
        padding: 14px 18px !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }

    .breakdown-table {
        margin-top: 8px !important;
        font-size: 12px !important;
    }

    .breakdown-table th,
    .breakdown-table td {
        padding: 6px 10px !important;
    }

    .progress-bar-bg {
        background: #e2e8f0 !important;
        height: 8px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .progress-bar-fill {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
