/* ========================================
   #Табак78 Sup Portal - Основные стили
   Версия: 2.0.0
   ======================================== */

/* ---------- Глобальные ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    min-height: 100vh;
    color: #1a1a2e;
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

/* ---------- Анимации ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ---------- Утилиты ---------- */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.rounded-custom {
    border-radius: 15px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-success {
    color: #27ae60;
}

.text-danger {
    color: #e74c3c;
}

.text-warning {
    color: #f39c12;
}

.text-info {
    color: #3498db;
}

/* ---------- Шапка и меню ---------- */
.mobile-header {
    background: #1a1a2e;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header .logo {
    font-size: 18px;
    font-weight: 600;
}

.mobile-header .logo i {
    margin-right: 8px;
    color: #667eea;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: background 0.2s;
}

.menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #1a1a2e;
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

.side-menu.open {
    left: 0;
}

.side-menu-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
}

.side-menu-header i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 12px;
}

.side-menu-header h5 {
    color: white;
    margin: 0;
    font-size: 16px;
}

.side-menu-header small {
    color: #888;
    font-size: 12px;
}

.side-menu .nav-item {
    padding: 14px 20px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 15px;
}

.side-menu .nav-item i {
    width: 24px;
    font-size: 18px;
}

.side-menu .nav-item:hover,
.side-menu .nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: white;
    border-left-color: #667eea;
}

.logout-btn {
    margin: 20px;
    padding: 12px;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: none;
    border-radius: 12px;
    width: calc(100% - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.menu-overlay.active {
    display: block;
}

.desktop-sidebar {
    display: none;
}

.main-content {
    padding: 16px;
    min-height: calc(100vh - 56px);
}

/* ---------- Десктоп ---------- */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }

    .desktop-sidebar {
        display: block;
        width: 280px;
        background: #1a1a2e;
        min-height: 100vh;
        position: sticky;
        top: 0;
    }

    .desktop-sidebar .side-menu {
        position: relative;
        left: 0;
        width: 100%;
        height: 100vh;
        box-shadow: none;
    }

    .menu-overlay {
        display: none !important;
    }

    .desktop-layout {
        display: flex;
    }

    .main-content {
        flex: 1;
        padding: 24px 32px;
        min-height: 100vh;
    }
}

/* ---------- Карточки ---------- */
.card-mobile {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) {
    .card-mobile:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }
}

/* ---------- Бейджи ---------- */
.badge-success {
    background: #27ae6010;
    color: #27ae60;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

.badge-warning {
    background: #f39c1210;
    color: #f39c12;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

.badge-danger {
    background: #e74c3c10;
    color: #e74c3c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

.badge-info {
    background: #3498db10;
    color: #3498db;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

.badge-pass {
    background: #27ae6010;
    color: #27ae60;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.badge-fail {
    background: #e74c3c10;
    color: #e74c3c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* ---------- Кнопки ---------- */
.btn-mobile {
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 500;
    width: 100%;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 16px;
}

.btn-mobile:active {
    background: #5a67d8;
    transform: scale(0.98);
}

.btn-mobile:hover {
    background: #5a67d8;
}

.btn-mobile-danger {
    background: #e74c3c;
}

.btn-mobile-danger:hover {
    background: #c0392b;
}

.details-btn {
    background: #667eea;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.details-btn-danger {
    background: #e74c3c;
}

.details-btn-danger:hover {
    background: #c0392b;
}

.details-btn:hover {
    background: #5a67d8;
}

.small-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.small-btn:hover {
    background: #5a67d8;
}

.small-btn-danger {
    background: #e74c3c;
}

.small-btn-danger:hover {
    background: #c0392b;
}

.small-btn-success {
    background: #28a745;
}

.small-btn-success:hover {
    background: #218838;
}

/* ---------- Формы ---------- */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ---------- Поиск (универсальный) ---------- */
.search-box {
    background: white;
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.search-box:focus-within {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.search-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrapper i {
    color: #999;
    font-size: 18px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 16px;
    background: transparent;
}

.search-btn {
    background: #667eea;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.search-btn:hover {
    background: #5a67d8;
}

.search-btn:active {
    transform: scale(0.98);
}

/* Стили для поиска на страницах ПК и Регламент */
.instructions-search,
.rules-search {
    background: white;
    border-radius: 20px;
    padding: 8px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.instructions-search input,
.rules-search input {
    width: 100%;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 16px;
    background: transparent;
}

.instructions-search i,
.rules-search i {
    color: #999;
    margin-right: 12px;
}

/* ---------- Вкладки ---------- */
.tabs-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    border-bottom-color: #667eea;
    color: #667eea;
}

.tab-content {
    display: none;
    margin-top: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ---------- Таблицы ---------- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

/* ---------- Модальные окна ---------- */
.mistake-modal,
.news-modal,
.photo-modal,
.test-question-modal,
.test-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.mistake-card,
.news-card,
.test-question-card,
.test-result-card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    max-width: 95%;
    width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@media (max-width: 768px) {
    .mistake-card,
    .news-card,
    .test-question-card,
    .test-result-card {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
}

.mistake-card h3,
.news-card h3 {
    margin-bottom: 16px;
    font-size: 20px;
}

.mistake-card .d-flex {
    justify-content: space-between;
    align-items: center;
}

.mistake-card button.close-btn,
.news-card button.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mistake-card button.close-btn:hover,
.news-card button.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* ---------- Карточки новостей ---------- */
.news-card {
    max-width: 700px;
}

.file-preview {
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.file-preview img,
.file-preview video {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
}

.file-link {
    display: inline-block;
    margin: 5px 10px 5px 0;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.file-link:hover {
    background: #5a67d8;
    color: white;
}

/* ---------- Варианты аттестации ---------- */
.variant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.variant-item {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}

.variant-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.variant-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.variant-stats {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.variant-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ---------- Редактор вопросов ---------- */
.question-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.question-item:hover {
    background: #e9ecef;
}

.option-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.sequence-item {
    background: #e9ecef;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: grab;
    display: flex;
    gap: 12px;
    align-items: center;
}

.sequence-item:active {
    cursor: grabbing;
}

.sequence-handle {
    cursor: grab;
    color: #999;
    font-size: 18px;
}

.image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 12px;
    margin-top: 10px;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.type-single {
    background: #3498db10;
    color: #3498db;
}

.type-multiple {
    background: #e74c3c10;
    color: #e74c3c;
}

.type-sequence {
    background: #27ae6010;
    color: #27ae60;
}

.type-text {
    background: #f39c1210;
    color: #f39c12;
}

/* ---------- Ответы в аттестации ---------- */
.answer-correct {
    border-left: 4px solid #27ae60;
    background: #f0fff4;
}

.answer-wrong {
    border-left: 4px solid #e74c3c;
    background: #fff5f5;
}

/* ---------- Вопросы при прохождении теста ---------- */
.option-btn {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    background: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #f0f2ff;
    border-color: #667eea;
}

.option-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-option:hover {
    background: #f0f2ff;
    border-color: #667eea;
}

.checkbox-option.selected {
    background: #f0f2ff;
    border-color: #667eea;
}

.question-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 16px;
    margin-bottom: 16px;
    object-fit: cover;
}

/* ---------- Каталог ---------- */
.category-card,
.subcategory-card {
    background: white;
    border-radius: 20px;
    padding: 20px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:active,
.subcategory-card:active {
    transform: scale(0.97);
}

.category-card:hover,
.subcategory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.cat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: #667eea;
}

.cat-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.3;
}

.cat-count {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

.product-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-card:active {
    transform: scale(0.98);
}

.product-card:hover {
    background: #f8f9ff;
    transform: translateX(4px);
}

.product-photo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: #f5f5f5;
    flex-shrink: 0;
}

.detail-card {
    background: white;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.detail-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.detail-divider {
    height: 1px;
    background: #eee;
    margin: 16px 0;
}

.detail-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #333;
}

.photo-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.photo-gallery img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    background: #f5f5f5;
    transition: border-color 0.2s;
}

.photo-gallery img.active,
.photo-gallery img:hover {
    border-color: #667eea;
}

.main-photo {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 20px;
    margin-bottom: 20px;
    background: #fafafa;
    cursor: pointer;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10001;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.breadcrumb {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.breadcrumb-item {
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: #667eea;
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #ccc;
}

.breadcrumb-current {
    color: #1a1a2e;
    font-weight: 500;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    margin-bottom: 16px;
    cursor: pointer;
    font-weight: 500;
    background: none;
    border: none;
    padding: 8px 0;
    transition: gap 0.2s;
}

.back-btn:hover {
    gap: 12px;
}

/* ---------- Поиск (страница поиска) ---------- */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-tab {
    background: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.filter-tab:hover {
    background: #e8eaff;
    color: #667eea;
}

.filter-tab.active {
    background: #667eea;
    color: white;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
    border-left: 4px solid #667eea;
}

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

.result-title {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}

.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-liquid {
    background: #e74c3c10;
    color: #e74c3c;
}

.badge-disposable {
    background: #e67e2210;
    color: #e67e22;
}

.badge-device {
    background: #3498db10;
    color: #3498db;
}

.badge-snus {
    background: #27ae6010;
    color: #27ae60;
}

.badge-hookah {
    background: #1abc9c10;
    color: #1abc9c;
}

.result-details {
    font-size: 13px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.result-detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stats-bar {
    background: #e8f5e9;
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.clear-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ---------- Тесты ---------- */
.test-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.progress {
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    height: 100%;
    transition: width 0.3s ease;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.score-pass {
    background: #27ae6010;
    color: #27ae60;
}

.score-fail {
    background: #e74c3c10;
    color: #e74c3c;
}

.days-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.day-info {
    flex: 1;
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.day-status {
    font-size: 13px;
}

.day-status.completed {
    color: #27ae60;
}

.day-status.not-completed {
    color: #e74c3c;
}

.day-score {
    font-size: 20px;
    font-weight: 700;
}

.day-score.high {
    color: #27ae60;
}

.day-score.low {
    color: #e74c3c;
}

.test-start-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.test-details-btn {
    background: #f0f2ff;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: #667eea;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.test-details-btn:hover {
    background: #e8eaff;
}

.final-test-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 20px;
    color: white;
    margin-top: 20px;
}

.final-test-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.final-test-status {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.final-test-score {
    font-size: 28px;
    font-weight: 700;
}

/* Тесты - вопросы */
.test-question-modal .test-question-card {
    max-width: 650px;
}

.test-question-text {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.test-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.test-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8f9fa;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.test-option:hover {
    background: #f0f2ff;
    border-color: #667eea;
}

.test-option-letter {
    font-weight: 700;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 14px;
}

.test-progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.test-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.test-counter {
    font-size: 13px;
    color: #6c757d;
}

/* Результаты тестов */
.test-result-card {
    max-width: 700px;
}

.test-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.test-result-score {
    font-size: 48px;
    font-weight: 700;
    margin: 12px 0;
}

.test-result-score.high {
    color: #27ae60;
}

.test-result-score.low {
    color: #e74c3c;
}

.test-result-message {
    font-size: 16px;
    color: #666;
}

.test-question-review {
    border-bottom: 1px solid #eee;
    padding: 16px 0;
}

.test-question-review.correct {
    border-left: 4px solid #27ae60;
    padding-left: 16px;
}

.test-question-review.wrong {
    border-left: 4px solid #e74c3c;
    padding-left: 16px;
}

.test-review-question {
    font-weight: 600;
    margin-bottom: 8px;
}

.test-review-answer {
    font-size: 14px;
    margin-bottom: 6px;
}

.test-review-correct {
    color: #27ae60;
}

.test-review-wrong {
    color: #e74c3c;
}

.test-review-explanation {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
}

/* ---------- Инструкции ПК ---------- */
.instruction-card {
    background: white;
    border-radius: 20px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.instruction-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.instruction-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: opacity 0.2s;
}

.instruction-header:hover {
    opacity: 0.95;
}

.instruction-header i {
    font-size: 18px;
}

.instruction-body {
    padding: 20px;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.instruction-body.active {
    display: block;
}

.instruction-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.instruction-media img {
    max-width: 100%;
    border-radius: 16px;
    margin-top: 8px;
}

.video-player {
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 16px;
}

.video-player video {
    width: 100%;
    max-height: 400px;
    display: block;
}

.badge-type {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 12px;
}

/* ---------- Правила ---------- */
.rule-card {
    background: white;
    border-radius: 20px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.rule-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.rule-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: opacity 0.2s;
}

.rule-header:hover {
    opacity: 0.95;
}

.rule-body {
    padding: 20px;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.rule-body.active {
    display: block;
}

.rule-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ---------- Адаптация для мобильных ---------- */
@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .card-mobile {
        padding: 16px;
    }

    .variant-list {
        grid-template-columns: 1fr;
    }

    .tabs-header {
        gap: 4px;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
        font-size: 13px;
    }

    .test-result-score {
        font-size: 36px;
    }

    .test-question-text {
        font-size: 16px;
    }

    .test-option {
        padding: 12px 14px;
    }

    .test-option-letter {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .instruction-header,
    .rule-header {
        padding: 14px 16px;
    }

    .instruction-body,
    .rule-body {
        padding: 16px;
    }

    .search-input-wrapper {
        gap: 8px;
    }

    .search-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* ---------- Статистика и админка ---------- */
.user-card {
    background: white;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.user-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
}

.user-stat-item {
    flex: 1;
    min-width: 100px;
}

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

.stats-table th,
.stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stats-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ---------- СТАТИСТИКА - ПЛАШКИ ДНЕЙ ---------- */
.day-box {
    height: 100px !important;
    min-height: 100px !important;
    max-height: 100px !important;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.day-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Для мобильных */
@media (max-width: 768px) {
    .day-box {
        height: 85px !important;
        min-height: 85px !important;
        max-height: 85px !important;
    }
}

/* Контейнер для сетки */
.row.g-2 {
    margin-left: -4px;
    margin-right: -4px;
}

.row.g-2 > [class*="col-"] {
    padding-left: 4px;
    padding-right: 4px;
}

/* ---------- Уведомления ---------- */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    z-index: 10001;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success {
    background: #27ae60;
}

.notification-error {
    background: #e74c3c;
}

.notification-warning {
    background: #f39c12;
}

.notification-info {
    background: #3498db;
}

/* ---------- Пустые состояния ---------- */
.empty-state-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: #999;
}

/* ---------- Спираль загрузки ---------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---------- Стили для последовательности (drag & drop) ---------- */
.seq-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.seq-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: grab;
    user-select: none;
    transition: background 0.2s;
}

.seq-item:active {
    cursor: grabbing;
}

.seq-item:hover {
    background: #e9ecef;
}

.seq-handle {
    cursor: grab;
    color: #999;
    font-size: 18px;
}

.seq-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.seq-text {
    flex: 1;
}

/* Анимация для таймера при малом остатке времени */
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#timer.danger {
    background: #e74c3c !important;
    animation: timerPulse 1s infinite;
}

#timer.warning {
    background: #f39c12 !important;
}

/* Стили для скролла в сводке аттестации */
#answersReview::-webkit-scrollbar {
    width: 4px;
}

#answersReview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#answersReview::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

#answersReview::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}

#answersReview {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}