/* IPSC Judge Quiz — Tactical Military Theme */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root {
    --bg-deep: #0a0c0e;
    --bg-dark: #0f1318;
    --bg-mid: #161b22;
    --bg-card: #1c2330;
    --bg-input: #111722;
    --border: #2a3444;
    --border-accent: #3d5a7a;
    --primary: #e8a020;
    --primary-dark: #b87818;
    --primary-glow: rgba(232, 160, 32, 0.3);
    --accent: #4a90d9;
    --accent-glow: rgba(74, 144, 217, 0.25);
    --success: #28c76f;
    --danger: #ea5455;
    --warning: #ff9f43;
    --text-main: #d8dde8;
    --text-muted: #7a8899;
    --text-dim: #4a5568;
    --shadow: 0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 48px rgba(0,0,0,0.7);
    --radius: 8px;
    --radius-lg: 14px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(232,160,32,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(74,144,217,0.04) 0%, transparent 50%);
}

/* SCAN LINE EFFECT */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 { font-family: 'Orbitron', sans-serif; letter-spacing: 0.05em; }
.mono { font-family: 'Share Tech Mono', monospace; }

/* NAVBAR */
.navbar {
    background: linear-gradient(90deg, var(--bg-dark) 0%, #131a24 100%);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.nav-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 12px var(--primary-glow);
}

.nav-brand-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 0.1em;
}

.nav-brand-sub { 
    font-size: 0.65rem; 
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
}

.nav-hamburger { display: none; }

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(232,160,32,0.1);
}

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

.nav-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), #2d6fa8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: white;
}

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-wrap { padding: 2rem 0 4rem; }

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.4;
}

.card-accent::before { opacity: 1; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0a0c0e;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-mid);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: rgba(234,84,85,0.15);
    color: var(--danger);
    border: 1px solid rgba(234,84,85,0.3);
}

.btn-danger:hover { background: rgba(234,84,85,0.25); }

.btn-success {
    background: linear-gradient(135deg, var(--success), #1fa55a);
    color: white;
    box-shadow: 0 0 15px rgba(40,199,111,0.25);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 14px;
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-dim); }

/* LOGIN PAGE */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(232,160,32,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(74,144,217,0.06) 0%, transparent 60%),
        var(--bg-deep);
}

.login-box {
    width: 100%;
    max-width: 420px;
}

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

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 1rem;
    box-shadow: 0 0 40px var(--primary-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 30px var(--primary-glow); }
    50% { box-shadow: 0 0 60px rgba(232,160,32,0.5); }
}

.login-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 0.1em;
}

.login-subtitle { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase; }

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); border-color: var(--primary); }

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232,160,32,0.05), transparent);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.stat-value { font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

/* QUIZ / EXAM */
.exam-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 72px;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.exam-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-mid);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ffd080);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.timer-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
    min-width: 90px;
    text-align: center;
}

.timer-display.warning { color: var(--warning); text-shadow: 0 0 10px rgba(255,159,67,0.4); }
.timer-display.danger { 
    color: var(--danger); 
    text-shadow: 0 0 10px rgba(234,84,85,0.4);
    animation: blink 0.8s step-end infinite;
}

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

.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: slide-in 0.25s ease;
}

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

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.question-num {
    font-family: 'Share Tech Mono', monospace;
    color: var(--primary);
    font-size: 0.9rem;
    background: rgba(232,160,32,0.1);
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(232,160,32,0.25);
}

.question-category {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-mid);
    padding: 3px 10px;
    border-radius: 4px;
}

.question-type-badge {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: auto;
}

.badge-single { background: rgba(74,144,217,0.15); color: var(--accent); border: 1px solid rgba(74,144,217,0.3); }
.badge-multiple { background: rgba(255,159,67,0.15); color: var(--warning); border: 1px solid rgba(255,159,67,0.3); }

.question-text {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.question-image {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    display: block;
}

/* ANSWER OPTIONS */
.options-list { display: flex; flex-direction: column; gap: 0.625rem; }

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-mid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.option-item:hover {
    border-color: var(--accent);
    background: rgba(74,144,217,0.08);
}

.option-item.selected {
    border-color: var(--primary);
    background: rgba(232,160,32,0.1);
}

.option-item.correct {
    border-color: var(--success) !important;
    background: rgba(40,199,111,0.12) !important;
}

.option-item.incorrect {
    border-color: var(--danger) !important;
    background: rgba(234,84,85,0.1) !important;
}

.option-letter {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
    margin-top: 1px;
}

.option-item.selected .option-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.option-item.correct .option-letter { background: var(--success); border-color: var(--success); color: white; }
.option-item.incorrect .option-letter { background: var(--danger); border-color: var(--danger); color: white; }

.option-text { font-size: 1rem; font-weight: 400; flex: 1; line-height: 1.5; }

input[type="checkbox"], input[type="radio"] { display: none; }

/* RESULTS PAGE */
.result-hero {
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
}

.score-ring {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.score-ring svg { transform: rotate(-90deg); }

.score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-percent {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--primary);
}

.score-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; }

.result-passed { color: var(--success); }
.result-failed { color: var(--danger); }

/* CATEGORY PILLS */
.category-pills { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2rem; }

.cat-pill {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-mid);
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cat-pill.active-pistol { background: rgba(232,160,32,0.15); border-color: var(--primary); color: var(--primary); }
.cat-pill.active-carbine { background: rgba(74,144,217,0.15); border-color: var(--accent); color: var(--accent); }
.cat-pill.active-shotgun { background: rgba(40,199,111,0.15); border-color: var(--success); color: var(--success); }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 5px;
}

.badge-primary { background: var(--primary); color: #000; }
.badge-info { background: var(--accent); color: white; }
.badge-success { background: var(--success); color: white; }

/* ADMIN TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

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

thead tr { background: var(--bg-mid); }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(42,52,68,0.5);
    font-size: 0.95rem;
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* ALERTS */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-danger { background: rgba(234,84,85,0.12); border: 1px solid rgba(234,84,85,0.3); color: #ff8080; }
.alert-success { background: rgba(40,199,111,0.12); border: 1px solid rgba(40,199,111,0.3); color: #5de8a0; }
.alert-info { background: rgba(74,144,217,0.12); border: 1px solid rgba(74,144,217,0.3); color: #80b8f0; }
.alert-warning { background: rgba(255,159,67,0.12); border: 1px solid rgba(255,159,67,0.3); color: var(--warning); }

/* DIFFICULTY BADGE */
.diff-easy { color: var(--success); background: rgba(40,199,111,0.1); border: 1px solid rgba(40,199,111,0.25); }
.diff-medium { color: var(--warning); background: rgba(255,159,67,0.1); border: 1px solid rgba(255,159,67,0.25); }
.diff-hard { color: var(--danger); background: rgba(234,84,85,0.1); border: 1px solid rgba(234,84,85,0.25); }
.diff-easy, .diff-medium, .diff-hard {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* PAGINATION */
.pagination { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.page-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-mid);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}
.page-btn:hover, .page-btn.active { border-color: var(--primary); color: var(--primary); background: rgba(232,160,32,0.1); }

/* UTILS */
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }

/* SECTION HEADER */
.section-header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    margin-bottom: 1.5rem; 
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
    flex-shrink: 0;
}

/* LOADING OVERLAY */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,12,14,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1rem;
}

.loader-ring {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* MOBILE */
@media (max-width: 768px) {

    /* NAVBAR — скрыть ссылки, показать гамбургер */
    .navbar { padding: 0 1rem; height: 56px; position: relative; }
    .nav-brand-sub { display: none; }
    .nav-brand-text { font-size: 0.85rem; }

    .nav-links {
        display: none;
        position: fixed;
        top: 56px;
        left: 0; right: 0;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 4px;
        z-index: 200;
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 10px 14px; font-size: 0.9rem; border-radius: var(--radius); }

    .nav-hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 6px;
        margin-left: auto;
        margin-right: 8px;
    }
    .nav-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-main);
        border-radius: 2px;
        transition: var(--transition);
    }

    /* LAYOUT */
    .container { padding: 0 0.75rem; }
    .page-wrap { padding: 1rem 0 3rem; }
    .card { padding: 1rem; }

    /* STATS */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
    .stat-value { font-size: 1.5rem; }

    /* BUTTONS */
    .btn-lg { padding: 12px 20px; font-size: 0.9rem; }
    .btn { font-size: 0.85rem; padding: 9px 16px; }

    /* EXAM HEADER */
    .exam-header {
        flex-direction: column;
        gap: 10px;
        padding: 0.875rem 1rem;
        top: 56px;
    }
    .exam-header > div:first-child { width: 100%; }
    .exam-header > div:last-child { width: 100%; justify-content: space-between; }
    .timer-display { font-size: 1.25rem; }

    /* QUESTION CARD */
    .question-card { padding: 1rem; }
    .question-text { font-size: 1rem; margin-bottom: 1.1rem; }
    .question-meta { flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
    .question-type-badge { margin-left: 0; }

    /* OPTIONS */
    .option-item { padding: 11px 12px; gap: 10px; }
    .option-text { font-size: 0.92rem; }

    /* EXAM NAVIGATION BUTTONS */
    .question-card > div:last-child {
        flex-direction: column;
        gap: 0.5rem;
    }
    .question-card > div:last-child > div { width: 100%; }
    .question-card > div:last-child .btn { width: 100%; justify-content: center; }

    /* EXAM LAYOUT */
    .exam-layout { grid-template-columns: 1fr; }
    .exam-sidebar { display: none; }

    /* TABLES — горизонтальный скролл */
    .table-wrap { border-radius: var(--radius); }
    table { font-size: 0.8rem; min-width: 500px; }
    th, td { padding: 9px 10px; }

    /* SECTION HEADER */
    .section-header { flex-wrap: wrap; gap: 0.5rem; }

    /* LOGIN */
    .login-wrap { padding: 1rem; }
    .login-logo-icon { width: 60px; height: 60px; font-size: 28px; }
    .login-title { font-size: 1.4rem; }

    /* SCORE RING */
    .score-ring { width: 140px; height: 140px; }
    .score-percent { font-size: 1.8rem; }

    /* HISTORY FLEX ITEMS */
    .flex-wrap-mobile { flex-wrap: wrap; }

    /* GRID 3-COL → 1-COL */
    [style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

    /* NAVBAR USER INFO — скрыть имя на маленьком экране */
    .nav-user-info { display: none; }
    .nav-user { gap: 8px; }

    /* HAMBURGER видим только на мобильном */
    .nav-hamburger { display: flex; }

    /* ADMIN PAYMENTS GRID */
    [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
}

/* QUESTION NAV GRID */
.q-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 4px;
}

.q-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--bg-mid);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.q-nav-btn.answered { background: rgba(232,160,32,0.15); border-color: var(--primary); color: var(--primary); }
.q-nav-btn.current { background: var(--primary); border-color: var(--primary); color: #000; }
.q-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

/* SIDEBAR LAYOUT */
.exam-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }

@media (max-width: 900px) { 
    .exam-layout { grid-template-columns: 1fr; }
    .exam-sidebar { display: none; }
}

.exam-sidebar { 
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 150px;
}
