@import url('/static/css/course_chat_fab.css');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f7fb;
    color: #1f2937;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.65;
}

.page {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 18px 56px;
}

.hero {
    background: linear-gradient(135deg, #2f6fed, #6f42c1);
    color: white;
    padding: 32px;
    border-radius: 22px;
    margin-bottom: 24px;
    box-shadow: 0 16px 40px rgba(47, 111, 237, 0.22);
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
}

.hero p {
    margin: 0;
    font-size: 17px;
    opacity: 0.95;
}

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin: 18px 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card h2 {
    margin-top: 0;
    color: #243b6b;
}

.theory-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.theory-table {
    width: 100%;
    max-width: 360px;
    border-collapse: collapse;
    font-size: 15px;
}

.theory-table th,
.theory-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
}

.theory-table thead th {
    background: #f8fafc;
    color: #243b6b;
    font-weight: 600;
}

.theory-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.theory-table td:last-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.theory-table--code-first {
    max-width: 560px;
}

.theory-table--code-first td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
}

.theory-table--code-first td:last-child {
    font-family: inherit;
}

.ord-table-widget {
    margin: 18px 0 8px;
    border: 1px solid #dbe3f0;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fc 100%);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ord-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5ebf5;
    background: rgba(255, 255, 255, 0.72);
}

.ord-table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ord-table-tab {
    border: 1px solid #d7e0ef;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ord-table-tab:hover {
    border-color: #9db7ef;
    color: #1d4ed8;
}

.ord-table-tab.is-active {
    background: #2f6fed;
    border-color: #2f6fed;
    color: #fff;
}

.ord-table-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ord-table-search {
    min-width: 180px;
    border: 1px solid #d7e0ef;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    background: #fff;
}

.ord-table-search:focus {
    outline: 2px solid rgba(47, 111, 237, 0.25);
    border-color: #2f6fed;
}

.ord-table-detail {
    padding: 10px 16px;
    border-bottom: 1px solid #e5ebf5;
    background: #fff;
    font-size: 14px;
    color: #475569;
    min-height: 42px;
}

.ord-table-viewport {
    max-height: 420px;
    overflow: auto;
    background: #fff;
}

.ord-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.ord-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef3fb;
    color: #243b6b;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #dbe3f0;
    box-shadow: 0 1px 0 #dbe3f0;
}

.ord-table tbody td,
.ord-table tbody th {
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.ord-table tbody tr[data-code] {
    cursor: default;
    transition: background 0.12s ease;
}

.ord-table tbody tr[data-code]:hover,
.ord-table tbody tr[data-code]:focus-within {
    background: #f3f8ff;
}

.ord-table-code {
    width: 88px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #1d4ed8;
    font-weight: 700;
}

.ord-table-char {
    width: 72px;
    text-align: center;
    font-size: 1.15em;
    font-weight: 700;
    color: #0f172a;
}

.ord-table-label {
    color: #334155;
}

.ord-table-section th {
    position: sticky;
    top: 45px;
    z-index: 1;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ord-table-empty td {
    text-align: center;
    color: #94a3b8;
    padding: 28px 16px;
}

@media (max-width: 720px) {
    .ord-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ord-table-tools {
        width: 100%;
    }

    .ord-table-search {
        flex: 1;
        min-width: 0;
    }
}

.course-nav {
    margin-bottom: 16px;
}

.course-nav-link,
.lesson-nav a {
    color: #2f6fed;
    text-decoration: none;
    font-weight: 600;
}

.course-nav-link:hover,
.lesson-nav a:hover {
    text-decoration: underline;
}

.course-index .hero {
    margin-bottom: 28px;
}

.hero-badge {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.topic-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.topic-panel-head {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef2f7;
}

.topic-panel-head h2,
.topic-panel-head h3 {
    margin: 0;
    font-size: 28px;
    line-height: 1.25;
    color: #243b6b;
}

.topic-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.topic-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    min-height: 140px;
}

.topic-card:hover {
    transform: translateY(-3px);
    background: #fff;
    text-decoration: none;
}

.topic-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    margin-bottom: 14px;
    background-color: #2f6fed;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

.topic-card--theory .topic-card-icon {
    background-color: #2f6fed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253'/%3E%3C/svg%3E");
}

.topic-card--tasks .topic-card-icon {
    background-color: #16a34a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/%3E%3C/svg%3E");
}

.topic-card--video .topic-card-icon {
    background-color: #d97706;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.topic-card-title {
    margin: 0;
    flex: 1;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.topic-card--theory {
    border-top: 4px solid #2f6fed;
}

.topic-card--theory:hover {
    border-color: #2f6fed;
    box-shadow: 0 12px 28px rgba(47, 111, 237, 0.18);
}

.topic-card--tasks {
    border-top: 4px solid #22c55e;
}

.topic-card--tasks:hover {
    border-color: #22c55e;
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.18);
}

.topic-card--video {
    border-top: 4px solid #f59e0b;
}

.topic-card--video:hover {
    border-color: #f59e0b;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.2);
}

.topic-card-action {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #2f6fed;
}

.topic-card--tasks .topic-card-action {
    color: #15803d;
}

.topic-card--video .topic-card-action {
    color: #b45309;
}

.task-page h1 {
    margin-top: 0;
    font-size: 28px;
    color: #243b6b;
}

.task-page-intro {
    color: #4b5563;
    margin-bottom: 24px;
}

.task-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    display: flex;
    gap: 16px;
    padding: 18px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.task-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #2f6fed;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.task-item p {
    margin: 0 0 6px;
}

.task-item p:last-child {
    margin-bottom: 0;
}

.task-hint {
    font-size: 13px;
    color: #6b7280;
}

.page--tasks {
    max-width: 900px;
}

.tasks-page-head {
    margin-bottom: 24px;
}

.tasks-page-head h1 {
    margin: 0;
    font-size: 30px;
    color: #243b6b;
}

.cf-problem {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.cf-problem-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f7;
}

.cf-problem-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #243b6b;
}

.cf-solved-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
}

.cf-solved-badge[hidden] {
    display: none !important;
}

.cf-problem--solved {
    border-color: #86efac;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.1);
}

.cf-limits {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.cf-statement p {
    margin: 0 0 10px;
}

.cf-statement p:last-child {
    margin-bottom: 0;
}

.cf-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0f9ff;
    border-left: 4px solid #2f6fed;
    font-size: 14px;
    color: #1e40af;
}

.cf-io {
    margin: 20px 0;
}

.cf-io h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #374151;
    text-transform: lowercase;
}

.cf-io-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cf-io-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.cf-io-box {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    white-space: pre-wrap;
    color: #111827;
}

.cf-solver {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.cf-solver-hint {
    margin: 0 0 12px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.cf-solver-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.cf-code {
    width: 100%;
    min-height: 140px;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: #101827;
    color: #e5e7eb;
    tab-size: 4;
}

.cf-code:focus {
    outline: none;
    border-color: #2f6fed;
}

.cf-solver-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.cf-run-sample,
.cf-submit {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.cf-run-sample {
    background: #e8f0fe;
    color: #2f6fed;
}

.cf-run-sample:hover:not(:disabled) {
    background: #dbeafe;
}

.cf-submit {
    background: #22c55e;
    color: #fff;
}

.cf-submit:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
}

.cf-run-sample:disabled,
.cf-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.cf-verdict {
    margin: 0;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
}

.cf-verdict--ok {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.cf-verdict--wa {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.cf-verdict--error {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.cf-verdict--pending {
    background: #f8fafc;
    color: #6b7280;
}

.video-page h1 {
    margin-top: 0;
    font-size: 28px;
    color: #243b6b;
}

.video-page-topic {
    margin: 0 0 20px;
    color: #4b5563;
    font-size: 16px;
}

.video-single {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #101827;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.video-single::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.video-single iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.code-block {
    background: #101827;
    color: #e5e7eb;
    padding: 18px;
    border-radius: 14px;
    overflow-x: auto;
    font-size: 15px;
}

.inline-code {
    background: #eef2ff;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: Consolas, monospace;
}

.task {
    border-left: 5px solid #2f6fed;
}

.note {
    background: #fff7ed;
    border-color: #fed7aa;
}

.code-playground {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #c7d2fe;
    background: #f8fafc;
}

.code-playground-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.code-playground-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-playground-title {
    font-weight: 700;
    color: #243b6b;
}

.code-playground-status {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #4b5563;
}

.code-playground-status.success {
    background: #dcfce7;
    color: #166534;
}

.code-playground-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.code-playground-code,
.code-playground-stdin {
    width: 100%;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    resize: vertical;
    background: #101827;
    color: #e5e7eb;
}

.code-playground-code {
    min-height: 130px;
    max-height: 220px;
    margin-bottom: 8px;
}

.code-playground-stdin-wrap {
    margin-bottom: 8px;
    font-size: 13px;
    color: #4b5563;
}

.code-playground-stdin-wrap summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

.code-playground-stdin {
    display: block;
    width: 100%;
    margin-top: 8px;
    min-height: 48px;
    max-height: 100px;
    background: #fff;
    color: #1f2937;
}

.code-playground-run {
    padding: 8px 14px;
    font-size: 13px;
    border: none;
    border-radius: 10px;
    background: #22c55e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.code-playground-run:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
}

.code-playground-run:disabled {
    opacity: 0.7;
    cursor: wait;
}

.code-playground-output {
    margin: 0;
    min-height: 56px;
    max-height: 160px;
    overflow: auto;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dbe3ef;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    color: #1f2937;
}

@media (max-width: 900px) {
    .topic-cards {
        grid-template-columns: 1fr;
    }

    .topic-card {
        min-height: 0;
    }

    .topic-panel {
        padding: 20px 16px;
    }

    .topic-panel-head h2 {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 24px;
    }

    .hero h1 {
        font-size: 27px;
    }

    .lesson-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .cf-io-grid {
        grid-template-columns: 1fr;
    }

    .cf-solver-actions {
        flex-direction: column;
    }

    .cf-run-sample,
    .cf-submit {
        width: 100%;
    }

    .code-playground-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .code-playground-run {
        flex-shrink: 0;
    }
}

.course-user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 18px 0;
    font-size: 14px;
    color: #4b5563;
}

.course-user-bar[hidden] {
    display: none !important;
}

#courseUserName {
    font-weight: 700;
    color: #243b6b;
}

.course-logout-btn {
    padding: 6px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #fff;
    color: #2f6fed;
    font-weight: 600;
    cursor: pointer;
}

.course-logout-btn:hover {
    background: #e8f0fe;
}

.course-login-page .page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.course-login-card {
    width: 100%;
    max-width: 400px;
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.1);
}

.course-login-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    color: #243b6b;
}

.course-login-card > p {
    margin: 0 0 20px;
    color: #6b7280;
}

.course-login-card label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.course-login-card input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
}

.course-login-card button[type="submit"] {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #2f6fed;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.course-login-card button[type="submit"]:hover {
    background: #2559c7;
}

.course-login-error {
    min-height: 20px;
    margin: 0 0 8px;
    color: #dc2626;
    font-size: 14px;
}

.course-login-notice {
    min-height: 20px;
    margin: 0 0 8px;
    color: #2f6fed;
    font-size: 14px;
    line-height: 1.45;
}

.course-login-notice a {
    color: #2f6fed;
    font-weight: 700;
    text-decoration: underline;
}

.course-login-notice a:hover {
    color: #2559c7;
}

.course-login-home {
    display: inline-block;
    margin-top: 16px;
    color: #2f6fed;
    text-decoration: none;
    font-weight: 600;
}

.reports-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.reports-head h1 {
    margin: 0;
    font-size: 28px;
    color: #243b6b;
}

.reports-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    margin: 0 0 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.reports-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    min-width: 160px;
    flex: 1;
}

.reports-filters select,
.reports-filters input[type="text"] {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
}

.reports-filters select {
    padding-right: 2rem;
    background-position: right 0.65rem center;
}

.reports-reset-btn {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 18px;
    background: white;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
}

.reports-reset-btn:hover {
    background: #f1f5f9;
}

.reports-refresh-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    background: #2f6fed;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.reports-refresh-btn:hover {
    background: #2558c7;
}

.reports-status {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
}

.reports-status--error {
    color: #dc2626;
}

.reports-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.reports-table th,
.reports-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
}

.reports-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

.reports-table tbody tr:hover {
    background: #f8fbff;
}

.reports-cell--ok {
    color: #15803d;
    font-weight: 700;
    text-align: center;
}

.reports-empty {
    text-align: center;
    color: #94a3b8;
    padding: 24px !important;
}

.reports-code-btn {
    border: none;
    background: #eef2ff;
    color: #1e40af;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: Consolas, monospace;
    font-size: 12px;
    max-width: 220px;
    text-align: left;
}

.reports-code-btn:hover {
    background: #dbeafe;
}

.reports-code-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: min(720px, 92vw);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.reports-code-dialog form {
    padding: 20px 22px 18px;
}

.reports-code-dialog h3 {
    margin: 0 0 12px;
}

.reports-code-dialog pre {
    margin: 0 0 16px;
    padding: 14px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    overflow: auto;
    max-height: 50vh;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.course-nav [data-admin-only] {
    margin-left: 12px;
}

/* —— Индекс курса: разделы и прогресс —— */

.course-index-page {
    max-width: 1100px;
}

.course-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.course-group {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px 24px 26px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.course-group--complete {
    border-color: #16a34a;
    background: linear-gradient(180deg, #ecfdf5 0%, #fff 28%);
    box-shadow: 0 12px 32px rgba(22, 163, 74, 0.22);
}

.course-group-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

a.course-group-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.course-group-card-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
}

.course-group-card-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.35), rgba(22, 163, 74, 0.28));
    border-radius: 18px 0 0 18px;
    transition: width 0.35s ease;
}

a.course-group-card .course-group-card-chevron,
a.course-group-card h2,
a.course-group-card .course-group-progress {
    position: relative;
    z-index: 1;
}

a.course-group-card:hover {
    transform: translateY(-2px);
    border-color: #2f6fed;
    box-shadow: 0 12px 28px rgba(47, 111, 237, 0.15);
    text-decoration: none;
}

.course-group-card--complete {
    border-color: #16a34a;
    background: linear-gradient(180deg, #ecfdf5 0%, #fff 40%);
}

.course-group-card-chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(-45deg);
}

a.course-group-card h2 {
    margin: 0;
    flex: 1;
    font-size: 22px;
    color: #243b6b;
}

.course-group-card--complete h2 {
    color: #15803d;
}

.course-group-page-head {
    margin-bottom: 24px;
}

.course-group-page-head h1 {
    margin: 0 0 8px;
    font-size: 30px;
    color: #243b6b;
}

.course-group-page-progress {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
}

.course-group-topics--page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-group--complete .course-group-head h2 {
    color: #15803d;
}

.course-group-progress {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.course-group--complete .course-group-progress {
    color: #16a34a;
}

.course-group-topics {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-group-empty {
    margin: 0;
    color: #9ca3af;
    font-size: 15px;
}

.topic-panel--complete {
    border-color: #22c55e;
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 35%);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.2);
}

.topic-done-badge {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
}

.topic-panel--soon {
    padding: 18px 22px;
    opacity: 0.85;
}

.topic-soon-badge {
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
}

.course-index-loading,
.course-index-error {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
}

.course-index-skeleton {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.course-index-skeleton-card {
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(90deg, #eef2f7 0%, #f8fafc 45%, #eef2f7 90%);
    background-size: 220% 100%;
    animation: course-index-shimmer 1.15s ease-in-out infinite;
}

.course-groups[aria-busy="true"] .course-index-loading {
    display: none;
}

@keyframes course-index-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.course-user-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.course-user-links a {
    color: #2f6fed;
    font-weight: 600;
    text-decoration: none;
}

.course-user-links a:hover {
    text-decoration: underline;
}

a.course-user-name {
    font-weight: 700;
    color: #243b6b;
    text-decoration: none;
    margin-right: auto;
}

a.course-user-name:hover {
    color: #2f6fed;
}

.course-user-bar {
    justify-content: space-between;
}

/* —— Профиль курса —— */

.course-profile-page .page {
    max-width: 900px;
}

.course-profile-card {
    padding: 28px 30px 32px;
}

.course-profile-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.course-profile-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2f6fed;
}

.course-profile-hero h1 {
    margin: 0;
    font-size: 32px;
    color: #243b6b;
}

.course-profile-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.course-profile-stat {
    text-align: center;
    padding: 18px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e8f0fe, #f5f3ff);
    border: 1px solid #dbeafe;
}

.course-profile-stat strong {
    display: block;
    font-size: 26px;
    color: #243b6b;
    margin-bottom: 4px;
}

.course-profile-stat span {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.course-profile-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

a.course-profile-group--link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a.course-profile-group--link:hover {
    border-color: #2f6fed;
    box-shadow: 0 8px 22px rgba(47, 111, 237, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.course-profile-group {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 18px;
    background: #fafbfc;
}

.course-profile-group-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
}

.course-profile-group-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.35), rgba(22, 163, 74, 0.28));
    border-radius: 14px 0 0 14px;
    transition: width 0.35s ease;
}

.course-profile-group header,
.course-profile-group ul {
    position: relative;
    z-index: 1;
}

.course-profile-group--complete {
    border-color: #22c55e;
    background: #ecfdf5;
}

.course-profile-group header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.course-profile-group header h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 17px;
    color: #243b6b;
}

.course-profile-group--complete header h3 {
    color: #15803d;
}

.course-profile-group-meta {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.course-profile-group-go {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(-45deg);
}

a.course-profile-group--link:hover .course-profile-group-go {
    border-color: #2f6fed;
}

a.course-profile-group--link:hover header h3 {
    color: #2f6fed;
}

.course-profile-group ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.course-profile-group li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 14px;
    border-top: 1px solid #eef2f7;
}

.course-profile-group li:first-child {
    border-top: none;
}

.course-profile-group li.done span:first-child {
    color: #15803d;
    font-weight: 600;
}

.course-profile-group li.muted {
    color: #9ca3af;
    justify-content: flex-start;
}

.course-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #eef2f7;
}

@media (max-width: 720px) {
    .course-profile-summary {
        grid-template-columns: 1fr;
    }

    .topic-cards {
        grid-template-columns: 1fr;
    }
}
