/* ============================================
🎨 ОСНОВНЫЕ СТИЛИ - ПРИГЛУШЁННЫЙ МИНИМАЛИЗМ
============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #e9eef3;
    min-height: 100vh;
    color: #1e2a3e;
    transition: background 0.3s, color 0.3s;
    line-height: 1.5;
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ============================================
🧭 НАВИГАЦИЯ (z-index: 100)
============================================ */
.navbar {
    background: white;
    padding: 12px 24px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #1e2a3e;
    letter-spacing: -0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 16px;
    color: #1e2a3e;
    transition: all 0.2s;
    background: none;
    border: none;
}

.hamburger:hover { background: #eef2f6; }

.nav-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.nav-menu a, .nav-menu span {
    text-decoration: none;
    color: #4a5b6e;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 40px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a:hover, .nav-menu span:hover {
    background: #eef2f6;
    color: #1e2a3e;
}

#userName {
    font-weight: 600;
    background: #eef2f6;
    color: #1e2a3e;
}

/* ============================================
📄 СТРАНИЦЫ
============================================ */
.page {
    display: none;
    background: white;
    padding: 32px;
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.25s ease;
    border: 1px solid #eef2f6;
}

.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 15px;
}

h1, h2, h3, h4 {
    color: #1e2a3e;
    font-weight: 600;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h1 { font-size: 30px; margin-bottom: 4px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

.page-header p {
    color: #6c7e97;
    font-size: 15px;
    margin-top: 4px;
}

.divider {
    margin: 32px 0;
    border: none;
    border-top: 1px solid #e6edf4;
}

/* ============================================
🗂️ КАРТОЧКИ
============================================ */
.tests-grid, .groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.test-card, .group-card {
    background: white;
    padding: 24px;
    border-radius: 24px;
    transition: all 0.2s;
    border: 1px solid #eef2f8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.test-card:hover, .group-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -12px rgba(0, 0, 0, 0.1);
    border-color: #cbddee;
}

.test-card h3, .group-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1e2a3e;
}

.test-card p, .group-card p {
    color: #5b6e8c;
    font-size: 14px;
    margin-bottom: 8px;
    flex: 1;
    word-break: break-word;
    white-space: normal;
}

.test-card small, .group-card small {
    color: #8ca0bb;
    font-size: 12px;
    display: block;
    margin-top: 8px;
}

.test-meta {
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid #eef2f8;
    border-bottom: 1px solid #eef2f8;
}

.test-meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin: 8px 0;
}

.test-meta-item span:first-child { color: #8ca0bb; }
.test-meta-item span:last-child { font-weight: 600; color: #1e2a3e; }

.test-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.test-actions button {
    flex: 1;
    min-width: 70px;
    justify-content: center;
    font-size: 12px;
}

/* ============================================
📝 ФОРМЫ
============================================ */
.form-card {
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    padding: 36px;
    border-radius: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #eef2f8;
}

.form-icon {
    font-size: 44px;
    text-align: center;
    margin-bottom: 20px;
    opacity: 0.8;
}

.input-group { margin-bottom: 20px; }

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e4e;
    font-size: 14px;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dce5ec;
    border-radius: 16px;
    font-size: 15px;
    transition: all 0.2s;
    font-family: inherit;
    background: white;
    color: #1e2a3e;
}

.input-group textarea { resize: vertical; min-height: 80px; }

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: #8ba0bc;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
}

/* ============================================
🔘 КНОПКИ
============================================ */
button { font-family: inherit; cursor: pointer; }

.btn-primary {
    background: #1e2a3e;
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: #0f1a2a;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-success {
    background: #58857b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-success:hover:not(:disabled) {
    background: #487067;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-info {
    background: #5f7f9e;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-info:hover:not(:disabled) {
    background: #4f6f8f;
    transform: translateY(-1px);
}

.btn-purple {
    background: #6f6f8f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-purple:hover:not(:disabled) {
    background: #5f5f7f;
    transform: translateY(-1px);
}

.btn-pink {
    background: #b57386;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-pink:hover:not(:disabled) {
    background: #a5637a;
    transform: translateY(-1px);
}

.btn-warning {
    background: #c9845c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-warning:hover:not(:disabled) {
    background: #b0734c;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #2c3e4e;
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-secondary:hover {
    background: #e6edf4;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #2c3e4e;
    padding: 10px 24px;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    padding: 8px 18px;
    border: 1px solid #fecaca;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-danger:hover {
    background: #fee2e2;
    color: #991b1b;
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.form-footer {
    text-align: center;
    margin-top: 24px;
    color: #6c7e97;
    font-size: 14px;
}

.form-footer a {
    color: #1e2a3e;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
👥 СПИСКИ УЧАСТНИКОВ / ЗАЯВОК
============================================ */
.member-list {
    padding: 16px;
    background: #f9fbfd;
    margin: 12px 0;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid #eef2f8;
}

.member-list:hover { background: #f1f5f9; border-color: #cbddee; }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f9fbfd;
    border-radius: 16px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1e2a3e;
}

/* ============================================
📊 СТАТИСТИКА
============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.stat-card {
    padding: 28px 20px;
    border-radius: 28px;
    text-align: center;
    transition: all 0.2s;
    color: white;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card.purple { background: #4f6f8f; }
.stat-card.blue { background: #5f7f9e; }
.stat-card.green { background: #58857b; }
.stat-card.orange { background: #c9845c; }
.stat-card.pink { background: #b57386; }

.stat-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.9; }
.stat-number { font-size: 38px; font-weight: 700; margin-bottom: 6px; }
.stat-label { font-size: 14px; opacity: 0.9; font-weight: 500; }

/* ============================================
🔔 УВЕДОМЛЕНИЯ (z-index: 999999)
============================================ */
.alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: 60px;
    z-index: 999999;
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-success { background: #eef6ee; color: #2b5e2f; border-left: 4px solid #5f8b5f; }
.alert-error { background: #fef2f2; color: #aa2e2e; border-left: 4px solid #d97a7a; }
.alert-info { background: #ecf5fc; color: #2c627a; border-left: 4px solid #6c9ebf; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid #c9845c; }

/* ============================================
🔲 МОДАЛЬНЫЕ ОКНА (z-index: 100000)
============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 32px;
    width: 90%;
    max-width: 720px;
    border-radius: 32px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalZoomIn 0.25s ease;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
    position: relative;
}

@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.close-modal {
    float: right;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    color: #8ba0b5;
    line-height: 1;
    position: sticky;
    top: 0;
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.close-modal:hover { color: #1e2a3e; background: #f1f5f9; }

.modal-input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #dce5ec;
    border-radius: 16px;
    font-size: 15px;
    background: white;
    color: #1e2a3e;
    font-family: inherit;
}

.modal-input:focus { outline: none; border-color: #8ba0bc; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

/* ============================================
📝 ИНТЕРФЕЙС ТЕСТА
============================================ */
.test-header {
    background: #1e2a3e;
    color: white;
    padding: 24px;
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(30, 42, 62, 0.2);
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.test-header h2 {
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-header-left {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.test-header-right {
    display: flex;
    align-items: center;
}

.timer {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.15);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: white;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 16px;
    width: 100%;
}

.progress-bar div {
    height: 100%;
    background: #58857b;
    transition: width 0.3s;
    border-radius: 8px;
}

.test-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

.questions-map {
    background: #f9fbfd;
    border-radius: 24px;
    padding: 18px;
    position: sticky;
    top: 20px;
    height: fit-content;
    border: 1px solid #eef2f8;
}

.questions-map h4 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #1e2a3e;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.map-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border: 2px solid transparent;
    color: #4a5b6e;
}

.map-item:hover { transform: scale(1.1); }

.map-item.answered { background: #d1e7dd; color: #2b5e2f; border-color: #58857b; }
.map-item.current { background: #fde68a; color: #92400e; border: 2px solid #c9845c; }
.map-item.unanswered { background: #fecaca; color: #aa2e2e; border-color: #d97a7a; }

.current-question {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    border: 1px solid #eef2f8;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ============================================
📋 ТАБЛИЧНЫЕ ВОПРОСЫ
============================================ */
.table-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dce5ec;
    border-radius: 14px;
    font-size: 14px;
    text-align: center;
    font-family: inherit;
    background: white;
    color: #1e2a3e;
}

.table-input:focus { outline: none; border-color: #8ba0bc; }
.table-input:disabled { background: #eef2f6; cursor: not-allowed; opacity: 0.7; }

.correct-column {
    background: #d1e7dd !important;
    border: 2px solid #58857b !important;
    color: #2b5e2f !important;
    font-weight: 600 !important;
    cursor: not-allowed !important;
}

.incorrect-column {
    background: #fef2f2 !important;
    border: 2px solid #d97a7a !important;
    color: #aa2e2e !important;
    font-weight: 500;
}

.table-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

.table-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.table-col-label {
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 8px 6px;
    background: #f1f5f9;
    border-radius: 10px;
    color: #2c3e4e;
    border: 1px solid #e2e8f0;
}

/* Обычное серое поле в РНО */
.table-input:not(.correct-column):not(.incorrect-column) {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e2a3e !important;
}

.table-input:not(.correct-column):not(.incorrect-column):focus {
    border-color: #8ba0bc !important;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1) !important;
}

/* ============================================
📷 ЗАГРУЗКА ИЗОБРАЖЕНИЙ
============================================ */
.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    margin: 12px 0;
    transition: 0.2s;
    background: #fafcff;
    color: #6c7e97;
}

.image-upload-area:hover {
    border-color: #8ba0bc;
    background: #ffffff;
}

.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 16px;
    height: 120px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
📊 ТАБЛИЦЫ
============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    border-radius: 16px;
    overflow: hidden;
}

table td, table th {
    padding: 12px;
    border: 1px solid #eef2f8;
    text-align: left;
    vertical-align: top;
}

table th {
    background: #f8fafd;
    font-weight: 600;
    color: #2c3e4e;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table th, .results-table td {
    padding: 12px;
    border: 1px solid #eef2f8;
}

.results-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #1e2a3e;
}

.results-table tr:hover td { background: #fafcff; }

/* ============================================
❓ КАРТОЧКИ ВОПРОСОВ
============================================ */
.question-card {
    background: #fafcff;
    padding: 24px;
    margin: 20px 0;
    border-radius: 24px;
    border-left: 4px solid #8ba0bc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.question-card h4 {
    margin-bottom: 16px;
    color: #1e2a3e;
    font-weight: 600;
}

.question-card img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 16px;
    margin: 12px 0;
    border: 1px solid #e2edf7;
}

.error-question {
    border-left-color: #d97a7a;
    background: #fef2f2;
}

.question-card.current-editing {
    border-left: 4px solid #c9845c;
    box-shadow: 0 0 0 3px rgba(201, 132, 92, 0.3);
    background: #fffaf5;
}

/* ============================================
📋 ВАРИАНТЫ ОТВЕТА
============================================ */
.options label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
    padding: 12px 18px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2eaf1;
    transition: all 0.15s;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.options label:hover {
    background: #f8fafd;
    border-color: #8ba0bc;
    transform: translateX(4px);
}

.options input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.05);
    accent-color: #1e2a3e;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid #dce5ec;
    border-radius: 40px;
    font-size: 14px;
    min-width: 200px;
    background: white;
    color: #1e2a3e;
    font-family: inherit;
}

.search-input:focus { outline: none; border-color: #8ba0bc; }
.search-input::placeholder { color: #8ca0bb; }

.correct-text, .correct {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #86c5a0;
    border-radius: 16px;
    font-size: 14px;
    background: #eef6ee;
    margin-top: 10px;
    color: #2b5e2f;
    font-weight: 500;
    font-family: inherit;
}

.correct-text:focus, .correct:focus {
    outline: none;
    border-color: #58857b;
    background: white;
}

/* Блокировка кнопок "Назад"/"Далее" */
.btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
}

.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-exit-test {
    color: white !important;
    border-color: white !important;
    width: auto !important;
    flex-shrink: 0;
}

/* Блокировка выхода в режиме РНО */
.test-header.rno-mode {
    background: #b91c1c !important;
}

.test-header.rno-mode::after {
    content: "⚠️ Режим РНО - выход заблокирован";
    display: block;
    width: 100%;
    text-align: center;
    font-size: 13px;
    margin-top: 8px;
    padding: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
}

/* ============================================
🌙 ТЁМНАЯ ТЕМА
============================================ */
body.dark-theme {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-theme .navbar,
body.dark-theme .page,
body.dark-theme .form-card,
body.dark-theme .test-card,
body.dark-theme .group-card,
body.dark-theme .modal-content,
body.dark-theme .question-card,
body.dark-theme .current-question,
body.dark-theme .questions-map {
    background: #16213e;
    border-color: #2a3a5e;
    color: #e0e0e0;
}

body.dark-theme .logo { color: #e0e0e0; }
body.dark-theme .navbar a, body.dark-theme .nav-menu a, body.dark-theme .nav-menu span { color: #b8c7e7; }
body.dark-theme .navbar a:hover, body.dark-theme .nav-menu a:hover, body.dark-theme .nav-menu span:hover { background: #2a3a5e; color: white; }
body.dark-theme #userName { background: #2a3a5e; color: #e0e0e0; }

body.dark-theme .input-group input, 
body.dark-theme .input-group select,
body.dark-theme .input-group textarea, 
body.dark-theme .modal-input {
    background: #0f3460;
    border-color: #2a3a5e;
    color: #e0e0e0;
}

body.dark-theme .input-group label { color: #b8c7e7; }
body.dark-theme .btn-primary { background: #3a4a6e; }
body.dark-theme .btn-primary:hover:not(:disabled) { background: #4a5a7e; }
body.dark-theme .btn-secondary { background: #2a3a5e; color: #e0e0e0; border-color: #3a4a6e; }
body.dark-theme .btn-outline { border-color: #4a5a7e; color: #b8c7e7; }
body.dark-theme .btn-outline:hover { background: #2a3a5e; }
body.dark-theme .btn-danger { background: #3a1a1a; color: #ff8a8a; border-color: #5a2a2a; }
body.dark-theme .member-list { background: #0f3460; border-color: #2a3a5e; }
body.dark-theme .alert-success { background: #1a3a2a; color: #8bc48a; }
body.dark-theme .alert-error { background: #3a1a1a; color: #ff8a8a; }
body.dark-theme .alert-info { background: #1a2a3a; color: #8ab4ff; }
body.dark-theme .page-header p, body.dark-theme .test-card p, body.dark-theme .group-card p { color: #b8c7e7; }
body.dark-theme .test-card small, body.dark-theme .group-card small { color: #8ca0bb; }
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3, body.dark-theme h4 { color: #e0e0e0; }
body.dark-theme .options label { background: #0f3460; border-color: #2a3a5e; color: #e0e0e0; }
body.dark-theme .options label:hover { background: #1a4a7a; }
body.dark-theme .image-upload-area { background: #0f3460; border-color: #2a3a5e; }
body.dark-theme .image-upload-area:hover { background: #1a4a7a; }
body.dark-theme .close-modal { color: #8ca0bb; background: #1e293b; }
body.dark-theme .close-modal:hover { color: white; background: #334155; }
body.dark-theme .skeleton { background: linear-gradient(90deg, #2a3a5e 25%, #3a4a6e 50%, #2a3a5e 75%); }
body.dark-theme .map-item { background: #334155; color: #cbd5e1; }
body.dark-theme .map-item.answered { background: #065f46; color: #86efac; border-color: #10b981; }
body.dark-theme .map-item.current { background: #d97706; color: #fef3c7; border-color: #f59e0b; }
body.dark-theme .map-item.unanswered { background: #991b1b; color: #fecaca; border-color: #ef4444; }
body.dark-theme .table-input { background: #0f3460; border-color: #2a3a5e; color: #e0e0e0; }
body.dark-theme .table-input:disabled { background: #2a3a5e; color: #94a3b8; }
body.dark-theme .correct-column { background: #065f46 !important; border-color: #10b981 !important; color: #86efac !important; }
body.dark-theme .incorrect-column { background: #3a1a1a !important; border-color: #991b1b !important; color: #fecaca !important; }
body.dark-theme .search-input { background: #0f3460; border-color: #2a3a5e; color: #f1f5f9; }
body.dark-theme .correct-text, body.dark-theme .correct { background: #064e3b; border-color: #10b981; color: #86efac; }
body.dark-theme .results-table th { background: #334155; color: #f1f5f9; }
body.dark-theme .results-table td { background: #1e293b; color: #e2e8f0; }
body.dark-theme table th { background: #334155; color: #f1f5f9; }
body.dark-theme table td { background: #1e293b; color: #e2e8f0; }
body.dark-theme .test-header { background: #0f1a2a; }
body.dark-theme .timer { background: rgba(255,255,255,0.1); }
body.dark-theme .table-col-label { background: #334155; color: #e2e8f0; border-color: #475569; }
body.dark-theme .form-footer { color: #8ca0bb; }
body.dark-theme .form-footer a { color: #b8c7e7; }
body.dark-theme .question-card.current-editing {
    background: #2a3a5e;
    border-left-color: #c9845c;
}
body.dark-theme .table-input:not(.correct-column):not(.incorrect-column) {
    background: #0f3460 !important;
    border-color: #2a3a5e !important;
    color: #e0e0e0 !important;
}

/* ============================================
📱 МОБИЛЬНАЯ АДАПТИВНОСТЬ
============================================ */
@media (max-width: 768px) {
    .container { padding: 10px; }
    .navbar { padding: 12px 16px; border-radius: 20px; }
    .hamburger { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 5px);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-radius: 20px;
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        max-height: 80vh;
        overflow-y: auto;
        border: 1px solid #eef2f6;
    }
    body.dark-theme .nav-menu { background: #16213e; }
    .nav-menu.active { display: flex; }
    .nav-menu a, .nav-menu span {
        width: 100%;
        padding: 12px 16px;
        border-radius: 12px;
    }
    .page { padding: 16px; border-radius: 20px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }

    .tests-grid, .groups-grid, .stats-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .test-card, .group-card, .form-card { padding: 16px; }

    .test-layout { grid-template-columns: 1fr; }
    .questions-map { position: relative; top: 0; margin-bottom: 20px; }
    .map-grid { grid-template-columns: repeat(5, 1fr); }

    .timer {
        display: block;
        text-align: center;
        margin: 10px auto;
        width: fit-content;
        font-size: 22px;
    }

    .test-controls { flex-direction: column; gap: 8px; }
    .test-controls button { width: 100%; margin: 0; }
    .btn-primary, .btn-success, .btn-info, .btn-purple, .btn-pink, .btn-warning,
    .btn-secondary, .btn-outline, .btn-danger {
        width: 100%;
        margin: 4px 0;
        justify-content: center;
    }
    .test-actions { flex-direction: column; }
    .test-actions button { width: 100%; }
    .member-list { flex-direction: column; text-align: center; }
    .modal-content { width: 95%; padding: 16px; margin: 10% auto; }
    .stat-card { padding: 16px; }
    .stat-number { font-size: 28px; }
    input, select, textarea { font-size: 16px !important; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .search-input { width: 100%; min-width: unset; }
    .results-table { display: block; overflow-x: auto; }
    .alert { bottom: 10px; right: 10px; left: 10px; max-width: none; }
    .table-grid-container { grid-template-columns: repeat(2, 1fr) !important; }

    .test-header-left {
        width: 100%;
        justify-content: space-between;
    }
    .test-header-right {
        width: 100%;
        justify-content: center;
    }
    .test-header-right .timer {
        font-size: 20px;
        padding: 6px 16px;
    }
    .btn-exit-test {
        padding: 6px 14px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 18px; }
    .map-grid { grid-template-columns: repeat(4, 1fr); }
    .test-card h3, .group-card h3 { font-size: 16px; }
    .test-header { padding: 16px; }
    .stat-number { font-size: 26px; }
    .table-grid-container { grid-template-columns: 1fr !important; }
    .nav-menu a, .nav-menu span { padding: 10px 12px; font-size: 13px; }
    .test-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .test-header-left h2 { font-size: 18px; }
}

/* Скроллбары */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #eef2f6; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #8ba0bc; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #6c7e97; }

body.dark-theme ::-webkit-scrollbar-track { background: #0f172a; }
body.dark-theme ::-webkit-scrollbar-thumb { background: #4a5a7e; }