/* ============================================================
   Sistema de Avaliações — SENAI-SP
   Design System & Styles
   Paleta: Laranja SENAI #E84910 + Azul Escuro #1B3A5C
   ============================================================ */

/* ---- Google Fonts Import ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* Paleta SENAI */
    --senai-orange: #E84910;
    --senai-orange-dark: #C73D0D;
    --senai-orange-light: #FF6B35;
    --senai-orange-glow: rgba(232, 73, 16, 0.15);
    --senai-blue: #1B3A5C;
    --senai-blue-dark: #0F2440;
    --senai-blue-light: #2A5580;

    /* Neutros */
    --bg-primary: #F5F6FA;
    --bg-secondary: #FFFFFF;
    --bg-dark: #0F1923;
    --surface: #FFFFFF;
    --surface-hover: #F8F9FC;
    --surface-active: #F0F1F5;

    /* Texto */
    --text-primary: #1A1A2E;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-inverse: #FFFFFF;

    /* Status */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Borders */
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --border-focus: var(--senai-orange);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(232, 73, 16, 0.2);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-toast: 600;
    --z-timer: 700;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--senai-orange); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--senai-orange-dark); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

pre {
    background: var(--bg-dark);
    color: #E2E8F0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    line-height: 1.7;
}

code {
    background: rgba(232, 73, 16, 0.08);
    color: var(--senai-orange-dark);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-weight: 500;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
}

::selection {
    background: var(--senai-orange);
    color: white;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--senai-blue-dark) 0%, var(--senai-blue) 40%, #1E4D7B 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 73, 16, 0.08) 0%, transparent 70%);
    animation: loginGlow 8s ease-in-out infinite alternate;
}

@keyframes loginGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, 5%) scale(1.1); }
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--senai-orange), var(--senai-orange-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(232, 73, 16, 0.3);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-logo .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.login-info {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.login-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.login-info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.login-info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.login-info-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--senai-orange), var(--senai-orange-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(232, 73, 16, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(232, 73, 16, 0.45);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--senai-blue);
    color: white;
    box-shadow: 0 4px 14px rgba(27, 58, 92, 0.25);
}

.btn-secondary:hover {
    background: var(--senai-blue-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--senai-orange);
    border: 2px solid var(--senai-orange);
}

.btn-outline:hover {
    background: var(--senai-orange);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-google {
    background: white;
    color: #374151;
    border: 2px solid var(--border);
    font-weight: 600;
    padding: 0.875rem 1.5rem;
}

.btn-google:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
    color: #374151;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.dev-login-buttons {
    display: flex;
    gap: 0.75rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-author {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================================
   Assessment Page Layout
   ============================================================ */
.assessment-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 0;
}

/* Timer Header */
.timer-header {
    grid-column: 1 / -1;
    background: var(--senai-blue-dark);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-timer);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timer-header .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timer-header .header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9375rem;
}

.timer-header .header-logo .logo-mark {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--senai-orange), var(--senai-orange-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
}

.timer-header .assessment-name {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timer-clock {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 120px;
    text-align: center;
}

.timer-clock.warning {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
    animation: timerPulse 1s ease-in-out infinite;
}

.timer-clock.danger {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.save-indicator {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color var(--transition-fast);
}

.save-indicator.saving {
    color: var(--warning);
}

.save-indicator.saved {
    color: var(--success);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--senai-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar */
.assessment-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    height: calc(100vh - 52px);
    position: sticky;
    top: 52px;
}

.sidebar-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.question-nav {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.question-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.question-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.question-nav-item.active {
    background: var(--senai-orange-glow);
    border-color: var(--senai-orange);
    color: var(--senai-orange);
    font-weight: 600;
}

.question-nav-item.answered {
    color: var(--success);
}

.question-nav-item.answered::after {
    content: '✓';
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
}

.question-nav-number {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.question-nav-item.active .question-nav-number {
    background: var(--senai-orange);
    color: white;
}

.question-nav-item.answered .question-nav-number {
    background: var(--success);
    color: white;
}

.question-nav-type {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.sidebar-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1rem 0 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.sidebar-progress {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--senai-orange), var(--senai-orange-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.sidebar-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Main Content */
.assessment-main {
    padding: 2rem 3rem;
    overflow-y: auto;
    max-width: 900px;
}

.question-card {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.question-card.active {
    display: block;
}

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

.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.question-number-badge {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    color: white;
}

.question-number-badge.practical {
    background: linear-gradient(135deg, var(--senai-orange), var(--senai-orange-dark));
}

.question-number-badge.theoretical {
    background: linear-gradient(135deg, var(--senai-blue), var(--senai-blue-dark));
}

.question-meta {
    flex: 1;
}

.question-meta h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.question-meta-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-module {
    background: var(--info-bg);
    color: var(--info);
}

.tag-practical {
    background: var(--senai-orange-glow);
    color: var(--senai-orange);
}

.tag-theoretical {
    background: rgba(27, 58, 92, 0.1);
    color: var(--senai-blue);
}

.tag-points {
    background: var(--success-bg);
    color: var(--success);
}

.question-description {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.question-description h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--senai-blue);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.question-description ul, .question-description ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.question-description li {
    margin-bottom: 0.35rem;
}

/* Code Editor */
.code-editor-container {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.code-editor-toolbar {
    background: var(--senai-blue-dark);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-editor-toolbar .toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-editor-toolbar .toolbar-dots {
    display: flex;
    gap: 6px;
}

.code-editor-toolbar .toolbar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.toolbar-dot.red { background: #FF5F57; }
.toolbar-dot.yellow { background: #FFBD2E; }
.toolbar-dot.green { background: #28C840; }

.code-editor-toolbar .toolbar-filename {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.5rem;
}

.code-editor-toolbar .toolbar-right {
    display: flex;
    gap: 0.5rem;
}

.btn-run-tests {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition-fast);
}

.btn-run-tests:hover {
    background: #059669;
    transform: translateY(-1px);
}

.code-editor-wrapper {
    min-height: 250px;
}

.code-editor-wrapper .CodeMirror {
    height: auto;
    min-height: 250px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

/* Test Results */
.test-results {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.test-results-header {
    background: var(--bg-primary);
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.test-results-summary {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.test-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.test-result-item:last-child {
    border-bottom: none;
}

.test-result-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    flex-shrink: 0;
    font-weight: 700;
}

.test-result-icon.pass {
    background: var(--success-bg);
    color: var(--success);
}

.test-result-icon.fail {
    background: var(--error-bg);
    color: var(--error);
}

.test-result-icon.pending {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.test-result-description {
    flex: 1;
    color: var(--text-secondary);
}

/* Multiple Choice (Theoretical) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.option-item:hover {
    border-color: var(--senai-orange);
    background: var(--senai-orange-glow);
}

.option-item.selected {
    border-color: var(--senai-orange);
    background: var(--senai-orange-glow);
    box-shadow: 0 0 0 1px var(--senai-orange);
}

.option-radio {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.option-item.selected .option-radio {
    border-color: var(--senai-orange);
    background: var(--senai-orange);
}

.option-item.selected .option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: white;
}

.option-key {
    font-weight: 700;
    color: var(--senai-blue);
    min-width: 24px;
    font-size: 0.875rem;
}

.option-text {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Question Navigation Buttons */
.question-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Submitted Page
   ============================================================ */
.submitted-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--senai-blue-dark) 0%, var(--senai-blue) 100%);
    padding: 2rem;
}

.submitted-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 3rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

.submitted-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    animation: checkBounce 0.5s ease-out 0.3s both;
}

@keyframes checkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.submitted-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.submitted-card p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.submitted-card .warning-text {
    color: var(--warning);
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
}

/* ============================================================
   Admin Dashboard
   ============================================================ */
.admin-layout {
    min-height: 100vh;
}

.admin-header {
    background: var(--senai-blue-dark);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
}

.admin-header .assessment-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card.orange .stat-value { color: var(--senai-orange); }
.stat-card.blue .stat-value { color: var(--senai-blue); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.yellow .stat-value { color: var(--warning); }

/* Table */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.table-header h2 {
    font-size: 1rem;
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

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

.data-table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background: var(--surface-hover);
}

.student-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.student-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--senai-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    overflow: hidden;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-name {
    font-weight: 600;
    color: var(--text-primary);
}

.student-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.submitted {
    background: var(--info-bg);
    color: var(--info);
}

.status-badge.graded {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.in-progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.auto-submitted {
    background: var(--error-bg);
    color: var(--error);
}

.score-display {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9375rem;
}

/* ============================================================
   Admin Submission View
   ============================================================ */
.submission-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.submission-student-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.submission-student-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--senai-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    overflow: hidden;
}

.submission-student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.submission-student-details h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.submission-student-details p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.submission-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.submission-meta-item {
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.submission-meta-item .label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.submission-meta-item .value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

.submission-question {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow var(--transition-fast);
}

.submission-question:hover {
    box-shadow: var(--shadow-md);
}

.submission-question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.grading-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    flex-wrap: wrap;
}

.grading-form label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.grading-form input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.grading-form input[type="number"]:focus {
    outline: none;
    border-color: var(--senai-orange);
    box-shadow: 0 0 0 3px var(--senai-orange-glow);
}

.grading-form input[type="text"],
.grading-form textarea {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    transition: border-color var(--transition-fast);
    resize: vertical;
}

.grading-form input[type="text"]:focus,
.grading-form textarea:focus {
    outline: none;
    border-color: var(--senai-orange);
    box-shadow: 0 0 0 3px var(--senai-orange-glow);
}

.student-code-display {
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1rem 0;
}

.student-code-display pre {
    margin: 0;
    border-radius: 0;
}

.student-answer-display {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.correct-answer {
    color: var(--success);
    font-weight: 600;
}

.incorrect-answer {
    color: var(--error);
    font-weight: 600;
}

/* Audit Log */
.audit-log {
    margin-top: 2rem;
}

.audit-log h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.audit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-light);
}

.audit-item:last-child {
    border-bottom: none;
}

.audit-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 140px;
}

.audit-action {
    font-weight: 600;
    min-width: 120px;
    flex-shrink: 0;
}

.audit-action.login { color: var(--info); }
.audit-action.assessment_started { color: var(--senai-orange); }
.audit-action.submitted { color: var(--success); }
.audit-action.auto_submitted { color: var(--warning); }
.audit-action.tab_switch { color: var(--error); }

.audit-details {
    color: var(--text-secondary);
}

/* ============================================================
   Flash Messages / Toasts
   ============================================================ */
.flash-message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

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

.flash-message.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.flash-message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    padding: 2rem;
}

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

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.modal h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    .timer-header, .admin-header,
    .assessment-sidebar, .sidebar-actions,
    .question-nav-buttons, .btn, .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
    }

    .assessment-layout {
        display: block;
    }

    .assessment-main {
        padding: 0;
        max-width: 100%;
    }

    .question-card {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 1.5rem;
        border: 1px solid #ccc;
        padding: 1rem;
    }

    .submission-question {
        page-break-inside: avoid;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .assessment-layout {
        grid-template-columns: 1fr;
    }

    .assessment-sidebar {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        width: 280px;
        height: calc(100vh - 52px);
        z-index: var(--z-fixed);
        box-shadow: var(--shadow-xl);
    }

    .assessment-sidebar.mobile-open {
        display: block;
    }

    .assessment-main {
        padding: 1.5rem;
    }

    .timer-header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .timer-clock {
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .question-nav-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .question-nav-buttons .btn {
        width: 100%;
    }

    .submission-header {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dev-login-buttons {
        flex-direction: column;
    }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   Utilities
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.font-mono { font-family: var(--font-mono); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 11pt !important;
    }

    .admin-header,
    .no-print,
    .btn,
    .grading-form,
    .audit-log,
    .sidebar-actions,
    .admin-layout::before {
        display: none !important;
    }

    .admin-layout,
    .admin-content {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        display: block !important;
    }

    .submission-header {
        border-bottom: 2px solid #000 !important;
        padding-bottom: 1rem !important;
        margin-bottom: 2rem !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .submission-question {
        page-break-inside: avoid !important;
        border: 1px solid #ccc !important;
        border-radius: 6px !important;
        padding: 1.5rem !important;
        margin-bottom: 2rem !important;
        background: transparent !important;
    }

    pre, code, .student-code-display, .model-code-display pre {
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow: visible !important;
        max-height: none !important;
    }

    .evaluation-criteria {
        background: #fafafa !important;
        border: 1px solid #ddd !important;
        color: black !important;
        padding: 1rem !important;
    }

    .tag {
        border: 1px solid #ccc !important;
        background: transparent !important;
        color: black !important;
    }
}
