/* Дополнительные стили поверх Bootstrap */
:root {
    --brand-primary: #2563eb;
    --brand-secondary: #0ea5e9;
    --sidebar-bg: #f8fafc;
}

/* Широкая страница */
@media (min-width: 1200px) {
    .container {
        max-width: 1600px;
    }
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #f0f9ff 0%, #fff 20%);
}

/* Таймер на странице теста */
#test-timer.test-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    background-color: transparent;
    color: #1e3a8a; /* тёмно-синий текст */
    border: 2px solid #1e3a8a;
}

#test-timer.test-timer-badge .bi-clock {
    font-size: 0.95rem;
}

.navbar-brand {
    font-weight: 700;
    color: var(--brand-primary) !important;
}

/* Логотип «Код программы» в шапке */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    text-decoration: none !important;
    color: inherit;
    transition: opacity 0.2s ease;
}
.site-brand:hover {
    opacity: 0.9;
    color: inherit;
}
.site-brand__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.site-brand__text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--brand-primary);
    background: linear-gradient(135deg, #1e3a5f 0%, var(--brand-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@media (max-width: 391px) {
    .site-brand__text {
        font-size: 1rem;
    }
}

.navbar .btn-outline-primary {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.navbar .btn-outline-primary:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Ссылка «учётная запись» в шапке — визуально выделена как кликабельная */
.navbar .profile-link {
    color: var(--brand-primary);
    border-radius: 6px;
    text-decoration: none;
}
.navbar .profile-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--brand-primary);
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.card-title a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
.card-title a:hover {
    color: var(--brand-primary);
}

/* ————— Карточки курсов на главной ————— */
.course-card-link {
    color: inherit;
    transition: transform 0.2s ease;
}
.course-card-link:hover {
    color: inherit;
}
.course-card-link:hover .course-card {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}
.course-card-link:hover .course-card__action {
    color: var(--brand-primary);
}
.course-card {
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.course-card__accent {
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}
.course-card .card-body {
    padding: 1rem 1.1rem 0.5rem;
}
.course-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.course-card__title {
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    margin-bottom: 0.35rem !important;
}
.course-card__desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #64748b !important;
}
.course-card__footer {
    padding: 0 1.1rem 0.85rem;
}
.course-card__action {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    transition: color 0.2s ease;
}
.course-card__action .bi-arrow-right {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}
.course-card-link:hover .course-card__action .bi-arrow-right {
    transform: translateX(3px);
}

.badge-role {
    font-size: 0.75rem;
    font-weight: 500;
}

.hero-title {
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.empty-state {
    padding: 3rem 2rem;
    text-align: center;
    background: var(--sidebar-bg);
    border-radius: 12px;
    color: #64748b;
}

.step-type-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Контент шага с HTML. «По умолчанию» в редакторе = шрифт страницы (sans-serif) */
.step-content-html [style*="По умолчанию"] {
    font-family: inherit !important;
}
.step-content-html img {
    max-width: 100%;
    height: auto;
}
.step-content-html table {
    max-width: 100%;
}

.messages .alert {
    border: none;
}

/* Формы */
form p {
    margin-bottom: 1rem;
}
form p label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
form .helptext {
    font-size: 0.875rem;
    color: #6c757d;
}
form .errorlist {
    list-style: none;
    padding: 0;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
.step-type-field label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
.step-type-field .form-select { max-width: 12rem; }
.step-content-block label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
/* Summernote + Bootstrap 5: выпадающие списки (шрифт, размер) не обрезаются и поверх контента */
.step-content-block .note-editor { position: relative; overflow: visible; }
.step-content-block .note-toolbar { overflow: visible; }
.step-content-block .note-editor .dropdown-menu { z-index: 1060; }
.step-content-block .note-editor .note-btn-group.dropdown { position: static; }
/* Убираем вторую стрелку у выпадающих кнопок (у Summernote уже есть своя) */
.step-content-block .note-editor .dropdown-toggle::after { display: none !important; }
/* Пункты выбора шрифта и размера — не как ссылки, единый вид */
.step-content-block .note-editor .dropdown-menu a,
.step-content-block .note-editor .dropdown-menu .note-dropdown-item,
.step-content-block .note-editor .dropdown-menu li a { color: #212529 !important; text-decoration: none !important; font-weight: normal !important; }
.step-content-block .note-editor .dropdown-menu a:hover,
.step-content-block .note-editor .dropdown-menu a:focus { color: #212529 !important; background-color: #f8f9fa; text-decoration: none !important; }
.step-content-block .note-editor .dropdown-menu a.checked,
.step-content-block .note-editor .dropdown-menu .note-dropdown-item.checked { font-weight: normal !important; text-decoration: none !important; background-color: #e9ecef; }
/* Вся строка пункта кликабельна (шрифт и размер), не только текст */
.step-content-block .note-editor .dropdown-menu li,
.step-content-block .note-editor .dropdown-menu .note-dropdown-item { list-style: none; margin: 0; padding: 0; }
.step-content-block .note-editor .dropdown-menu li a,
.step-content-block .note-editor .dropdown-menu .note-dropdown-item { display: block !important; width: 100% !important; padding: 0.35rem 0.75rem !important; box-sizing: border-box; cursor: pointer; }
#correct-answer-block label { display: block; font-weight: 500; margin-bottom: 0.25rem; }
/* Поле верного ответа и ввода ответа при прохождении — число или короткая строка */
.short-answer-field { max-width: 22em; }

/* Полоса шагов — карточки-значки */
.steps-strip-wrapper {
    background: #374151;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}
.steps-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    flex: 1 1 auto;
    min-width: 0;
}
.steps-strip-finish-form {
    flex-shrink: 0;
}
.steps-strip-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.steps-strip-card:hover {
    transform: scale(1.05);
    color: #fff;
}
.steps-strip-card--completed {
    background: #22c55e;
}
.steps-strip-card--pending {
    background: #4b5563;
}
.steps-strip-card--answered {
    background: #414b5a;
}
.steps-strip-card--incorrect {
    background: #dc2626;
}
.steps-strip-card--partial {
    background: #eab308;
}
.steps-strip-card--current {
    box-shadow: 0 0 0 2px #fff;
    position: relative;
}
.steps-strip-card__icon {
    font-size: 1.25rem;
}
.steps-strip-card__arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #fff;
}

/* Подтема «Вариант»: 27 заданий — карточки на всю ширину полосы, равными долями */
.steps-strip--variant {
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
}
.steps-strip--variant .steps-strip-card {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    aspect-ratio: 1;
    min-height: 20px;
    border-radius: 5px;
    font-size: clamp(0.5rem, 1.2vw, 0.75rem);
}
.steps-strip--variant .steps-strip-card__icon {
    font-size: inherit;
}
.steps-strip-card--variant .steps-strip-card__num {
    font-weight: 600;
    line-height: 1;
}
.steps-strip--variant .steps-strip-card__arrow {
    bottom: -6px;
    border-left-width: 3px;
    border-right-width: 3px;
    border-bottom-width: 5px;
}

/* ————— Табличный ввод пар (ученик и форма урока) ————— */
.variant-answer-table-wrap {
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: #fff;
    border: 1px solid #e2e8f0;
}

.variant-answer-table-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a5f;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.variant-answer-table-banner--teacher {
    font-weight: 500;
    color: #334155;
}

.variant-answer-table-responsive {
    margin-bottom: 0;
}

.variant-answer-table {
    margin-bottom: 0;
    border: none;
}

.variant-answer-table thead th,
.variant-answer-table__row-head,
.variant-answer-table__col-head {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8125rem;
    text-align: center;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.5rem;
}

.variant-answer-table__row-head {
    width: 2.5rem;
    min-width: 2.5rem;
    border-right: 1px solid #e2e8f0;
}

.variant-answer-table__row-num {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.8125rem;
    text-align: center;
    width: 2.5rem;
    border: none;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.4rem;
}

.variant-answer-table__cell {
    vertical-align: middle;
    background: #fff;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.4rem 0.5rem;
}

.variant-answer-table__cell:last-child {
    border-right: none;
}

.variant-answer-table tbody tr:last-child .variant-answer-table__row-num,
.variant-answer-table tbody tr:last-child .variant-answer-table__cell {
    border-bottom: none;
}

.variant-answer-table input.form-control {
    min-width: 0;
    width: 100%;
    max-width: 140px;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.variant-answer-table input.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: 0;
}

/* Форма урока для учителя — те же стили, чуть больше полей при 10 строках */
.variant-teacher-table .variant-answer-table__cell {
    padding: 0.35rem 0.5rem;
}

.variant-teacher-table input.form-control {
    max-width: 120px;
    padding: 0.35rem 0.45rem;
}

/* Фиксированная высота шапки страницы курса — только при наличии кнопок; у ученика не занимает место */
.course-page-header {
    min-height: 0;
    margin-bottom: 0.5rem;
}

/* Убираем лишний верхний отступ, чтобы урок был выше */
.course-detail-page {
    margin-top: -1rem;
}

/* Убираем лишний верхний отступ, чтобы урок был выше */
.course-detail-page {
    margin-top: -1rem;
}

/* Меню курса по центру (структура: темы с прогрессом n/m, подтемы без прогресса) */
.course-menu-nav {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 2.5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}
.course-menu-theme {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.course-menu-theme:first-of-type {
    padding-top: 0;
}
.course-menu-theme:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.course-menu-theme-header {
    margin-bottom: 0.75rem;
}
.course-menu-theme-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.course-menu-theme-progress {
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}
.course-menu-subthemes {
    padding-left: 1.5rem;
}
.course-menu-subtheme {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.course-menu-subtheme-link {
    font-size: 1rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.2rem 0;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.course-menu-subtheme-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
}
.course-menu-subtheme-progress {
    font-variant-numeric: tabular-nums;
    margin-left: 0.5rem;
}
.course-menu-subtheme--completed .course-menu-subtheme-link {
    color: #15803d;
}
.course-menu-subtheme--completed .course-menu-subtheme-link:hover {
    background: #dcfce7;
    color: #166534;
}
.course-sidebar__subthemes--sortable .course-menu-subtheme {
    cursor: move;
}

/* Макет курса: слева сайдбар, справа контент — выравнивание по контейнеру (шапка и контент в одну линию) */
.course-lesson-layout {
    min-height: 60vh;
    align-items: flex-start;
}
.course-sidebar {
    background: #f8fafc;
    border-radius: 12px;
    padding-left: 0.5rem;
    padding-right: 0.75rem;
    position: sticky;
    top: 1rem;
}
.course-sidebar__inner {
    padding: 1rem;
    min-height: 320px;
}
.course-sidebar__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.course-sidebar__progress {
    margin-bottom: 0.75rem;
}
.course-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.course-sidebar__theme {
    margin-bottom: 0.5rem;
}
.course-sidebar__theme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.35rem;
}
.course-sidebar__theme-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    min-width: 0;
}
.course-sidebar__theme-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}
.course-sidebar__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.course-sidebar__action:hover {
    background: #e2e8f0;
    color: #334155;
}
.course-sidebar__action--danger:hover {
    background: #fee2e2;
    color: #dc2626;
}
.course-sidebar__btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.course-sidebar__btn-add:hover {
    background: #bbf7d0;
    color: #15803d;
}
.course-sidebar__subtheme {
    margin-left: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: #f1f5f9;
    border-radius: 8px;
    border-left: 3px solid #94a3b8;
}
.course-sidebar__subtheme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}
.course-sidebar__subtheme-title,
.course-sidebar__subtheme-title-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    flex: 1;
    min-width: 0;
}
.course-sidebar__subtheme-title-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: color 0.15s;
}
.course-sidebar__subtheme-title-link:hover {
    color: #0ea5e9;
}
.course-sidebar__subtheme--active {
    background: #e2e8f0;
    border-left-color: #64748b;
}
.course-sidebar__subtheme--active .course-sidebar__subtheme-title-link {
    color: #0ea5e9;
    font-weight: 700;
}
.course-sidebar__subtheme--active.course-sidebar__subtheme--completed {
    background: #dcfce7;
    border-left-color: #22c55e;
}
.course-sidebar__subtheme--completed {
    background: #f0fdf4;
    border-left-color: #86efac;
}
.course-sidebar__subtheme-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.course-sidebar__subtheme-drag-handle {
    cursor: grab;
    color: #94a3b8;
    padding: 0.15rem 0.25rem;
    margin: -0.15rem 0.2rem -0.15rem -0.25rem;
    user-select: none;
}
.course-sidebar__subtheme-drag-handle:active {
    cursor: grabbing;
}
.course-sidebar__subthemes--sortable .sortable-ghost {
    opacity: 0.5;
    background: #e2e8f0;
}
.course-sidebar__lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.course-sidebar__subtheme .course-sidebar__lesson {
    margin-left: 0;
    padding: 0.35rem 0.5rem;
    border-left: none;
    font-size: 0.85rem;
}
.course-sidebar__btn-lesson {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0ea5e9;
    background: #e0f2fe;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.course-sidebar__btn-lesson:hover {
    background: #bae6fd;
    color: #0284c7;
}
.course-sidebar__btn-theme {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #16a34a;
    background: #dcfce7;
    border: 1px dashed #86efac;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.course-sidebar__btn-theme:hover {
    background: #bbf7d0;
    border-color: #4ade80;
    color: #15803d;
}
.course-sidebar__lesson {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    transition: background 0.15s;
}
.course-sidebar__lesson:hover {
    background: #e2e8f0;
    color: #334155;
}
.course-sidebar__lesson--active {
    background: #22c55e;
    color: #fff;
}
.course-sidebar__lesson--active:hover {
    background: #16a34a;
    color: #fff;
}
.course-sidebar__lesson-num {
    margin-right: 0.5rem;
    font-weight: 600;
    flex-shrink: 0;
}
.course-sidebar__lesson-title {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.course-sidebar__lesson-arrow {
    font-size: 0.75rem;
    opacity: 0.7;
    flex-shrink: 0;
}
.course-main__inner {
    padding: 0.25rem 0 1rem 1rem;
    min-height: 200px;
}
.course-main__inner--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}
.step-content-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}
.empty-topic-state {
    text-align: center;
    padding: 2rem;
}

/* ————— Таблица статистики по курсу (legacy) ————— */
.course-stats-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    background: #fff;
}
.course-stats-table {
    width: 100%;
    min-width: 400px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.course-stats-table thead th {
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    padding: 0.75rem 0.6rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.course-stats-table thead th:first-child,
.course-stats-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
.course-stats-table thead th:first-child {
    background: #f8fafc;
    min-width: 140px;
    max-width: 200px;
}
.course-stats-table thead th:nth-child(2) {
    min-width: 100px;
    max-width: 160px;
}
.course-stats-table thead th.subtheme-col {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 140px;
    padding: 4px 2px;
    vertical-align: bottom;
    text-align: left;
}
.course-stats-table thead th.subtheme-col .subtheme-col-label {
    display: inline-block;
    transform: rotate(-90deg);
    transform-origin: center center;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    font-size: 0.75rem;
    color: #475569;
    line-height: 36px;
}
.course-stats-table tbody td.stats-cell {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
}
.course-stats-table thead th.progress-col {
    min-width: 90px;
    text-align: right;
    padding-right: 0.75rem;
    position: sticky;
    right: 0;
    background: #f8fafc;
    box-shadow: -2px 0 4px rgba(0,0,0,.04);
}
.course-stats-table tbody td {
    padding: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.course-stats-table tbody td:first-child {
    min-width: 140px;
    max-width: 200px;
}
.course-stats-table tbody td:nth-child(2) {
    min-width: 100px;
    max-width: 160px;
}
.course-stats-table tbody tr:hover td {
    background: #f8fafc;
}
.course-stats-table tbody tr:hover td:first-child {
    background: #f1f5f9;
}
.course-stats-table .stats-user-name {
    font-weight: 500;
    color: #1e293b;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.course-stats-table .stats-user-login {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.course-stats-table .stats-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 160px;
}
.course-stats-table .stats-groups .badge {
    font-size: 0.7rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.course-stats-table .stats-cell {
    text-align: center;
    min-width: 52px;
    max-width: 70px;
    font-variant-numeric: tabular-nums;
}
.course-stats-table .stats-cell--done {
    color: #16a34a;
    font-weight: 500;
}
.course-stats-table .stats-cell--partial {
    color: #ca8a04;
}
.course-stats-table tbody td.stats-progress {
    position: sticky;
    right: 0;
    text-align: right;
    padding-right: 0.75rem;
    background: #fff;
    box-shadow: -2px 0 4px rgba(0,0,0,.04);
    font-variant-numeric: tabular-nums;
}
.course-stats-table tbody tr:hover td.stats-progress {
    background: #f8fafc;
}
.course-stats-table .stats-pct {
    font-weight: 600;
    color: #1e293b;
}
.course-stats-table .stats-pct--full {
    color: #16a34a;
}
.course-stats-table .stats-pct--zero {
    color: #94a3b8;
}
.course-stats-filters .badge {
    transition: background .15s, color .15s;
}
.course-stats-filters .badge:hover {
    opacity: 0.9;
}

/* ————— Матрица статистики по курсу: по одной таблице на тему ————— */
.course-stats-theme-block {
    margin-bottom: 1.5rem;
}
.course-stats-theme-block:last-of-type {
    margin-bottom: 0;
}
.course-stats-theme-title {
    font-weight: 600;
    color: #334155;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e2e8f0;
}
.course-stats-matrix-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.course-stats-matrix-wrap--variant {
    overflow: visible;
}
.course-stats-matrix-wrap--variant .course-stats-matrix-scroll {
    overflow: visible;
}
.course-stats-matrix-wrap--variant .course-stats-matrix-scroll .course-stats-matrix thead th {
    background: #f8fafc;
}
.course-stats-matrix__col-sum,
.course-stats-matrix__cell-sum {
    min-width: 3rem;
    font-weight: 600;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
.course-stats-matrix thead .course-stats-matrix__col-sum {
    background: #f8fafc !important;
}
.course-stats-matrix {
    font-size: 0.875rem;
    border-collapse: collapse;
    min-width: 100%;
    table-layout: fixed;
}
.course-stats-matrix thead th {
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    padding: 0.5rem 0.45rem;
    border-color: #e2e8f0 !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    vertical-align: middle;
}
.course-stats-matrix__col-student {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    left: 0;
    z-index: 3;
    background: #f8fafc;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
    text-align: left;
    padding: 0.5rem 0.6rem !important;
}
.course-stats-matrix__col-topic {
    min-width: 52px;
    max-width: 90px;
}
.course-stats-matrix__col-variant {
    text-align: center;
}
.course-stats-matrix__variant-header-row th,
.course-stats-matrix__variant-num {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.2rem 0.15rem !important;
    min-width: 1.5rem;
    text-align: center;
}
.course-stats-matrix__variant-cell {
    min-width: 1.5rem;
    padding: 0.25rem 0.15rem !important;
    font-size: 0.8125rem;
    text-align: center;
}
.course-stats-matrix--variant-stacked .course-stats-matrix__col-student {
    width: 200px;
    min-width: 200px;
}
.course-stats-matrix__variant-row-label .course-stats-matrix__variant-label {
    font-size: 0.8rem;
}
.course-stats-matrix__variant-row-label--center {
    text-align: center;
    vertical-align: middle;
}
.course-stats-matrix__variant-row-label--center .course-stats-matrix__variant-label {
    display: block;
}
.course-stats-matrix__variant-cell--merged {
    background: #f8fafc;
}
.course-stats-matrix__student-header-row + tr td:first-child {
    border-top-color: #e2e8f0;
}
.course-stats-matrix__pct-row .course-stats-matrix__variant-cell--pct {
    font-size: 0.8rem;
    font-weight: 500;
    background: #f1f5f9;
}
.course-stats-matrix__pct-label {
    font-weight: 500;
}
.course-stats-matrix__student-cell {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
    padding: 0.5rem 0.6rem !important;
    border-color: #e2e8f0 !important;
    vertical-align: middle;
}
.course-stats-matrix tbody tr:hover .course-stats-matrix__student-cell {
    background: #f8fafc;
}
.course-stats-matrix__student-name {
    display: block;
    font-weight: 500;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
}
.course-stats-matrix__student-groups {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.course-stats-matrix__student-groups .badge {
    font-size: 0.7rem;
}
.course-stats-matrix__cell {
    text-align: center;
    padding: 0.4rem 0.35rem !important;
    border-color: #e2e8f0 !important;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    max-width: 90px;
}
/* Отключаем заливку строки при наведении, чтобы цвет ячеек был всегда виден */
.course-stats-matrix tbody tr:hover {
    background: transparent;
}
.course-stats-matrix__cell--low {
    background: #fef2f2 !important;
    color: #991b1b;
}
.course-stats-matrix__cell--empty {
    background: #f1f5f9 !important;
    color: #94a3b8;
}
.course-stats-matrix__cell--mid {
    background: #fffbeb !important;
    color: #92400e;
}
.course-stats-matrix__cell--high {
    background: #f0fdf4 !important;
    color: #166534;
}
.course-stats-matrix tbody tr:hover .course-stats-matrix__cell--low {
    background: #fee2e2 !important;
}
.course-stats-matrix tbody tr:hover .course-stats-matrix__cell--mid {
    background: #fef3c7 !important;
}
.course-stats-matrix tbody tr:hover .course-stats-matrix__cell--high {
    background: #dcfce7 !important;
}
.course-stats-matrix__legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}
.course-stats-matrix__legend-dot.course-stats-matrix__cell--low {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.course-stats-matrix__legend-dot.course-stats-matrix__cell--mid {
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.course-stats-matrix__legend-dot.course-stats-matrix__cell--high {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

/* ————— Банк заданий: карточки и бесконечный скролл ————— */
.bank-tasks-list {
    min-height: 120px;
}
.bank-task-card {
    border-radius: 10px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.bank-task-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.25) !important;
}
.bank-task-card__num {
    font-variant-numeric: tabular-nums;
}
.bank-task-card__content {
    font-size: 0.95rem;
    line-height: 1.55;
}
.bank-task-card__content :first-child {
    margin-top: 0;
}
.bank-task-card__content :last-child {
    margin-bottom: 0;
}
.bank-task-card__attachments a {
    color: var(--brand-primary);
    text-decoration: none;
}
.bank-task-card__attachments a:hover {
    text-decoration: underline;
}
.bank-task-card__answer {
    font-variant-numeric: tabular-nums;
}
.bank-load-more-sentinel {
    min-height: 48px;
}

/* ————— Прохождение теста: прогресс по заданиям (степпер) ————— */
.test-progress-bar {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.test-progress-bar a {
    text-decoration: none !important;
    color: inherit;
}
.test-progress-bar__label {
    font-size: 0.9375rem;
    color: #475569;
}
.test-progress-bar__label strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.test-progress-bar__done {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.test-progress-bar__track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.test-progress-bar__track::after {
    content: '';
    display: block;
    height: 100%;
    width: calc(100% * (var(--progress) / var(--total)));
    max-width: 100%;
    background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}
.test-progress-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    justify-content: flex-start;
}
.test-progress-step {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0.2rem;
    text-decoration: none !important;
    color: #64748b !important;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
    border: 1px solid transparent;
}
.test-progress-step:hover {
    background: #f1f5f9;
    color: #475569 !important;
}
.test-progress-step:hover .test-progress-step__circle {
    border-color: #64748b;
    color: #475569;
}
.test-progress-step:hover .test-progress-step__label {
    color: #475569;
}
.test-progress-step__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.test-progress-step__num {
    font-variant-numeric: tabular-nums;
}
.test-progress-step__icon {
    font-size: 1rem;
    font-weight: 700;
}
.test-progress-step__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: inherit;
}
.test-progress-step--pending .test-progress-step__circle {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.test-progress-step--answered .test-progress-step__circle {
    background: #94a3b8;
    border-color: #64748b;
    color: #fff;
}
.test-progress-step--answered:hover .test-progress-step__circle {
    background: #64748b;
    border-color: #475569;
    color: #fff;
}
.test-progress-step--current {
    color: #475569 !important;
}
.test-progress-step--current .test-progress-step__circle {
    border-width: 3px;
    border-color: #64748b;
    color: #475569;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.25);
}
.test-progress-step--current.test-progress-step--answered .test-progress-step__circle {
    border-color: #64748b;
    background: #64748b;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.3);
}

/* Форма ответа заблокирована (ответ уже сохранён) */
.test-answer-locked input:disabled,
.test-answer-locked textarea:disabled,
.test-answer-locked select:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.95;
}
@media (max-width: 576px) {
    .test-progress-step__label {
        display: none;
    }
    .test-progress-step {
        padding: 0.25rem;
    }
}
