:root {
    --primary: #1769ff;
    --primary-dark: #0f55d6;
    --primary-soft: #eaf2ff;
    --sidebar: #0c1b31;
    --sidebar-2: #112641;
    --text: #132238;
    --muted: #6f7c90;
    --line: #e7ebf2;
    --surface: #ffffff;
    --page: #f7f9fc;
    --success: #18a56c;
    --danger: #e94c55;
    --warning: #f2a51a;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(30, 50, 80, .07);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--page);
}
a { color: inherit; }

.admin-shell { min-height: 100vh; }
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 214px;
    padding: 20px 14px 18px;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}
.sidebar-brand {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
    margin-bottom: 24px;
    color: #2f7cff;
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
}
.sidebar-brand img { width: 34px; height: 34px; object-fit: contain; }
.sidebar-label {
    color: #75849a;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0 8px 8px;
}
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e3e9f2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .18s ease;
}
.sidebar-link i { width: 17px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active {
    background: linear-gradient(135deg, #165edc, #1769ff);
    box-shadow: 0 8px 20px rgba(23,105,255,.24);
}
.sidebar-user {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 6px 0;
}
.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: #60738d; border: 1px solid rgba(255,255,255,.25);
    font-weight: 700;
}
.sidebar-user-copy { min-width: 0; display: grid; }
.sidebar-user-copy strong { font-size: 12px; }
.sidebar-user-copy span { color: #aeb9c9; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-main { margin-left: 214px; min-height: 100vh; }
.admin-topbar {
    height: 58px;
    padding: 0 22px;
    background: rgba(255,255,255,.95);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.admin-topbar-title { font-size: 15px; }
.admin-topbar-actions { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: 13px; }
.topbar-link, .topbar-user { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #2b394e; }
.mobile-menu-button { display: none; border: 0; background: transparent; font-size: 20px; }
.admin-page { padding: 24px 28px 40px; max-width: 1500px; margin: 0 auto; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.page-header h1 { margin: 0; font-size: 26px; font-weight: 750; }
.page-header p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.title-line { display: flex; align-items: center; gap: 10px; }
.count-pill {
    background: #f0f3f8; border: 1px solid #e0e6ef;
    padding: 4px 9px; border-radius: 999px; font-size: 11px; color: #46556b;
}
.page-actions { display: flex; gap: 10px; }

.primary-button, .secondary-button, .danger-button {
    border: 0; min-height: 38px; padding: 0 15px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer;
    transition: .18s ease;
}
.primary-button { background: var(--primary); color: #fff; box-shadow: 0 7px 18px rgba(23,105,255,.18); }
.primary-button:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.secondary-button { background: #fff; color: #25344a; border: 1px solid #dce3ed; }
.secondary-button:hover { border-color: #b9c6d8; background: #fbfcfe; }
.danger-button { background: #fff0f1; color: var(--danger); border: 1px solid #ffd5d8; }
.compact { min-height: 34px; padding: 0 12px; font-size: 12px; }

.toolbar {
    display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.search-box {
    width: min(520px, 100%); height: 40px; position: relative;
    background: #fff; border: 1px solid #dfe5ee; border-radius: 9px;
    display: flex; align-items: center;
}
.search-box > i { margin-left: 13px; color: #7b889a; font-size: 13px; }
.search-box input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 13px; font-size: 13px; }
.clear-search { padding: 0 13px; color: #8995a5; text-decoration: none; }

.section-heading {
    display: flex; align-items: center; justify-content: space-between;
    margin: 10px 0 10px;
}
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 700; }
.section-heading span { color: var(--muted); font-size: 12px; }
.section-heading.separated { margin-top: 24px; }

.data-card, .folder-card, .trash-card {
    background: #fff; border: 1px solid var(--line); border-radius: 11px;
    overflow: hidden; box-shadow: 0 2px 7px rgba(37,54,82,.04);
}
.modern-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.modern-table th {
    background: #fafbfd; color: #526078; font-weight: 650;
    padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.modern-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.modern-table tbody tr:last-child td { border-bottom: 0; }
.modern-table tbody tr:hover { background: #fbfcff; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.entity-cell > div { display: grid; gap: 2px; }
.entity-cell strong { font-size: 12px; }
.entity-cell small { font-size: 10px; color: var(--muted); }
.course-icon {
    width: 31px; height: 31px; border-radius: 7px;
    display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.round-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; background: #74839a; color: #fff; font-weight: 700;
}
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 650;
}
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.success { background: #e9f8f1; color: var(--success); }
.status-badge.danger { background: #fff0f1; color: var(--danger); }

.icon-button {
    width: 34px; height: 34px; border-radius: 8px;
    border: 1px solid #dfe5ee; background: #fff; color: #314157;
    display: inline-grid; place-items: center; text-decoration: none;
    vertical-align: middle; cursor: pointer; transition: .15s ease;
}
.icon-button:hover { border-color: #aebbd0; color: var(--primary); background: #f9fbff; }
.icon-button.danger:hover { color: var(--danger); border-color: #ffc7cb; background: #fff6f6; }
.inline-form { display: inline; }

.folders-accordion { display: grid; gap: 9px; }
.folder-card { border-radius: 10px !important; }
.folder-row { min-height: 60px; display: grid; grid-template-columns: 1fr 110px auto; align-items: center; }
.folder-toggle {
    height: 100%; border: 0; background: transparent; padding: 0 15px;
    display: flex; align-items: center; gap: 11px; text-align: left;
}
.folder-chevron { font-size: 10px; color: #607089; transition: .18s ease; }
.folder-toggle[aria-expanded="true"] .folder-chevron { transform: rotate(90deg); }
.folder-icon {
    width: 31px; height: 31px; border-radius: 7px;
    display: grid; place-items: center; background: #fff3d7; color: #f4a516;
}
.folder-copy { display: grid; gap: 2px; }
.folder-copy strong { font-size: 12px; color: var(--text); }
.folder-copy small { color: var(--muted); font-size: 10px; }
.folder-metrics { display: flex; justify-content: center; }
.folder-metrics span { display: grid; text-align: center; gap: 1px; }
.folder-metrics strong { font-size: 12px; }
.folder-metrics small { color: var(--muted); font-size: 9px; }
.folder-actions { padding-right: 12px; display: flex; gap: 6px; }
.folder-content { border-top: 1px solid var(--line); background: #fbfcff; padding: 12px; }
.folder-content-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; font-size: 12px; font-weight: 650; }
.inner-table { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 30px; color: #aeb9c9; margin-bottom: 12px; }
.empty-state h3 { color: var(--text); font-size: 17px; margin: 0 0 7px; }
.empty-inline { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
.trash-toggle {
    width: 100%; min-height: 50px; padding: 0 15px; border: 0; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
}
.trash-toggle span { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 12px; color: #5c6879; }
.modern-select {
    min-width: 170px; height: 34px; border: 1px solid #dfe5ee; border-radius: 7px;
    padding: 0 9px; background: #fff; font-size: 11px;
}

.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-card {
    min-height: 105px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    display: flex; align-items: center; gap: 14px; padding: 18px; text-decoration: none;
}
.summary-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.summary-card > span:last-child { display: grid; gap: 5px; }
.summary-card small { color: var(--muted); font-size: 11px; }
.summary-card strong { font-size: 20px; }
.summary-icon {
    width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 17px;
}
.summary-icon.blue { background: #eaf2ff; color: #1769ff; }
.summary-icon.green { background: #eaf8f2; color: #18a56c; }
.summary-icon.amber { background: #fff5de; color: #e99a0b; }
.summary-icon.purple { background: #f1ecff; color: #7957df; }

.modern-modal { border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 22px 60px rgba(23,36,57,.18); }
.modern-modal .modal-header { align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modern-modal .modal-header h5 { margin: 0; font-size: 18px; }
.modern-modal .modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modern-modal .modal-body { padding: 20px 22px; }
.modern-modal .modal-footer { padding: 14px 22px; border-top: 1px solid var(--line); }
.form-label { color: #405069; font-size: 11px; font-weight: 650; }
.form-label span { color: var(--danger); }
.form-control, .form-select {
    border: 1px solid #dfe5ee; border-radius: 8px; padding: 10px 12px; font-size: 12px;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus { border-color: #8ab4ff; }
.helper-text { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }

.public-main { padding-top: 68px; min-height: calc(100vh - 150px); }
.public-navbar { background: #fff; border-bottom: 1px solid var(--line); }
.public-navbar .navbar-brand { font-weight: 800; color: var(--primary); }
.public-navbar .navbar-brand img { height: 34px; }
.footer { background: #25354a; color: #e6ebf3; padding: 30px 0; text-align: center; font-size: 13px; }

.toast-container { z-index: 2000; }
.toast { border-radius: 10px; }

.chat-widget, .admin-chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 1200; }
.chat-toggle, .admin-chat-toggle {
    position: relative; width: 54px; height: 54px; border-radius: 50%;
    border: 0; color: #fff; display: grid; place-items: center; font-size: 20px;
}
.chat-toggle { background: var(--primary); box-shadow: 0 8px 22px rgba(23,105,255,.28); }
.admin-chat-toggle { background: var(--warning); box-shadow: 0 8px 22px rgba(242,165,26,.28); }
.chat-badge {
    display: none; position: absolute; right: -4px; top: -4px;
    min-width: 21px; height: 21px; border-radius: 50%; background: var(--danger); color: #fff;
    font-size: 10px; line-height: 21px; font-weight: 700;
}
.chat-window {
    display: none; position: absolute; right: 0; bottom: 66px; width: 320px; height: 410px;
    background: #fff; border-radius: 14px; box-shadow: 0 20px 55px rgba(20,35,58,.22); overflow: hidden; flex-direction: column;
}
.chat-header, .admin-chat-header, .admin-chat-column-title {
    height: 47px; display: flex; align-items: center; padding: 0 14px;
    color: #fff; background: var(--primary); font-size: 13px; font-weight: 700;
}
.chat-header { justify-content: space-between; }
.chat-header button, .admin-chat-header button { margin-left: auto; background: transparent; border: 0; color: #fff; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-form { display: flex; gap: 7px; padding: 9px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border: 1px solid #dfe5ee; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.chat-form button { width: 38px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; }
.chat-message { display: grid; justify-items: start; gap: 3px; }
.chat-message.mine { justify-items: end; }
.chat-message small { color: #97a1af; font-size: 9px; }
.chat-message div { max-width: 84%; padding: 7px 10px; border-radius: 9px; background: #edf7f1; font-size: 11px; }
.chat-message.mine div { background: #eaf2ff; }
.chat-message.mine.admin div { background: #fff4dc; }

.admin-chat-window {
    display: none; position: absolute; right: 0; bottom: 66px; width: 520px; height: 450px;
    background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 55px rgba(20,35,58,.22);
}
.admin-chat-users { width: 185px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.admin-chat-column-title, .admin-chat-header { background: var(--warning); }
.admin-user-list { flex: 1; overflow-y: auto; padding: 8px; }
.admin-user-row {
    width: 100%; border: 0; background: transparent; padding: 8px; border-radius: 7px;
    display: flex; justify-content: space-between; font-size: 11px; text-align: left;
}
.admin-user-row.active { background: #fff2cf; }
.user-unread { background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 6px; }
.admin-chat-dialog { flex: 1; display: flex; flex-direction: column; }

.sidebar-backdrop { display: none; }

@media (max-width: 980px) {
    .admin-sidebar { transform: translateX(-100%); transition: .22s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .mobile-menu-button { display: block; }
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(7,18,34,.48); z-index: 1035;
    }
    .sidebar-backdrop.show { display: block; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .admin-page { padding: 18px 12px 30px; }
    .admin-topbar { padding: 0 12px; }
    .admin-topbar-title { display: none; }
    .topbar-user { display: none; }
    .page-header { flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions > * { flex: 1; }
    .toolbar { flex-wrap: wrap; }
    .search-box { width: 100%; }
    .folder-row { grid-template-columns: 1fr auto; }
    .folder-metrics { display: none; }
    .folder-actions { padding-right: 8px; }
    .modern-table { min-width: 700px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-chat-window { width: calc(100vw - 24px); }
    .admin-chat-users { width: 145px; }
}

/* ДОПОЛНЕНИЯ И ПОЛИРОВКА СТРАНИЦЫ КУРСОВ */
.admin-sidebar {
    width: 196px;
}
.admin-main {
    margin-left: 196px;
}
.admin-page {
    padding: 22px 24px 36px;
    max-width: none;
}
.page-header {
    margin-bottom: 12px;
}
.page-header h1 {
    font-size: 25px;
}
.page-header p {
    font-size: 12px;
    margin-top: 5px;
}
.page-actions {
    gap: 8px;
}
.primary-button,
.secondary-button {
    min-height: 36px;
    border-radius: 8px;
    padding: 0 14px;
}
.courses-overview {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.overview-chip {
    min-width: 118px;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.overview-chip > span:last-child {
    display: grid;
    line-height: 1.05;
}
.overview-chip strong {
    font-size: 16px;
}
.overview-chip small {
    color: var(--muted);
    font-size: 10px;
}
.overview-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 14px;
}
.overview-icon.folder {
    background: #fff3d7;
    color: #f0a114;
}
.overview-icon.course {
    background: var(--primary-soft);
    color: var(--primary);
}
.courses-toolbar {
    justify-content: space-between;
}
.search-box-wide {
    width: min(760px, 100%);
}
.folder-card {
    box-shadow: 0 1px 4px rgba(37,54,82,.035);
}
.folder-row {
    min-height: 52px;
    grid-template-columns: 1fr 88px auto;
}
.folder-toggle {
    padding: 0 12px;
    gap: 9px;
}
.folder-icon {
    width: 29px;
    height: 29px;
}
.folder-copy strong {
    font-size: 11.5px;
}
.folder-copy small {
    font-size: 9px;
}
.folder-count {
    display: grid;
    text-align: center;
    line-height: 1.05;
}
.folder-count strong {
    font-size: 12px;
}
.folder-count small {
    font-size: 9px;
    color: var(--muted);
}
.folder-actions {
    padding-right: 10px;
    gap: 5px;
}
.icon-button {
    width: 31px;
    height: 31px;
    border-radius: 7px;
}
.add-course-button {
    color: var(--primary);
    background: #f6f9ff;
    border-color: #cfe0ff;
}
.modern-dropdown {
    min-width: 190px;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(20,35,58,.14);
    padding: 6px;
}
.modern-dropdown .dropdown-item {
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
}
.folder-content {
    padding: 10px;
}
.folder-content-toolbar {
    padding: 0 2px 9px;
}
.folder-content-toolbar > div {
    display: grid;
}
.folder-content-toolbar strong {
    font-size: 12px;
}
.folder-content-toolbar small {
    color: var(--muted);
    font-size: 9px;
}
.inner-table th,
.inner-table td {
    padding-top: 9px;
    padding-bottom: 9px;
}
.section-heading {
    margin-top: 8px;
    margin-bottom: 8px;
}
.section-heading h2 {
    font-size: 15px;
}

@media (max-width: 980px) {
    .admin-main {
        margin-left: 0;
    }
}
@media (max-width: 700px) {
    .courses-overview {
        flex-wrap: wrap;
    }
    .overview-chip {
        flex: 1;
    }
    .folder-row {
        grid-template-columns: 1fr auto;
    }
    .folder-count {
        display: none;
    }
}

/* Выпадающее меню папки не должно обрезаться карточкой */
.folders-accordion {
    overflow: visible;
}

.folder-card {
    position: relative;
    overflow: visible;
}

.folder-row {
    position: relative;
    z-index: 2;
}

.folder-card .dropdown-menu {
    z-index: 1100;
}

/* Выпадающее меню папок */
.folder-card .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.15);
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 9999;
}

.folder-card .dropdown-item {
    padding: 10px 16px;
}

.folder-card .dropdown-item:hover {
    background: #f4f7ff;
}

.folder-card .dropdown-divider {
    margin: 6px 0;
}

/* Жёстко задаём непрозрачный фон меню папки */
.folder-card .dropdown-menu,
.folder-card .dropdown-menu.show,
.folder-card .modern-dropdown,
.folder-card .modern-dropdown.show {
    --bs-dropdown-bg: #ffffff;
    --bs-dropdown-link-hover-bg: #f4f7ff;

    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;

    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18) !important;

    overflow: hidden;
    z-index: 99999 !important;
}

.folder-card .dropdown-menu .dropdown-item {
    background-color: #ffffff !important;
    opacity: 1 !important;
}

.folder-card .dropdown-menu .dropdown-item:hover,
.folder-card .dropdown-menu .dropdown-item:focus {
    background-color: #f4f7ff !important;
}

.folder-card .dropdown-menu .dropdown-divider {
    border-color: #e5e7eb !important;
    opacity: 1 !important;
}

/* Выпадающее меню папки должно находиться поверх соседних папок */
.folders-accordion,
.folder-card,
.folder-row,
.folder-actions,
.folder-dropdown {
    overflow: visible !important;
}

.folder-card {
    position: relative;
    z-index: 1;
}

.folder-card:has(.folder-dropdown .dropdown-menu.show) {
    z-index: 1000 !important;
}

.folder-dropdown {
    position: relative;
    z-index: 1001;
}

.folder-dropdown .dropdown-menu,
.folder-dropdown .dropdown-menu.show {
    position: absolute !important;
    z-index: 1002 !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18) !important;
}

/* ===== СТРАНИЦА КОНКРЕТНОГО КУРСА ===== */

.course-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 11px;
}

.course-breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.course-breadcrumbs a:hover {
    text-decoration: underline;
}

.course-breadcrumbs i {
    font-size: 8px;
    color: #9aa6b6;
}

.course-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.course-page-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 27px;
    font-weight: 750;
    line-height: 1.2;
}

.course-page-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.course-page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.course-back-row {
    margin-bottom: 18px;
}

.back-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #ffffff;
    color: #405069;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.18s ease;
}

.back-button:hover {
    color: var(--primary);
    border-color: #b8c7da;
    background: #f9fbff;
}

.course-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.course-section-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
}

.course-section-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
}

.course-section-header span {
    padding: 4px 8px;
    border: 1px solid #e0e6ef;
    border-radius: 999px;
    background: #f0f3f8;
    color: #56647a;
    font-size: 10px;
}

.course-modules-card {
    overflow: visible;
}

.modules-table {
    table-layout: fixed;
}

.modules-table tbody tr {
    height: 58px;
}

.modules-table th,
.modules-table td {
    vertical-align: middle;
}

.module-order-column {
    width: 64px;
    text-align: center;
}

.module-lessons-column {
    width: 110px;
    text-align: center;
}

.module-actions-column {
    width: 245px;
    white-space: nowrap;
}

.module-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.module-name-cell > div {
    display: grid;
    gap: 3px;
}

.module-name-cell strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.module-name-cell small {
    color: var(--muted);
    font-size: 9px;
}

.module-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
}

.course-section-header .dropdown-menu {
    background: #ffffff !important;
    opacity: 1 !important;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(20, 35, 58, 0.14);
    padding: 6px;
    z-index: 9999;
}

.course-section-header .dropdown-item {
    padding: 9px 11px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #34445a;
    font-size: 12px;
}

.course-section-header .dropdown-item:hover {
    background: #f2f6ff;
    color: var(--primary);
}

@media (max-width: 900px) {
    .course-page-header {
        flex-direction: column;
    }

    .course-page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .course-page-actions > * {
        flex: 1;
    }
}

@media (max-width: 700px) {
    .course-page-header h1 {
        font-size: 22px;
    }

    .course-section-header {
        align-items: flex-start;
    }

    .modules-table {
        min-width: 760px;
    }
}

/* ===== СТРАНИЦА УРОКОВ В МОДУЛЕ ===== */

.module-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.module-page-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 27px;
    font-weight: 750;
    line-height: 1.2;
}

.module-page-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.module-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.module-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.module-section-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
}

.module-section-title span {
    padding: 4px 8px;
    border: 1px solid #e0e6ef;
    border-radius: 999px;
    background: #f0f3f8;
    color: #56647a;
    font-size: 10px;
}

.module-page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.module-page-actions .dropdown {
    position: relative;
}

.module-dropdown-menu,
.module-dropdown-menu.show {
    min-width: 220px;
    background: #ffffff !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    border: 1px solid var(--line) !important;
    border-radius: 10px !important;
    box-shadow: 0 14px 36px rgba(20, 35, 58, 0.14) !important;
    padding: 6px !important;
    z-index: 9999 !important;
}

.module-dropdown-menu .dropdown-item {
    padding: 9px 11px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #34445a;
    font-size: 12px;
}

.module-dropdown-menu .dropdown-item:hover,
.module-dropdown-menu .dropdown-item:focus {
    background: #f2f6ff !important;
    color: var(--primary);
}

.module-lessons-card {
    overflow: visible;
}

.lessons-table {
    table-layout: fixed;
}

.lessons-table tbody tr {
    height: 58px;
}

.lessons-table th,
.lessons-table td {
    vertical-align: middle;
}

.lesson-order-column {
    width: 64px;
    text-align: center;
}

.lesson-status-column {
    width: 90px;
    text-align: center;
}

.lesson-actions-column {
    width: 245px;
    white-space: nowrap;
}

.lesson-name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.lesson-name-cell > div {
    display: grid;
    gap: 3px;
}

.lesson-name-cell strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.lesson-name-cell small {
    color: var(--muted);
    font-size: 9px;
}

.lesson-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
}

.lesson-status {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    min-height: 22px;
    border-radius: 50%;
    font-size: 10px;
}

.lesson-status.success {
    background: #e9f8f1;
    color: var(--success);
}

.lesson-status.empty {
    background: transparent;
    color: #98a3b3;
}

@media (max-width: 900px) {
    .module-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .module-page-actions .dropdown {
        flex: 1;
    }

    .module-page-actions .dropdown > button {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .module-page-header h1 {
        font-size: 22px;
    }

    .lessons-table {
        min-width: 820px;
    }
}

/* ===== ЕДИНЫЙ СТИЛЬ МОДАЛЬНЫХ ОКОН LMS ===== */

/* Затемнение фона */
.modal-backdrop.show {
    opacity: 0.52;
}

/* Основное окно */
.modal:not(.note-modal) .modal-dialog {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
}

.modal:not(.note-modal) .modal-content {
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

/* Верхняя часть */
.modal:not(.note-modal) .modal-header {
    min-height: 76px;
    padding: 18px 22px;
    align-items: flex-start;
    border-bottom: 1px solid #e7ebf2;
    background: #ffffff;
}

.modal:not(.note-modal) .modal-header > div {
    min-width: 0;
}

.modal:not(.note-modal) .modal-title,
.modal:not(.note-modal) .modal-header h5 {
    margin: 0;
    color: #132238;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.modal:not(.note-modal) .modal-header p {
    margin: 5px 0 0;
    color: #6f7c90;
    font-size: 11px;
    line-height: 1.5;
}

.modal:not(.note-modal) .btn-close {
    width: 34px;
    height: 34px;
    margin: -3px -4px 0 14px;
    padding: 0;
    border-radius: 8px;
    background-size: 12px;
    opacity: 0.65;
    transition: 0.18s ease;
}

.modal:not(.note-modal) .btn-close:hover {
    background-color: #f2f5f9;
    opacity: 1;
}

/* Содержимое */
.modal:not(.note-modal) .modal-body {
    padding: 20px 22px;
    background: #ffffff;
}

.modal:not(.note-modal) .form-label {
    margin-bottom: 7px;
    color: #405069;
    font-size: 11px;
    font-weight: 650;
}

.modal:not(.note-modal) .form-control,
.modal:not(.note-modal) .form-select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dfe5ee;
    border-radius: 9px;
    background: #ffffff;
    color: #233249;
    font-size: 12px;
    box-shadow: none;
    transition: 0.18s ease;
}

.modal:not(.note-modal) textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.modal:not(.note-modal) .form-control:focus,
.modal:not(.note-modal) .form-select:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.10);
}

.modal:not(.note-modal) .form-control::placeholder {
    color: #9aa6b6;
}

.modal:not(.note-modal) .helper-text,
.modal:not(.note-modal) .text-muted,
.modal:not(.note-modal) small {
    color: #7b8798 !important;
    font-size: 10px;
    line-height: 1.5;
}

/* Нижняя часть */
.modal:not(.note-modal) .modal-footer {
    min-height: 68px;
    padding: 13px 22px;
    gap: 8px;
    border-top: 1px solid #e7ebf2;
    background: #fbfcfe;
}

/* Старые Bootstrap-кнопки внутри модальных окон */
.modal:not(.note-modal) .modal-footer .btn {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 650;
    box-shadow: none;
    transform: none;
}

.modal:not(.note-modal) .modal-footer .btn-primary,
.modal:not(.note-modal) .modal-footer .btn-success {
    border: 0;
    background: #1769ff;
    color: #ffffff;
}

.modal:not(.note-modal) .modal-footer .btn-primary:hover,
.modal:not(.note-modal) .modal-footer .btn-success:hover {
    background: #0f55d6;
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.modal:not(.note-modal) .modal-footer .btn-secondary,
.modal:not(.note-modal) .modal-footer .btn-outline-secondary {
    border: 1px solid #dce3ed;
    background: #ffffff;
    color: #25344a;
}

.modal:not(.note-modal) .modal-footer .btn-secondary:hover,
.modal:not(.note-modal) .modal-footer .btn-outline-secondary:hover {
    border-color: #b9c6d8;
    background: #f8fafc;
    color: #25344a;
    transform: none;
    box-shadow: none;
}

/* Summernote внутри окна редактирования */
.modal:not(.note-modal) .note-editor.note-frame {
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    box-shadow: none;
}

.modal:not(.note-modal) .note-toolbar {
    padding: 7px 8px;
    border-bottom: 1px solid #e7ebf2;
    background: #f7f9fc;
}

.modal:not(.note-modal) .note-toolbar .btn {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #dce3ed;
    border-radius: 6px;
    background: #ffffff;
    color: #26364d;
    box-shadow: none;
    transform: none;
}

.modal:not(.note-modal) .note-editing-area {
    background: #ffffff;
}

.modal:not(.note-modal) .note-editable {
    padding: 14px;
    color: #1f2d3d;
    font-size: 14px;
    line-height: 1.65;
}

/* Большие окна редактирования */
.modal-xl:not(.note-modal) {
    max-width: min(1080px, calc(100vw - 32px));
}

/* Плавное появление */
.modal.fade:not(.note-modal) .modal-dialog {
    transform: translateY(14px) scale(0.985);
    transition: transform 0.18s ease-out;
}

.modal.show:not(.note-modal) .modal-dialog {
    transform: translateY(0) scale(1);
}

/* Мобильная версия */
@media (max-width: 700px) {
    .modal:not(.note-modal) .modal-dialog {
        margin: 10px;
    }

    .modal:not(.note-modal) .modal-content {
        border-radius: 13px;
    }

    .modal:not(.note-modal) .modal-header,
    .modal:not(.note-modal) .modal-body,
    .modal:not(.note-modal) .modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }

    .modal:not(.note-modal) .modal-footer {
        flex-wrap: nowrap;
    }

    .modal:not(.note-modal) .modal-footer > button,
    .modal:not(.note-modal) .modal-footer > .btn,
    .modal:not(.note-modal) .modal-footer > .primary-button,
    .modal:not(.note-modal) .modal-footer > .secondary-button {
        flex: 1;
    }
}

/* ===== ЛИЧНЫЙ КАБИНЕТ УЧЕНИКА: МОИ КУРСЫ ===== */

.student-page-header {
    margin: 8px 0 24px;
}

.student-page-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.student-page-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    font-weight: 750;
    line-height: 1.2;
}

.student-page-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.student-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.student-course-card {
    min-height: 330px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 26px rgba(35, 52, 77, 0.06);
    display: flex;
    flex-direction: column;
    transition: 0.2s ease;
}

.student-course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(35, 52, 77, 0.10);
}

.student-course-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.student-course-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 16px;
}

.student-course-status {
    min-height: 27px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
}

.student-course-status.active {
    background: #eef4ff;
    color: var(--primary);
}

.student-course-status.completed {
    background: #e9f8f1;
    color: var(--success);
}

.student-course-card-body {
    flex: 1;
}

.student-course-card-body h2 {
    margin: 0 0 9px;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.student-course-card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.student-course-description-muted {
    color: #9aa6b6 !important;
}

.student-course-progress-block {
    margin: 22px 0 16px;
}

.student-course-progress-line,
.student-course-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.student-course-progress-line {
    margin-bottom: 8px;
}

.student-course-progress-line span,
.student-course-progress-meta span {
    color: var(--muted);
    font-size: 10px;
}

.student-course-progress-line strong {
    color: var(--text);
    font-size: 12px;
}

.student-course-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f6;
}

.student-course-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1769ff, #4b8cff);
}

.student-course-progress-meta {
    margin-top: 8px;
}

.student-course-button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: 0.18s ease;
}

.student-course-button:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
}

.student-empty-state {
    max-width: 560px;
    margin: 70px auto;
    padding: 42px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 8px 26px rgba(35, 52, 77, 0.06);
}

.student-empty-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 15px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 20px;
}

.student-empty-state h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.student-empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .student-courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .student-page-header h1 {
        font-size: 25px;
    }

    .student-courses-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .student-course-card {
        min-height: 300px;
    }
}

/* ===========================
   СТРАНИЦА КУРСА УЧЕНИКА
=========================== */

.student-module-list{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.student-module-card{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:20px;

    border:1px solid var(--line);
    border-radius:16px;

    background:#fff;

    box-shadow:0 8px 24px rgba(0,0,0,.05);

    transition:.2s;
}

.student-module-card:hover{

    transform:translateY(-2px);

    box-shadow:0 14px 34px rgba(0,0,0,.08);

}

.student-module-left{

    display:flex;

    gap:18px;

    align-items:flex-start;

    flex:1;

}

.student-module-icon{

    width:48px;

    height:48px;

    border-radius:12px;

    display:flex;

    align-items:center;

    justify-content:center;

    background:#eef4ff;

    color:#1769ff;

    font-size:20px;

}

.student-module-info{

    flex:1;

}

.student-module-info h3{

    margin-bottom:10px;

    font-size:20px;

    font-weight:700;

}

.student-module-meta{

    display:flex;

    gap:12px;

    align-items:center;

    margin-bottom:12px;

    flex-wrap:wrap;

    color:#74849a;

    font-size:13px;

}

.student-module-button{

    width:180px;

    justify-content:center;

}

@media(max-width:900px){

.student-module-card{

flex-direction:column;

align-items:stretch;

gap:20px;

}

.student-module-button{

width:100%;

}

}

/* ===========================
   СПИСОК УРОКОВ УЧЕНИКА
=========================== */

.student-lessons-list{

display:flex;

flex-direction:column;

gap:16px;

}

.student-lesson-card{

display:flex;

justify-content:space-between;

align-items:center;

padding:18px;

background:#fff;

border:1px solid var(--line);

border-radius:16px;

box-shadow:0 8px 24px rgba(0,0,0,.05);

transition:.2s;

}

.student-lesson-card:hover{

transform:translateY(-2px);

box-shadow:0 14px 34px rgba(0,0,0,.08);

}

.student-lesson-left{

display:flex;

gap:18px;

align-items:flex-start;

flex:1;

}

.student-lesson-icon{

width:46px;

height:46px;

border-radius:12px;

display:flex;

align-items:center;

justify-content:center;

background:#eef4ff;

color:#1769ff;

font-size:18px;

}

.student-lesson-info{

flex:1;

}

.student-lesson-info h3{

margin-bottom:10px;

font-size:18px;

font-weight:700;

}

.student-lesson-meta{

display:flex;

gap:12px;

align-items:center;

flex-wrap:wrap;

font-size:13px;

color:#74849a;

}

.student-lesson-right{

display:flex;

align-items:center;

gap:16px;

}

.student-lesson-button{

width:170px;

justify-content:center;

}

.lesson-lock{

width:42px;

height:42px;

border-radius:10px;

display:flex;

align-items:center;

justify-content:center;

background:#f3f5f8;

color:#98a6b8;

font-size:18px;

}

@media(max-width:900px){

.student-lesson-card{

flex-direction:column;

align-items:stretch;

gap:18px;

}

.student-lesson-button{

width:100%;

}

.student-lesson-right{

justify-content:flex-end;

}

}

/* ===== СТРАНИЦА УРОКА УЧЕНИКА ===== */

.lesson-page {
    width: min(1220px, 100%);
    margin: 0 auto;
    padding: 0 20px 24px;
}

.lesson-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.lesson-hero-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 18px;
}

.lesson-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lesson-hero h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 760;
    line-height: 1.22;
}

.lesson-hero p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.lesson-divider {
    height: 1px;
    margin-bottom: 28px;
    background: var(--line);
}

.lesson-article {
    max-width: 1100px;
    margin: 0 auto 20px;
    color: #1f2d3d;
    font-size: 16px;
    line-height: 1.75;
}

.lesson-article h1,
.lesson-article h2,
.lesson-article h3,
.lesson-article h4,
.lesson-article h5,
.lesson-article h6 {
    color: var(--text);
    font-weight: 740;
    line-height: 1.35;
}

.lesson-article h2 {
    margin: 34px 0 14px;
    font-size: 25px;
}

.lesson-article h3 {
    margin: 28px 0 12px;
    font-size: 20px;
}

.lesson-article p {
    margin: 0 0 18px;
}

.lesson-article ul,
.lesson-article ol {
    margin: 0 0 20px;
    padding-left: 28px;
}

.lesson-article li {
    margin-bottom: 8px;
}

.lesson-article blockquote {
    margin: 24px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
    background: #f4f8ff;
    color: #3a4b61;
}

.lesson-article table {
    width: 100%;
    margin: 22px 0;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.lesson-article th,
.lesson-article td {
    padding: 11px 13px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.lesson-article th {
    background: #f7f9fc;
    font-weight: 700;
}

.lesson-article tr:last-child td {
    border-bottom: 0;
}

.lesson-article th:last-child,
.lesson-article td:last-child {
    border-right: 0;
}

.lesson-article img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.lesson-section {
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(35, 52, 77, 0.04);
}

.lesson-section-heading,
.lesson-section-heading-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-section-heading-row {
    justify-content: space-between;
}

.lesson-section-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
}

.lesson-section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 720;
}

.lesson-section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.lesson-video-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.lesson-video-card {
    overflow: hidden;
    border-radius: 13px;
    background: #0f1724;
}

.lesson-video-frame {
    position: relative;
    height: 0;
    padding-bottom: 56.25%;
}

.lesson-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lesson-direct-video {
    width: 100%;
    display: block;
}

.lesson-external-video-link {
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: var(--primary);
    text-decoration: none;
    font-weight: 650;
}

.lesson-files-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.lesson-file-row {
    min-height: 54px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lesson-file-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.lesson-file-main > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.lesson-file-main strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-file-main small {
    color: var(--muted);
    font-size: 9px;
}

.lesson-file-icon {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #eef4ff;
    color: var(--primary);
}

.lesson-file-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.lesson-files-empty {
    min-height: 76px;
    margin-top: 18px;
    border: 1px dashed #d8e0eb;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}

.lesson-test-form {
    margin-top: 18px;
}

.lesson-question-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfe;
}

.lesson-question-card + .lesson-question-card {
    margin-top: 12px;
}

.lesson-question-number {
    margin-bottom: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.lesson-question-card h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

.lesson-options-list {
    display: grid;
    gap: 8px;
}

.lesson-option {
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #dfe5ee;
    border-radius: 9px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: 0.15s ease;
}

.lesson-option:hover {
    border-color: #b7c8e4;
    background: #f7faff;
}

.lesson-option span {
    font-size: 12px;
}

.lesson-test-submit {
    min-width: 190px;
    margin-top: 16px;
}

.lesson-test-result {
    margin-top: 18px;
}

.lesson-result-summary {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1769ff, #4d8fff);
    color: #ffffff;
}

.lesson-result-summary div {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.lesson-result-summary span {
    font-size: 11px;
    opacity: 0.9;
}

.lesson-result-summary strong {
    font-size: 28px;
}

.lesson-result-summary p {
    margin: 7px 0 0;
    font-size: 12px;
}

.lesson-result-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 10px;
    background: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.lesson-result-item + .lesson-result-item {
    margin-top: 9px;
}

.lesson-result-item.correct {
    border-left-color: var(--success);
    background: #f6fcf9;
}

.lesson-result-item.incorrect {
    border-left-color: var(--danger);
    background: #fff8f8;
}

.lesson-result-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 11px;
}

.lesson-result-item.correct .lesson-result-icon {
    background: var(--success);
}

.lesson-result-item.incorrect .lesson-result-icon {
    background: var(--danger);
}

.lesson-result-item h4 {
    margin: 1px 0 7px;
    font-size: 13px;
}

.lesson-result-item p {
    margin: 0;
    color: #526078;
    font-size: 11px;
}

.lesson-correct-answer {
    margin-top: 5px !important;
    color: var(--success) !important;
}

.lesson-result-button {
    margin-top: 15px;
}

.lesson-completion-block {
    margin: 26px 0 22px;
}

.lesson-completion-button {
    min-height: 44px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(23, 105, 255, 0.18);
}

.lesson-completion-button.completed {
    background: #70bb9a;
    box-shadow: none;
}

.lesson-navigation {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lesson-navigation-item {
    min-width: 0;
}

.lesson-navigation-item form {
    height: 100%;
}

.lesson-nav-button {
    width: 100%;
    min-height: 42px;
}

.lesson-rating-stars {
    margin-bottom: 16px;
    color: #cccccc;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 800px) {
    .lesson-page {
        width: 100%;
    }

    .lesson-hero {
        gap: 12px;
    }

    .lesson-hero-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .lesson-article {
        font-size: 15px;
        line-height: 1.75;
    }

    .lesson-section-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .lesson-file-row {
        align-items: stretch;
        flex-direction: column;
    }

    .lesson-file-actions {
        justify-content: flex-end;
    }

    .lesson-navigation {
        grid-template-columns: 1fr;
    }

    .lesson-navigation-item:empty {
        display: none;
    }
}

/* ===== СТРАНИЦА НАСТРОЕК УЧЕНИКА ===== */

.user-settings-page {
    max-width: 1280px;
    margin: 0 auto;
}

.user-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.user-settings-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    font-weight: 750;
}

.user-settings-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.student-profile-card,
.student-setting-card,
.student-enroll-card,
.student-courses-section,
.student-danger-zone {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 8px 26px rgba(35, 52, 77, 0.05);
}

.student-profile-card {
    padding: 20px;
    margin-bottom: 16px;
}

.student-profile-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-profile-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6f8199, #4d6079);
    color: #ffffff;
    font-size: 22px;
    font-weight: 750;
}

.student-profile-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.student-profile-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.student-profile-title-row h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    font-weight: 730;
}

.student-profile-email {
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
}

.student-profile-last-active {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 10px;
}

.student-profile-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.student-info-item {
    min-height: 76px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfcfe;
    display: flex;
    align-items: center;
    gap: 11px;
}

.student-info-icon,
.student-setting-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
}

.student-info-item > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.student-info-item small,
.student-access-current small {
    color: var(--muted);
    font-size: 9px;
}

.student-info-item strong {
    color: var(--text);
    font-size: 12px;
}

.student-block-date-form {
    min-width: 0;
    flex: 1;
}

.student-block-date-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 9px;
}

.student-date-field {
    position: relative;
}

.student-date-field input {
    width: 100%;
    min-height: 35px;
    padding: 0 32px 0 10px;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-size: 11px;
    outline: none;
}

.student-date-field input:focus {
    border-color: #8ab4ff;
    box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.08);
}

.student-date-field i {
    position: absolute;
    top: 50%;
    right: 10px;
    color: var(--primary);
    pointer-events: none;
    transform: translateY(-50%);
}

.student-inline-action {
    margin: 0;
}

.student-text-action {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
}

.student-text-action.success {
    color: var(--success);
}

.student-text-action.danger {
    color: var(--danger);
}

.student-profile-footer {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.student-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.student-setting-card,
.student-enroll-card,
.student-courses-section,
.student-danger-zone {
    padding: 18px;
}

.student-setting-card-heading,
.student-enroll-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.student-setting-card-heading h3,
.student-enroll-heading h3,
.student-danger-zone h3,
.student-courses-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 720;
}

.student-setting-card-heading p,
.student-enroll-heading p,
.student-danger-zone p,
.student-courses-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.student-setting-form {
    margin-top: 18px;
}

.student-setting-form .primary-button {
    width: 100%;
    margin-top: 10px;
}

.student-access-current {
    min-height: 64px;
    margin: 18px 0 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
    display: grid;
    gap: 5px;
}

.student-access-current strong {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: 12px;
}

.student-setting-full-button {
    width: 100%;
}

.student-enroll-card {
    margin-bottom: 16px;
}

.student-enroll-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 16px;
}

.student-courses-section {
    margin-bottom: 16px;
}

.student-courses-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.student-admin-courses-list {
    display: grid;
    gap: 10px;
}

.student-admin-course-card {
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfcfe;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.student-admin-course-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.student-admin-course-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.student-admin-course-copy {
    min-width: 0;
    flex: 1;
}

.student-admin-course-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.student-admin-course-title-row h3 {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 680;
}

.student-admin-course-title-row strong {
    color: var(--primary);
    font-size: 12px;
}

.student-admin-course-progress {
    height: 6px;
    margin: 9px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef5;
}

.student-admin-course-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1769ff, #4b8cff);
}

.student-admin-course-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 9px;
}

.student-admin-course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.student-settings-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--muted);
}

.student-settings-empty > i {
    margin-bottom: 10px;
    color: #aeb9c9;
    font-size: 28px;
}

.student-settings-empty h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 16px;
}

.student-settings-empty p {
    margin: 0;
    font-size: 10px;
}

.student-danger-zone {
    border-color: #ffd9dc;
    background: #fffafa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

@media (max-width: 900px) {
    .student-profile-info-grid,
    .student-settings-grid {
        grid-template-columns: 1fr;
    }

    .student-enroll-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .user-settings-header {
        flex-direction: column;
    }

    .student-profile-main {
        align-items: flex-start;
    }

    .student-profile-footer {
        flex-direction: column;
    }

    .student-admin-course-card,
    .student-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .student-admin-course-card > form,
    .student-danger-zone > form {
        align-self: flex-end;
    }
}

#ratingModal .modal-header {
    position: relative;
    display: block;
    min-height: 82px;
    padding: 18px 60px;
    text-align: center;
}

#ratingModal .modal-header > div {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
}

#ratingModal .modal-header h5 {
    width: 100%;
    margin: 0;
    text-align: center;
}

#ratingModal .modal-header p {
    width: 100%;
    margin: 5px 0 0;
    text-align: center;
}

#ratingModal .modal-header .btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    margin: 0;
}

/* ========================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ В БОКОВОМ МЕНЮ
   ======================================== */

.sidebar-theme {
    margin-top: auto;
    padding: 12px 14px 8px;
}

.sidebar-theme-toggle {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.sidebar-theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-theme-icon {
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sidebar-theme-text {
    flex: 1;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-theme-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease;
}

.sidebar-theme-switch-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease;
}

.admin-dark-theme .sidebar-theme-switch {
    background: #1769ff;
}

.admin-dark-theme .sidebar-theme-switch-circle {
    transform: translateX(16px);
}

/* ========================================
   ТЁМНАЯ ТЕМА АДМИНИСТРАТОРА
   Боковое меню не изменяется
   ======================================== */

.admin-dark-theme .admin-main {
    --text: #edf3fc;
    --muted: #93a4ba;
    --line: #2b3a50;
    --surface: #182438;
    --surface-soft: #202d42;

    color-scheme: dark;
    color: #edf3fc;
    background: #101927;
}

/* Основной фон */

.admin-dark-theme .admin-page {
    color: #edf3fc;
    background: #101927;
}

/* Верхняя панель */

.admin-dark-theme .admin-topbar {
    border-color: #2b3a50;
    background: #182438;
    color: #edf3fc;
}

.admin-dark-theme .admin-topbar-title,
.admin-dark-theme .admin-topbar strong {
    color: #edf3fc;
}

.admin-dark-theme .topbar-link,
.admin-dark-theme .topbar-user,
.admin-dark-theme .mobile-menu-button {
    color: #cbd6e5;
}

.admin-dark-theme .topbar-link:hover,
.admin-dark-theme .mobile-menu-button:hover {
    color: #ffffff;
    background: #25344b;
}

/* Карточки и основные блоки */

.admin-dark-theme .admin-main .card,
.admin-dark-theme .admin-main .modern-card,
.admin-dark-theme .admin-main .summary-card,
.admin-dark-theme .admin-main .stat-card,
.admin-dark-theme .admin-main .content-card,
.admin-dark-theme .admin-main .dashboard-card,
.admin-dark-theme .admin-main .admin-card,
.admin-dark-theme .admin-main .panel,
.admin-dark-theme .admin-main .table-card,
.admin-dark-theme .admin-main .settings-card,
.admin-dark-theme .admin-main .course-card {
    border-color: #2b3a50;
    background: #182438;
    color: #edf3fc;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

/* Заголовки */

.admin-dark-theme .admin-main h1,
.admin-dark-theme .admin-main h2,
.admin-dark-theme .admin-main h3,
.admin-dark-theme .admin-main h4,
.admin-dark-theme .admin-main h5,
.admin-dark-theme .admin-main h6,
.admin-dark-theme .admin-main strong,
.admin-dark-theme .admin-main .card-title,
.admin-dark-theme .admin-main .section-title {
    color: #edf3fc;
}

/* Вторичный текст */

.admin-dark-theme .admin-main p,
.admin-dark-theme .admin-main .text-muted,
.admin-dark-theme .admin-main small,
.admin-dark-theme .admin-main .form-text,
.admin-dark-theme .admin-main .help-text {
    color: #93a4ba !important;
}

/* Таблицы */

.admin-dark-theme .admin-main table,
.admin-dark-theme .admin-main .table {
    --bs-table-bg: transparent;
    --bs-table-color: #dce5f2;
    --bs-table-border-color: #2b3a50;
    --bs-table-striped-bg: #1d2a3e;
    --bs-table-striped-color: #dce5f2;
    --bs-table-hover-bg: #25344b;
    --bs-table-hover-color: #ffffff;

    color: #dce5f2;
    border-color: #2b3a50;
}

.admin-dark-theme .admin-main thead,
.admin-dark-theme .admin-main th {
    color: #aebdd0;
    background: #202d42;
    border-color: #2b3a50;
}

.admin-dark-theme .admin-main td {
    color: #dce5f2;
    border-color: #2b3a50;
}

/* Поля ввода */

.admin-dark-theme .admin-main .form-control,
.admin-dark-theme .admin-main .form-select,
.admin-dark-theme .admin-main input,
.admin-dark-theme .admin-main textarea,
.admin-dark-theme .admin-main select {
    border-color: #34455e;
    background: #121d2d;
    color: #edf3fc;
}

.admin-dark-theme .admin-main .form-control::placeholder,
.admin-dark-theme .admin-main textarea::placeholder,
.admin-dark-theme .admin-main input::placeholder {
    color: #75869c;
}

.admin-dark-theme .admin-main .form-control:focus,
.admin-dark-theme .admin-main .form-select:focus,
.admin-dark-theme .admin-main input:focus,
.admin-dark-theme .admin-main textarea:focus,
.admin-dark-theme .admin-main select:focus {
    border-color: #4b8cff;
    background: #162235;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(75, 140, 255, 0.16);
}

.admin-dark-theme .admin-main label,
.admin-dark-theme .admin-main .form-label {
    color: #b8c5d7;
}

/* Выпадающие списки */

.admin-dark-theme .admin-main .dropdown-menu {
    border-color: #34455e;
    background: #182438;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

.admin-dark-theme .admin-main .dropdown-item {
    color: #dce5f2;
}

.admin-dark-theme .admin-main .dropdown-item:hover,
.admin-dark-theme .admin-main .dropdown-item:focus {
    color: #ffffff;
    background: #25344b;
}

/* Вкладки и навигация внутри правой части */

.admin-dark-theme .admin-main .nav-tabs {
    border-color: #2b3a50;
}

.admin-dark-theme .admin-main .nav-tabs .nav-link {
    color: #93a4ba;
}

.admin-dark-theme .admin-main .nav-tabs .nav-link:hover {
    border-color: #34455e;
    color: #ffffff;
}

.admin-dark-theme .admin-main .nav-tabs .nav-link.active {
    border-color: #34455e #34455e #182438;
    background: #182438;
    color: #ffffff;
}

/* Разделители */

.admin-dark-theme .admin-main hr {
    border-color: #34455e;
    opacity: 1;
}

/* Списки */

.admin-dark-theme .admin-main .list-group-item {
    border-color: #2b3a50;
    background: #182438;
    color: #dce5f2;
}

/* Пагинация */

.admin-dark-theme .admin-main .page-link {
    border-color: #34455e;
    background: #182438;
    color: #aebdd0;
}

.admin-dark-theme .admin-main .page-link:hover {
    background: #25344b;
    color: #ffffff;
}

.admin-dark-theme .admin-main .page-item.active .page-link {
    border-color: #1769ff;
    background: #1769ff;
    color: #ffffff;
}

/* Модальные окна администратора */

.admin-dark-theme .modal:not(.note-modal) .modal-content {
    border-color: #34455e;
    background: #182438;
    color: #edf3fc;
}

.admin-dark-theme .modal:not(.note-modal) .modal-header,
.admin-dark-theme .modal:not(.note-modal) .modal-footer {
    border-color: #2b3a50;
    background: #182438;
}

.admin-dark-theme .modal:not(.note-modal) .modal-header h5,
.admin-dark-theme .modal:not(.note-modal) .modal-title {
    color: #edf3fc;
}

.admin-dark-theme .modal:not(.note-modal) .modal-header p {
    color: #93a4ba;
}

.admin-dark-theme .modal:not(.note-modal) .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
}

/* Bootstrap-фоны */

.admin-dark-theme .admin-main .bg-white {
    background-color: #182438 !important;
}

.admin-dark-theme .admin-main .bg-light {
    background-color: #202d42 !important;
}

.admin-dark-theme .admin-main .border,
.admin-dark-theme .admin-main .border-top,
.admin-dark-theme .admin-main .border-bottom,
.admin-dark-theme .admin-main .border-start,
.admin-dark-theme .admin-main .border-end {
    border-color: #2b3a50 !important;
}

.admin-dark-theme .folder-card,
.admin-dark-theme .folder-card.accordion-item,
.admin-dark-theme .accordion-item {
    background: #182438 !important;
    border-color: #2b3a50 !important;
    color: #edf3fc !important;
}

.admin-dark-theme .folder-row {
    background: transparent !important;
    color: #edf3fc !important;
}

.admin-dark-theme .folder-toggle,
.admin-dark-theme .folder-copy,
.admin-dark-theme .folder-count,
.admin-dark-theme .folder-actions {
    color: #edf3fc !important;
}

/* Таблица курсов в темной теме */

.admin-dark-theme table,
.admin-dark-theme .table {
    background: #182438 !important;
    color: #edf3fc !important;
}

.admin-dark-theme thead,
.admin-dark-theme thead th {
    background: #24344d !important;
    color: #edf3fc !important;
}

.admin-dark-theme tbody tr {
    background: #182438 !important;
    color: #edf3fc !important;
}

.admin-dark-theme tbody tr:nth-child(even) {
    background: #1d2a40 !important;
}

.admin-dark-theme td,
.admin-dark-theme th {
    border-color: #2b3a50 !important;
}

.admin-dark-theme tbody tr:hover {
    background: #263752 !important;
}

/* Поиск в тёмной теме */

.admin-dark-theme .search-box,
.admin-dark-theme .search-wrapper,
.admin-dark-theme .input-group,
.admin-dark-theme .input-group-text {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}

.admin-dark-theme .input-group-text {
    border-right:none !important;
}

.admin-dark-theme .search-box input,
.admin-dark-theme .search-wrapper input,
.admin-dark-theme .input-group input,
.admin-dark-theme input[type="search"] {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}

.admin-dark-theme .search-box input::placeholder,
.admin-dark-theme .search-wrapper input::placeholder,
.admin-dark-theme input[type="search"]::placeholder {
    color:#8fa2bd !important;
}


/* Убираем белую рамку у раскрытой папки */

.admin-dark-theme .accordion-collapse,
.admin-dark-theme .accordion-body,
.admin-dark-theme .folder-content,
.admin-dark-theme .folder-courses,
.admin-dark-theme .courses-table-wrapper {
    background:#101a29 !important;
    border-color:#2b3a50 !important;
}

.admin-dark-theme .accordion-body {
    border-top:none !important;
}

.admin-dark-theme .folder-card:has(.accordion-collapse.show) {
    border-color:#2b3a50 !important;
}

/* =========================
   Настройки ученика — тёмная тема
   ========================= */

.admin-dark-theme .student-settings-page,
.admin-dark-theme .student-settings-container {
    color:#edf3fc !important;
}


/* Основные белые карточки */

.admin-dark-theme .student-profile-card,
.admin-dark-theme .student-settings-card,
.admin-dark-theme .student-info-card,
.admin-dark-theme .password-card,
.admin-dark-theme .access-card,
.admin-dark-theme .assign-course-card {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}


/* Если карточки сделаны обычными Bootstrap-классами */

.admin-dark-theme .card {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}


/* Заголовки и основной текст */

.admin-dark-theme .student-profile-card h1,
.admin-dark-theme .student-profile-card h2,
.admin-dark-theme .student-profile-card h3,
.admin-dark-theme .student-settings-card h1,
.admin-dark-theme .student-settings-card h2,
.admin-dark-theme .student-settings-card h3,
.admin-dark-theme .password-card h2,
.admin-dark-theme .access-card h2,
.admin-dark-theme .assign-course-card h2,
.admin-dark-theme .card h1,
.admin-dark-theme .card h2,
.admin-dark-theme .card h3 {
    color:#edf3fc !important;
}

.admin-dark-theme .student-profile-card p,
.admin-dark-theme .student-settings-card p,
.admin-dark-theme .password-card p,
.admin-dark-theme .access-card p,
.admin-dark-theme .assign-course-card p,
.admin-dark-theme .card p {
    color:#9fb0c8 !important;
}


/* Подписи полей */

.admin-dark-theme label,
.admin-dark-theme .form-label,
.admin-dark-theme .field-label,
.admin-dark-theme .info-label {
    color:#9fb0c8 !important;
}


/* Информационные блоки внутри верхней карточки */

.admin-dark-theme .student-info-item,
.admin-dark-theme .profile-info-item,
.admin-dark-theme .info-box,
.admin-dark-theme .stat-box {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}


/* Поля ввода и выпадающие списки */

.admin-dark-theme input,
.admin-dark-theme select,
.admin-dark-theme textarea,
.admin-dark-theme .form-control,
.admin-dark-theme .form-select {
    background:#101a29 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme input::placeholder,
.admin-dark-theme textarea::placeholder {
    color:#7f91aa !important;
}

.admin-dark-theme select option {
    background:#101a29 !important;
    color:#edf3fc !important;
}


/* Разделители */

.admin-dark-theme hr,
.admin-dark-theme .divider,
.admin-dark-theme .section-divider {
    border-color:#34445d !important;
    opacity:1 !important;
}


/* Второстепенные светлые кнопки */

.admin-dark-theme .btn-light,
.admin-dark-theme .btn-outline-secondary,
.admin-dark-theme .back-button,
.admin-dark-theme .journal-button,
.admin-dark-theme .export-button,
.admin-dark-theme .sequential-access-button {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme .btn-light:hover,
.admin-dark-theme .btn-outline-secondary:hover,
.admin-dark-theme .back-button:hover,
.admin-dark-theme .journal-button:hover,
.admin-dark-theme .export-button:hover,
.admin-dark-theme .sequential-access-button:hover {
    background:#263752 !important;
    border-color:#4c6384 !important;
    color:#ffffff !important;
}


/* Аватар */

.admin-dark-theme .student-avatar,
.admin-dark-theme .profile-avatar,
.admin-dark-theme .avatar {
    background:#344d6d !important;
    color:#ffffff !important;
}


/* Статус активности */

.admin-dark-theme .status-active,
.admin-dark-theme .student-status {
    background:#173d32 !important;
    color:#72e2b6 !important;
}


/* Красная ссылка блокировки */

.admin-dark-theme .block-student,
.admin-dark-theme .danger-link {
    color:#ff7b7b !important;
}

/* Настройки ученика — оставшиеся светлые блоки */

.admin-dark-theme .student-settings-page > div,
.admin-dark-theme .student-settings-page section,
.admin-dark-theme .student-settings-page article,
.admin-dark-theme .student-settings-page .card,
.admin-dark-theme .student-settings-page .panel {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}


/* Контейнеры разделов */

.admin-dark-theme .settings-section,
.admin-dark-theme .student-section,
.admin-dark-theme .password-section,
.admin-dark-theme .access-section,
.admin-dark-theme .course-assign-section,
.admin-dark-theme .student-courses-section,
.admin-dark-theme .danger-section,
.admin-dark-theme .danger-zone {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}


/* Вложенные карточки курсов */

.admin-dark-theme .student-course-item,
.admin-dark-theme .course-progress-item,
.admin-dark-theme .enrolled-course-item {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}


/* Заголовки */

.admin-dark-theme .student-settings-page h1,
.admin-dark-theme .student-settings-page h2,
.admin-dark-theme .student-settings-page h3,
.admin-dark-theme .student-settings-page h4 {
    color:#edf3fc !important;
}


/* Описания и мелкий текст */

.admin-dark-theme .student-settings-page p,
.admin-dark-theme .student-settings-page small,
.admin-dark-theme .student-settings-page .text-muted {
    color:#9fb0c8 !important;
}


/* Белые области форм */

.admin-dark-theme .student-settings-page form,
.admin-dark-theme .student-settings-page .form-section {
    background:transparent !important;
}


/* Опасная зона */

.admin-dark-theme .danger-section,
.admin-dark-theme .danger-zone {
    background:#2a1d24 !important;
    border-color:#6a3342 !important;
}

.admin-dark-theme .danger-section h2,
.admin-dark-theme .danger-section h3,
.admin-dark-theme .danger-zone h2,
.admin-dark-theme .danger-zone h3 {
    color:#ffb4b4 !important;
}

/* ==========================================
   Настройки ученика — точные классы из HTML
   ========================================== */

/* Карточки: пароль и режим доступа */
.admin-dark-theme .user-settings-page .student-setting-card {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}

/* Записать на другой курс */
.admin-dark-theme .user-settings-page .student-enroll-card {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}

/* Курсы ученика */
.admin-dark-theme .user-settings-page .student-courses-section {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}

/* Удаление ученика */
.admin-dark-theme .user-settings-page .student-danger-zone {
    background:#271c25 !important;
    border-color:#693040 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}


/* Заголовки карточек */
.admin-dark-theme .student-setting-card h2,
.admin-dark-theme .student-setting-card h3,
.admin-dark-theme .student-enroll-card h2,
.admin-dark-theme .student-enroll-card h3,
.admin-dark-theme .student-courses-section h2,
.admin-dark-theme .student-courses-section h3 {
    color:#edf3fc !important;
}


/* Описания под заголовками */
.admin-dark-theme .student-setting-card p,
.admin-dark-theme .student-enroll-card p,
.admin-dark-theme .student-courses-section p,
.admin-dark-theme .student-setting-card small,
.admin-dark-theme .student-enroll-card small,
.admin-dark-theme .student-courses-section small {
    color:#9fb0c8 !important;
}


/* Текущий режим доступа */
.admin-dark-theme .student-access-current {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}


/* Список назначенных курсов */
.admin-dark-theme .student-admin-courses-list {
    background:transparent !important;
}


/* Отдельная строка курса */
.admin-dark-theme .student-admin-course,
.admin-dark-theme .student-course-item {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}


/* Названия курсов */
.admin-dark-theme .student-admin-course h3,
.admin-dark-theme .student-admin-course-title,
.admin-dark-theme .student-course-title {
    color:#edf3fc !important;
}


/* Мелкая информация по курсам */
.admin-dark-theme .student-admin-course small,
.admin-dark-theme .student-admin-course-meta,
.admin-dark-theme .student-course-meta {
    color:#9fb0c8 !important;
}


/* Полоса прогресса */
.admin-dark-theme .student-course-progress,
.admin-dark-theme .progress {
    background:#101a29 !important;
}


/* Светлые второстепенные кнопки */
.admin-dark-theme .student-setting-card .btn:not(.btn-primary):not(.btn-danger),
.admin-dark-theme .student-courses-section button,
.admin-dark-theme .student-profile-card button {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme .student-setting-card .btn:not(.btn-primary):not(.btn-danger):hover,
.admin-dark-theme .student-courses-section button:hover,
.admin-dark-theme .student-profile-card button:hover {
    background:#263752 !important;
    border-color:#4c6384 !important;
    color:#ffffff !important;
}


/* Опасная зона */
.admin-dark-theme .student-danger-zone h2,
.admin-dark-theme .student-danger-zone h3 {
    color:#ffb0ba !important;
}

.admin-dark-theme .student-danger-zone p {
    color:#c99ca6 !important;
}

/* ==========================================
   Настройки ученика — карточки назначенных курсов
   ========================================== */

.admin-dark-theme .student-admin-course-card {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}

.admin-dark-theme .student-admin-course-main,
.admin-dark-theme .student-admin-course-copy {
    background:transparent !important;
    color:#edf3fc !important;
}

.admin-dark-theme .student-admin-course-title-row h3,
.admin-dark-theme .student-admin-course-title-row,
.admin-dark-theme .student-admin-course-copy h3 {
    color:#edf3fc !important;
}

.admin-dark-theme .student-admin-course-copy p,
.admin-dark-theme .student-admin-course-copy span,
.admin-dark-theme .student-admin-course-copy small {
    color:#9fb0c8 !important;
}


/* Иконка курса */

.admin-dark-theme .student-admin-course-icon {
    background:#24344d !important;
    color:#69a2ff !important;
}


/* Полоса прогресса */

.admin-dark-theme .student-admin-course-progress {
    background:#101a29 !important;
    border-color:#2b3a50 !important;
}

.admin-dark-theme .student-admin-course-progress > div {
    background:#397cff !important;
}


/* Кнопка удаления курса справа */

.admin-dark-theme .student-admin-course-card button {
    background:#101a29 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme .student-admin-course-card button:hover {
    background:#263752 !important;
    border-color:#4c6384 !important;
    color:#ffffff !important;
}

/* ==========================================
   Модальные окна — тёмная тема
   ========================================== */

.admin-dark-theme .modal-content {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:0 20px 60px rgba(0,0,0,.45) !important;
}

.admin-dark-theme .modal-header,
.admin-dark-theme .modal-footer {
    background:#182438 !important;
    border-color:#2b3a50 !important;
    color:#edf3fc !important;
}

.admin-dark-theme .modal-body {
    background:#182438 !important;
    color:#edf3fc !important;
}


/* Заголовок и описание */

.admin-dark-theme .modal-title,
.admin-dark-theme .modal-header h1,
.admin-dark-theme .modal-header h2,
.admin-dark-theme .modal-header h3 {
    color:#edf3fc !important;
}

.admin-dark-theme .modal-header p,
.admin-dark-theme .modal-body p,
.admin-dark-theme .modal-body small,
.admin-dark-theme .modal-body .form-text {
    color:#9fb0c8 !important;
}


/* Подписи полей */

.admin-dark-theme .modal-body label,
.admin-dark-theme .modal-body .form-label {
    color:#aebdd2 !important;
}


/* Поля формы */

.admin-dark-theme .modal-body input,
.admin-dark-theme .modal-body textarea,
.admin-dark-theme .modal-body select,
.admin-dark-theme .modal-body .form-control,
.admin-dark-theme .modal-body .form-select {
    background:#101a29 !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme .modal-body input::placeholder,
.admin-dark-theme .modal-body textarea::placeholder {
    color:#7f91aa !important;
}

.admin-dark-theme .modal-body select option {
    background:#101a29 !important;
    color:#edf3fc !important;
}


/* Крестик закрытия */

.admin-dark-theme .modal-header .btn-close,
.admin-dark-theme .modal-close,
.admin-dark-theme .close-modal {
    filter:invert(1) grayscale(1) brightness(1.8);
    opacity:.75;
}

.admin-dark-theme .modal-header .btn-close:hover,
.admin-dark-theme .modal-close:hover,
.admin-dark-theme .close-modal:hover {
    opacity:1;
}


/* Кнопка отмены */

.admin-dark-theme .modal-footer .btn-secondary,
.admin-dark-theme .modal-footer .btn-light,
.admin-dark-theme .modal-footer .cancel-button {
    background:#24344d !important;
    border-color:#34445d !important;
    color:#edf3fc !important;
}

.admin-dark-theme .modal-footer .btn-secondary:hover,
.admin-dark-theme .modal-footer .btn-light:hover,
.admin-dark-theme .modal-footer .cancel-button:hover {
    background:#2d405e !important;
    color:#ffffff !important;
}


/* Затемнение фона за модальным окном */

.admin-dark-theme .modal-backdrop,
.admin-dark-theme .modal-overlay {
    background:rgba(3,8,16,.78) !important;
}

/* ==========================================
   Страница тестирования
   ========================================== */

/* Все секции страницы урока */

.admin-dark-theme .lesson-page .lesson-section{
    background:#182438!important;
    border:1px solid #2b3a50!important;
    color:#edf3fc!important;
    box-shadow:none!important;
}

/* Заголовки секций */

.admin-dark-theme .lesson-page .lesson-section-heading,
.admin-dark-theme .lesson-page .lesson-section-heading h2,
.admin-dark-theme .lesson-page .lesson-section-heading h3{
    color:#edf3fc!important;
}

/* Подписи */

.admin-dark-theme .lesson-page .lesson-section p,
.admin-dark-theme .lesson-page .lesson-section small,
.admin-dark-theme .lesson-page .lesson-section span{
    color:#9fb0c8!important;
}

/* Зона файлов */

.admin-dark-theme .lesson-files-empty,
.admin-dark-theme .lesson-files-dropzone,
.admin-dark-theme .lesson-files-list{
    background:#101a29!important;
    border:1px dashed #34445d!important;
    color:#9fb0c8!important;
}

/* ==========================================
   Тестирование
   ========================================== */

/* Карточка вопроса */

.admin-dark-theme .lesson-question-card{
    background:#1d2a40!important;
    border:1px solid #34445d!important;
    color:#edf3fc!important;
}

/* Номер вопроса */

.admin-dark-theme .lesson-question-number{
    color:#69a2ff!important;
    font-weight:700;
}

/* Текст вопроса */

.admin-dark-theme .lesson-question-card h3,
.admin-dark-theme .lesson-question-card p{
    color:#edf3fc!important;
}

/* Контейнер вариантов */

.admin-dark-theme .lesson-options-list{
    background:transparent!important;
}

/* Каждый вариант ответа */

.admin-dark-theme .lesson-option{
    display:block;
    background:#101a29!important;
    border:1px solid #34445d!important;
    color:#edf3fc!important;
    border-radius:10px;
    padding:12px 16px;
    margin-bottom:10px;
    transition:.2s;
}

/* Наведение */

.admin-dark-theme .lesson-option:hover{
    background:#24344d!important;
    border-color:#4d6386!important;
}

/* Выбранный вариант */

.admin-dark-theme .lesson-option:has(input:checked){
    background:#2d4670!important;
    border-color:#4f86ff!important;
}

/* Радиокнопки */

.admin-dark-theme .lesson-option input{
    accent-color:#4f86ff;
}

/* Кнопка отправки теста */

.admin-dark-theme .lesson-test-form button{
    background:#2d6df6!important;
    border-color:#2d6df6!important;
    color:#fff!important;
}

.admin-dark-theme .lesson-test-form button:hover{
    background:#3f7dff!important;
}

/* ==========================================
   Корзина удалённых курсов
   ========================================== */

.admin-dark-theme .trash-card{
    background:#182438!important;
    border:1px solid #2b3a50!important;
    color:#edf3fc!important;
}

.admin-dark-theme .trash-card .table-responsive{
    background:#182438!important;
}

.admin-dark-theme .trash-card .modern-table{
    background:#182438!important;
    color:#edf3fc!important;
}

.admin-dark-theme .trash-card .modern-table thead{
    background:#24344d!important;
}

.admin-dark-theme .trash-card .modern-table tbody tr{
    background:#182438!important;
    color:#edf3fc!important;
}

.admin-dark-theme .trash-card .modern-table tbody tr:nth-child(even){
    background:#1d2a40!important;
}

.admin-dark-theme .trash-card .modern-table td,
.admin-dark-theme .trash-card .modern-table th{
    border-color:#34445d!important;
}

/* Корзина — кнопка "Удалённые курсы" */

.admin-dark-theme .trash-card .trash-toggle,
.admin-dark-theme .trash-card .trash-toggle.collapsed {
    width:100%;
    background:#182438 !important;
    border:1px solid #2b3a50 !important;
    color:#edf3fc !important;
    box-shadow:none !important;
}

.admin-dark-theme .trash-card .trash-toggle:hover,
.admin-dark-theme .trash-card .trash-toggle:focus {
    background:#1d2a40 !important;
    border-color:#34445d !important;
    color:#ffffff !important;
}

.admin-dark-theme .trash-card .trash-toggle span,
.admin-dark-theme .trash-card .trash-toggle i {
    color:#edf3fc !important;
}

.admin-dark-theme .trash-card #folder2,
.admin-dark-theme .trash-card #folder2 .table-responsive {
    background:#182438 !important;
    border-color:#2b3a50 !important;
}

/* ==========================================
   Ученики — "На проверке"
   ========================================== */

.admin-body .badge.bg-warning.text-dark {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;

    padding: 6px 10px !important;

    background: #fff1d6 !important;
    color: #b86d00 !important;

    border: none !important;
    border-radius: 7px !important;

    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    text-decoration: none !important;
    box-shadow: none !important;
}

.admin-body .badge.bg-warning.text-dark::before {
    content: "";
    display: block;

    width: 6px;
    height: 6px;

    background: #ffa20a;
    border-radius: 50%;

    flex: 0 0 6px;
}

.admin-body .badge.bg-warning.text-dark:hover {
    background: #ffe5b3 !important;
    color: #9a5c00 !important;
    text-decoration: none !important;
}

/* ==========================================
   Практические задания ученика
   ========================================== */

.admin-tasks-page {
    width: 100%;
}


/* Заголовок страницы */

.admin-tasks-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 14px;
}

.admin-tasks-header h2 {
    margin: 0 0 6px 0;

    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;

    color: #0f1f33;
}

.admin-tasks-student {
    margin: 0;

    font-size: 14px;
    color: #74839a;
}


/* Кнопка назад */

.admin-tasks-back {
    display: inline-flex;
    align-items: center;

    margin-bottom: 18px;
    padding: 8px 12px;

    border: 1px solid #d8e0eb;
    border-radius: 8px;

    background: #ffffff;
    color: #56657a;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

    transition: 0.15s ease;
}

.admin-tasks-back:hover {
    background: #f4f7fb;
    border-color: #cbd5e2;

    color: #24364f;
    text-decoration: none;
}


/* Карточка задания */

.admin-task-card {
    overflow: hidden;

    margin-bottom: 20px;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(15, 31, 51, 0.04);
}


/* Верх карточки */

.admin-task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 16px 18px;

    background: #f7f9fc;

    border-bottom: 1px solid #e2e8f0;
}

.admin-task-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;

    color: #16263c;
}

.admin-task-date {
    flex-shrink: 0;

    padding: 5px 9px;

    background: #edf2f8;
    border-radius: 7px;

    font-size: 12px;
    font-weight: 500;

    color: #68788f;
}


/* Тело */

.admin-task-card-body {
    padding: 18px;
}


/* Список вопросов */

.admin-task-questions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Один вопрос */

.admin-task-question {
    padding: 14px 16px;

    background: #f8fafc;

    border: 1px solid #e4eaf2;
    border-radius: 10px;
}


/* Заголовок вопроса */

.admin-task-question-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;

    color: #1b2b42;
}


/* Номер вопроса */

.admin-task-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 24px;
    height: 24px;

    padding: 0 7px;

    background: #edf3ff;
    color: #2d6df6;

    border-radius: 7px;

    font-size: 11px;
    font-weight: 700;

    flex-shrink: 0;
}


/* Ответ */

.admin-task-answer {
    margin-top: 12px;
    padding-top: 12px;

    border-top: 1px solid #e5eaf1;
}

.admin-task-answer-label {
    display: block;

    margin-bottom: 5px;

    font-size: 11px;
    font-weight: 700;

    color: #8190a5;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-task-answer-text {
    font-size: 14px;
    line-height: 1.55;

    color: #314157;

    white-space: pre-wrap;
    word-break: break-word;
}


/* Кнопки */

.admin-task-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid #e5eaf1;
}

.admin-task-actions form {
    margin: 0;
}

.admin-task-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 36px;

    padding: 8px 14px;

    border: 0;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.15s ease;
}


/* Принять */

.admin-task-btn-accept {
    background: #e6f7ef;
    color: #159765;
}

.admin-task-btn-accept:hover {
    background: #d7f2e5;
    color: #107b52;
}


/* Отклонить */

.admin-task-btn-reject {
    background: #fdebec;
    color: #dc4453;
}

.admin-task-btn-reject:hover {
    background: #fbdcdf;
    color: #bd3341;
}


/* Уже принято */

.admin-task-completed {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;

    background: #e8f7f0;
    color: #149567;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;
}

.admin-task-completed-dot {
    width: 6px;
    height: 6px;

    background: #1daf79;
    border-radius: 50%;
}


/* Нет заданий */

.admin-tasks-empty {
    padding: 25px;

    background: #ffffff;

    border: 1px solid #dfe6ef;
    border-radius: 12px;

    color: #7b899d;
    font-size: 14px;

    text-align: center;
}


/* ==========================================
   Практические задания — тёмная тема
   ========================================== */

.admin-dark-theme .admin-tasks-header h2 {
    color: #edf3fc;
}

.admin-dark-theme .admin-tasks-student {
    color: #9fb0c8;
}

.admin-dark-theme .admin-tasks-back {
    background: #182438;
    border-color: #2b3a50;

    color: #b5c2d5;
}

.admin-dark-theme .admin-tasks-back:hover {
    background: #1d2a40;
    border-color: #34445d;

    color: #edf3fc;
}

.admin-dark-theme .admin-task-card {
    background: #182438;
    border-color: #2b3a50;

    box-shadow: none;
}

.admin-dark-theme .admin-task-card-header {
    background: #1d2a40;
    border-bottom-color: #2b3a50;
}

.admin-dark-theme .admin-task-title {
    color: #edf3fc;
}

.admin-dark-theme .admin-task-date {
    background: #24334a;
    color: #9fb0c8;
}

.admin-dark-theme .admin-task-question {
    background: #1d2a40;
    border-color: #2b3a50;
}

.admin-dark-theme .admin-task-question-title {
    color: #edf3fc;
}

.admin-dark-theme .admin-task-number {
    background: rgba(79, 134, 255, 0.12);
    color: #72a0ff;
}

.admin-dark-theme .admin-task-answer {
    border-top-color: #2b3a50;
}

.admin-dark-theme .admin-task-answer-label {
    color: #8294ad;
}

.admin-dark-theme .admin-task-answer-text {
    color: #c7d3e4;
}

.admin-dark-theme .admin-task-actions {
    border-top-color: #2b3a50;
}

.admin-dark-theme .admin-tasks-empty {
    background: #182438;
    border-color: #2b3a50;

    color: #9fb0c8;
}

/* =========================================================
   ЧАТ — ЕДИНЫЙ ДИЗАЙН
   ========================================================= */


/* ---------------------------------------------------------
   Плавающая кнопка чата
   --------------------------------------------------------- */

.chat-toggle,
.admin-chat-toggle {
    width: 52px !important;
    height: 52px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: none !important;
    border-radius: 16px !important;

    background: #2d6df6 !important;
    color: #ffffff !important;

    box-shadow: 0 8px 24px rgba(45, 109, 246, 0.24) !important;

    cursor: pointer !important;

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease !important;
}

.chat-toggle:hover,
.admin-chat-toggle:hover {
    background: #3f7dff !important;

    transform: translateY(-2px);

    box-shadow: 0 10px 28px rgba(45, 109, 246, 0.30) !important;
}


/* ---------------------------------------------------------
   Счётчик непрочитанных
   --------------------------------------------------------- */

.chat-badge {
    min-width: 18px !important;
    height: 18px !important;

    padding: 0 5px !important;

    display: none;
    align-items: center !important;
    justify-content: center !important;

    position: absolute;

    border: 2px solid #ffffff !important;
    border-radius: 999px !important;

    background: #ffa20a !important;
    color: #ffffff !important;

    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}


/* =========================================================
   ЧАТ УЧЕНИКА
   ========================================================= */

.chat-window {
    overflow: hidden !important;

    flex-direction: column !important;

    background: #ffffff !important;

    border: 1px solid #dfe6ef !important;
    border-radius: 16px !important;

    box-shadow: 0 16px 45px rgba(15, 31, 51, 0.16) !important;
}


/* Шапка */

.chat-header {
    min-height: 54px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    padding: 0 16px !important;

    background: #ffffff !important;

    border-bottom: 1px solid #e5eaf1 !important;

    color: #16263c !important;

    font-size: 14px !important;
    font-weight: 700 !important;
}


/* Кнопка закрытия */

#chatClose {
    width: 30px !important;
    height: 30px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;

    border: none !important;
    border-radius: 8px !important;

    background: transparent !important;
    color: #7b899d !important;

    font-size: 15px !important;
    line-height: 1 !important;

    cursor: pointer !important;

    transition: 0.15s ease !important;
}

#chatClose:hover {
    background: #f1f4f8 !important;
    color: #24364f !important;
}


/* =========================================================
   ОБЩАЯ ОБЛАСТЬ СООБЩЕНИЙ
   ========================================================= */

.chat-messages {
    flex: 1 !important;

    padding: 16px !important;

    overflow-y: auto !important;

    background: #f7f9fc !important;

    scrollbar-width: thin;
    scrollbar-color: #cbd5e2 transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e2;
    border-radius: 999px;
}


/* Одно сообщение */

.chat-message {
    width: fit-content;
    max-width: 78%;

    margin: 0 0 10px 0 !important;
    padding: 9px 12px !important;

    background: #ffffff !important;
    color: #314157 !important;

    border: 1px solid #e1e7ef !important;
    border-radius: 12px 12px 12px 4px !important;

    font-size: 13px !important;
    line-height: 1.45 !important;

    overflow-wrap: anywhere;

    box-shadow: 0 1px 3px rgba(15, 31, 51, 0.04) !important;
}


/* Моё сообщение */

.chat-message.mine {
    margin-left: auto !important;

    background: #2d6df6 !important;
    color: #ffffff !important;

    border-color: #2d6df6 !important;
    border-radius: 12px 12px 4px 12px !important;

    box-shadow: 0 3px 10px rgba(45, 109, 246, 0.14) !important;
}


/* =========================================================
   ФОРМА ОТПРАВКИ
   ========================================================= */

.chat-form {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;

    padding: 12px !important;

    background: #ffffff !important;

    border-top: 1px solid #e5eaf1 !important;
}


/* Поля ввода */

.chat-form input,
#chatInput,
#adminChatForm input {
    flex: 1 !important;

    min-width: 0 !important;
    height: 40px !important;

    padding: 0 13px !important;

    background: #f8fafc !important;
    color: #26384f !important;

    border: 1px solid #dbe3ed !important;
    border-radius: 10px !important;

    outline: none !important;

    font-size: 13px !important;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease !important;
}

.chat-form input::placeholder,
#chatInput::placeholder,
#adminChatForm input::placeholder {
    color: #9aa7b8 !important;
}

.chat-form input:focus,
#chatInput:focus,
#adminChatForm input:focus {
    background: #ffffff !important;

    border-color: #4f86ff !important;

    box-shadow: 0 0 0 3px rgba(79, 134, 255, 0.10) !important;
}


/* Кнопка отправки */

.chat-form button,
#adminChatForm button {
    width: 40px !important;
    height: 40px !important;

    flex: 0 0 40px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;

    border: none !important;
    border-radius: 10px !important;

    background: #2d6df6 !important;
    color: #ffffff !important;

    cursor: pointer !important;

    transition: 0.15s ease !important;
}

.chat-form button:hover,
#adminChatForm button:hover {
    background: #3f7dff !important;

    transform: translateY(-1px);
}


/* =========================================================
   АДМИНСКИЙ ЧАТ
   ========================================================= */

.admin-chat-window {
    overflow: hidden !important;

    background: #ffffff !important;

    border: 1px solid #dfe6ef !important;
    border-radius: 16px !important;

    box-shadow: 0 16px 45px rgba(15, 31, 51, 0.18) !important;
}


/* Левая колонка */

.admin-chat-users {
    background: #f8fafc !important;

    border-right: 1px solid #e2e8f0 !important;
}


/* Заголовок "Ученики" */

.admin-chat-column-title {
    min-height: 54px !important;

    display: flex !important;
    align-items: center !important;

    padding: 0 15px !important;

    background: #ffffff !important;

    border-bottom: 1px solid #e5eaf1 !important;

    color: #16263c !important;

    font-size: 13px !important;
    font-weight: 700 !important;
}


/* Правая колонка */

.admin-chat-dialog {
    min-width: 0 !important;

    display: flex !important;
    flex-direction: column !important;

    background: #ffffff !important;
}


/* Заголовок диалога */

.admin-chat-header {
    min-height: 54px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    padding: 0 14px !important;

    background: #ffffff !important;

    border-bottom: 1px solid #e5eaf1 !important;

    color: #16263c !important;

    font-size: 13px !important;
    font-weight: 700 !important;
}


/* Кнопки внутри заголовка админ-чата */

.admin-chat-header button {
    width: 30px !important;
    height: 30px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;

    border: none !important;
    border-radius: 8px !important;

    background: transparent !important;
    color: #7b899d !important;

    cursor: pointer !important;

    transition: 0.15s ease !important;
}

.admin-chat-header button:hover {
    background: #f1f4f8 !important;
    color: #24364f !important;
}


/* Сообщение администратора */

.chat-message.mine.admin {
    background: #2d6df6 !important;
    color: #ffffff !important;
    border-color: #2d6df6 !important;
}


/* =========================================================
   ТЁМНАЯ ТЕМА
   ========================================================= */

.admin-dark-theme .admin-chat-window,
.admin-dark-theme .chat-window {
    background: #182438 !important;

    border-color: #2b3a50 !important;

    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28) !important;
}


.admin-dark-theme .chat-header,
.admin-dark-theme .admin-chat-header,
.admin-dark-theme .admin-chat-column-title {
    background: #182438 !important;

    border-color: #2b3a50 !important;

    color: #edf3fc !important;
}


.admin-dark-theme .admin-chat-users {
    background: #162135 !important;

    border-color: #2b3a50 !important;
}


.admin-dark-theme .admin-chat-dialog {
    background: #182438 !important;
}


.admin-dark-theme .chat-messages {
    background: #131e30 !important;

    scrollbar-color: #34445d transparent;
}


.admin-dark-theme .chat-message {
    background: #1d2a40 !important;

    border-color: #2b3a50 !important;

    color: #d6e0ee !important;

    box-shadow: none !important;
}


.admin-dark-theme .chat-message.mine,
.admin-dark-theme .chat-message.mine.admin {
    background: #2d6df6 !important;

    border-color: #2d6df6 !important;

    color: #ffffff !important;
}


.admin-dark-theme .chat-form {
    background: #182438 !important;

    border-color: #2b3a50 !important;
}


.admin-dark-theme .chat-form input,
.admin-dark-theme #chatInput,
.admin-dark-theme #adminChatForm input {
    background: #1d2a40 !important;
    color: #edf3fc !important;

    border-color: #2b3a50 !important;
}


.admin-dark-theme .chat-form input:focus,
.admin-dark-theme #chatInput:focus,
.admin-dark-theme #adminChatForm input:focus {
    background: #202f47 !important;

    border-color: #4f86ff !important;

    box-shadow: 0 0 0 3px rgba(79, 134, 255, 0.13) !important;
}


.admin-dark-theme #chatClose,
.admin-dark-theme .admin-chat-header button {
    color: #9fb0c8 !important;
}


.admin-dark-theme #chatClose:hover,
.admin-dark-theme .admin-chat-header button:hover {
    background: #24334a !important;
    color: #edf3fc !important;
}

/* =========================================================
   FIX: чат — чистый единый стиль без старых вложенных плашек
   ========================================================= */


/* ---------- ОБЩЕЕ ОКНО ---------- */

.chat-window,
.admin-chat-window {
    background: #ffffff !important;
    border: 1px solid #dfe6ef !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 35px rgba(15, 31, 51, 0.14) !important;
}


/* ---------- ШАПКИ ---------- */

.chat-header,
.admin-chat-header,
.admin-chat-column-title {
    background: #ffffff !important;
    color: #16263c !important;

    border-bottom: 1px solid #e5eaf1 !important;

    font-weight: 700 !important;
}


/* ---------- ЛЕВАЯ КОЛОНКА АДМИНА ---------- */

.admin-chat-users {
    background: #f8fafc !important;
    border-right: 1px solid #e2e8f0 !important;
}


/* строка ученика */
.admin-chat-users > div:not(.admin-chat-column-title),
.admin-chat-user {
    background: transparent !important;
    color: #26384f !important;

    border: none !important;
    border-radius: 8px !important;

    padding: 10px 12px !important;
    margin: 4px 6px !important;

    cursor: pointer !important;
}


/* активный ученик */
.admin-chat-users > div:not(.admin-chat-column-title):hover,
.admin-chat-user:hover {
    background: #eef3fb !important;
}

.admin-chat-users .active,
.admin-chat-user.active {
    background: #eaf1ff !important;
    color: #2d6df6 !important;
    font-weight: 600 !important;
}


/* ---------- ОБЛАСТЬ СООБЩЕНИЙ ---------- */

.chat-messages {
    background: #f7f9fc !important;
    padding: 16px !important;
}


/* главное: убираем старые вложенные карточки */
.chat-message,
.chat-message * {
    box-shadow: none !important;
}


/* входящее сообщение */
.chat-message {
    display: block !important;

    width: fit-content !important;
    max-width: 76% !important;

    margin: 0 0 10px 0 !important;
    padding: 9px 12px !important;

    background: #ffffff !important;
    color: #314157 !important;

    border: 1px solid #e1e7ef !important;
    border-radius: 12px 12px 12px 4px !important;

    font-size: 13px !important;
    line-height: 1.45 !important;
}


/* всё внутри сообщения — прозрачное */
.chat-message > div,
.chat-message > span,
.chat-message > p {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
}


/* исходящее сообщение */
.chat-message.mine,
.chat-message.mine.admin {
    margin-left: auto !important;

    background: #2d6df6 !important;
    color: #ffffff !important;

    border: none !important;
    border-radius: 12px 12px 4px 12px !important;

    box-shadow: 0 3px 10px rgba(45, 109, 246, 0.16) !important;
}


/* всё внутри исходящего тоже прозрачное */
.chat-message.mine > div,
.chat-message.mine > span,
.chat-message.mine > p,
.chat-message.mine.admin > div,
.chat-message.mine.admin > span,
.chat-message.mine.admin > p {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
}


/* ---------- ВРЕМЯ / ИМЯ ---------- */

.chat-message small,
.chat-message .time,
.chat-message .chat-time,
.chat-message .sender,
.chat-message .chat-sender {
    display: block !important;

    margin-bottom: 4px !important;

    color: #8a98aa !important;

    font-size: 10px !important;
    line-height: 1.2 !important;
}

.chat-message.mine small,
.chat-message.mine .time,
.chat-message.mine .chat-time,
.chat-message.mine .sender,
.chat-message.mine .chat-sender {
    color: rgba(255, 255, 255, 0.72) !important;
}


/* ---------- ФОРМА ---------- */

.chat-form {
    background: #ffffff !important;

    border-top: 1px solid #e5eaf1 !important;

    padding: 10px !important;
    gap: 8px !important;
}

.chat-form input {
    height: 40px !important;

    background: #f8fafc !important;
    color: #26384f !important;

    border: 1px solid #dbe3ed !important;
    border-radius: 10px !important;

    padding: 0 12px !important;

    outline: none !important;
}

.chat-form input:focus {
    background: #ffffff !important;
    border-color: #4f86ff !important;
    box-shadow: 0 0 0 3px rgba(79, 134, 255, 0.10) !important;
}

.chat-form button {
    width: 40px !important;
    height: 40px !important;

    border: none !important;
    border-radius: 10px !important;

    background: #2d6df6 !important;
    color: #ffffff !important;

    box-shadow: none !important;
}


/* ---------- КНОПКИ ЗАКРЫТИЯ ---------- */

#chatClose,
.admin-chat-header button {
    background: transparent !important;
    color: #7f8da0 !important;

    border: none !important;
    border-radius: 8px !important;
}

#chatClose:hover,
.admin-chat-header button:hover {
    background: #f1f4f8 !important;
    color: #24364f !important;
}


/* ---------- ТЁМНАЯ ТЕМА ---------- */

.admin-dark-theme .chat-window,
.admin-dark-theme .admin-chat-window {
    background: #182438 !important;
    border-color: #2b3a50 !important;
}

.admin-dark-theme .chat-header,
.admin-dark-theme .admin-chat-header,
.admin-dark-theme .admin-chat-column-title {
    background: #182438 !important;
    color: #edf3fc !important;
    border-color: #2b3a50 !important;
}

.admin-dark-theme .admin-chat-users {
    background: #162135 !important;
    border-color: #2b3a50 !important;
}

.admin-dark-theme .chat-messages {
    background: #131e30 !important;
}

.admin-dark-theme .chat-message {
    background: #1d2a40 !important;
    color: #d6e0ee !important;
    border-color: #2b3a50 !important;
}

.admin-dark-theme .chat-message.mine,
.admin-dark-theme .chat-message.mine.admin {
    background: #2d6df6 !important;
    color: #ffffff !important;
    border: none !important;
}

.admin-dark-theme .chat-form {
    background: #182438 !important;
    border-color: #2b3a50 !important;
}

.admin-dark-theme .chat-form input {
    background: #1d2a40 !important;
    color: #edf3fc !important;
    border-color: #2b3a50 !important;
}