/* Палитра проекта: базовый цвет #07488D и его оттенки */
:root {
    --brand-950: #021a33;
    --brand-900: #032447;
    --brand-800: #053566;
    --brand-700: #063f7a;
    --brand:     #07488D;
    --brand-500: #2a64a3;
    --brand-400: #4f80b8;
    --brand-300: #82a6cf;
    --brand-200: #b4cae3;
    --brand-100: #dae4f1;
    --brand-50:  #eef3f9;

    --bs-primary: var(--brand);
    --bs-primary-rgb: 7, 72, 141;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 7, 72, 141;
    --bs-link-hover-color: var(--brand-800);
    --bs-link-hover-color-rgb: 5, 53, 102;
    --bs-primary-bg-subtle: var(--brand-50);
    --bs-primary-border-subtle: var(--brand-200);
    --bs-primary-text-emphasis: var(--brand-800);
    --bs-body-bg: #f5f8fc;
    --bs-font-sans-serif: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--bs-body-bg); }

/* Утилиты бренда */
.bg-brand      { background-color: var(--brand) !important; }
.bg-brand-dark { background-color: var(--brand-900) !important; }
.bg-brand-50   { background-color: var(--brand-50) !important; }
.bg-brand-100  { background-color: var(--brand-100) !important; }
.text-brand    { color: var(--brand) !important; }
.border-brand  { border-color: var(--brand) !important; }

/* Кнопки */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-800);
    --bs-btn-hover-border-color: var(--brand-800);
    --bs-btn-active-bg: var(--brand-900);
    --bs-btn-active-border-color: var(--brand-900);
    --bs-btn-disabled-bg: var(--brand-400);
    --bs-btn-disabled-border-color: var(--brand-400);
    --bs-btn-focus-shadow-rgb: 7, 72, 141;
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-800);
    --bs-btn-active-border-color: var(--brand-800);
    --bs-btn-focus-shadow-rgb: 7, 72, 141;
}
.btn-soft {
    background: var(--brand-50);
    color: var(--brand);
    border: 1px solid var(--brand-100);
}
.btn-soft:hover { background: var(--brand-100); color: var(--brand-800); }

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 .25rem rgba(7, 72, 141, .2);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); }
.progress { --bs-progress-bar-bg: var(--brand); }

/* Переключатель вариантов */
.variant-pills .nav-link {
    background: #fff;
    border: 1px solid var(--brand-100);
    color: var(--brand-800);
    font-weight: 600;
}
.variant-pills .nav-link:hover { background: var(--brand-50); }
.variant-pills .nav-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Карточки */
.card { border-color: var(--brand-100); border-radius: .75rem; }
.card-header.bg-brand { color: #fff; }
.shadow-brand { box-shadow: 0 .5rem 1.25rem rgba(7, 72, 141, .08); }

/* Герой главной страницы */
.hero {
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand) 55%, var(--brand-500) 100%);
    color: #fff;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
.hero .stat { background: rgba(255, 255, 255, .1); border-radius: .75rem; }

/* Карточка модуля */
.module-card { transition: transform .15s ease, box-shadow .15s ease; }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 .75rem 1.5rem rgba(7, 72, 141, .15); }
.module-num {
    width: 3rem; height: 3rem;
    border-radius: .75rem;
    background: var(--brand-50);
    color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.35rem;
    flex-shrink: 0;
}

/* Таймеры */
.timer-bar {
    position: sticky; top: 0; z-index: 1020;
    background: #fff;
    border-bottom: 1px solid var(--brand-100);
    box-shadow: 0 .25rem .75rem rgba(7, 72, 141, .06);
}
.timer-box { border-radius: .75rem; padding: .5rem .9rem; min-width: 11rem; }
.timer-box.module-timer { background: var(--brand); color: #fff; }
.timer-box.task-timer { background: var(--brand-50); color: var(--brand-900); border: 1px solid var(--brand-100); }
.timer-value { font-family: "Consolas", "Courier New", monospace; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.timer-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.timer-box.warn { background: #fff3cd; color: #664d03; border-color: #ffe69c; }
.timer-box.danger { background: #dc3545; color: #fff; animation: pulse 1s infinite; }
.timer-box.overtime { background: #f8d7da; color: #842029; border-color: #f1aeb5; }
@keyframes pulse { 50% { opacity: .75; } }

/* Лента этапов */
.step-list { position: relative; }
.step-item { position: relative; padding-left: 3.25rem; }
.step-item::before {
    content: ""; position: absolute; left: 1.2rem; top: 2.6rem; bottom: -1rem;
    width: 2px; background: var(--brand-100);
}
.step-item:last-child::before { display: none; }
.step-marker {
    position: absolute; left: 0; top: .6rem;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    background: var(--brand-50); color: var(--brand); border: 2px solid var(--brand-200);
}
.step-item.done .step-marker { background: #198754; border-color: #198754; color: #fff; }
.step-item.current .step-marker { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 .3rem rgba(7, 72, 141, .2); }
.step-item.locked .step-marker { background: #f1f3f5; border-color: #dee2e6; color: #adb5bd; }
.step-item.current .card { border: 2px solid var(--brand-300); }
.step-item.fade-in { animation: fadeIn .45s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.task-content { line-height: 1.6; }
.task-content h5, .task-content h6 { color: var(--brand-800); margin-top: 1rem; }
.task-content ul, .task-content ol { padding-left: 1.25rem; }
.task-content code { color: var(--brand-800); background: var(--brand-50); padding: .1rem .3rem; border-radius: .25rem; }
.task-content table { width: 100%; margin-bottom: 1rem; }
.task-content table td, .task-content table th { border: 1px solid var(--brand-100); padding: .35rem .5rem; }
.task-content table th { background: var(--brand-50); }

.answer-format {
    background: var(--brand-50);
    border-left: 4px solid var(--brand);
    border-radius: .5rem;
    padding: .6rem .9rem;
}

/* Код, приложенный к этапу */
.answer-code {
    max-height: 360px;
    overflow: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    padding: .6rem .8rem;
    font-size: .85em;
    white-space: pre;
}
.answer-code code { color: inherit; }
.answer-code-input { font-size: .9em; tab-size: 4; resize: vertical; }

/* Список файлов */
.file-item { border-radius: .5rem; transition: background .15s; }
.file-item:hover { background: var(--brand-50); }

/* Таблицы */
.table thead.table-brand th { background: var(--brand); color: #fff; border-color: var(--brand-700); }
.score-pill {
    display: inline-block; min-width: 4.5rem; text-align: center;
    border-radius: 2rem; padding: .2rem .6rem; font-weight: 600;
    background: var(--brand-50); color: var(--brand-800);
}

/* Авторизация */
.auth-card { max-width: 460px; }
.auth-icon {
    width: 4rem; height: 4rem; border-radius: 1rem;
    background: var(--brand-50); color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.75rem;
}

/* ---------- Шапка (перенесена с сайта «Методичка», цвета — палитра #07488D) ---------- */
.site-banner {
    width: 100%;
    background-color: var(--brand);
    color: #fff;
    padding: 8px 15px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.site-banner-text { flex: 0 1 auto; min-width: 0; }
.banner-search-wrap { flex: 1 1 auto; display: flex; justify-content: center; align-items: center; min-width: 0; max-width: 640px; margin: 0 auto; }
.banner-search-feedback { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 600px; min-width: 0; }
.header-search-form {
    display: flex; align-items: center; flex: 1 1 auto; min-width: 180px; max-width: 440px;
    background: rgba(255, 255, 255, .95); border-radius: 4px; overflow: hidden;
}
.header-search-input { flex: 1; min-width: 0; padding: 6px 10px; border: none; font-size: 13px; color: #1f2d3d; background: transparent; }
.header-search-input:focus { outline: none; }
.header-search-input::placeholder { color: #5b6b7d; }
.header-search-btn { padding: 6px 10px; border: none; background: var(--brand-800); color: #fff; cursor: pointer; transition: background .2s; }
.header-search-btn:hover { background: var(--brand-500); }
.site-feedback-trigger {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px;
    color: #fff; text-decoration: none; font-size: 13px; white-space: nowrap; transition: background .2s;
}
.site-feedback-trigger:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.banner-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 0 0 auto; }
.theme-btn {
    width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff;
    border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0; transition: background .2s;
}
.theme-btn:hover { background: rgba(255, 255, 255, .2); }
.login-btn {
    background-color: #fff; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px;
    padding: 6px 14px; font-size: 12px; text-decoration: none; white-space: nowrap; transition: all .3s;
}
.login-btn:hover { background-color: var(--brand-800); color: #fff; border-color: #fff; }
.header-user-info { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.header-user-info:hover { color: rgba(255, 255, 255, .85); }
.header-user-avatar { width: 28px; height: 28px; border-radius: 50%; }
.header-user-avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .3); font-size: 13px; }
.header-user-name { font-size: 13px; }

.site-header { width: 100%; background-color: var(--brand-50); padding: 7px 15px; border-bottom: 1px solid var(--brand-100); }
.header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; max-width: 1600px; margin: 0 auto; }
.header-brand { display: flex; align-items: center; gap: 15px; flex: 0 1 auto; min-width: 0; }
.header-part { flex: 1; display: flex; justify-content: center; align-items: center; padding: 5px; min-width: 120px; }
.logo-link { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.site-logo { width: 84px; height: 84px; display: block; }
.site-info { display: flex; flex-direction: column; align-items: flex-start; }
.site-name { font-size: clamp(1.25rem, 1.6vw + .8rem, 2.4rem); font-weight: 700; line-height: 1.1; margin: 0; white-space: nowrap; }
.site-name-link { color: var(--brand); text-decoration: none; }
.site-name-link:hover { color: var(--brand-500); }
.site-subtitle { color: var(--brand-800); font-size: .9rem; margin-top: 4px; }
.contact-info-container { display: flex; flex-direction: column; justify-content: center; }
.contact-info { font-size: 14px; color: var(--brand); line-height: 1.4; margin: 3px 0; }
.contact-info i { margin-right: 5px; }
.email-link { color: var(--brand); text-decoration: none; }
.email-link:hover { text-decoration: underline; }
.social-icons-header { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.social-icon {
    width: 25px; height: 25px; font-size: 18px; display: flex; justify-content: center; align-items: center;
    color: var(--brand); text-decoration: none; transition: color .3s, transform .3s;
}
.social-icon .icon-circle-text {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    border-radius: 50%; border: 1.5px solid currentColor; font-weight: bold; font-family: Arial, sans-serif;
    font-size: .55em; line-height: 1;
}
.social-icon.max:hover { color: #8E66AD; transform: scale(1.15); }

/* Главное меню. Классы site-nav-* вместо nav-* донора, чтобы не конфликтовать с .nav-link Bootstrap */
.menu-toggle {
    display: none; width: 100%; border: none; cursor: pointer; padding: 12px; color: #fff; font-size: 20px;
    background-color: var(--brand); text-align: center; transition: background-color .3s;
}
.menu-toggle:hover { background-color: var(--brand-500); }
.site-nav { width: 100%; background-color: var(--brand); box-shadow: 0 .25rem .75rem rgba(3, 36, 71, .15); }
.site-nav-list { display: flex; list-style: none; margin: 0 auto; padding: 0; justify-content: center; max-width: 1600px; flex-wrap: wrap; }
.site-nav-item { position: relative; }
.site-nav-link {
    display: flex; align-items: center; color: #fff; text-decoration: none; padding: 14px 20px;
    font-size: 17px; white-space: nowrap; width: 100%; transition: background-color .3s ease;
}
.site-nav-link > i:first-child { margin-right: 8px; }
.site-nav-link:hover, .site-nav-item.active > .site-nav-link { background-color: var(--brand-500); color: #fff; }
.site-nav-item.active > .site-nav-link { box-shadow: inset 0 -3px 0 #fff; }
.site-nav-chevron { margin-left: 8px; font-size: .7em; opacity: .85; transition: transform .2s ease; }
.site-nav-submenu {
    position: absolute; top: 100%; left: 0; background-color: var(--brand-500); list-style: none; display: none;
    min-width: max-content; z-index: 1030; padding: 0; margin: 0; border-top: 3px solid var(--brand-800);
    box-shadow: 0 .5rem 1rem rgba(3, 36, 71, .25);
}
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    .site-nav-item:hover > .site-nav-submenu { display: block; animation: fadeIn .3s ease; }
}
.site-nav-submenu-link {
    padding: 11px 18px; display: flex; align-items: center; color: #fff; text-decoration: none;
    font-size: 15px; white-space: nowrap; transition: all .2s ease;
}
.site-nav-submenu-link i { margin-right: 8px; width: 18px; text-align: center; }
.site-nav-submenu-link:hover { background-color: var(--brand); color: #fff; padding-left: 25px; }

@media (max-width: 1200px) {
    .header-inner { gap: 10px; }
    .site-name { white-space: normal; }
}
@media (max-width: 1024px) {
    .site-banner { flex-direction: column; align-items: stretch; padding: 10px 12px; }
    .site-banner-text { text-align: center; line-height: 1.35; }
    .banner-search-wrap { max-width: 100%; width: 100%; }
    .banner-search-feedback { max-width: 100%; flex-wrap: wrap; justify-content: center; }
    .header-search-form { max-width: 100%; flex: 1 1 100%; }
    .banner-right { justify-content: center; width: 100%; }
    .header-part { flex: 1 1 40%; }
    .menu-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; }
    .site-nav-list { flex-direction: column; display: none; width: 100%; }
    .site-nav-list.active { display: flex; }
    .site-nav-item { width: 100%; }
    .site-nav-chevron { margin-left: auto; }
    .site-nav-submenu { position: static; display: none; width: 100%; background-color: rgba(0, 0, 0, .2); border-top: none; box-shadow: none; }
    .site-nav-item.is-open > .site-nav-submenu { display: block; }
    .site-nav-item.is-open > .site-nav-link { background-color: var(--brand-500); }
    .site-nav-item.is-open .site-nav-chevron { transform: rotate(180deg); }
    .site-nav-submenu-link { padding-left: 30px; white-space: normal; }
    .site-nav-link { font-size: 16px; padding: 12px 15px; }
}
@media (max-width: 768px) {
    .header-part { flex: 1 1 100%; }
    .header-part-contacts { justify-content: flex-start; }
    .site-logo { width: 64px; height: 64px; }
}
@media (max-width: 480px) {
    .site-banner, .site-banner-text { font-size: 12px; }
    .banner-search-feedback { flex-direction: column; align-items: stretch; gap: 8px; }
    .site-feedback-trigger { justify-content: center; }
    .banner-right { flex-direction: column; align-items: stretch; }
    .banner-right .login-btn, .banner-right .header-user-info { justify-content: center; text-align: center; }
    .theme-btn { align-self: center; }
    .header-brand { gap: 10px; }
    .site-subtitle { font-size: .8rem; }
}

/* ---------- Тёмная тема (кнопка в верхней полосе; Bootstrap 5.3 data-bs-theme) ---------- */
[data-bs-theme="dark"] {
    --bs-body-bg: #0d1929;
    --bs-body-color: #dfe7f1;
    --bs-tertiary-bg: #1a2d47;
    --bs-link-color: #8eb9e0;
    --bs-link-color-rgb: 142, 185, 224;
    --bs-link-hover-color: #b4cae3;
    --bs-link-hover-color-rgb: 180, 202, 227;
    --brand-50: #13263d;
    --brand-100: #1f3a5c;
    --brand-200: #2d5282;
    color-scheme: dark;
}
[data-bs-theme="dark"] body { background: var(--bs-body-bg); }
[data-bs-theme="dark"] .card { --bs-card-bg: #152238; border-color: #1f3a5c; }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light { background-color: #1a2d47 !important; }
[data-bs-theme="dark"] .table-light { --bs-table-bg: #1a2d47; --bs-table-color: #dfe7f1; }
[data-bs-theme="dark"] .text-brand,
[data-bs-theme="dark"] .site-name-link,
[data-bs-theme="dark"] .contact-info,
[data-bs-theme="dark"] .email-link,
[data-bs-theme="dark"] .social-icon,
[data-bs-theme="dark"] .site-subtitle,
[data-bs-theme="dark"] .module-num,
[data-bs-theme="dark"] .score-pill,
[data-bs-theme="dark"] .timer-box.task-timer,
[data-bs-theme="dark"] .btn-soft,
[data-bs-theme="dark"] .variant-pills .nav-link:not(.active),
[data-bs-theme="dark"] .learn-nav .list-group-item:not(.active),
[data-bs-theme="dark"] .learn-toc a,
[data-bs-theme="dark"] .learn-content h2,
[data-bs-theme="dark"] .learn-content h3,
[data-bs-theme="dark"] .task-content h5,
[data-bs-theme="dark"] .task-content h6,
[data-bs-theme="dark"] .approach-title,
[data-bs-theme="dark"] .callout-info .callout-title,
[data-bs-theme="dark"] .learn-content :not(pre) > code,
[data-bs-theme="dark"] .task-content code { color: #8eb9e0 !important; }
/* Белые кнопки на синем фоне (герой главной, вход) сохраняют фирменный текст */
[data-bs-theme="dark"] .btn-light.text-brand { color: var(--brand) !important; }
[data-bs-theme="dark"] .variant-pills .nav-link:not(.active),
[data-bs-theme="dark"] .timer-bar,
[data-bs-theme="dark"] .approach,
[data-bs-theme="dark"] .flow-node { background: #152238; }
[data-bs-theme="dark"] .mistake { background: #2a1a20; border-color: #5a2a33; }
[data-bs-theme="dark"] .callout-tip { background: #13291e; }
[data-bs-theme="dark"] .callout-warning { background: #2d2610; }
[data-bs-theme="dark"] .callout-danger { background: #2d1519; }
[data-bs-theme="dark"] .flow-node.end-ok { background: #13291e; }
[data-bs-theme="dark"] .flow-node.end-bad { background: #2d1519; }
[data-bs-theme="dark"] .timer-box.warn { background: #2d2610; color: #ffda6a; }
[data-bs-theme="dark"] .timer-box.overtime { background: #2d1519; color: #f1aeb5; }
[data-bs-theme="dark"] .site-header { background-color: #10213a; border-color: #1f3a5c; }
[data-bs-theme="dark"] .header-search-form { background: rgba(21, 34, 56, .95); border: 1px solid rgba(142, 185, 224, .3); }
[data-bs-theme="dark"] .header-search-input { color: #e0e6ed; }
[data-bs-theme="dark"] .header-search-input::placeholder { color: rgba(255, 255, 255, .5); }
[data-bs-theme="dark"] .login-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
[data-bs-theme="dark"] .site-banner, [data-bs-theme="dark"] .site-nav, [data-bs-theme="dark"] .menu-toggle { background-color: var(--brand-800); }
[data-bs-theme="dark"] .site-footer { background-color: #081424; }
[data-bs-theme="dark"] .footer-input, [data-bs-theme="dark"] .footer-textarea { color: #e0e6ed; }
[data-bs-theme="dark"] .footer-input::placeholder, [data-bs-theme="dark"] .footer-textarea::placeholder { color: rgba(255, 255, 255, .5); }
[data-bs-theme="dark"] .footer-input:focus, [data-bs-theme="dark"] .footer-textarea:focus { background-color: #1a2d47; }
[data-bs-theme="dark"] .scroll-top { background: #1a2d47; color: #8eb9e0; }

/* ---------- Подвал (перенесён с сайта «Методичка», цвета — палитра #07488D) ---------- */
.site-footer {
    background-color: var(--brand-900);
    color: #fff;
    padding: 30px 0 20px;
    width: 100%;
    margin-top: auto;
}
.footer-container { max-width: 1600px; margin: 0 auto; padding: 0 15px; }
.footer-content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 30px; }
.footer-section { flex: 1 1 200px; min-width: 200px; max-width: 300px; }
.social-section { max-width: 320px; }
.footer-heading { color: var(--brand-300); margin-bottom: 15px; font-size: 18px; font-weight: 600; }

.footer-social { display: flex; gap: 15px; margin-top: 10px; }
.footer-social-icon {
    color: #fff; font-size: 24px; width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; transition: color .3s, transform .3s;
}
.footer-social-icon:hover { transform: scale(1.2); }
.footer-social-icon.max:hover { color: #8E66AD; }
/* Иконка Макса — картинка, как в футере 21mygroop (images/logo/max-white.png; в светлой шапке — max.png) */
.footer-social-icon.max { width: 40px; height: 40px; }
.social-icon.max { width: 28px; height: 28px; }
.social-icon-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.footer-social-icon.max:hover, .social-icon.max:hover { opacity: .9; }
.footer-social-icon.max .icon-circle-text {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor;
    font-size: 13px; font-weight: bold; font-family: Arial, sans-serif; line-height: 1; box-sizing: border-box;
}

.footer-partners { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.footer-partners-title { color: var(--brand-300); font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.footer-partners-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.footer-partner-item {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    text-decoration: none; color: rgba(255, 255, 255, .95); transition: color .2s ease, transform .2s ease;
}
.footer-partner-item:hover { color: var(--brand-300); transform: translateY(-2px); }
.footer-partner-logo {
    width: 48px; height: 48px; object-fit: contain; border-radius: 6px;
    background: rgba(255, 255, 255, .08); padding: 4px; box-sizing: border-box;
}
.footer-partner-name { display: block; margin-top: 6px; font-size: .72rem; line-height: 1.25; max-width: 100%; }

.footer-form { display: flex; flex-direction: column; gap: 15px; }
.footer-input, .footer-textarea {
    padding: 10px 12px; border: none; border-radius: 4px;
    background-color: var(--brand-100); width: 100%; font-size: 14px; color: #1f2d3d;
}
.footer-input:focus, .footer-textarea:focus { outline: 2px solid var(--brand-300); background-color: #fff; }
.footer-textarea { resize: vertical; min-height: 100px; }
.footer-input::placeholder, .footer-textarea::placeholder { color: #5b6b7d; }
.footer-submit {
    background-color: var(--brand-500); color: #fff; border: none; padding: 10px 15px;
    border-radius: 4px; cursor: pointer; font-size: 15px; transition: background-color .3s;
}
.footer-submit:hover { background-color: var(--brand); }

.author-info { display: flex; flex-direction: column; gap: 10px; }
.author-photo-container { display: flex; align-items: center; gap: 15px; margin-bottom: 5px; }
.author-photo { width: 100px; height: 100px; border: 1px solid #fff; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.author-name { font-weight: bold; font-size: 1em; color: #fff; }
.author-position { font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, .95); }

.footer-contact-list { display: flex; flex-direction: column; gap: 8px; }
.footer-contact { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: .9em; color: rgba(255, 255, 255, .95); }
.footer-contact i { color: var(--brand-300); width: 20px; text-align: center; margin-top: 2px; flex-shrink: 0; }
.footer-link { color: rgba(255, 255, 255, .95); text-decoration: none; }
.footer-link:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
    margin-top: 30px; padding-top: 15px; border-top: 1px solid var(--brand-700);
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-copyright { font-size: .9em; color: rgba(255, 255, 255, .9); margin: 0; }

.scroll-top {
    width: 48px; height: 48px; background: #fff; color: var(--brand); border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    position: fixed; bottom: 24px; right: 24px; z-index: 999; box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
    transition: opacity .3s, visibility .3s, transform .3s, background .2s;
}
.scroll-top--hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); }
.scroll-top:not(.scroll-top--hidden) { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.scroll-top:hover { background: var(--brand-50); }

@media (max-width: 1200px) {
    .footer-content { gap: 24px; }
    .footer-section { flex: 1 1 calc(50% - 24px); min-width: 180px; max-width: none; }
}
@media (max-width: 992px) {
    .footer-section { flex: 1 1 100%; max-width: 100%; }
    .scroll-top { bottom: 16px; right: 16px; }
}
@media (max-width: 768px) {
    .footer-content { flex-direction: column; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 12px; }
    .author-photo-container { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .footer-heading { font-size: 16px; }
    .footer-container { padding: 0 12px; }
    .scroll-top { width: 44px; height: 44px; bottom: 12px; right: 12px; }
}

/* ---------- Раздел «Обучение» ---------- */
.learn-aside { position: sticky; top: 1rem; }
.learn-nav .list-group-item { border-color: var(--brand-50); color: var(--brand-900); font-size: .92rem; }
.learn-nav .list-group-item.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.learn-toc a { color: var(--brand-800); text-decoration: none; border-left: 2px solid transparent; padding-left: .5rem; }
.learn-toc a:hover { color: var(--brand); }
.learn-toc a.active { border-left-color: var(--brand); color: var(--brand); font-weight: 600; }

.learn-content { line-height: 1.7; }
.learn-content h2 {
    font-size: 1.35rem; color: var(--brand); margin: 2.25rem 0 1rem;
    padding-bottom: .4rem; border-bottom: 2px solid var(--brand-100); scroll-margin-top: 1rem;
}
.learn-content h2:first-child { margin-top: 0; }
.learn-content h3 { font-size: 1.1rem; color: var(--brand-800); margin: 1.5rem 0 .75rem; }
.learn-content table { font-size: .92rem; }
.learn-content table:not(.table) { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.learn-content table:not(.table) td, .learn-content table:not(.table) th { border: 1px solid var(--brand-100); padding: .4rem .6rem; vertical-align: top; }
.learn-content table:not(.table) th { background: var(--brand-50); color: var(--brand-900); }
.learn-content :not(pre) > code { color: var(--brand-800); background: var(--brand-50); padding: .1rem .35rem; border-radius: .25rem; font-size: .88em; }
.learn-content kbd { background: var(--brand-800); }

.code-wrap { border: 1px solid var(--brand-100); border-radius: .6rem; overflow: hidden; margin: 1rem 0 1.25rem; }
.code-head { background: var(--brand-800); color: #fff; font-size: .8rem; padding: .35rem .8rem; display: flex; justify-content: space-between; align-items: center; }
.code-wrap pre { margin: 0; max-height: 560px; }
.code-wrap pre code.hljs, .code-wrap pre code { padding: 1rem; font-size: .84rem; line-height: 1.55; background: #f8fafd; display: block; }

.callout { border-radius: .6rem; padding: .85rem 1rem; margin: 1rem 0; border-left: 4px solid; }
.callout-title { font-weight: 600; margin-bottom: .25rem; }
.callout-tip { background: #eef8f1; border-color: #198754; }
.callout-tip .callout-title { color: #146c43; }
.callout-info { background: var(--brand-50); border-color: var(--brand); }
.callout-info .callout-title { color: var(--brand); }
.callout-warning { background: #fff8e6; border-color: #ffc107; }
.callout-warning .callout-title { color: #997404; }
.callout-danger { background: #fdf0f1; border-color: #dc3545; }
.callout-danger .callout-title { color: #b02a37; }

.mistakes { display: grid; gap: .75rem; margin: 1rem 0; }
.mistake { display: flex; gap: .85rem; border: 1px solid #f1d3d6; background: #fffafa; border-radius: .6rem; padding: .75rem 1rem; }
.mistake-num {
    flex-shrink: 0; width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: #dc3545; color: #fff; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
}
.approach { border: 1px solid var(--brand-100); border-radius: .6rem; padding: .85rem 1rem; background: #fff; }
.approach-title { font-weight: 700; color: var(--brand-800); margin-bottom: .4rem; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { padding: .3rem 0; border-bottom: 1px dashed var(--brand-100); }

.step-grid { counter-reset: step; display: grid; gap: .6rem; margin: 1rem 0; }
.step-grid > div { position: relative; padding: .7rem 1rem .7rem 3.2rem; background: var(--brand-50); border-radius: .6rem; }
.step-grid > div::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: .8rem; top: .7rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem;
    display: flex; align-items: center; justify-content: center;
}

/* Блок-схемы на HTML */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 1rem 0; }
.flow-node { border: 2px solid var(--brand); background: #fff; border-radius: .5rem; padding: .45rem .9rem; font-size: .88rem; text-align: center; max-width: 520px; }
.flow-node.decision { background: var(--brand-50); border-style: dashed; }
.flow-node.end-ok { border-color: #198754; background: #eef8f1; }
.flow-node.end-bad { border-color: #dc3545; background: #fdf0f1; }
.flow-arrow { color: var(--brand-400); line-height: 1; padding: .15rem 0; }
.flow-branch { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.flow-branch .flow-node { font-size: .82rem; }

/* ER-диаграммы (SVG) */
.er-svg { width: 100%; height: auto; background: #fbfcfe; border: 1px solid var(--brand-100); border-radius: .6rem; }
.er-svg line, .er-svg path.er-link { stroke: var(--brand-800); stroke-width: 1.6; fill: none; }
.er-svg .er-sep { stroke: var(--brand-100); stroke-width: 1; }
.er-svg .er-box { fill: #fff; stroke: var(--brand); stroke-width: 1.5; }
.er-svg .er-head { fill: var(--brand); }
.er-svg .er-hollow { fill: #fff; stroke: var(--brand-800); stroke-width: 1.6; }
.er-svg text { font-family: "Segoe UI", Arial, sans-serif; font-size: 13px; fill: #1f2d3d; }
.er-svg .er-title { fill: #fff; font-weight: 700; }
.er-svg .er-key { fill: var(--brand-400); font-weight: 700; font-size: 11px; }
.er-svg .er-pk { font-weight: 700; text-decoration: underline; }
.er-svg .er-caption { font-size: 12px; fill: #555; }

.dropzone {
    border: 2px dashed var(--brand-200);
    border-radius: .75rem;
    background: var(--brand-50);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.dropzone.dragover { background: var(--brand-100); border-color: var(--brand); }

/* ===== SQL-тренажёр ===== */
.sql-task-num { min-width: 2.2rem; }
.sql-task-content p:last-child { margin-bottom: .75rem; }
.sql-playground {
    background: linear-gradient(160deg, var(--brand-950), #111827);
    border-radius: 12px;
    padding: 1rem 1.1rem 1.1rem;
    color: #e5e7eb;
    box-shadow: 0 6px 18px rgba(2, 26, 51, .25);
}
.sql-playground-label { font-size: .8rem; font-weight: 600; color: var(--brand-200); display: inline-block; margin-bottom: .35rem; }
.sql-playground-hint { font-size: .8rem; color: #9ca3af; }
.sql-playground-hint kbd { font-size: .7rem; }
.sql-playground .CodeMirror {
    height: 240px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
}
.sql-playground .btn-check:checked + .btn-outline-light { color: var(--brand-900); }
.sql-result-wrap { max-height: 420px; overflow: auto; }
.sql-result { font-size: .85rem; }
.sql-result thead th { position: sticky; top: 0; background: var(--brand-50); color: var(--brand-800); white-space: nowrap; }
.sql-result td { white-space: nowrap; }
.sql-null { color: #9ca3af; font-style: italic; }
.sql-history { max-height: 360px; overflow: auto; }
.sql-history-item code { color: var(--brand-800); }
.sql-schema .accordion-button:not(.collapsed) { background: var(--brand-50); color: var(--brand-800); box-shadow: none; }
[data-bs-theme="dark"] .sql-result thead th { background: #0f2744; color: var(--brand-100); }
[data-bs-theme="dark"] .sql-history-item code { color: var(--brand-200); }
[data-bs-theme="dark"] .sql-schema .accordion-button:not(.collapsed) { background: #0f2744; color: var(--brand-100); }
[data-bs-theme="dark"] .sql-playground .CodeMirror { background: #0b1220; color: #e5e7eb; }
[data-bs-theme="dark"] .sql-playground .CodeMirror-gutters { background: #0f172a; border-color: #1f2937; }
[data-bs-theme="dark"] .sql-playground .CodeMirror-cursor { border-left-color: #e5e7eb; }
[data-bs-theme="dark"] .sql-playground .cm-keyword { color: #93c5fd; }
[data-bs-theme="dark"] .sql-playground .cm-string { color: #fca5a5; }
[data-bs-theme="dark"] .sql-playground .cm-number { color: #86efac; }
[data-bs-theme="dark"] .sql-playground .cm-variable-2,
[data-bs-theme="dark"] .sql-playground .cm-variable,
[data-bs-theme="dark"] .sql-playground .cm-qualifier { color: #e5e7eb; }
[data-bs-theme="dark"] .sql-playground .cm-builtin,
[data-bs-theme="dark"] .sql-playground .cm-type { color: #c4b5fd; }
[data-bs-theme="dark"] .sql-playground .cm-atom { color: #fcd34d; }
[data-bs-theme="dark"] .sql-playground .cm-comment { color: #9ca3af; }

/* ===== Вход, регистрация, восстановление пароля (по образцу 24protexsting) ===== */
.login-screen { display: flex; align-items: center; justify-content: center; padding: 8px 0 20px; }
.login-card {
    width: 100%; max-width: 440px; border-radius: 28px; padding: 22px 26px 26px;
    background: linear-gradient(155deg, var(--brand-900) 0%, var(--brand) 55%, #1f7cc2 100%);
    border: 1px solid #5ca5db; box-shadow: 0 24px 54px rgba(6, 39, 74, .35); color: #eaf5ff;
}
.register-card { max-width: 540px; }
.login-back-link { color: #cbe6ff; text-decoration: none; font-size: 14px; }
.login-back-link:hover { color: #fff; text-decoration: underline; }
.login-card__logo-wrap {
    width: 112px; height: 112px; border-radius: 50%; margin: 12px auto; border: 2px solid #5cb8ff;
    display: flex; align-items: center; justify-content: center; background: rgba(7, 30, 52, .25);
}
.login-card__logo { width: 72px; height: 72px; border-radius: 16px; }
.login-card__title { margin: 0 0 4px; text-align: center; color: #fff; font-weight: 700; font-size: 24px; }
.login-card__subtitle { margin: 0 0 18px; text-align: center; color: #cfe7ff; font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-field__label { display: inline-block; margin-bottom: 6px; color: #d8ecff; font-size: 14px; }
.login-field__hint { margin: 6px 0 0; color: #a9c8e4; font-size: 12px; line-height: 1.4; }
.login-field__control {
    display: flex; align-items: center; gap: 10px; position: relative;
    background: rgba(3, 31, 63, .5); border: 1px solid #3f86bf; border-radius: 8px; padding: 10px 12px;
}
.login-field__control:focus-within { border-color: #9fd1ff; box-shadow: 0 0 0 3px rgba(95, 170, 240, .3); }
.login-field__control > i { color: #9fd1ff; width: 16px; text-align: center; }
.login-field__control input, .login-field__control select {
    border: 0; outline: none; background: transparent; width: 100%; color: #f5fbff; font-size: 15px;
}
.login-field__control input::placeholder { color: #97bbdb; }
.login-field__control input:-webkit-autofill { -webkit-text-fill-color: #f5fbff; transition: background-color 9999s; }
.login-field__control select { appearance: none; padding-right: 18px; cursor: pointer; }
.login-field__control select option { color: #1b2b40; }
.login-field__control--select::after {
    content: "\25BC"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #9fd1ff; font-size: 11px; pointer-events: none;
}
.login-field__toggle { border: 0; background: transparent; color: #9fd1ff; padding: 0 2px; }
.login-field__toggle:hover { color: #fff; }
.login-field.is-invalid .login-field__control { border-color: #ff9b9b; }
.login-field__error { margin: 6px 0 0; color: #ffc9c9; font-size: 12.5px; }
.login-options { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.login-options__text { color: #c6e1fb; font-size: 13px; }
.login-options__link { color: #d0e8ff; text-decoration: none; font-size: 13px; }
.login-options__link:hover { color: #fff; text-decoration: underline; }
.login-submit-btn {
    margin-top: 6px; border: 0; border-radius: 10px; color: #fff; padding: 11px 18px; font-size: 17px; font-weight: 700;
    background: linear-gradient(180deg, #1987e2 0%, #0b63b2 100%);
}
.login-submit-btn:hover { background: linear-gradient(180deg, #36a0f8 0%, #0e6cc0 100%); }
.login-submit-btn:disabled { opacity: .7; }
.login-card .alert { font-size: 14px; }
.req-mark { color: #ffb4b4; }
.login-role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.login-role-switch label {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border-radius: 8px; cursor: pointer;
    border: 1px solid #3f86bf; background: rgba(3, 31, 63, .35); color: #d8ecff; font-size: 14px;
}
.login-role-switch input:checked + label { background: #1987e2; border-color: #9fd1ff; color: #fff; }
.login-role-switch input:focus-visible + label { box-shadow: 0 0 0 3px rgba(95, 170, 240, .45); }
[data-bs-theme="dark"] .login-card { background: linear-gradient(155deg, #0b1a2c 0%, #10345c 60%, #155a94 100%); border-color: #2d6da3; }

/* Прогресс выполнения */
.progress-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-100) 0); }
.progress-ring > span { width: 92px; height: 92px; border-radius: 50%; background: var(--bs-body-bg); display: grid; place-items: center;
    font-weight: 700; font-size: 1.5rem; color: var(--brand); }
[data-bs-theme="dark"] .progress-ring { background: conic-gradient(var(--brand-400) calc(var(--p) * 1%), #1f2d3d 0); }
[data-bs-theme="dark"] .progress-ring > span { color: var(--brand-200); }
.stat-bar { height: 8px; }
.visits-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.visits-chart > div { flex: 1; background: var(--brand-400); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.visits-chart > div:hover { background: var(--brand); }

/* ===== Статистика в стиле 24protexsting (admin/site_statistics.php) ===== */
.admin-stats-page .site-stats-lead { color: #555; max-width: 760px; margin-bottom: .5rem; }
.admin-stats-page .site-stats-since { display: inline-flex; align-items: center; gap: .4rem; margin: 0 0 1.25rem; padding: .45rem .85rem;
    background: #eef5fc; border: 1px solid rgba(15, 70, 133, .15); border-radius: 8px; color: var(--brand); font-weight: 600; font-size: .95rem; }
.admin-stats-page .site-stats-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .75rem 1rem;
    background: #f0f6fc; border: 1px solid rgba(15, 70, 133, .15); border-radius: 8px; }
.admin-stats-page .site-stats-toolbar-label { font-weight: 600; color: var(--brand); }
.admin-stats-page .site-stats-toolbar-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-stats-page .site-stats-kpi { background: linear-gradient(135deg, #e8f2fc 0%, #f0f7ff 100%); border: 1px solid rgba(15, 70, 133, .12);
    border-radius: 10px; padding: 1rem 1.1rem; text-align: center; height: 100%; }
.admin-stats-page .site-stats-kpi-val { display: block; font-size: 1.75rem; font-weight: 700; color: var(--brand); line-height: 1.2; }
.admin-stats-page .site-stats-kpi-val--sm { font-size: 1rem; }
.admin-stats-page .site-stats-kpi-label { display: block; font-size: .85rem; color: #666; margin-top: .35rem; }
.admin-stats-page .site-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.admin-stats-page .site-stats-card { background: #fff; border: 1px solid #dee2e6; border-radius: 10px; padding: 1rem 1.1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(15, 70, 133, .06); min-width: 0; }
.admin-stats-page .site-stats-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.admin-stats-page .site-stats-card-title { font-size: 1rem; font-weight: 700; color: var(--brand); margin: 0; flex: 1 1 180px; }
.admin-stats-page .site-stats-type-wrap { flex: 0 1 160px; min-width: 140px; }
.admin-stats-page .site-stats-canvas-wrap { position: relative; height: 280px; min-width: 0; }
.admin-stats-page .site-stats-canvas-wrap--table { height: auto; max-height: 320px; overflow: auto; }
.admin-stats-page .site-stats-table-view table { font-size: .85rem; }
.admin-stats-page .site-stats-canvas-wrap--pie { height: auto; width: 100%; display: flex; flex-direction: column; align-items: center; margin: 0 auto .5rem; }
.admin-stats-page .site-stats-pie-host { width: 240px; max-width: 100%; flex: 0 0 auto; margin: 0 auto; }
.admin-stats-page .site-stats-pie-host > canvas { display: block; max-width: 100%; margin: 0 auto; }
.admin-stats-page .site-stats-card-export { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .75rem; padding-top: .65rem; border-top: 1px dashed #dee2e6; }
.admin-stats-page .site-stats-card-export-label { font-size: .85rem; color: #666; margin-right: .25rem; }
.admin-stats-page .site-stats-canvas-wrap--side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; height: auto; }
.admin-stats-page .site-stats-canvas-wrap--side .site-stats-pie-host { margin: 0; }
.admin-stats-page .site-stats-hidden-slices { flex: 1 1 45%; min-width: 78px; max-height: 280px; overflow: auto; font-size: .72rem; background: #fff; border-radius: 6px; }
.admin-stats-page .site-stats-hidden-slices td { padding: 2px 4px; vertical-align: middle; overflow-wrap: break-word; }
.admin-stats-page .site-stats-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15); }
[data-bs-theme="dark"] .admin-stats-page .site-stats-lead { color: #b6c6d8; }
[data-bs-theme="dark"] .admin-stats-page .site-stats-since,
[data-bs-theme="dark"] .admin-stats-page .site-stats-toolbar,
[data-bs-theme="dark"] .admin-stats-page .site-stats-kpi { background: rgba(15, 70, 133, .25); border-color: rgba(255, 255, 255, .12); color: #8eb9e0; }
[data-bs-theme="dark"] .admin-stats-page .site-stats-toolbar-label,
[data-bs-theme="dark"] .admin-stats-page .site-stats-kpi-val,
[data-bs-theme="dark"] .admin-stats-page .site-stats-card-title { color: #8eb9e0; }
[data-bs-theme="dark"] .admin-stats-page .site-stats-kpi-label,
[data-bs-theme="dark"] .admin-stats-page .site-stats-card-export-label { color: #9db0c4; }
[data-bs-theme="dark"] .admin-stats-page .site-stats-card { background: rgba(21, 34, 56, .55); border-color: rgba(255, 255, 255, .12); }
[data-bs-theme="dark"] .admin-stats-page .site-stats-card-export { border-top-color: rgba(255, 255, 255, .12); }
[data-bs-theme="dark"] .admin-stats-page .site-stats-hidden-slices { background: rgba(21, 34, 56, .85); }
@media (max-width: 900px) { .admin-stats-page .site-stats-grid { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
    .admin-stats-page .site-stats-card { padding: .75rem .7rem .9rem; }
    .admin-stats-page .site-stats-card-title { font-size: .92rem; flex: 1 1 100%; }
    .admin-stats-page .site-stats-type-wrap { flex: 1 1 100%; min-width: 0; }
    .admin-stats-page .site-stats-canvas-wrap { height: 220px; }
    .admin-stats-page .site-stats-canvas-wrap--pie, .admin-stats-page .site-stats-canvas-wrap--table { height: auto; }
    .admin-stats-page .site-stats-pie-host { width: min(200px, 100%); }
    .admin-stats-page .site-stats-canvas-wrap--side { flex-direction: column; align-items: stretch; }
    .admin-stats-page .site-stats-kpi-val { font-size: 1.35rem; }
}
.perm-group-row td { background: var(--brand-50); }
[data-bs-theme="dark"] .perm-group-row td { background: rgba(15, 70, 133, .25); }

/* ===== Отработка: цветовая шкала прогресса ===== */
.pc-4 { background: #22c55e !important; color: #fff !important; }
.pc-3 { background: #bbf7d0 !important; color: #14532d !important; }
.pc-2 { background: #fef08a !important; color: #713f12 !important; }
.pc-1 { background: #fed7aa !important; color: #7c2d12 !important; }
.pc-0 { background: #fecaca !important; color: #7f1d1d !important; }
.pc-na { background: #f1f3f5 !important; color: #6c757d !important; }
.pc-legend { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .78rem; font-weight: 600; }
.progress-matrix-wrap { max-height: 70vh; overflow: auto; }
.progress-matrix { font-size: .85rem; }
.progress-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--brand); color: #fff; white-space: nowrap; }
.progress-matrix thead th[data-dir="asc"]::after { content: " \25B2"; font-size: .7em; }
.progress-matrix thead th[data-dir="desc"]::after { content: " \25BC"; font-size: .7em; }
.progress-matrix .pm-sticky { position: sticky; left: 0; z-index: 1; background: var(--bs-body-bg); }
.progress-matrix thead .pm-sticky { z-index: 3; background: var(--brand); }
.progress-matrix .pm-cell { font-weight: 600; min-width: 64px; }
.progress-matrix .pm-sep { border-left: 3px solid var(--brand-300) !important; }
.progress-matrix tbody tr:hover td { filter: brightness(.95); }
.progress-matrix tbody tr:hover .pm-sticky { background: var(--brand-50); }
.progress-matrix tfoot .pm-avg th { position: sticky; bottom: 0; border-top: 2px solid var(--brand); }
.progress-matrix tfoot .pm-sticky { background: var(--brand-50); }
.site-stats-toolbar-like { padding: .6rem .9rem; background: #f0f6fc; border: 1px solid rgba(15, 70, 133, .15); border-radius: 8px; }
[data-bs-theme="dark"] .site-stats-toolbar-like { background: rgba(15, 70, 133, .25); border-color: rgba(255, 255, 255, .12); }
[data-bs-theme="dark"] .progress-matrix tfoot .pm-sticky, [data-bs-theme="dark"] .progress-matrix tbody tr:hover .pm-sticky { background: #0f2744; }

/* ===== Админка: оболочка с боковым меню (по образцу 24protexsting) ===== */
.login-btn--admin { display: inline-flex; align-items: center; gap: 6px; background: #ffc53d; color: #3d2a00; border-color: #ffc53d; font-weight: 700; }
.login-btn--admin:hover, .login-btn--admin.is-active { background: #ffb400; color: #2a1d00; border-color: #fff; }
.login-btn-badge { background: #d64545; color: #fff; border-radius: 999px; font-size: 10px; line-height: 1; padding: 2px 6px; font-weight: 700; }
[data-bs-theme="dark"] .login-btn--admin { background: #ffc53d; color: #3d2a00; border-color: #ffc53d; }

.admin-main { background: #eef4fb; }
[data-bs-theme="dark"] .admin-main { background: transparent; }
.admin-container { max-width: none; padding-left: 16px; padding-right: 16px; }
.admin-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-content { min-width: 0; }
.admin-sidebar { background: #1f2f46; border-radius: 12px; padding: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto;
    box-shadow: 0 .5rem 1.25rem rgba(2, 26, 51, .18); scrollbar-width: thin; scrollbar-color: #3b5579 transparent; }
.admin-sidebar-toggle { display: none; }
.admin-sidebar-nav a { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .88); text-decoration: none; padding: 8px 10px;
    border-radius: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 4px; transition: background .15s; }
.admin-sidebar-nav a i { width: 16px; text-align: center; color: rgba(255, 255, 255, .82); }
.admin-sidebar-nav a:hover, .admin-sidebar-nav a.active { background: #2f4d73; color: #fff; }
.admin-sidebar-nav a.active { box-shadow: inset 3px 0 0 #4ea5ff; }
.admin-sidebar-nav a:hover i, .admin-sidebar-nav a.active i { color: #fff; }
.admin-nav-badge { margin-left: auto; background: #d64545; color: #fff; border-radius: 999px; font-size: .7rem; line-height: 1; padding: 3px 7px; }
.admin-nav-section-title { display: flex; align-items: center; gap: 9px; color: #b9d8ff; font-weight: 800; font-size: .72rem; letter-spacing: .06em;
    text-transform: uppercase; line-height: 1.2; padding: 8px 10px 6px; margin-bottom: 4px; border-left: 3px solid #4ea5ff; border-radius: 4px;
    background: linear-gradient(90deg, rgba(78, 165, 255, .18) 0%, rgba(78, 165, 255, .04) 70%, rgba(78, 165, 255, 0) 100%); }
.admin-nav-section-title:not(:first-child) { margin-top: 12px; }
.admin-nav-section-title i { color: #7ec2ff; width: 16px; text-align: center; font-size: .85rem; }

/* Заголовок раздела админки */
.admin-heading { color: var(--brand); font-weight: 700; display: flex; align-items: center; gap: 12px; }
.admin-heading i { color: #4dabf7; }
[data-bs-theme="dark"] .admin-heading { color: #8eb9e0; }

/* Дашборд: карточки показателей */
.dash-kpi { display: block; background: #fff; border-radius: 10px; padding: 14px 16px; height: 100%; text-decoration: none; color: inherit;
    border: 1px solid rgba(15, 70, 133, .08); box-shadow: 0 1px 4px rgba(15, 70, 133, .06); transition: transform .15s, box-shadow .15s; position: relative; }
a.dash-kpi:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.25rem rgba(7, 72, 141, .12); color: inherit; }
.dash-kpi-icon { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand); font-size: .95rem; }
.dash-kpi-label { font-size: .8rem; color: #6b7a8c; }
.dash-kpi-value { font-size: 1.6rem; font-weight: 700; color: #1f2f46; line-height: 1.25; margin-top: 4px; }
.dash-kpi-value small { font-size: .85rem; color: #6b7a8c; font-weight: 600; }
.dash-kpi-sub { font-size: .76rem; color: #6b7a8c; margin-top: 2px; }
.dash-kpi--warn .dash-kpi-icon { background: #fff4db; color: #b7791f; }
.dash-kpi--ok .dash-kpi-icon { background: #e3f7ec; color: #1f8a4c; }
.dash-panel { background: #fff; border-radius: 10px; padding: 16px 18px; border: 1px solid rgba(15, 70, 133, .08); box-shadow: 0 1px 4px rgba(15, 70, 133, .06); }
.dash-panel-title { font-size: 1.05rem; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.dash-panel-title i { color: #4dabf7; }
.dash-panel-lead { font-size: .8rem; color: #6b7a8c; margin-bottom: 14px; }
.dash-visits-total { background: #f7fafd; border: 1px solid rgba(15, 70, 133, .1); border-radius: 8px; padding: 14px 16px; height: 100%; }
.dash-visits-total .dash-kpi-value { font-size: 1.9rem; }
.dash-table { font-size: .85rem; margin-bottom: 0; }
.dash-table thead th { border-bottom: 2px solid #1f2f46; font-weight: 700; white-space: nowrap; }
.dash-table-scroll { max-height: 260px; overflow-y: auto; }
.dash-section-title { font-size: 1.25rem; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 10px; margin: 0; }
.dash-section-title i { color: #4dabf7; }
.dash-quick a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--brand-800);
    font-weight: 600; font-size: .88rem; border: 1px solid var(--brand-100); background: var(--brand-50); transition: background .15s; }
.dash-quick a:hover { background: var(--brand-100); }
.dash-quick a i { width: 18px; text-align: center; color: var(--brand); }
.dash-quick a .admin-nav-badge { font-size: .68rem; }
.dash-bar { height: 6px; background: var(--brand-50); border-radius: 3px; overflow: hidden; min-width: 60px; }
.dash-bar > span { display: block; height: 100%; background: #4dabf7; }
[data-bs-theme="dark"] .dash-kpi, [data-bs-theme="dark"] .dash-panel { background: #152238; border-color: #1f3a5c; }
[data-bs-theme="dark"] .dash-visits-total { background: rgba(15, 70, 133, .25); border-color: rgba(255, 255, 255, .12); }
[data-bs-theme="dark"] .dash-kpi-value { color: #e3ecf6; }
[data-bs-theme="dark"] .dash-kpi-label, [data-bs-theme="dark"] .dash-kpi-sub, [data-bs-theme="dark"] .dash-kpi-value small,
[data-bs-theme="dark"] .dash-panel-lead { color: #9db0c4; }
[data-bs-theme="dark"] .dash-panel-title, [data-bs-theme="dark"] .dash-section-title { color: #8eb9e0; }
[data-bs-theme="dark"] .dash-table thead th { border-bottom-color: #4f80b8; }
[data-bs-theme="dark"] .dash-quick a { color: #cfe0f3; }

@media (max-width: 991.98px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; max-height: none; padding: 10px; }
    .admin-sidebar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; color: #fff; font-weight: 700; padding: 4px 6px; }
    .admin-sidebar-nav { display: none; margin-top: 8px; }
    .admin-sidebar.is-open .admin-sidebar-nav { display: block; }
}

/* ===== Оценка (admin/grading.php) ===== */
.mark-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 700; font-size: .85rem; color: #fff; }
.mark-5 { background: #1f8a4c; }
.mark-4 { background: #2a7fd4; }
.mark-3 { background: #d99a1e; }
.mark-2 { background: #c9423b; }
.grading-export { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .65rem 1rem; background: #f0f6fc; border: 1px solid rgba(15, 70, 133, .15); border-radius: 8px; }
.grading-export-label { font-weight: 600; color: var(--brand); margin-right: .25rem; }
.grading-cell { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; text-decoration: none; color: inherit; border: 1px solid transparent; white-space: nowrap; }
.grading-cell:hover { border-color: var(--brand-300); background: var(--brand-50); color: inherit; }
.grading-cell.is-confirmed, .grading-legend.is-confirmed { background: #e3f7ec; }
.grading-cell.is-checked, .grading-legend.is-checked { background: #e6f0fb; }
.grading-cell.is-pending, .grading-legend.is-pending { background: #fff4db; }
.grading-legend { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid rgba(0, 0, 0, .1); }
.grading-matrix td, .grading-matrix th { white-space: nowrap; }
.grading-page details > summary { cursor: pointer; list-style: none; }
.grading-page details > summary::-webkit-details-marker { display: none; }
.grading-page fieldset:disabled .accordion-button { pointer-events: auto; }
[data-bs-theme="dark"] .grading-export { background: rgba(15, 70, 133, .25); border-color: rgba(255, 255, 255, .12); }
[data-bs-theme="dark"] .grading-export-label { color: #8eb9e0; }
[data-bs-theme="dark"] .grading-cell.is-confirmed, [data-bs-theme="dark"] .grading-legend.is-confirmed { background: rgba(31, 138, 76, .3); }
[data-bs-theme="dark"] .grading-cell.is-checked, [data-bs-theme="dark"] .grading-legend.is-checked { background: rgba(42, 127, 212, .3); }
[data-bs-theme="dark"] .grading-cell.is-pending, [data-bs-theme="dark"] .grading-legend.is-pending { background: rgba(217, 154, 30, .3); }

/* ===== Аватары ===== */
.avatar-img { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-img--empty { background: var(--brand-50); color: var(--brand-400); }
img.header-user-avatar { object-fit: cover; border: 1px solid rgba(255, 255, 255, .6); }
.profile-avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 4px solid var(--brand-50); box-shadow: 0 .5rem 1.25rem rgba(7, 72, 141, .15); }
.avatar-preview img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px dashed var(--brand-300); }
.avatar-request--pending { background: #fff4db; border: 1px solid #f3d58a; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.avatar-card { position: relative; background: #fff; border: 1px solid rgba(15, 70, 133, .1); border-radius: 10px; padding: 14px 10px 12px; text-align: center; box-shadow: 0 1px 4px rgba(15, 70, 133, .06); min-width: 0; }
.avatar-card-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; border: 3px solid var(--brand-50); }
.avatar-check { position: absolute; top: 10px; left: 10px; width: 1.2em; height: 1.2em; }
[data-bs-theme="dark"] .avatar-card { background: #152238; border-color: #1f3a5c; }
[data-bs-theme="dark"] .avatar-request--pending { background: rgba(217, 154, 30, .2); border-color: rgba(217, 154, 30, .4); }

/* ===== Сообщения ===== */
.header-mail-btn { position: relative; width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px; text-decoration: none; flex-shrink: 0; transition: background .2s; }
.header-mail-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.header-mail-btn.has-unread i { animation: mail-ring 2.4s ease-in-out infinite; }
.header-mail-badge { position: absolute; top: -7px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #e03131; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; border: 2px solid var(--brand); }
@keyframes mail-ring { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-14deg); } 93% { transform: rotate(12deg); } 97% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .header-mail-btn.has-unread i { animation: none; } }
.messages-list { max-height: 70vh; overflow-y: auto; }
.messages-item.is-unread { background: var(--brand-50); }
.messages-item.is-unread .fw-semibold::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e03131; margin-right: 6px; vertical-align: middle; }
.messages-item.active { background: var(--brand); border-color: var(--brand); }
.min-w-0 { min-width: 0; }
.messages-feed { max-height: 60vh; overflow-y: auto; background: #f5f8fc; display: flex; flex-direction: column; gap: 12px; }
.message-row { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.message-row.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble { background: #fff; border: 1px solid rgba(15, 70, 133, .12); border-radius: 12px 12px 12px 4px; padding: 8px 12px; min-width: 0; }
.message-bubble.is-staff { background: #e8f1fb; border-color: rgba(15, 70, 133, .2); }
.message-row.is-mine .message-bubble { border-radius: 12px 12px 4px 12px; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .75rem; color: #6b7a8c; margin-bottom: 3px; }
.message-meta b { color: var(--brand-800); }
.message-text { white-space: normal; overflow-wrap: anywhere; }
.messages-new-divider { display: flex; align-items: center; gap: 10px; color: #e03131; font-size: .75rem; font-weight: 600; }
.messages-new-divider::before, .messages-new-divider::after { content: ''; flex: 1; border-top: 1px dashed #e03131; }
[data-bs-theme="dark"] .messages-feed { background: #0f1b2d; }
[data-bs-theme="dark"] .message-bubble { background: #152238; border-color: #1f3a5c; }
[data-bs-theme="dark"] .message-bubble.is-staff { background: #1a3050; }
[data-bs-theme="dark"] .message-meta b { color: #8eb9e0; }

/* ---------- Расписание подготовки (календарь по образцу 21mygroop) ---------- */
.schedule-controls { border: 1px solid rgba(7, 72, 141, .2); }
.schedule-legend { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.schedule-legend-item { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--brand-800); }
.schedule-legend-bar { width: 4px; height: 1.25rem; border-radius: 2px; flex-shrink: 0; }
.schedule-legend-icon { font-size: .9rem; opacity: .85; }
.schedule-view-switch .btn { min-width: 4.5rem; font-weight: 600; }
.schedule-period-label { color: var(--brand); font-weight: 700; white-space: nowrap; }
.schedule-nav-pill { border-radius: 999px; font-weight: 600; }
.schedule-main { gap: 1rem; }

/* Месяц */
.schedule-table { width: 100%; overflow: hidden; }
.schedule-table .row { margin: 0; flex-wrap: nowrap; }
.schedule-table .row > .col { flex: 0 0 14.285714%; max-width: 14.285714%; min-width: 0; }
.schedule-head-cell { padding: .5rem .25rem; text-align: center; font-weight: 600; font-size: .85rem; background: var(--brand-50); border-bottom: 1px solid rgba(0, 0, 0, .08); }
.schedule-day { min-height: 6.5rem; padding: .35rem; border: 1px solid rgba(0, 0, 0, .08); border-right: none; }
.schedule-week-row + .schedule-week-row .schedule-day { border-top: none; }
.schedule-week-row .schedule-day:last-child { border-right: 1px solid rgba(0, 0, 0, .08); }
.schedule-day--blank { background: rgba(0, 0, 0, .02); }
.schedule-day--interactive { cursor: pointer; }
.schedule-day--interactive:focus-visible { outline: 2px solid rgba(7, 72, 141, .45); outline-offset: -2px; }
.schedule-empty-day:hover { background: rgba(7, 72, 141, .04); }
.schedule-day.is-weekend, .schedule-week-col.is-weekend, .schedule-week-col-head.is-weekend { background: #e3effb; }
.schedule-day.is-weekend.schedule-empty-day:hover, .schedule-week-col.is-weekend.schedule-empty-day:hover { background: #d3e5f8; }
.schedule-day.is-today { background: rgba(7, 72, 141, .07); box-shadow: inset 0 0 0 2px rgba(7, 72, 141, .35); }
.schedule-day-num { display: block; font-size: .8rem; font-weight: 600; color: #555; margin-bottom: .25rem; }

/* Событие в ячейке */
.schedule-event { display: block; width: 100%; text-align: left; border: none; border-radius: 4px; background: var(--brand); color: #fff;
    font-size: .72rem; font-weight: 600; line-height: 1.25; padding: .2rem .35rem; margin-bottom: .2rem; cursor: pointer; overflow-wrap: anywhere; }
.schedule-event:hover { filter: brightness(.88); }
.schedule-event--excluded { opacity: .6; text-decoration: line-through; }
.schedule-event-icon { margin-right: .2rem; font-size: .85em; }
.schedule-event-time { opacity: .85; margin-right: .25rem; }
.schedule-event-mark { float: right; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem;
    border-radius: 50%; font-size: .65rem; margin-left: .15rem; color: #fff; }
.schedule-event-mark--completed { background: #198754; }
.schedule-event-mark--rescheduled { background: #0d6efd; }
.schedule-event-mark--excluded { background: #dc143c; }
.schedule-event--week { margin-bottom: .35rem; }
.schedule-event--slot { font-size: .85rem; padding: .35rem .55rem; white-space: normal; }

/* Неделя */
.schedule-week-head { background: #f0f4f8; border-bottom: 1px solid rgba(7, 72, 141, .15); }
.schedule-week-col-head { padding: .5rem .35rem; text-align: center; border-right: 1px solid rgba(7, 72, 141, .12); color: var(--brand); font-weight: 600; }
.schedule-week-col-head:last-child, .schedule-week-col:last-child { border-right: none; }
.schedule-week-col-head.is-today { background: #fff8e1; }
.schedule-week-wd { display: block; font-size: .75rem; text-transform: uppercase; opacity: .8; }
.schedule-week-dn { display: block; font-size: 1rem; }
.schedule-week-body { min-height: 12rem; }
.schedule-week-col { border-right: 1px solid rgba(7, 72, 141, .12); background: #fafbfd; padding: .5rem .35rem; min-height: 10rem; min-width: 0; }
.schedule-week-col.is-today { background: #fffef5; }
.schedule-week-col-label { display: none; font-size: .8rem; font-weight: 600; color: var(--brand); margin-bottom: .25rem; }
.schedule-week-empty { margin: 0; padding: .25rem 0; font-size: .8rem; font-style: italic; color: #6c757d; }

/* День */
.schedule-day-view-head { background: #f8fafc; color: var(--brand); }
.schedule-day-view-body { padding: 1.25rem; background: #fafbfd; }
.schedule-day-view-empty { font-style: italic; color: #6c757d; }
.schedule-hour-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .75rem; align-items: start; padding: .45rem 0; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.schedule-hour-row--all-day { background: rgba(7, 72, 141, .04); border-bottom-width: 2px; }
.schedule-hour-row--empty { opacity: .6; }
.schedule-hour-label { font-size: .82rem; font-weight: 600; color: var(--brand); padding-top: .15rem; white-space: nowrap; }
.schedule-hour-events { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }

/* Форма */
.schedule-create { background: #f0f7ff; border: 1px solid rgba(7, 72, 141, .35); border-radius: .75rem; }
.schedule-create-toggle { cursor: pointer; user-select: none; background: rgba(7, 72, 141, .06); }
.schedule-create-toggle:hover { background: rgba(7, 72, 141, .1); }
.schedule-create-chevron { transition: transform .2s ease; color: var(--brand); }
.schedule-create-toggle[aria-expanded="true"] .schedule-create-chevron { transform: rotate(180deg); }
.schedule-create-title { color: var(--brand); font-weight: 700; }
.schedule-optional-heading { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: #5c6b7a; }
.schedule-optional { font-size: .75em; font-weight: 400; color: #6c757d; }
.schedule-create-submit { border-radius: 2rem; padding: .5rem 1.25rem; font-weight: 600; }
.schedule-recurrence { border: 1px dashed rgba(7, 72, 141, .25); border-radius: .5rem; padding: .75rem .85rem; background: rgba(255, 255, 255, .65); }
.schedule-weekday-chip { margin: 0; }
.schedule-weekday-chip .btn { min-width: 2.5rem; padding-left: .5rem; padding-right: .5rem; }
.schedule-file-preview { display: flex; flex-wrap: wrap; gap: .35rem; }
.schedule-file-chip { display: inline-flex; align-items: center; font-size: .8rem; padding: .25rem .5rem; border-radius: .35rem; background: var(--brand-50); color: var(--brand); }
.schedule-mobile-add { display: none; position: fixed; right: 1rem; bottom: 1rem; z-index: 1040; width: 3.25rem; height: 3.25rem; border-radius: 50%;
    align-items: center; justify-content: center; padding: 0; }

/* Карточка */
.schedule-modal .modal-content { border-radius: 12px; }
.schedule-modal-cat, .schedule-modal-status { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.schedule-modal-status { color: #fff; }
.schedule-modal-status--completed { background: #198754; }
.schedule-modal-status--rescheduled { background: #0d6efd; }
.schedule-modal-status--excluded { background: #dc143c; }
.schedule-meta li { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .45rem; color: var(--brand-800); }
.schedule-meta li i { margin-top: .2rem; width: 1rem; text-align: center; opacity: .75; }
.schedule-card-description { white-space: pre-line; }
.schedule-card-section { border-top: 1px solid #e8eef5; padding-top: 1rem; margin-top: 1rem; }
.schedule-status-btn { border: 1px solid #adb5bd; background: #fff; color: #495057; flex: 1 1 auto; min-width: 7rem; }
.schedule-status-btn.active.schedule-status-btn--completed { background: #198754; border-color: #198754; color: #fff; }
.schedule-status-btn.active.schedule-status-btn--rescheduled { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.schedule-status-btn.active.schedule-status-btn--excluded { background: #dc143c; border-color: #dc143c; color: #fff; }
/* hidden сильнее d-flex и других утилит Bootstrap внутри карточки */
.schedule-modal [hidden] { display: none !important; }

/* Тренажёр «Postman: проверка API» */
.at-response { border: 1px solid #e8eef5; border-radius: .5rem; padding: .6rem .75rem; background: #f8fafc; }
.at-response-body { max-height: 360px; overflow: auto; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }

/* Участники и посещаемость */
.schedule-att-table-wrap { max-height: 50vh; overflow-y: auto; }
.schedule-att-table thead th { position: sticky; top: 0; z-index: 1; }
.schedule-att-group .btn { min-width: 2.1rem; font-weight: 600; }
.schedule-att-remark { min-width: 10rem; }
.schedule-participants-select optgroup { font-style: normal; color: var(--brand); }

[data-bs-theme="dark"] .schedule-legend-item, [data-bs-theme="dark"] .schedule-meta li { color: #b8d0ea; }
[data-bs-theme="dark"] .schedule-period-label, [data-bs-theme="dark"] .schedule-hour-label, [data-bs-theme="dark"] .schedule-week-col-head,
[data-bs-theme="dark"] .schedule-week-col-label, [data-bs-theme="dark"] .schedule-create-title, [data-bs-theme="dark"] .schedule-day-view-head { color: #8eb9e0; }
[data-bs-theme="dark"] .schedule-head-cell, [data-bs-theme="dark"] .schedule-week-head, [data-bs-theme="dark"] .schedule-day-view-head { background: rgba(255, 255, 255, .06); }
[data-bs-theme="dark"] .schedule-day, [data-bs-theme="dark"] .schedule-week-row .schedule-day:last-child { border-color: rgba(255, 255, 255, .1); }
[data-bs-theme="dark"] .schedule-day-num { color: #c3cfdd; }
[data-bs-theme="dark"] .schedule-week-col, [data-bs-theme="dark"] .schedule-day-view-body { background: transparent; }
[data-bs-theme="dark"] .schedule-day.is-weekend, [data-bs-theme="dark"] .schedule-week-col.is-weekend, [data-bs-theme="dark"] .schedule-week-col-head.is-weekend { background: rgba(120, 170, 220, .12); }
[data-bs-theme="dark"] .schedule-week-col-head.is-today, [data-bs-theme="dark"] .schedule-week-col.is-today { background: rgba(255, 213, 79, .08); }
[data-bs-theme="dark"] .schedule-create { background: #13233a; border-color: #1f3a5c; }
[data-bs-theme="dark"] .schedule-recurrence { background: rgba(255, 255, 255, .03); }
[data-bs-theme="dark"] .schedule-status-btn { background: transparent; color: #c3cfdd; }
[data-bs-theme="dark"] .schedule-card-section { border-color: #1f3a5c; }

@media (max-width: 767.98px) {
    .schedule-controls-row { flex-direction: column; align-items: stretch !important; }
    .schedule-view-switch { flex: 1 1 auto; }
    .schedule-view-switch .btn { flex: 1 1 33%; min-width: 0; }
    .schedule-period-nav { width: 100%; justify-content: center; }
    .schedule-period-label { font-size: 1rem; text-align: center; white-space: normal; }
    .schedule-week-head { display: none; }
    .schedule-week-body { flex-direction: column; }
    .schedule-week-body > .col { flex: 0 0 100%; max-width: 100%; border-right: none; border-bottom: 1px solid rgba(7, 72, 141, .12); min-height: 0; }
    .schedule-week-col-label { display: block; }
    .schedule-create-form .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
    .schedule-create-submit { width: 100%; }
    .schedule-mobile-add { display: inline-flex; }
    .schedule-hour-row { grid-template-columns: 3.25rem minmax(0, 1fr); gap: .5rem; }
    .schedule-day { min-height: 4.5rem; padding: .2rem; }
    .schedule-day-num { font-size: .7rem; }
    .schedule-event { font-size: .6rem; padding: .15rem .2rem; }
    .schedule-event-icon, .schedule-event-time { display: none; }
    .schedule-head-cell { font-size: .7rem; padding: .35rem .1rem; }
}

/* ---------- Главная: статистика подготовки (по образцу «Аналитики результатов» 24protexsting) ---------- */
.prep-insight { background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%); border: 1px solid rgba(7, 72, 141, .12); border-left: 4px solid #4dabf7;
    border-radius: 1rem; padding: 1.25rem 1.25rem 1rem; box-shadow: 0 .5rem 1.5rem rgba(7, 72, 141, .07); }
.prep-insight__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.prep-insight__title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .85rem; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: var(--brand); }
.prep-insight__note { margin: .5rem 0 1rem; font-size: .9rem; color: #4a5d78; }
.prep-insight__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.prep-card { background: #fff; border: 1px solid rgba(7, 72, 141, .1); border-radius: .85rem; padding: 1rem; box-shadow: 0 4px 16px rgba(7, 72, 141, .05); min-width: 0; }
.prep-card--wide { grid-column: 1 / -1; }
.prep-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.prep-card__title { margin: 0; font-size: 1rem; font-weight: 700; color: #152238; }
.prep-card__chart { position: relative; width: 100%; }
.prep-card__chart--bars { height: 290px; }
.prep-card__chart--line { height: 250px; }
.prep-card__chart--donut { height: 250px; }
.prep-card__chart--stages { height: 260px; }
.prep-card__hint { margin: .5rem 0 0; font-size: .78rem; color: #6b7a8c; }
.prep-period { width: auto; min-width: 9rem; }
.prep-toggle .btn { font-size: .78rem; }
.prep-empty { display: flex; align-items: center; justify-content: center; min-height: 250px; margin: 0; color: #6b7a8c; font-size: .9rem; text-align: center; }
.prep-table-details summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.prep-table th { font-size: .78rem; color: #6b7a8c; font-weight: 600; white-space: nowrap; }
.prep-num { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin-right: .5rem; border-radius: .4rem;
    background: var(--brand-50); color: var(--brand); font-size: .75rem; font-weight: 700; }
.prep-pct { display: inline-block; min-width: 3.5rem; padding: .1rem .4rem; border-radius: .35rem; font-weight: 600;
    background: #339af0; background: color-mix(in srgb, #2f9e44 calc(var(--p) * 1%), #e03131); color: #fff; }

/* Плитки показателей */
.prep-stat-groups { display: flex; flex-direction: column; gap: .85rem; }
.prep-stat-group { background: rgba(255, 255, 255, .7); border: 1px solid rgba(7, 72, 141, .1); border-radius: .85rem; padding: .7rem; }
.prep-stat-group__title { margin: 0 0 .55rem .15rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4a5d78; }
.prep-stat-group__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.prep-stat-card { display: flex; align-items: center; gap: .65rem; padding: .7rem .75rem; background: #fff; border: 1px solid rgba(7, 72, 141, .1);
    border-radius: .75rem; box-shadow: 0 2px 10px rgba(7, 72, 141, .05); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.prep-stat-card:hover { transform: translateY(-2px); border-color: rgba(7, 72, 141, .3); box-shadow: 0 8px 20px rgba(7, 72, 141, .1); color: inherit; }
.prep-stat-card__icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; font-size: 1.05rem; }
.prep-stat-card__body { display: flex; flex-direction: column; min-width: 0; }
.prep-stat-card__label { font-size: .62rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #6b7a8c; line-height: 1.2; }
.prep-stat-card__value { font-size: 1.2rem; line-height: 1.2; color: #152238; white-space: nowrap; }
.prep-stat-card--blue .prep-stat-card__icon { background: linear-gradient(145deg, #e8f4fc, #d3e8f8); color: #1864ab; }
.prep-stat-card--indigo .prep-stat-card__icon { background: linear-gradient(145deg, #edf2ff, #dbe4ff); color: #4263eb; }
.prep-stat-card--cyan .prep-stat-card__icon { background: linear-gradient(145deg, #e3fafc, #c5f6fa); color: #0c8599; }
.prep-stat-card--yellow .prep-stat-card__icon { background: linear-gradient(145deg, #fff9db, #ffec99); color: #f08c00; }
.prep-stat-card--green .prep-stat-card__icon { background: linear-gradient(145deg, #e6fcf5, #c3fae8); color: #0ca678; }
.prep-stat-card--violet .prep-stat-card__icon { background: linear-gradient(145deg, #f3f0ff, #e5dbff); color: #7048e8; }
.prep-stat-card--orange .prep-stat-card__icon { background: linear-gradient(145deg, #fff4e6, #ffe8cc); color: #e8590c; }

[data-bs-theme="dark"] .prep-insight { background: linear-gradient(180deg, #13233a 0%, #0f1b2d 100%); border-color: #1f3a5c; border-left-color: #4dabf7; }
[data-bs-theme="dark"] .prep-insight__title, [data-bs-theme="dark"] .prep-table-details summary { color: #8ec5ff; }
[data-bs-theme="dark"] .prep-insight__note, [data-bs-theme="dark"] .prep-card__hint, [data-bs-theme="dark"] .prep-empty,
[data-bs-theme="dark"] .prep-stat-group__title, [data-bs-theme="dark"] .prep-stat-card__label, [data-bs-theme="dark"] .prep-table th { color: #9aabbf; }
[data-bs-theme="dark"] .prep-card { background: rgba(22, 36, 56, .72); border-color: rgba(116, 192, 252, .16); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
[data-bs-theme="dark"] .prep-card__title, [data-bs-theme="dark"] .prep-stat-card__value { color: #e7eef8; }
[data-bs-theme="dark"] .prep-stat-group { background: rgba(15, 23, 36, .55); border-color: rgba(159, 209, 255, .12); }
[data-bs-theme="dark"] .prep-stat-card { background: #152238; border-color: #1f3a5c; }
[data-bs-theme="dark"] .prep-num { background: #1a3050; color: #8ec5ff; }
[data-bs-theme="dark"] .prep-stat-card__icon { filter: saturate(.85) brightness(.9); }

@media (min-width: 576px) and (max-width: 1199.98px) {
    .prep-stat-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .prep-insight { padding: 1rem .75rem; }
    .prep-insight__grid { grid-template-columns: minmax(0, 1fr); }
    .prep-card__head { align-items: flex-start; }
}
[data-bs-theme="dark"] .prep-insight .btn-outline-primary:not(.active) { color: #8ec5ff; border-color: rgba(142, 197, 255, .45); }

/* ===== ER-тренажёр (er.php, assets/js/ertrainer.js) ===== */
.er-trainer {
    --er-accent: var(--brand);
    --er-accent-bg: var(--brand-50);
    --er-border: var(--bs-border-color);
    --er-bg: var(--bs-body-bg);
    --er-card: #fff;
    --er-text: var(--bs-body-color);
    --er-danger: var(--bs-danger);
    --er-danger-bg: var(--bs-danger-bg-subtle);
    --er-mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
}
[data-bs-theme="dark"] .er-trainer { --er-accent: #4f80b8; --er-card: #152238; --er-border: #1f3a5c; }
.er-aside { position: sticky; top: 1rem; }
.er-aside .card-body { max-height: calc(100vh - 9rem); overflow-y: auto; }
.er-tier-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); margin: .75rem .5rem .35rem; }
.er-tier-title:first-child { margin-top: .25rem; }
.er-task-list { list-style: none; margin: 0; padding: 0; }
.er-task-btn { width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left; background: none; border: 0; padding: .4rem .5rem; border-radius: .4rem; color: var(--er-text); font-size: .92rem; }
.er-task-btn:hover { background: var(--er-accent-bg); }
.er-task-btn.active { background: var(--er-accent-bg); font-weight: 600; color: var(--er-accent); }
.er-task-btn .mark { width: 1.35rem; height: 1.35rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--er-border); font-size: .72rem; }
.er-task-btn.solved .mark { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
.er-task-btn.tried .mark { border-color: var(--bs-warning); }
.er-task-time { font-size: .72rem; color: var(--bs-secondary-color); white-space: nowrap; }
.er-brief { color: var(--bs-secondary-color); max-width: 60rem; }
.er-timer { font-family: var(--er-mono); font-size: .95rem; padding: .3rem .7rem; border-radius: 999px; background: var(--er-accent-bg); color: var(--er-accent); }
.er-task-stats { min-width: 12rem; }

.er-zoom { border: 1px solid var(--er-border); border-radius: .6rem; overflow: hidden; background: var(--er-bg); }
.er-zoom-controls { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; border-bottom: 1px solid var(--er-border); background: var(--er-card); }
.er-zoom-controls button { border: 1px solid var(--er-border); background: var(--er-card); color: var(--er-text); border-radius: .35rem; min-width: 1.9rem; height: 1.9rem; line-height: 1; }
.er-zoom-controls button:hover { background: var(--er-accent-bg); }
.er-zoom-pct { font-family: var(--er-mono); font-size: .8rem; color: var(--bs-secondary-color); min-width: 2.8rem; }
.er-zoom-hint { margin-left: auto; font-size: .78rem; color: var(--bs-secondary-color); }
@media (max-width: 720px) { .er-zoom-hint { display: none; } }
.er-viewport { position: relative; height: 520px; overflow: hidden; cursor: grab; touch-action: none; }
.er-viewport.dragging { cursor: grabbing; }
.er-content { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.er-canvas { position: relative; background-image: radial-gradient(var(--er-border) 1px, transparent 1px); background-size: 22px 22px; }
.er-svg { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.er-rel-line { stroke: var(--er-accent); stroke-width: 1.6; fill: none; }
.er-rel-line.drawing { stroke-dasharray: 5 4; opacity: .8; }
.er-arrow-head { fill: var(--er-accent); }
.er-rel-card { font-family: var(--er-mono); font-size: 10px; font-weight: 700; fill: var(--er-accent); paint-order: stroke; stroke: var(--er-bg); stroke-width: 4px; }
.er-rel-delete { fill: var(--er-card); stroke: var(--er-border); stroke-width: 1; cursor: pointer; pointer-events: auto; }
.er-rel-delete:hover { fill: var(--er-danger-bg); stroke: var(--er-danger); }
.er-rel-delete-x { font-family: var(--er-mono); font-size: 11px; fill: var(--er-text); pointer-events: none; }

.er-table { position: absolute; border: 1px solid var(--er-border); border-radius: .5rem; background: var(--er-card); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); font-family: var(--er-mono); font-size: 12px; }
.er-table-header { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px; background: var(--er-accent); border-radius: .5rem .5rem 0 0; cursor: grab; touch-action: none; }
.er-table-header:active { cursor: grabbing; }
.er-table-name { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 13px; font-family: var(--er-mono); outline: none; }
.er-icon-btn { background: none; border: 0; color: var(--er-text); width: 20px; height: 20px; border-radius: 4px; font-size: 14px; line-height: 1; flex-shrink: 0; padding: 0; }
.er-icon-btn:hover { background: var(--er-danger-bg); color: var(--er-danger); }
.er-table-header .er-icon-btn { color: #fff; }
.er-table-header .er-icon-btn:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.er-row { position: relative; display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-top: 1px solid var(--er-border); }
.er-pk-toggle { background: none; border: 0; opacity: .3; font-size: 12px; padding: 0; width: 16px; flex-shrink: 0; }
.er-pk-toggle.active { opacity: 1; }
.er-col-name { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed transparent; font-family: var(--er-mono); font-size: 11.5px; color: var(--er-text); outline: none; }
.er-col-name:focus { border-bottom-color: var(--er-accent); }
.er-col-type { border: 0; background: transparent; font-family: var(--er-mono); font-size: 10.5px; color: var(--er-text); opacity: .7; flex-shrink: 0; width: 64px; }
.er-fk-badge { font-size: 9px; font-weight: 700; background: var(--er-danger-bg); color: var(--er-danger); padding: 0 4px; border-radius: 3px; flex-shrink: 0; }
.er-connector { position: absolute; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; background: var(--er-card); border: 2px solid var(--er-accent); z-index: 2; }
.er-connector-in { left: -6px; cursor: crosshair; }
.er-connector-out { right: -6px; cursor: grab; }
.er-connector:hover { background: var(--er-accent); }
.er-add-col { display: block; width: 100%; border: 0; background: none; border-top: 1px dashed var(--er-border); padding: 6px; font-size: 11.5px; color: var(--er-accent); border-radius: 0 0 .5rem .5rem; }
.er-add-col:hover { background: var(--er-accent-bg); }

.er-checklist { display: flex; flex-direction: column; gap: .35rem; border: 1px solid var(--er-border); border-radius: .5rem; padding: .75rem 1rem; margin-top: 1rem; background: var(--er-bg); }
.er-check-item { font-size: .92rem; }
.er-check-item.fail { color: var(--er-danger); }
.er-check-item.success { font-weight: 700; color: var(--bs-success); margin-top: .25rem; }

/* ===== Уроки SQL / C# / WPF (lessons.php, assets/js/lessons.js) ===== */
.lessons-domains { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--bs-border-color); }
.lessons-domains .btn { border-radius: 0; border: 0; }
.hub-card { transition: transform .15s, box-shadow .15s; color: inherit; }
.hub-card:hover { transform: translateY(-2px); }
.lessons-list .list-group-item { font-size: .9rem; }
.lesson-mark { width: 1.35rem; height: 1.35rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--bs-border-color); font-size: .7rem; }
.lessons-list .active .lesson-mark { border-color: rgba(255, 255, 255, .7); }
.lesson-mark.done { background: var(--bs-success); border-color: var(--bs-success) !important; color: #fff; }
.lesson-time { font-size: .72rem; opacity: .75; white-space: nowrap; }
.lesson-markdown p { margin-bottom: .85rem; }
.lesson-markdown ul, .lesson-markdown ol { margin-bottom: .85rem; }
.lesson-markdown blockquote { border-left: 4px solid var(--brand-200); padding: .25rem 1rem; color: var(--bs-secondary-color); }
.lesson-sandbox { border: 1px solid var(--brand-100); border-radius: .6rem; padding: 1rem; background: var(--brand-50); }
.lesson-code { font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace; font-size: .86rem; line-height: 1.5; tab-size: 4; }
.lesson-result { max-height: 360px; overflow: auto; background: var(--bs-body-bg); }
.lesson-output { background: #0f1b2d; color: #dfe7f1; border-radius: .5rem; padding: .75rem 1rem; font-size: .85rem; max-height: 360px; overflow: auto; white-space: pre-wrap; margin: 0; }
.lesson-output--error { color: #fca5a5; }
.lesson-schema summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.lesson-schema-table { border: 1px solid var(--brand-100); border-radius: .5rem; overflow: hidden; font-size: .8rem; height: 100%; }
.lesson-schema-name { background: var(--brand); color: #fff; font-weight: 600; padding: .3rem .6rem; }
.lesson-schema-col { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem .6rem; border-top: 1px solid var(--brand-100); font-family: ui-monospace, Consolas, monospace; }

/* ===== Визуальная статистика (admin/visual_stats.php, assets/js/visual-stats.js) ===== */
.vs-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .88rem; }
.vs-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.vs-bar { height: 6px; border-radius: 3px; background: var(--brand-50); overflow: hidden; min-width: 70px; }
.vs-bar > div { height: 100%; border-radius: 3px; }
.vs-cell-text { font-family: ui-monospace, Consolas, monospace; font-size: .75rem; color: var(--bs-secondary-color); margin-top: .2rem; }
.vs-table th { font-size: .85rem; white-space: nowrap; }
.vs-table th[data-dir="asc"]::after { content: " ▲"; font-size: .7em; }
.vs-table th[data-dir="desc"]::after { content: " ▼"; font-size: .7em; }
.vs-chart-row > td { background: var(--bs-body-bg); }
.vs-chart-box { position: relative; height: 340px; }
.vs-rank { margin-bottom: .75rem; }
.vs-rank .vs-bar { height: 10px; border-radius: 5px; }

/* ===== Загрузка студентов (admin/students_import.php) ===== */
.st-groups { max-height: 260px; overflow-y: auto; }

/* ===== SQL-тренажёр: список заданий (sql.php, assets/js/sql-list.js) ===== */
.sqlx-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.6rem 1.8rem;
    border-radius: 1rem; color: #fff; background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand) 55%, var(--brand-500) 100%);
    box-shadow: 0 10px 30px rgba(7, 72, 141, .25); position: relative; overflow: hidden; }
.sqlx-hero::after { content: "SELECT * FROM"; position: absolute; right: -10px; bottom: -18px; font: 700 4.5rem/1 ui-monospace, Consolas, monospace;
    color: rgba(255, 255, 255, .06); pointer-events: none; white-space: nowrap; }
.sqlx-hero__main { display: flex; gap: 1.1rem; align-items: flex-start; }
.sqlx-hero__icon { width: 3.4rem; height: 3.4rem; border-radius: .9rem; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .15); font-size: 1.5rem; flex-shrink: 0; }
.sqlx-hero__title { font-size: 1.75rem; font-weight: 700; margin: 0 0 .2rem; color: #fff; }
.sqlx-hero__sub { margin: 0 0 .6rem; color: rgba(255, 255, 255, .85); }
.sqlx-dbms { display: flex; flex-wrap: wrap; gap: .4rem; }
.sqlx-dbms span { font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.sqlx-dbms i { margin-right: .35rem; opacity: .85; }
.sqlx-hero__stats { display: flex; align-items: center; gap: 1.3rem; position: relative; z-index: 1; }
.sqlx-ring { --p: 0; width: 5.2rem; height: 5.2rem; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(#4ade80 calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.sqlx-ring span { width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-800); font-weight: 700; font-size: 1.1rem; }
.sqlx-kpis { display: grid; grid-template-columns: repeat(2, auto); gap: .5rem 1.4rem; }
.sqlx-kpis div { display: flex; flex-direction: column; line-height: 1.15; }
.sqlx-kpis b { font-size: 1.35rem; }
.sqlx-kpis span { font-size: .75rem; color: rgba(255, 255, 255, .75); text-transform: uppercase; letter-spacing: .04em; }
.sqlx-kpis .is-solved b { color: #86efac; }
.sqlx-kpis .is-tried b { color: #fde68a; }

.sqlx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.sqlx-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.sqlx-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); }
.sqlx-search input { width: 100%; padding: .5rem .9rem .5rem 2.3rem; border: 1px solid var(--bs-border-color); border-radius: 999px;
    background: var(--bs-body-bg); color: var(--bs-body-color); }
.sqlx-search input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 .2rem rgba(7, 72, 141, .15); }
.sqlx-chips { display: inline-flex; gap: .3rem; padding: .2rem; border-radius: 999px; background: var(--brand-50); }
.sqlx-chip { border: 0; background: transparent; border-radius: 999px; padding: .3rem .8rem; font-size: .82rem; color: var(--brand-800); }
.sqlx-chip:hover { background: rgba(7, 72, 141, .08); }
.sqlx-chip.active { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(7, 72, 141, .3); }
.sqlx-chip--easy.active { background: #16a34a; }
.sqlx-chip--medium.active { background: #d97706; }
.sqlx-chip--hard.active { background: #dc2626; }

.sqlx-ds { border: 1px solid var(--brand-100); border-radius: 1rem; background: var(--bs-body-bg); margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(7, 72, 141, .06); overflow: hidden; }
[data-bs-theme="dark"] .sqlx-ds { background: #152238; border-color: #1f3a5c; }
.sqlx-ds__head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; cursor: pointer; list-style: none; }
.sqlx-ds__head::-webkit-details-marker { display: none; }
.sqlx-ds__head:hover { background: var(--brand-50); }
.sqlx-ds[open] > .sqlx-ds__head { border-bottom: 1px solid var(--brand-100); background: linear-gradient(90deg, var(--brand-50), transparent); }
.sqlx-ds__icon { width: 2.8rem; height: 2.8rem; flex-shrink: 0; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: #fff; font-size: 1.15rem; box-shadow: 0 4px 10px rgba(7, 72, 141, .25); }
.sqlx-ds__titles { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sqlx-ds__title { font-weight: 700; font-size: 1.1rem; color: var(--brand-800); }
[data-bs-theme="dark"] .sqlx-ds__title { color: #b4cae3; }
.sqlx-ds__desc { font-size: .82rem; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; }
.sqlx-ds__meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.sqlx-pill { font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); white-space: nowrap; }
.sqlx-pill i { margin-right: .3rem; opacity: .7; }
[data-bs-theme="dark"] .sqlx-pill { color: #b4cae3; }
.sqlx-diffbar { display: inline-flex; width: 70px; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; }
.sqlx-diffbar .easy { background: #22c55e; } .sqlx-diffbar .medium { background: #f59e0b; } .sqlx-diffbar .hard { background: #ef4444; }
.sqlx-ds__progress { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; }
.sqlx-ds__bar { width: 80px; height: 8px; border-radius: 4px; background: var(--brand-100); overflow: hidden; }
.sqlx-ds__bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 4px; }
.sqlx-ds__chevron { color: var(--brand-400); transition: transform .25s; }
.sqlx-ds[open] .sqlx-ds__chevron { transform: rotate(180deg); }
.sqlx-ds__body { padding: 1rem 1.25rem 1.25rem; animation: sqlxIn .25s ease; }
@keyframes sqlxIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.sqlx-schema { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; font-size: .8rem; }
.sqlx-schema__label { color: var(--bs-secondary-color); }
.sqlx-table { position: relative; font-family: ui-monospace, Consolas, monospace; padding: .2rem .55rem; border-radius: .4rem;
    border: 1px dashed var(--brand-200); color: var(--brand-800); cursor: help; }
[data-bs-theme="dark"] .sqlx-table { color: #b4cae3; }
.sqlx-table i { margin-right: .3rem; opacity: .6; }
.sqlx-table__cols { display: none; position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); min-width: 210px; padding: .45rem .6rem;
    background: var(--bs-body-bg); border: 1px solid var(--brand-100); border-radius: .5rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.sqlx-table:hover .sqlx-table__cols, .sqlx-table:focus .sqlx-table__cols { display: block; }
.sqlx-table__cols span { display: block; white-space: nowrap; padding: .1rem 0; color: var(--bs-body-color); }
.sqlx-table__cols em { color: var(--bs-secondary-color); font-style: normal; font-size: .72rem; }

.sqlx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .65rem; }
.sqlx-task { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border-radius: .75rem; border: 1px solid var(--brand-100);
    background: var(--bs-body-bg); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
[data-bs-theme="dark"] .sqlx-task { background: #1a2d47; border-color: #1f3a5c; }
.sqlx-task:hover { transform: translateY(-2px); border-color: var(--brand-300); box-shadow: 0 8px 18px rgba(7, 72, 141, .12); color: inherit; }
.sqlx-task__num { width: 2.3rem; height: 2.3rem; flex-shrink: 0; border-radius: .6rem; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); }
.sqlx-task--solved { border-left: 4px solid #22c55e; }
.sqlx-task--solved .sqlx-task__num { background: #22c55e; color: #fff; border-color: #22c55e; }
.sqlx-task--tried { border-left: 4px solid #f59e0b; }
.sqlx-task--tried .sqlx-task__num { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sqlx-task__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sqlx-task__title { font-weight: 600; color: var(--brand-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-bs-theme="dark"] .sqlx-task__title { color: #dfe7f1; }
.sqlx-task__meta { display: flex; align-items: center; gap: .6rem; font-size: .75rem; margin-top: .15rem; }
.sqlx-diff { padding: .05rem .5rem; border-radius: 999px; font-weight: 600; }
.sqlx-diff--easy { background: #dcfce7; color: #166534; } .sqlx-diff--medium { background: #fef3c7; color: #92400e; } .sqlx-diff--hard { background: #fee2e2; color: #991b1b; }
.sqlx-task__go { color: var(--brand-300); transition: transform .15s, color .15s; }
.sqlx-task:hover .sqlx-task__go { transform: translateX(3px); color: var(--brand); }
.sqlx-empty { font-size: .85rem; color: var(--bs-secondary-color); padding: .5rem 0; }

@media (max-width: 767px) {
    .sqlx-hero { padding: 1.2rem; }
    .sqlx-hero::after { display: none; }
    .sqlx-ds__head { flex-wrap: wrap; }
    .sqlx-ds__meta { width: 100%; justify-content: flex-start; }
    .sqlx-grid { grid-template-columns: 1fr; }
}
@media (min-width: 768px) { .sqlx-ds__meta { flex-wrap: nowrap; flex-shrink: 0; } .sqlx-ds__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } }
[data-bs-theme="dark"] .sqlx-task__num { background: #13263d; color: #8eb9e0; border-color: #2d5282; }
[data-bs-theme="dark"] .sqlx-task--solved .sqlx-task__num { background: #16a34a; color: #fff; border-color: #16a34a; }
[data-bs-theme="dark"] .sqlx-task--tried .sqlx-task__num { background: #78350f; color: #fde68a; border-color: #b45309; }
[data-bs-theme="dark"] .sqlx-chip { color: #b4cae3; }
[data-bs-theme="dark"] .sqlx-ds__head:hover, [data-bs-theme="dark"] .sqlx-ds[open] > .sqlx-ds__head { background: #1a2d47; }
[data-bs-theme="dark"] .sqlx-table__cols { background: #152238; border-color: #2d5282; }

/* Главный блок страниц сайта — на ширину шапки, меню и подвала (1600px) вместо стандартных 1140/1320px Bootstrap */
@media (min-width: 992px) { .site-container { max-width: 1600px; } }

/* ===== Права доступа (admin/user_permissions.php): контрастные уровни ===== */
.perm-table { --perm-none: #c62828; --perm-view: #0b5ed7; --perm-edit: #157347;
    --perm-none-bg: #fdecec; --perm-view-bg: #e7f0fd; --perm-edit-bg: #e6f4ec; --perm-line: #cfd8e3; }
[data-bs-theme="dark"] .perm-table { --perm-none: #f87171; --perm-view: #60a5fa; --perm-edit: #4ade80;
    --perm-none-bg: rgba(248, 113, 113, .16); --perm-view-bg: rgba(96, 165, 250, .16); --perm-edit-bg: rgba(74, 222, 128, .14); --perm-line: #2d4566; }
.perm-table > :not(caption) > * > * { border-bottom-color: var(--perm-line); }
.perm-table tbody td { color: var(--bs-emphasis-color); padding-top: .45rem; padding-bottom: .45rem; }
.perm-table tbody tr[data-perm-row]:hover td, .perm-table tbody tr:not(.perm-group-row):hover td { background-color: rgba(7, 72, 141, .05); }

/* Заголовки столбцов с цветной меткой уровня */
.perm-table .perm-th::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem;
    vertical-align: -1px; border: 2px solid #fff; }
.perm-table .perm-th--none::before { background: #ef5350; }
.perm-table .perm-th--view::before { background: #64b5f6; }
.perm-table .perm-th--edit::before { background: #66bb6a; }

/* Строки групп разделов */
.perm-table .perm-group-row td { background: var(--brand-100); border-top: 2px solid var(--brand-300); border-bottom-color: var(--brand-300); }
.perm-table .perm-group-row .btn-link { color: var(--brand-900) !important; font-weight: 700; letter-spacing: .01em; }
[data-bs-theme="dark"] .perm-table .perm-group-row td { background: #1f3a5c; border-top-color: #4f80b8; }
[data-bs-theme="dark"] .perm-table .perm-group-row .btn-link { color: #dae4f1 !important; }

/* Переключатели: чёткая рамка, заливка цветом уровня */
.perm-table .perm-radio { width: 1.3em; height: 1.3em; margin-top: 0; cursor: pointer; border: 2px solid #7b8a9e; background-color: var(--bs-body-bg); }
[data-bs-theme="dark"] .perm-table .perm-radio { border-color: #8aa0bd; }
.perm-table .perm-radio:hover { border-color: var(--brand); }
.perm-table .perm-radio:focus { box-shadow: 0 0 0 .2rem rgba(7, 72, 141, .25); }
.perm-table .perm-radio--none:checked { background-color: var(--perm-none); border-color: var(--perm-none); box-shadow: 0 0 0 .2rem rgba(198, 40, 40, .2); }
.perm-table .perm-radio--view:checked { background-color: var(--perm-view); border-color: var(--perm-view); box-shadow: 0 0 0 .2rem rgba(11, 94, 215, .2); }
.perm-table .perm-radio--edit:checked { background-color: var(--perm-edit); border-color: var(--perm-edit); box-shadow: 0 0 0 .2rem rgba(21, 115, 71, .2); }

/* Ячейка выбранного уровня подсвечивается и подписывается */
.perm-table .perm-cell { position: relative; transition: background-color .15s; }
.perm-table .perm-cell--none:has(.perm-radio:checked) { background-color: var(--perm-none-bg); }
.perm-table .perm-cell--view:has(.perm-radio:checked) { background-color: var(--perm-view-bg); }
.perm-table .perm-cell--edit:has(.perm-radio:checked) { background-color: var(--perm-edit-bg); }
.perm-table .perm-cell:has(.perm-radio:checked)::after { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.perm-table .perm-cell--none:has(.perm-radio:checked)::after { content: "нет"; color: var(--perm-none); }
.perm-table .perm-cell--view:has(.perm-radio:checked)::after { content: "просмотр"; color: var(--perm-view); }
.perm-table .perm-cell--edit:has(.perm-radio:checked)::after { content: "редакт."; color: var(--perm-edit); }
.perm-table .perm-cell--site.perm-cell--edit:has(.perm-radio:checked)::after { content: "да"; }
.perm-table tbody td.perm-cell { padding-top: .35rem; padding-bottom: .75rem; }

/* ---------- Защита контента (includes/protection.php, assets/js/protect.js) ---------- */
.protect-watermark {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    background-repeat: repeat;
    opacity: .13;
}
[data-bs-theme="dark"] .protect-watermark { opacity: .16; filter: invert(1); }
body.protect-nocopy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect-nocopy input, body.protect-nocopy textarea, body.protect-nocopy select,
body.protect-nocopy [contenteditable], body.protect-nocopy [contenteditable] *,
body.protect-nocopy .CodeMirror, body.protect-nocopy .CodeMirror *, body.protect-nocopy .allow-copy, body.protect-nocopy .allow-copy * {
    -webkit-user-select: text; user-select: text;
}
body.protect-nocopy img { -webkit-user-drag: none; }
.protect-hint {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
    z-index: 2100; padding: .55rem 1rem; border-radius: .5rem;
    background: #1f2937; color: #fff; font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.25);
    opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.protect-hint.show { opacity: 1; transform: translate(-50%, 0); }
@media print {
    body.protect-nocopy > * { display: none !important; }
    body.protect-nocopy::after {
        content: "Печать материалов заданий запрещена";
        display: block; margin: 40mm auto; text-align: center; font: 16pt sans-serif;
    }
}

/* ---------- Круговой индикатор выполнения в углу карточки (progress_ring() в includes/stats.php) ---------- */
.pring { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex-shrink: 0; }
.pring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 4; }
.pring__track { stroke: var(--brand-100); }
.pring__value { stroke: var(--pring-color, var(--brand-400)); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.pring__text { position: absolute; font-size: .72rem; font-weight: 700; color: var(--pring-text, var(--brand-700)); line-height: 1; }
.pring__text small { font-size: .55rem; font-weight: 600; margin-left: 1px; }
.pring--zero { --pring-color: var(--brand-200); --pring-text: var(--brand-300); }
.pring--low  { --pring-color: var(--brand-300); --pring-text: var(--brand-500); }
.pring--mid  { --pring-color: var(--brand-500); --pring-text: var(--brand-700); }
.pring--high { --pring-color: #3d8a8f; --pring-text: #2c6d71; }
.pring--done { --pring-color: #4a9a72; --pring-text: #357556; }
[data-bs-theme="dark"] .pring__track { stroke: rgba(130, 166, 207, .25); }
[data-bs-theme="dark"] .pring--zero, [data-bs-theme="dark"] .pring--low, [data-bs-theme="dark"] .pring--mid { --pring-text: var(--brand-200); }

/* ---------- Отчёты по отработке и кабинет куратора ---------- */
.analytics-tile { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: .7rem .85rem; border-radius: .6rem;
    background: var(--brand-50); border: 1px solid var(--brand-100); }
.analytics-tile i { color: var(--brand-500); }
.analytics-tile span { font-size: .75rem; color: var(--bs-secondary-color); }
.analytics-tile strong { font-size: 1.05rem; color: var(--brand-800); }
[data-bs-theme="dark"] .analytics-tile { background: rgba(7, 72, 141, .18); border-color: rgba(130, 166, 207, .25); }
[data-bs-theme="dark"] .analytics-tile strong { color: var(--brand-100); }
.analytics-chart-box { position: relative; height: 300px; }
.analytics-scroll { max-height: 420px; overflow: auto; }
.analytics-rank { padding-left: 1.2rem; }
.analytics-rank li { margin-bottom: .3rem; }
.analytics-rank li .pc-legend { margin-right: .35rem; }
.curator-notes { max-height: 320px; overflow: auto; }
.curator-note--new { background: var(--brand-50); border-left: 3px solid var(--brand-400); }
[data-bs-theme="dark"] .curator-note--new { background: rgba(7, 72, 141, .18); }
.schedule-export-box summary { cursor: pointer; }

/* ---------- Видеоуроки (videos.php, videos_manage.php) ---------- */
.video-filters .video-search-btn { background: #1f7a8c; color: #fff; border-color: #1f7a8c; }
.video-filters .video-search-btn:hover { background: #17606e; color: #fff; }
.video-card { border: 0; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 6px 18px rgba(7, 72, 141, .12); }
.video-card__player { position: relative; aspect-ratio: 16 / 9; background: #0b1a2b; }
.video-card__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card__duration { position: absolute; left: .5rem; top: .5rem; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .65);
    color: #fff; font-size: .72rem; font-weight: 700; pointer-events: none; }
.video-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.video-card__topic { color: var(--brand-700); text-decoration: none; font-size: .78rem; }
.video-card__topic:hover { text-decoration: underline; }
.video-card__desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--bs-body-color); }
.video-card__btn { border-radius: 999px; color: #fff; font-weight: 600; padding: .3rem .9rem; }
.video-card__btn--youtube { background: #c4302b; border-color: #c4302b; }
.video-card__btn--youtube:hover { background: #a52722; color: #fff; }
.video-card__btn--rutube { background: #14191f; border-color: #14191f; }
.video-card__btn--rutube:hover { background: #000; color: #fff; }
.video-thumb { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .4rem; flex-shrink: 0; background: var(--brand-50); }
.video-thumb--empty { display: inline-flex; align-items: center; justify-content: center; color: var(--brand-300); }
#vPreview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Видеоуроки: обложка с запуском (учёт просмотра), вопросы преподавателю */
.video-facade { cursor: pointer; background: #0b1a2b center / cover no-repeat; }
.video-facade::after { content: ''; position: absolute; inset: 0; background: rgba(3, 36, 71, .18); transition: background .2s; }
.video-facade:hover::after, .video-facade:focus-visible::after { background: rgba(3, 36, 71, .05); }
.video-facade:focus-visible { outline: 3px solid var(--brand-300); outline-offset: -3px; }
.video-facade[data-started]::after { display: none; }
.video-facade__play { position: absolute; left: 50%; top: 50%; z-index: 1; transform: translate(-50%, -50%); width: 64px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.video-facade__play--youtube { background: #e62117; }
.video-facade__play--rutube { background: #14191f; }
.video-facade .video-card__duration { z-index: 1; }
.video-question--private { border-left: 3px solid #8a96a3 !important; }
.video-answer { margin: .6rem 0 0 1.25rem; padding: .5rem .75rem; border-radius: .5rem; background: var(--bs-tertiary-bg); }
.video-answer--staff { background: var(--brand-50); border-left: 3px solid var(--brand-400); }
[data-bs-theme="dark"] .video-answer--staff { background: rgba(7, 72, 141, .2); }

/* ===== Правки: эффективность и рейтинг, срочные объявления, цвета расписания, автопроверка, экспорт ===== */

/* Рейтинг студента в верхней полосе */
.header-rank { display: inline-flex; align-items: center; gap: .4rem; height: 36px; padding: 0 .7rem; border-radius: 4px; color: #fff; text-decoration: none;
    font-size: .82rem; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45); white-space: nowrap; }
.header-rank:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.header-rank i { color: #ffd166; }
@media (max-width: 767.98px) { .header-rank span { display: none; } }

/* Колокольчик срочных объявлений */
.header-bell-btn { background: none; cursor: pointer; }
.header-bell-btn.has-unread i { animation: mail-ring 2.4s ease-in-out infinite; color: #ffd166; }
.header-bell-menu { width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; padding: 0; }
.header-bell-head { padding: .6rem .9rem; font-weight: 700; color: #800020; border-bottom: 1px solid var(--bs-border-color); }
@media (prefers-reduced-motion: reduce) { .header-bell-btn.has-unread i { animation: none; } }

/* Объявления: блок на странице расписания, в карточке занятия и в колокольчике */
.ann-board { border-left: 4px solid #800020 !important; }
.ann-board-title { color: #800020; font-weight: 700; }
.ann-list { display: grid; gap: .5rem; }
.ann-item { border: 1px solid rgba(128, 0, 32, .18); background: #fff7f8; border-radius: .5rem; padding: .55rem .75rem; }
.ann-item--global { background: #fff3f5; border-color: rgba(128, 0, 32, .32); }
.ann-item--compact { border-radius: 0; border-width: 0 0 1px; padding: .55rem .9rem; }
.ann-item--compact.is-unread { background: #ffe9ee; }
.ann-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; margin-bottom: .2rem; }
.ann-item-tag { font-size: .72rem; font-weight: 600; color: #800020; background: rgba(128, 0, 32, .08); border-radius: 999px; padding: .05rem .5rem; }
.ann-item-title { color: #800020; }
.ann-item-meta { font-size: .75rem; color: var(--bs-secondary-color); }
.ann-item-body { font-size: .9rem; line-height: 1.4; }
.ann-important { color: #800020; font-weight: 700; }
.ann-form { background: var(--bs-tertiary-bg); border-radius: .5rem; padding: .75rem; }
[data-bs-theme="dark"] .ann-item, [data-bs-theme="dark"] .ann-item--global { background: rgba(128, 0, 32, .14); border-color: rgba(255, 120, 150, .25); }
[data-bs-theme="dark"] .ann-item--compact.is-unread { background: rgba(128, 0, 32, .3); }
[data-bs-theme="dark"] .ann-important, [data-bs-theme="dark"] .ann-item-title, [data-bs-theme="dark"] .ann-board-title,
[data-bs-theme="dark"] .ann-item-tag, [data-bs-theme="dark"] .header-bell-head { color: #ff9fb3; }
[data-bs-theme="dark"] .ann-board { border-left-color: #ff9fb3 !important; }

/* Расписание: онлайн / офлайн, значимые события, цвета преподавателей */
.schedule-format-badge { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.schedule-format-badge--online { background: #e6f6ec; color: #146c43; border: 1px solid #8fd1a8; }
.schedule-format-badge--offline { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200); }
[data-bs-theme="dark"] .schedule-format-badge--online { background: rgba(25, 135, 84, .2); color: #8fe0b0; }
[data-bs-theme="dark"] .schedule-format-badge--offline { background: rgba(7, 72, 141, .25); color: var(--brand-200); }
.schedule-modal-key { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
    background: #fff3cd; color: #7a5200; border: 1px solid #ffcf5a; }
.schedule-event-online { float: right; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%;
    background: rgba(255, 255, 255, .92); color: #146c43; font-size: .6rem; margin-left: .15rem; }
.schedule-event--key { box-shadow: inset 4px 0 0 #ffd166, 0 1px 4px rgba(0, 0, 0, .25); font-weight: 800; padding-left: .55rem; }
.schedule-event--key .schedule-event-icon { color: #ffd166; }
.schedule-legend--teachers { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; }
.schedule-legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: .3rem; vertical-align: -2px; }

/* Эффективность студента в шапке главной */
.eff-hero { display: flex; align-items: center; gap: 1.1rem; padding: 1rem 1.1rem; border-radius: .9rem; background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(2px); }
.eff-hero__ring { --p: 0; flex-shrink: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
    background: radial-gradient(closest-side, var(--brand-800) 78%, transparent 79% 100%), conic-gradient(#ffd166 calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.eff-hero--high .eff-hero__ring { background: radial-gradient(closest-side, var(--brand-800) 78%, transparent 79% 100%), conic-gradient(#7ee2a8 calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.eff-hero--low .eff-hero__ring { background: radial-gradient(closest-side, var(--brand-800) 78%, transparent 79% 100%), conic-gradient(#ff9f9f calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.eff-hero__ke { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.eff-hero__ke-label { font-size: .68rem; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
.eff-hero__body { flex: 1; min-width: 0; }
.eff-hero__title { font-size: .95rem; margin-bottom: .35rem; }
.eff-hero__row { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; opacity: .92; }
.eff-hero__bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .22); margin: .15rem 0 .4rem; overflow: hidden; }
.eff-hero__bar > span { display: block; height: 100%; background: #ffd166; border-radius: inherit; }
.eff-hero__rank { display: inline-block; margin-top: .45rem; padding: .25rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--brand-800);
    font-size: .8rem; text-decoration: none; }
.eff-hero__rank:hover { background: #fff; color: var(--brand); }
@media (max-width: 575.98px) { .eff-hero { flex-direction: column; text-align: center; } .eff-hero__body { width: 100%; text-align: left; } }

.eff-badge { display: inline-block; min-width: 3.1em; padding: .15rem .45rem; border-radius: 999px; font-weight: 700; font-size: .8rem; text-align: center; }
.eff-badge--high { background: #d1f2df; color: #0f5132; }
.eff-badge--good { background: var(--brand-100); color: var(--brand-800); }
.eff-badge--mid { background: #fff3cd; color: #7a5200; }
.eff-badge--low { background: #f8d7da; color: #842029; }
.eff-ring--high { background: conic-gradient(#198754 calc(var(--p) * 1%), var(--brand-100) 0); }
.eff-ring--low { background: conic-gradient(#dc3545 calc(var(--p) * 1%), var(--brand-100) 0); }
.eff-cell { --p: 0; display: inline-block; min-width: 3em; padding: .1rem .35rem; border-radius: .3rem; font-weight: 600;
    background: color-mix(in srgb, #198754 calc(var(--p) * .55%), var(--brand-50)); }
[data-bs-theme="dark"] .eff-cell { background: color-mix(in srgb, #198754 calc(var(--p) * .6%), #13263d); }

/* Автопроверка: перечень недостатков */
.ac-box { border: 1px dashed var(--brand-200); border-radius: .5rem; padding: .5rem .75rem; background: var(--brand-50); }
.ac-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.ac-item { font-size: .85rem; }
.ac-item--error i { color: #dc3545; }
.ac-item--warn i { color: #e0a100; }
.ac-hint { display: block; padding-left: 1.2rem; color: var(--bs-secondary-color); font-size: .78rem; }
.ac-ok { color: #198754; }
.ac-task + .ac-task { border-top: 1px solid var(--bs-border-color); margin-top: .5rem; padding-top: .5rem; }
[data-bs-theme="dark"] .ac-box { background: rgba(7, 72, 141, .15); }

/* Выбор стека модуля API */
.stack-choice-btn { padding: .6rem .8rem; }
.stack-card--python .card-header { border-left: 4px solid #3776ab; }
.stack-card--csharp .card-header { border-left: 4px solid #68217a; }

/* Кнопки экспорта отчётов */
.rx-toolbar .btn { white-space: nowrap; }
