/* ============================================
   ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ КУРСОВ
   ============================================ */

.course-container {
    color: rgb(47, 87, 85);
    width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.course-content {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 40px;
}

/* ─── Содержание (боковая панель) ─── */
.table-of-contents {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(67, 35, 35, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

    .table-of-contents h2 {
        color: rgb(47, 87, 85);
        margin-bottom: 20px;
        font-size: 1.3rem;
    }

.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 8px;
}

.toc-nav a {
    color: rgb(38, 76, 73);
    text-decoration: none;
    padding: 5px 0 5px 10px;
    display: block;
    transition: color 0.3s;
    border-left: 3px solid transparent;
}

    .toc-nav a:hover {
        color: rgb(90, 150, 144);
        border-left-color: rgb(90, 150, 144);
        background-color: rgba(174, 216, 212, 0.1);
        border-radius: 4px;
    }

.toc-nav ul ul {
    margin-left: 15px;
    margin-top: 5px;
}

    .toc-nav ul ul a {
        font-size: 0.9rem;
        color: rgb(47, 87, 85);
    }

/* ─── Материал курса ─── */
.course-material {
    color: rgb(47, 87, 85);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(59, 35, 67, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.chapter {
    margin-bottom: 50px;
}

    .chapter h1 {
        color: rgb(47, 87, 85);
        margin-bottom: 30px;
    }

    .chapter h2 {
        color: rgb(47, 87, 85);
        border-bottom: 1px solid rgb(224, 217, 217);
        padding-bottom: 10px;
        margin-bottom: 25px;
    }

.lesson {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgb(224, 217, 217);
}

    .lesson:last-child {
        border-bottom: none;
    }

    .lesson h3 {
        color: rgb(38, 76, 73);
        margin-bottom: 20px;
        font-size: 1.15rem;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(90, 150, 144, 0.3);
    }

.text-content h4 {
    color: rgb(47, 87, 85);
    margin-top: 1.6em;
    margin-bottom: 0.7em;
    font-size: 1rem;
}

.text-content p {
    margin-bottom: 1em;
    line-height: 1.7;
}

/* ─── Листинги (блоки кода) ─── */
.content-placeholder {
    background: rgb(243, 246, 246);
    padding: 18px 20px;
    border-radius: 8px;
    border-left: 4px solid rgb(90, 150, 144);
    color: rgb(47, 87, 85);
    font-family: 'Courier New', monospace;
    font-size: 0.87rem;
    font-style: normal;
    line-height: 1.75;
    margin-bottom: 1em;
    margin-top: 1em;
}

/* ─── Встроенный код в тексте ─── */
code {
    background: rgb(243, 246, 246);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: rgb(47, 87, 85);
}

/* ─── Раздел с практическими заданиями ─── */
.practice-section {
    text-align: center;
    padding: 30px;
    background: rgba(90, 150, 144, 0.07);
    border-radius: 8px;
    border: 2px solid rgb(90, 150, 144);
}

    .practice-section p {
        margin-bottom: 16px;
        font-size: 1.05rem;
    }

/* ─── Списки ─── */
ol {
    margin-left: 30px;
}

ul {
    margin-left: 40px;
    margin-top: 0.6em;
    margin-bottom: 0.8em;
}

li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* ─── Таблицы в контенте курса ─── */
.course-material table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.course-material th {
    background: rgb(47, 87, 85);
    color: white;
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #ccc;
}

.course-material td {
    padding: 9px 14px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.course-material tr:nth-child(even) td {
    background: rgb(243, 246, 246);
}

/* ─── Блок предпросмотра (web-course) ─── */
.preview-block {
    margin-top: 24px;
    padding: 30px;
    background: rgba(90, 150, 144, 0.07);
    border: 2px solid rgb(90, 150, 144);
    border-radius: 12px;
    text-align: center;
}

.preview-btn {
    display: inline-block;
    background: rgb(47, 87, 85);
    color: white;
    padding: 13px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

    .preview-btn:hover {
        background: rgb(90, 150, 144);
    }

.preview-note {
    margin-top: 12px;
    font-size: 0.88rem;
    color: rgb(90, 150, 144);
    margin-bottom: 0;
}

/* ─── Плавная прокрутка к якорям ─── */
.chapter, .lesson {
    scroll-margin-top: 20px;
}

/* ============================================
   СТРАНИЦА ПРАКТИЧЕСКИХ ЗАДАНИЙ (sql-practice)
   ============================================ */

.pr-wrap {
    max-width: 1500px;
    margin: 0 auto;
}

.pr-h1 {
    font-size: 1.6rem;
    color: rgb(47, 87, 85);
    margin-bottom: 25px;
}

/* ─── Сетка ─── */
.pr-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 25px;
    align-items: start;
}

/* ─── Боковая панель ─── */
.pr-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(60, 35, 67, 0.1);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

.pr-topic {
    border-bottom: 1px solid rgb(224, 217, 217);
}

    .pr-topic:last-child {
        border-bottom: none;
    }

.pr-topic-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgb(47, 87, 85);
    background: white;
    transition: background 0.2s;
    user-select: none;
}

    .pr-topic-head:hover {
        background: rgba(90, 150, 144, 0.07);
    }

    .pr-topic-head span:first-child {
        flex: 1;
    }

.pr-topic-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgb(90, 150, 144);
}

.pr-arrow {
    font-size: 0.75rem;
    color: rgb(90, 150, 144);
    transition: transform 0.2s;
    display: inline-block;
}

.pr-topic--open .pr-arrow {
    transform: rotate(180deg);
}

.pr-topic-body {
    display: none;
    padding: 6px 0 10px 0;
    background: rgb(248, 248, 248);
}

.pr-topic--open .pr-topic-body {
    display: block;
}

.pr-task-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: rgb(47, 87, 85);
    text-decoration: none;
    transition: background 0.15s;
}

    .pr-task-link:hover {
        background: rgba(90, 150, 144, 0.1);
    }

.pr-task-link--active {
    background: rgba(90, 150, 144, 0.15);
    border-left: 3px solid rgb(47, 87, 85);
    font-weight: 600;
}

.pr-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.pr-dot--plain {
    background: #e0e0e0;
    color: rgb(47, 87, 85);
}

.pr-dot--done {
    background: rgb(47, 87, 85);
    color: white;
}

.pr-task-link--active .pr-dot--plain {
    background: rgb(90, 150, 144);
    color: white;
}

.pr-no-tasks {
    display: block;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* ─── Рабочая область ─── */
.pr-workspace {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(64, 35, 67, 0.1);
    padding: 30px;
    /* Важно: ограничиваем ширину чтобы таблицы не вылезали */
    min-width: 0;
    overflow: hidden;
}

.pr-task-desc {
    margin-bottom: 25px;
}

.pr-task-title {
    font-size: 1.2rem;
    color: rgb(47, 87, 85);
    margin-bottom: 10px;
    border-bottom: 1px solid rgb(224, 217, 217);
    padding-bottom: 10px;
}

.pr-task-text {
    font-size: 1rem;
    color: rgb(47, 87, 85);
    line-height: 1.7;
}

.pr-done-banner {
    display: inline-block;
    margin-top: 14px;
    background: rgba(47, 87, 85, 0.1);
    color: rgb(47, 87, 85);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ─── Кнопки просмотра таблиц ─── */
.pr-tables {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.pr-table-btn {
    background: rgb(47, 87, 85);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background 0.2s;
}

    .pr-table-btn:hover {
        background: rgb(90, 150, 144);
    }

/* ─── SQL-редактор ─── */
.pr-form {
    margin-bottom: 20px;
}

.pr-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: rgb(47, 87, 85);
    margin-bottom: 10px;
}

.pr-editor-wrap {
    position: relative;
    margin-bottom: 15px;
}

.pr-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 15px;
}

.pr-highlights {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
}

.pr-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid rgb(224, 217, 217);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    background: transparent;
    color: transparent;
    caret-color: #333;
    position: relative;
    z-index: 1;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

    .pr-form textarea:focus {
        border-color: rgb(90, 150, 144);
        outline: none;
        box-shadow: 0 0 0 3px rgba(90, 150, 144, 0.12);
    }

.pr-run-btn {
    background: rgb(47, 87, 85);
    color: white;
    padding: 11px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: background 0.2s;
}

    .pr-run-btn:hover {
        background: rgb(90, 150, 144);
    }

/* ─── Подсветка синтаксиса  ─── */
.sql-keyword {
    font-weight: bold;
    color: inherit;  
}
.sql-table {
    color: #039e0a;
    text-decoration: underline;
    font-weight: 600;
}

.sql-string {
    background-color: rgb(79, 241, 253);  
    color: #000000;             
    border-radius: 3px;
    padding: 0 2px;
}

.sql-comment {
    color: #2600ff; 
    font-style: italic;
}

.sql-function {
    font-weight: normal;
    color: inherit;
}

.sql-function {
    font-weight: normal;
    color: inherit;
}

/* ─── Сообщения ─── */
.pr-msg {
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 5px solid;
    font-size: 1rem;
    margin-bottom: 20px;
}

.pr-msg--ok {
    background: rgba(47, 87, 85, 0.08);
    color: rgb(47, 87, 85);
    border-left-color: rgb(47, 87, 85);
}

.pr-msg--info {
    background: rgba(90, 150, 144, 0.1);
    color: rgb(47, 87, 85);
    border-left-color: rgb(90, 150, 144);
}

.pr-msg--err {
    background: rgba(220, 53, 69, 0.08);
    color: #721c24;
    border-left-color: #dc3545;
}

/* ─── Таблица результатов ─── */
.pr-result {
    margin-top: 20px;
}

.pr-result-head {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(47, 87, 85);
    margin-bottom: 12px;
}

/* Контейнер с прокруткой — строго фиксированная ширина */
.pr-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 480px;
    border: 1px solid rgb(224, 217, 217);
    border-radius: 8px;
    /* Останавливаем расширение за пределы родителя */
    box-sizing: border-box;
    display: block;
}

.pr-table {
    border-collapse: collapse;
    white-space: nowrap;
    /* Растягиваем на всю ширину контейнера когда столбцов мало,
       но разрешаем выходить за неё когда столбцов много (тогда появится прокрутка) */
    min-width: 100%;
    width: max-content;
}

    .pr-table th {
        background: rgb(47, 87, 85);
        color: white;
        padding: 10px 14px;
        text-align: left;
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 5;
        /* Убираем жирные линии — только фон шапки отделяет */
        border: none;
    }

    .pr-table td {
        padding: 8px 14px;
        color: rgb(47, 87, 85);
        font-size: 0.95rem;
        /* Тонкий разделитель строк */
        border-bottom: 1px solid rgb(240, 236, 236);
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .pr-table tr:last-child td {
        border-bottom: none;
    }

    .pr-table tr:hover td {
        background: rgba(90, 150, 144, 0.07);
    }

.pr-empty {
    color: rgb(47, 87, 85);
    padding: 15px 0;
    font-size: 1rem;
}


/* ============================================
   ОБЩИЕ СТИЛИ ДЛЯ ADMIN-СТРАНИЦ
   ============================================ */

/* ─── Кнопки (единая система) ─── */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.2s, opacity 0.2s;
}

/* Нейтральная (назад, отмена) */
.btn:not([class*="btn-"]):hover,
.btn-neutral         { background: rgba(90, 150, 144, 0.15); color: rgb(47, 87, 85); }
.btn-neutral:hover   { background: rgba(90, 150, 144, 0.28); }

.btn-primary         { background: rgb(47, 87, 85); color: white; }
.btn-primary:hover   { background: rgb(90, 150, 144); }

.btn-edit            { background: rgba(110, 86, 160, 0.12); color: rgb(90, 65, 145); border: 1px solid rgba(110, 86, 160, 0.3); }
.btn-edit:hover      { background: rgba(110, 86, 160, 0.22); }

.btn-delete          { background: rgba(220, 53, 69, 0.1); color: #c0392b; border: 1px solid rgba(220, 53, 69, 0.3); }
.btn-delete:hover    { background: rgba(220, 53, 69, 0.22); }

.btn-small           { padding: 5px 11px; font-size: 0.8rem; }

/* ─── Уведомления ─── */
.alert {
    padding: 13px 18px;
    margin-bottom: 18px;
    border-radius: 8px;
    border-left: 5px solid;
    font-size: 0.95rem;
}
.alert-success { background: rgba(47, 87, 85, 0.08);  color: rgb(47, 87, 85); border-left-color: rgb(47, 87, 85); }
.alert-error   { background: rgba(220, 53, 69, 0.08); color: #721c24;         border-left-color: #dc3545; }

/* ─── Белая карточка (общая) ─── */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(47, 87, 85, 0.1);
    padding: 25px;
}

.admin-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgb(47, 87, 85);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(90, 150, 144, 0.35);
}

/* ─── Формы (tasks.php) ─── */
.admin-form .form-row     { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; }
.admin-form .form-group   { margin-bottom: 15px; }
.admin-form label         { display: block; margin-bottom: 5px; font-size: 0.9rem; font-weight: 600; color: rgb(47, 87, 85); }
.admin-form input,
.admin-form select,
.admin-form textarea      { width: 100%; padding: 10px 12px; border: 2px solid rgb(224, 217, 217); border-radius: 7px; font-size: 0.9rem; font-family: inherit; box-sizing: border-box; }
.admin-form textarea      { font-family: 'Consolas', 'Monaco', monospace; resize: vertical; }
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus { border-color: rgb(90, 150, 144); outline: none; }
.admin-form .hint         { display: block; margin-top: 4px; font-size: 0.8rem; color: rgb(47, 87, 85); opacity: 0.55; }
.admin-form .form-buttons { display: flex; gap: 10px; margin-top: 18px; }

/* ─── Таблица заданий (tasks.php) ─── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th,
.admin-table td          { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(90, 150, 144, 0.2); font-size: 0.9rem; color: rgb(47, 87, 85); }
.admin-table th          { background: rgba(90, 150, 144, 0.1); font-weight: 600; }
.admin-table tr:hover td { background: rgba(90, 150, 144, 0.05); }
.admin-table .actions    { white-space: nowrap; }

.topic-group             { margin-bottom: 28px; }
.topic-group h3          { font-size: 0.95rem; font-weight: 700; color: rgb(47, 87, 85); margin-bottom: 10px; }
.no-tasks                { color: rgb(47, 87, 85); opacity: 0.5; font-style: italic; padding: 8px 0; font-size: 0.9rem; }

/* ─── Статистика (users.php) ─── */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 20px 0;
}
.stat-card {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(47, 87, 85, 0.1);
    text-align: center;
}
.stat-card h3 { font-size: 1.8rem; color: rgb(47, 87, 85); margin-bottom: 4px; }
.stat-card p  { font-size: 0.85rem; color: rgb(47, 87, 85); opacity: 0.6; margin: 0; }

/* ─── Таблица пользователей (users.php) ─── */
.users-section           { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(47, 87, 85, 0.1); }
.users-section h2        { font-size: 1.05rem; font-weight: 700; color: rgb(47, 87, 85); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(90, 150, 144, 0.35); }
.table-container         { width: 100%; overflow-x: auto; }

.users-table             { width: 100%; min-width: 800px; border-collapse: collapse; }
.users-table th,
.users-table td          { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(90, 150, 144, 0.15); font-size: 0.9rem; color: rgb(47, 87, 85); }
.users-table th          { background: rgba(90, 150, 144, 0.1); font-weight: 600; }
.users-table tr:hover td { background: rgba(90, 150, 144, 0.05); }
.users-table tr.current-user td { background: rgba(47, 87, 85, 0.06); }
.users-table .actions    { white-space: nowrap; }

.badge        { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; margin-left: 5px; }
.badge-you    { background: rgb(90, 150, 144); color: white; }

.role-badge   { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.82rem; font-weight: 500; }
.role-1       { background: rgba(90, 150, 144, 0.18);  color: rgb(47, 87, 85); }
.role-2       { background: rgba(92, 107, 192, 0.18);  color: #3f51b5; }
.role-3       { background: rgba(110, 86, 160, 0.18);  color: rgb(90, 65, 145); }

.progress-mini     { width: 60px; height: 7px; background: rgba(90, 150, 144, 0.18); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 5px; }
.progress-bar-mini { height: 100%; background: rgb(90, 150, 144); border-radius: 4px; }

.role-form         { display: inline-block; margin-right: 8px; }
.role-form select  { padding: 4px 8px; border: 1px solid rgba(90, 150, 144, 0.4); border-radius: 6px; font-size: 0.85rem; color: rgb(47, 87, 85); }
.no-action         { color: rgb(47, 87, 85); opacity: 0.35; }

.admin-container { max-width: 1400px; margin: 0 auto; }


/* ============================================
   СТИЛИ ДЛЯ ЛИЧНОГО КАБИНЕТА (dashboard)
   ============================================ */

.db-wrap {
    max-width: 960px;
    margin: 0 auto;
}

.db-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px 36px;
    box-shadow: 0 6px 28px rgba(47, 87, 85, 0.12);
}

.db-h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(47, 87, 85);
    margin-bottom: 24px;
}

/* ─── Пользователь ─── */
.db-user-section {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.db-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgb(79, 57, 113);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.db-user-info {
    flex: 1;
    min-width: 180px;
}

.db-username {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgb(47, 87, 85);
    margin-bottom: 10px;
}

.db-meta-row {
    display: flex;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: rgb(47, 87, 85);
}

.db-meta-key {
    opacity: 0.55;
    min-width: 130px;
}

.db-meta-val {
    font-weight: 500;
}

.db-user-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

/* ─── Кнопки ─── */
.db-btn {
    display: block;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s, transform 0.15s;
}

.db-btn:hover {
    opacity: 0.82;
    transform: translateY(-1px);
}

.db-btn--teal {
    background: rgba(90, 150, 144, 0.15);
    color: rgb(47, 87, 85);
}

.db-btn--purple {
    background: rgba(99, 59, 187, 0.3);
    color: rgb(90, 65, 145);
    border: 1px solid rgba(110, 86, 160, 0.3);
}

.db-btn--logout {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: rgb(47, 87, 85);
    opacity: 0.6;
}

/* ─── Разделитель ─── */
.db-divider {
    height: 1px;
    background: rgba(90, 150, 144, 0.2);
    margin: 28px 0;
}

/* ─── Прогресс ─── */
.db-progress-row {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 32px;
    align-items: start;
}

.db-progress-sep {
    background: rgba(90, 150, 144, 0.2);
    min-height: 260px;
}

.db-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: rgb(47, 87, 85);
    margin-bottom: 16px;
}

/* Большой кружок по центру */
.db-circle-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.db-circle-wrap {
    position: relative;
    width: 120px;
    height: 120px;
}

.db-circle-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: rgb(47, 87, 85);
}

.db-circle-sub {
    font-size: 0.85rem;
    color: rgb(47, 87, 85);
    opacity: 0.6;
    margin-top: 6px;
    text-align: center;
}

.db-sub-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.db-sub-name {
    flex: 1;
    font-size: 0.88rem;
    color: rgb(47, 87, 85);
}

.db-sub-count {
    font-size: 0.82rem;
    color: rgb(47, 87, 85);
    opacity: 0.55;
    white-space: nowrap;
}

.db-tbar {
    height: 7px;
    background: rgba(90, 150, 144, 0.18);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.db-tbar-fill {
    height: 100%;
    border-radius: 4px;
    background: rgb(117, 99, 156);
}

/* ─── TOGGLE TOPIC ─── */
.topic-form {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.topic-done-btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid rgba(90, 150, 144, 0.4);
    background: rgba(90, 150, 144, 0.12);
    color: rgb(47, 87, 85);
    transition: all 0.2s ease;
}

.topic-done-btn.done {
    background: rgb(47, 87, 85);
    color: #fff;
    border-color: transparent;
}

.topic-done-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ============================================
   СТИЛИ ДЛЯ СТРАНИЦЫ КУРСОВ (courses.php)
   ============================================ */

.cs-wrap { max-width: 960px; margin: 0 auto; }
.cs-head { margin-bottom: 24px; margin-top: 20px; padding: 5px 0px; }
.cs-h1   { font-size: 1.5rem; font-weight: 600; color: rgb(47,87,85); }
.cs-sub  { font-size: .92rem; color: #555; }
.cs-sub strong { color: rgb(47,87,85); }

.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.cs-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(55, 35, 67, 0.14);
    transition: box-shadow 0.2s, transform 0.2s;
}
.cs-card:hover {
    box-shadow: 0 8px 28px rgba(130, 110, 172, 0.3);
    transform: translateY(-3px);
}

.cs-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cs-num { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; background: rgba(90,150,144,.17); color: rgb(47,87,85); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.cs-num--final { background: rgba(47,87,85,.13); }

.cs-card-title    { font-size: 1.3rem; font-weight: 640; color: rgb(47,87,85); }
.cs-card-sub      { font-size: .75rem; color: #888; margin-top: 2px; }
.cs-card-sub--teal{ color: rgb(90,150,144); font-weight: 500; }

.cs-done-badge { margin-left: auto; font-size: .72rem; background: rgba(130, 110, 172, .2); color: rgb(69, 47, 87); padding: 3px 10px; border-radius: 20px; font-weight: 500; white-space: nowrap; }

.cs-card-desc { font-size: .83rem; color: #555; line-height: 1.6; margin-bottom: 14px; }

.cs-bar-wrap { margin-bottom: 14px; }
.cs-bar      { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-bottom: 5px; }
.cs-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, rgb(60, 123, 117) 0%, rgb(130, 110, 172, .57) 100%); }
.cs-bar-meta { display: flex; justify-content: space-between; font-size: .75rem; color: #888; }

.cs-btn { display: inline-block; padding: 8px 18px; border-radius: 8px; font-size: .83rem; font-weight: 500; text-decoration: none; }
.cs-btn:hover { opacity: .85; }
.cs-btn--start, .cs-btn--continue { background: rgb(47,87,85); color: #fff; }
.cs-btn--repeat { background: rgba(90,150,144,.15); color: rgb(47,87,85); }