:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --ink: #1d252d;
    --muted: #637083;
    --line: #dce2ea;
    --brand: #176b5b;
    --brand-dark: #0f4c40;
    --accent: #c46d2d;
    --danger: #a73737;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
}

.brand {
    color: var(--ink);
    font-size: 19px;
    font-weight: 700;
}

.nav {
    align-items: center;
    display: flex;
    gap: 16px;
}

.container {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px;
}

.admin-shell {
    display: grid;
    gap: 22px;
    grid-template-columns: 230px minmax(0, 1fr);
}

.admin-menu {
    align-self: start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px;
    position: sticky;
    top: 18px;
}

.admin-menu a {
    border-radius: 6px;
    color: var(--ink);
    font-weight: 700;
    padding: 11px 12px;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: #e7ecef;
    text-decoration: none;
}

.admin-menu a.danger {
    color: var(--danger);
}

.admin-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.hero {
    align-items: stretch;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    min-height: 420px;
}

.hero-copy {
    align-self: center;
}

.hero h1 {
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.02;
    margin: 0 0 18px;
}

.hero p {
    color: var(--muted);
    font-size: 19px;
    line-height: 1.6;
    margin: 0 0 24px;
}

.hero-media {
    background: linear-gradient(145deg, #e8ecef, #c8d6d1);
    border-radius: 8px;
    min-height: 360px;
    overflow: hidden;
}

.hero-media img,
.course-image {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 22px;
}

.stat {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stat strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 7px;
}

.panel,
.card,
.form-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel,
.form-panel {
    padding: 22px;
}

.card {
    overflow: hidden;
}

.card-body {
    padding: 18px;
}

.card h3,
.panel h2,
.form-panel h1 {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.price {
    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
}

.button,
button {
    align-items: center;
    background: var(--brand);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
}

.button:hover,
button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button.secondary {
    background: #e7ecef;
    color: var(--ink);
}

.button.danger {
    background: var(--danger);
}

input,
textarea,
select {
    border: 1px solid var(--line);
    border-radius: 6px;
    display: block;
    font: inherit;
    margin-top: 6px;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-summary {
    align-items: center;
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
}

.avatar,
.avatar-placeholder {
    align-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 76px;
    height: 76px;
    justify-content: center;
    object-fit: cover;
    width: 76px;
}

.avatar-placeholder {
    background: #e7ecef;
    color: var(--muted);
    font-size: 26px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notice {
    background: #edf7f3;
    border: 1px solid #b9ded2;
    border-radius: 8px;
    color: #155246;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.error {
    background: #fff1f1;
    border-color: #efb6b6;
    color: #8f2828;
}

.lesson-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.lesson-item {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 14px;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.status.ok {
    background: #dff4ea;
    color: #176346;
}

.status.locked {
    background: #eceff3;
    color: #5c6876;
}

.split {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 0.75fr) minmax(280px, 0.25fr);
}

.file-link {
    background: #f3f5f7;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    padding: 14px;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 14px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f1f4f6;
    font-size: 13px;
}

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

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.smtp-hint {
    margin: 0 0 14px;
}

.checkbox-line {
    align-items: center;
    display: flex;
    font-weight: 700;
    gap: 10px;
    margin: 0 0 16px;
}

.checkbox-line input {
    margin: 0;
    min-height: auto;
    width: auto;
}

.smtp-test-box {
    background: #f6f8fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 18px 0 24px;
    padding: 18px;
}

.smtp-test-box h3 {
    margin: 0 0 8px;
}

.smtp-log {
    background: #0f1720;
    border-radius: 8px;
    color: #d7e2ec;
    font-size: 12px;
    line-height: 1.5;
    max-height: 280px;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

@media (max-width: 780px) {
    .topbar,
    .nav,
    .actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 16px 20px;
    }

    .container {
        padding: 20px;
    }

    .admin-shell,
    .hero,
    .split,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-menu {
        position: static;
    }

    .hero-media {
        min-height: 240px;
    }
}
