/* === Палитра «Творческий центр» === */
:root {
    --color-primary: #1B4D6E;
    --color-primary-dark: #153D54;
    --color-primary-light: #225A75;
    --color-heading: #1B4D6E;
    --color-accent: #2A9D8F;
    --color-accent-light: #4EC4B0;
    --color-accent-pale: #D4EDE9;
    --color-accent-pale-2: #EDF6F4;
    --color-warm: #E9A319;
    --color-warm-dark: #D49210;
    --color-warm-light: #F4A261;
    --color-cta-text: var(--color-primary);
    --color-danger-soft-bg: #fee2e2;
    --color-danger-soft-text: #b91c1c;
    --color-danger-soft-border: #fca5a5;
    --color-danger-soft-bg-hover: #ef4444;
    --color-danger-soft-text-hover: #ffffff;
    --color-danger-soft-border-hover: #ef4444;
    --color-bg: #F7F5F2;
    --color-surface: #ffffff;
    --color-surface-muted: #f1f5f9;
    --color-input-bg: #ffffff;
    --color-text: #2D3748;
    --color-text-muted: #5A6B7D;
    --color-border: #E2DDD6;
    --color-footer: #152A35;
    --color-on-gradient: #ffffff;
    --color-hero-secondary-border: #ffffff;
    --gradient-brand: linear-gradient(135deg, #1B4D6E, #2A9D8F);
    --gradient-hero: linear-gradient(135deg, #1B4D6E 0%, #4EC4B0 100%);
    --gradient-sidebar: linear-gradient(180deg, #1B4D6E, #225A75);
    --shadow-brand: rgba(27, 77, 110, 0.28);
    --shadow-accent: rgba(42, 157, 143, 0.2);
    --shadow-warm: rgba(233, 163, 25, 0.35);
    --shadow-card: rgba(0, 0, 0, 0.08);
    --shadow-card-hover: rgba(42, 157, 143, 0.15);
    --color-link: #1B6B8C;
    --color-link-hover: #155A75;
    --color-mission-border: var(--color-accent);
    --color-welcome-bg-start: var(--color-accent-pale-2);
    --color-welcome-bg-end: var(--color-accent-pale);
    --color-leader-bg: #f0f9ff;
    --color-leader-border: rgba(42, 157, 143, 0.2);
    --color-highlight-bg: #fef3c7;
    --color-highlight-border: #f59e0b;
    --color-highlight-text: #334155;
}

/* === Тёмная тема (тёмно-бирюзовая) === */
[data-theme="dark"] {
    --color-primary: #3DB8A8;
    --color-primary-dark: #2A8F8A;
    --color-primary-light: #5ECFBF;
    --color-heading: #7DD3C8;
    --color-accent: #4EC4B0;
    --color-accent-light: #6DD9C8;
    --color-accent-pale: #1A3D42;
    --color-accent-pale-2: #142E33;
    --color-warm: #9A7628;
    --color-warm-dark: #AD8834;
    --color-warm-light: #C4A04A;
    --color-cta-text: #E2EAE8;
    --color-danger-soft-bg: rgba(248, 113, 113, 0.14);
    --color-danger-soft-text: #FCA5A5;
    --color-danger-soft-border: rgba(248, 113, 113, 0.42);
    --color-danger-soft-bg-hover: rgba(239, 68, 68, 0.4);
    --color-danger-soft-text-hover: #FEE2E2;
    --color-danger-soft-border-hover: #F87171;
    --color-bg: #0B161F;
    --color-surface: #132A38;
    --color-surface-muted: #1A3545;
    --color-input-bg: #1A3545;
    --color-text: #C8D9E0;
    --color-text-muted: #8BA8B5;
    --color-border: #2A4A5C;
    --color-footer: #071018;
    --color-on-gradient: #E8F6F4;
    --color-hero-secondary-border: rgba(232, 246, 244, 0.35);
    --gradient-brand: linear-gradient(135deg, #0F2835 0%, #1A4A52 55%, #1E6B63 100%);
    --gradient-hero: linear-gradient(135deg, #0D1F2A 0%, #1A4A52 50%, #2A7A72 100%);
    --gradient-sidebar: linear-gradient(180deg, #0F2835, #1A4A52);
    --shadow-brand: rgba(0, 0, 0, 0.45);
    --shadow-accent: rgba(78, 196, 176, 0.22);
    --shadow-warm: rgba(240, 180, 41, 0.28);
    --shadow-card: rgba(0, 0, 0, 0.38);
    --shadow-card-hover: rgba(78, 196, 176, 0.18);
    --color-link: #7EC8BE;
    --color-link-hover: #9DD9D0;
    --color-mission-border: #4EC4B0;
    --color-leader-bg: rgba(78, 196, 176, 0.1);
    --color-leader-border: rgba(78, 196, 176, 0.28);
    --color-highlight-bg: #1E3A42;
    --color-highlight-border: #C4A04A;
    --color-highlight-text: #C5D6DE;
    --color-welcome-bg-start: #121F28;
    --color-welcome-bg-end: #1E3D48;
    color-scheme: dark;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === HEADER === */
header {
    background: var(--gradient-brand);
    color: var(--color-on-gradient);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header .container.header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding: 18px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.25s ease;
}

.logo:hover {
    opacity: 0.96;
}

.logo-mark {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: #ffffff;
    padding: 5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo-mark {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}

.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.logo-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.95rem;
    line-height: 1.35;
    opacity: 0.92;
    max-width: 300px;
}

header .container.header-bar > nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
    margin-left: auto;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Переключатель темы (ползунок) */
.theme-switch {
    display: block;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.theme-switch:focus-visible .theme-switch__track {
    outline: 2px solid var(--color-on-gradient);
    outline-offset: 3px;
}

.theme-switch__track {
    position: relative;
    display: block;
    width: 64px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: background 0.35s ease, border-color 0.35s ease;
}

.theme-switch:hover .theme-switch__track {
    background: rgba(255, 255, 255, 0.28);
}

.theme-switch__glyph {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    color: var(--color-on-gradient);
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s ease;
}

.theme-switch__glyph--sun {
    left: 10px;
    opacity: 1;
}

.theme-switch__glyph--moon {
    right: 10px;
    opacity: 0.45;
}

.theme-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-on-gradient);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.theme-switch[aria-checked="true"] .theme-switch__thumb {
    transform: translateX(30px);
}

.theme-switch[aria-checked="true"] .theme-switch__glyph--sun {
    opacity: 0.45;
}

.theme-switch[aria-checked="true"] .theme-switch__glyph--moon {
    opacity: 1;
}

.theme-switch[aria-checked="true"] .theme-switch__track {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(125, 211, 200, 0.35);
}

[data-theme="dark"] .theme-switch__thumb {
    transform: translateX(30px);
}

[data-theme="dark"] .theme-switch__glyph--sun {
    opacity: 0.45;
}

[data-theme="dark"] .theme-switch__glyph--moon {
    opacity: 1;
}

[data-theme="dark"] .theme-switch__track {
    background: rgba(0, 0, 0, 0.22);
    border-color: rgba(125, 211, 200, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .theme-switch__thumb,
    .theme-switch__glyph,
    .theme-switch__track {
        transition-duration: 0.01ms;
    }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.25s;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.nav-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.nav-toggle-bar {
    display: block;
    height: 3px;
    width: 22px;
    border-radius: 2px;
    background: var(--color-on-gradient);
    transition: transform 0.3s ease, opacity 0.25s ease;
    transform-origin: center;
}

header.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

header.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

header.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

nav a {
    color: var(--color-on-gradient);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

nav a:hover {
    color: #B8E8E0;
    transform: translateY(-2px);
}

.nav-btn {
    background: rgba(255,255,255,0.25);
    padding: 10px 22px;
    border-radius: 50px;
    transition: all 0.3s;
    font-weight: 600;
}

.nav-btn:hover {
    background: var(--color-surface);
    color: var(--color-heading);
    transform: translateY(-3px);
}

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }

    header .container.header-bar {
        row-gap: 0;
    }

    header .container.header-bar > nav {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        margin-top: 16px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.22);
        gap: 4px;
        order: 3;
    }

    header.nav-open .container.header-bar > nav {
        display: flex;
    }

    .header-controls {
        margin-left: auto;
    }

    .logo {
        gap: 12px;
    }

    .logo-mark {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        padding: 4px;
    }

    .logo-title {
        font-size: 1.85rem;
    }

    .logo-subtitle {
        font-size: 0.82rem;
        max-width: 220px;
    }

    nav a {
        margin-left: 0;
        padding: 14px 12px;
        border-radius: 12px;
        text-align: center;
    }

    nav a:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.12);
        color: var(--color-on-gradient);
    }

    nav a.nav-btn {
        margin-top: 6px;
    }

    nav a.nav-btn:first-of-type {
        margin-top: 10px;
    }

    nav a.nav-btn:hover {
        transform: none;
    }
}

/* === HERO === */
.hero {
    background: var(--gradient-hero);
    color: var(--color-on-gradient);
    text-align: center;
    padding: 160px 20px 120px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://picsum.photos/id/1015/2000/1200') center/cover;
    opacity: 0.15;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 1.65rem;
    margin-bottom: 24px;
    opacity: 0.95;
}

.hero p {
    max-width: 680px;
    margin: 0 auto 40px;
    font-size: 1.2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 16px 36px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.primary {
    background: var(--color-warm);
    color: var(--color-cta-text);
}

.primary:hover {
    background: var(--color-warm-dark);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 15px 35px var(--shadow-warm);
}

.secondary {
    background: transparent;
    border: 2.5px solid var(--color-hero-secondary-border);
    color: var(--color-on-gradient);
    margin-left: 16px;
}

.secondary:hover {
    background: var(--color-on-gradient);
    color: var(--color-primary);
}

/* === FEATURES === */
.info {
    padding: 100px 0;
    background: var(--color-surface);
}

h2 {
    text-align: center;
    font-size: 2.6rem;
    margin-bottom: 60px;
    color: var(--color-heading);
}

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

.feature-card {
    background: var(--color-surface);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.4s;
}

.feature-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(42, 157, 143, 0.15);
}

.feature-card h3 {
    font-size: 1.55rem;
    margin: 20px 0 12px;
    color: var(--color-heading);
}

/* === AUTH PAGES === */
.auth-container {
    max-width: 460px;
    margin: 100px auto;
    background: var(--color-surface);
    padding: 50px 45px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-heading);
}

.auth-container input {
    width: 100%;
    padding: 16px 20px;
    margin: 12px 0;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
    background: var(--color-input-bg);
    color: var(--color-text);
    transition: all 0.3s;
}

.auth-container input:focus {
    border-color: #2A9D8F;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

.password-field {
    position: relative;
    margin: 12px 0;
}

.auth-container .password-field input {
    margin: 0;
    padding-right: 52px;
}

.profile-card .profile-form .password-field {
    margin: 0 0 16px;
}

.profile-card .profile-form .password-field input {
    width: 100%;
    padding: 14px 52px 14px 18px;
    margin: 0;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: inherit;
}

.profile-card .profile-form .password-field input:focus {
    border-color: #2A9D8F;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #5A6B7D;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
    color: var(--color-primary);
    background: var(--color-accent-pale-2);
}

.password-toggle:focus-visible {
    outline: 2px solid #2A9D8F;
    outline-offset: 2px;
}

.password-toggle-icon--hide {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon--show {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon--hide {
    display: block;
}

/* === DASHBOARD === */
.dashboard {
    display: flex;
    min-height: calc(100vh - 78px);
    background: var(--color-bg);
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 78px);
    background: var(--gradient-sidebar);
    color: var(--color-on-gradient);
    padding: 40px 24px 28px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-user h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.sidebar-user p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

.sidebar-nav {
    list-style: none;
    margin-top: 36px;
    flex: 1;
}

.sidebar-nav li {
    margin: 10px 0;
}

.sidebar a {
    color: #D4EDE9;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: var(--color-on-gradient);
}

.sidebar-nav a.active {
    font-weight: 600;
    box-shadow: inset 3px 0 0 #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(252, 165, 165, 0.45);
    transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s;
}

.sidebar-logout:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.sidebar-logout:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
    margin: 24px 0 12px;
    list-style: none;
}

.sidebar-admin-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    padding: 0 16px 8px;
    list-style: none;
}

/* === Сайдбар: раскрывающиеся группы === */
.sidebar-group {
    list-style: none;
    margin: 16px 0 4px;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
    text-align: left;
}

.sidebar-group-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-group-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sidebar-group-title {
    flex: 1;
    min-width: 0;
}

.sidebar-group-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-left: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    opacity: 0.9;
}

.sidebar-group.is-open .sidebar-group-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
}

.sidebar-group.is-open .sidebar-submenu {
    margin-top: 6px;
    max-height: 2000px;
    opacity: 1;
}

.sidebar-submenu li {
    margin: 2px 0;
}

.sidebar-submenu a {
    padding: 8px 12px 8px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 8px;
    border-radius: 10px;
}

.sidebar-submenu a.active {
    box-shadow: inset 3px 0 0 #E9A319;
}

.content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 50px 60px;
}

.content h1 {
    font-size: 2.4rem;
    color: var(--color-heading);
    margin-bottom: 8px;
    text-align: left;
}

.content h2 {
    text-align: left;
    font-size: 1.55rem;
    margin-bottom: 24px;
    margin-top: 40px;
    color: var(--color-heading);
}

.content-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.content .btn.cabinet-btn.primary,
.content .btn.cabinet-btn.primary.full {
    background: var(--gradient-brand);
    color: var(--color-on-gradient);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.content .btn.cabinet-btn.primary:hover,
.content .btn.cabinet-btn.primary.full:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(27, 77, 110, 0.35);
}

.content .btn.cabinet-btn.outline {
    background: var(--color-surface-muted);
    color: var(--color-heading);
    border: 2px solid #cbd5e1;
    box-shadow: none;
}

.content .btn.cabinet-btn.outline:hover {
    background: var(--color-border);
    transform: translateY(-2px);
}

.content .btn.cabinet-btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 10px;
    background: #D4EDE9;
    color: var(--color-heading);
    box-shadow: none;
}

.content .btn.cabinet-btn.small:hover {
    background: #2A9D8F;
    color: var(--color-on-gradient);
    transform: none;
}

.content .btn.cabinet-btn.small.danger {
    background: var(--color-danger-soft-bg);
    color: var(--color-danger-soft-text);
    border: 1px solid var(--color-danger-soft-border);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.1);
}

.content .btn.cabinet-btn.small.danger:hover {
    background: var(--color-danger-soft-bg-hover);
    color: var(--color-danger-soft-text-hover);
    border-color: var(--color-danger-soft-border-hover);
    transform: none;
}

.btn.cabinet-btn.full {
    width: 100%;
    text-align: center;
    margin-top: 28px;
}

.profile-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    background: var(--color-surface);
}

.profile-select:focus {
    border-color: #2A9D8F;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

/* Админка: список и форма пользователей */
.admin-users-content {
    max-width: none;
}

.admin-panel--users {
    width: 100%;
    max-width: none;
    padding: 0;
}

.admin-form-panel {
    max-width: 720px;
    width: 100%;
}

.admin-users-content > .profile-card.admin-form-panel {
    margin-bottom: 32px;
}

.admin-users-content > .profile-card.admin-form-panel:last-child {
    margin-bottom: 0;
}

.admin-users-content > .admin-form-panel + .admin-form-panel,
.admin-users-content > .admin-form-panel + .admin-panel,
.admin-users-content > .welcome + .admin-form-panel {
    margin-top: 0;
}

.admin-users-content > .welcome + .profile-card {
    margin-top: 0;
}

.admin-table {
    width: 100%;
    table-layout: auto;
}

.admin-table th,
.admin-table td {
    padding: 18px 20px;
    vertical-align: middle;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) { width: 5%; min-width: 48px; }

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) { width: 22%; min-width: 140px; }

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) { width: 14%; min-width: 100px; }

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) { width: 26%; min-width: 160px; }

.admin-table th:nth-child(5),
.admin-table td:nth-child(5) { width: 13%; min-width: 110px; }

.admin-table th:nth-child(6),
.admin-table td:nth-child(6) { width: 20%; min-width: 180px; }

.admin-table td:nth-child(2),
.admin-table td:nth-child(4) {
    white-space: normal;
    word-break: break-word;
}

.role-select-wrap {
    position: relative;
    display: block;
}

.role-select {
    width: 100%;
    padding: 16px 52px 16px 20px;
    border: 2px solid var(--color-border);
    border-radius: 14px;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--color-text);
    background: linear-gradient(135deg, var(--color-surface-muted) 0%, var(--color-accent-pale-2) 100%);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.role-select:hover {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-accent-pale-2) 0%, var(--color-accent-pale) 100%);
}

.role-select:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 4px var(--shadow-accent);
    background: var(--color-surface);
}

.role-select-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -8px;
    border-right: 2.5px solid var(--color-accent);
    border-bottom: 2.5px solid var(--color-accent);
    transform: rotate(45deg);
    pointer-events: none;
    transition: transform 0.2s;
}

.role-select-wrap:focus-within .role-select-arrow {
    margin-top: -4px;
    transform: rotate(225deg);
}

.course-admin-form .course-activity-select-wrap {
    margin-bottom: 4px;
}

.course-admin-form .course-activity-select {
    font-weight: 600;
    color: var(--color-heading);
}

.course-admin-form label[for="course-activity-type"] + .course-activity-select-wrap {
    margin-top: 4px;
}

.profile-form-submit {
    margin-top: 40px !important;
}

.admin-toolbar {
    margin-bottom: 24px;
}

.admin-panel {
    padding: 0;
    overflow: hidden;
}

.admin-panel .schedule-table {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-empty {
    text-align: center;
    color: #5A6B7D;
    padding: 40px 16px !important;
}

.welcome {
    background: linear-gradient(135deg, var(--color-welcome-bg-start) 0%, var(--color-welcome-bg-end) 100%);
    padding: 24px 32px;
    border-radius: 20px;
    margin-bottom: 32px;
    border: 1px solid var(--color-border);
    border-left: 6px solid var(--color-mission-border);
    color: var(--color-text);
    line-height: 1.65;
    box-shadow: 0 8px 24px var(--shadow-card);
}

.welcome p {
    margin: 0;
}

.welcome p + p {
    margin-top: 10px;
}

.welcome strong {
    color: var(--color-heading);
    font-weight: 700;
}

.welcome a {
    color: var(--color-link);
    font-weight: 600;
    text-decoration: none;
}

.welcome a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.course-card {
    background: var(--color-surface);
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    margin-bottom: 24px;
    transition: all 0.3s;
}

.course-card:hover {
    transform: translateY(-8px);
}

.progress-bar {
    height: 10px;
    background: var(--color-border);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar div {
    height: 100%;
    background: linear-gradient(90deg, #2A9D8F, #4EC4B0);
    border-radius: 9999px;
}

.content .course-card .tag {
    display: inline-block;
    margin-bottom: 10px;
}

.dashboard-course-leader,
.dashboard-course-programs {
    color: #5A6B7D;
    margin: 8px 0 0;
    line-height: 1.5;
}

/* === DASHBOARD: ближайшие занятия === */
.dashboard-upcoming {
    margin: 36px 0 40px;
    padding: 28px 28px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--color-accent-pale-2) 0%, var(--color-surface) 55%);
    border: 1px solid var(--color-border);
    box-shadow: 0 12px 36px var(--shadow-card);
}

.dashboard-upcoming-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 24px;
}

.dashboard-upcoming-head h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
}

.dashboard-upcoming-lead {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.dashboard-upcoming-list {
    --upcoming-date-width: 118px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upcoming-lesson-card {
    display: grid;
    grid-template-columns: var(--upcoming-date-width) 1fr auto;
    gap: 20px;
    align-items: stretch;
    padding: 20px 22px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.upcoming-lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--shadow-card-hover);
}

.upcoming-lesson-card--next {
    border-color: rgba(42, 157, 143, 0.45);
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-accent-pale-2) 100%);
    box-shadow: 0 10px 32px var(--shadow-accent);
}

.upcoming-lesson-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: var(--upcoming-date-width);
    min-width: var(--upcoming-date-width);
    max-width: var(--upcoming-date-width);
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 12px 10px;
    border-radius: 14px;
    background: var(--gradient-brand);
    color: var(--color-on-gradient);
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 8px 20px var(--shadow-brand);
}

.upcoming-lesson-card--next .upcoming-lesson-date {
    background: linear-gradient(135deg, var(--color-warm) 0%, var(--color-warm-light) 100%);
    color: var(--color-cta-text);
    box-shadow: 0 8px 22px var(--shadow-warm);
}

.upcoming-lesson-date-label {
    width: 100%;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.92;
    margin-bottom: 4px;
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
}

.upcoming-lesson-date-num {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

.upcoming-lesson-date-month {
    font-size: 0.78rem;
    opacity: 0.9;
    margin-top: 2px;
}

.upcoming-lesson-date-time {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.95rem;
    font-weight: 700;
    width: 100%;
}

.upcoming-lesson-card--next .upcoming-lesson-date-time {
    border-top-color: rgba(27, 77, 110, 0.2);
}

.upcoming-lesson-main {
    min-width: 0;
    align-self: center;
}

.upcoming-lesson-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--color-accent-pale);
    color: var(--color-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.upcoming-lesson-card--next .upcoming-lesson-badge {
    background: rgba(233, 163, 25, 0.2);
    color: var(--color-warm-dark);
}

.upcoming-lesson-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: var(--color-heading);
    line-height: 1.35;
}

.upcoming-lesson-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 12px;
}

.upcoming-lesson-meta .tag {
    margin-bottom: 0;
}

.upcoming-lesson-course {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.upcoming-lesson-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.upcoming-lesson-details li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.upcoming-lesson-detail-icon {
    flex-shrink: 0;
    line-height: 1;
}

.upcoming-lesson-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: center;
    gap: 8px;
    flex-shrink: 0;
}

.upcoming-lesson-actions .online-join-btn {
    white-space: nowrap;
}

@media (max-width: 992px) {
    .dashboard-upcoming {
        padding: 22px 18px 18px;
    }

    .upcoming-lesson-card {
        grid-template-columns: var(--upcoming-date-width) 1fr;
        gap: 16px;
    }

    .upcoming-lesson-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .upcoming-lesson-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .upcoming-lesson-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .upcoming-lesson-date {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px 14px;
        min-width: 0;
        width: 100%;
        text-align: left;
        padding: 14px 16px;
    }

    .upcoming-lesson-date-label {
        flex: 1 0 100%;
        margin-bottom: 0;
    }

    .upcoming-lesson-date-num {
        font-size: 1.5rem;
    }

    .upcoming-lesson-date-time {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        width: auto;
    }
}

/* Footer */
footer {
    background: var(--color-footer);
    color: #A8B5C0;
    text-align: center;
    padding: 50px 20px;
}

/* Responsive */
@media (max-width: 992px) {
    .hero h1 { font-size: 3rem; }
    .dashboard,
    .cabinet-dashboard {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .sidebar,
    .cabinet-sidebar,
    .cabinet-sidebar > .sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: auto;
        padding-bottom: 24px;
        box-shadow: none;
    }
    .cabinet-sidebar {
        flex: 0 0 auto;
        align-self: stretch;
    }
    .cabinet-main {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .sidebar-footer {
        margin-top: 20px;
    }
    .content { padding: 30px 20px; }
    .content h1 { font-size: 1.9rem; }
}

/* === PAGE HERO === */
.page-hero {
    background: var(--gradient-brand);
    color: var(--color-on-gradient);
    text-align: center;
    padding: 120px 20px 80px;
}

.page-hero h1 {
    font-size: 3.2rem;
    margin-bottom: 12px;
}

.page-hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.92;
    line-height: 1.6;
    max-width: 720px;
    margin: 0 auto;
}

.page-hero--about {
    position: relative;
}

.about-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--color-on-gradient);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(6px);
}

/* === DIRECTIONS === */
.directions-section {
    padding: 80px 0;
    background: var(--color-bg);
}

.directions-intro {
    max-width: 820px;
    margin: 0 auto 48px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.12rem;
    line-height: 1.7;
}

.directions-catalog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.direction-category {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.direction-category.is-open {
    border-color: rgba(42, 157, 143, 0.35);
    box-shadow: 0 16px 40px var(--shadow-card-hover);
}

.direction-category-toggle {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    width: 100%;
    padding: 24px 28px;
    border: none;
    background: linear-gradient(135deg, var(--color-accent-pale-2) 0%, var(--color-surface) 55%);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s ease;
}

.direction-category.is-open .direction-category-toggle {
    background: linear-gradient(135deg, var(--color-accent-pale) 0%, var(--color-surface) 70%);
}

.direction-category-toggle:hover {
    background: linear-gradient(135deg, var(--color-accent-pale) 0%, var(--color-accent-pale-2) 100%);
}

.direction-category-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.direction-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.direction-category-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.direction-category-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.35;
}

.direction-category-summary {
    font-size: 0.98rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.direction-category-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.direction-category-count {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--color-accent-pale);
    color: var(--color-primary);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.direction-category-chevron {
    width: 12px;
    height: 12px;
    border-right: 2.5px solid var(--color-primary);
    border-bottom: 2.5px solid var(--color-primary);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    margin-top: -4px;
}

.direction-category.is-open .direction-category-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.direction-category-panel[hidden] {
    display: none;
}

.direction-category-panel-inner {
    padding: 8px 24px 32px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.direction-category-empty {
    margin: 16px 0 8px;
    padding: 28px 32px;
    border-radius: 16px;
    background: var(--color-surface-muted);
    border: 1px dashed var(--color-border);
    color: var(--color-text-muted);
    line-height: 1.65;
    text-align: center;
}

.direction-category-courses {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 20px;
}

.direction-course {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.direction-course.is-open {
    border-color: rgba(42, 157, 143, 0.3);
    box-shadow: 0 10px 28px var(--shadow-card-hover);
}

.direction-course-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    width: 100%;
    padding: 18px 20px;
    border: none;
    background: var(--color-surface);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.direction-course.is-open .direction-course-toggle {
    background: var(--color-accent-pale-2);
    border-bottom: 1px solid var(--color-border);
}

.direction-course-toggle:hover {
    background: var(--color-accent-pale-2);
}

.direction-course-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.direction-course-toggle-main {
    display: inline-flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.direction-course-toggle-main .tag,
.direction-course-tag.tag {
    margin: 0;
    flex-shrink: 0;
    line-height: 1.25;
}

.direction-course-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.3;
    min-width: 0;
}

.direction-course-toggle-meta {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.92rem;
    color: var(--color-text-muted);
}

.direction-course-leader::before {
    content: '👤 ';
}

.direction-course-age::before {
    content: '🎂 ';
}

.direction-course-chevron {
    flex-shrink: 0;
    margin-left: auto;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid var(--color-primary);
    border-bottom: 2.5px solid var(--color-primary);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    margin-top: -3px;
}

.direction-course.is-open .direction-course-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.direction-course-panel[hidden] {
    display: none;
}

.direction-course-panel-inner {
    padding: 20px 16px 16px;
    background: var(--color-bg);
}

.direction-course-panel-inner .direction-card {
    margin-bottom: 0;
    box-shadow: none;
    border: 1px solid var(--color-border);
}

.direction-category-courses .direction-card {
    margin-bottom: 0;
}

.direction-content h3 {
    font-size: 1.35rem;
    color: var(--color-heading);
    margin: 28px 0 12px;
}

.direction-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--color-surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    margin-bottom: 80px;
    align-items: stretch;
}

.direction-card.reverse {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.direction-card.reverse > * {
    direction: ltr;
}

.direction-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.direction-content {
    padding: 50px 45px;
}

.tag {
    display: inline-block;
    background: var(--color-accent-pale);
    color: var(--color-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.direction-content h2 {
    font-size: 2.4rem;
    color: var(--color-heading);
    margin-bottom: 24px;
}

.leader {
    background: var(--color-leader-bg);
    border: 1px solid var(--color-leader-border);
    padding: 18px 22px;
    border-radius: 16px;
    margin-bottom: 28px;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--color-text);
}

.leader strong {
    color: var(--color-heading);
}

.leader em {
    color: var(--color-text-muted);
    font-style: italic;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.highlight {
    background: var(--color-highlight-bg);
    color: var(--color-highlight-text);
    padding: 20px;
    border-left: 5px solid var(--color-highlight-border);
    border-radius: 12px;
    margin: 30px 0;
    font-size: 1.02rem;
    line-height: 1.65;
}

.highlight strong {
    color: var(--color-heading);
}

/* Адаптивность */
@media (max-width: 992px) {
    .direction-category-toggle {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
        padding: 20px;
    }

    .direction-category-meta {
        grid-column: 1 / -1;
        justify-content: space-between;
        width: 100%;
    }

    .direction-category-title {
        font-size: 1.2rem;
    }

    .direction-category-panel-inner {
        padding: 8px 16px 24px;
    }

    .direction-course-toggle {
        padding: 16px;
    }

    .direction-course-toggle-main {
        flex-wrap: wrap;
        align-items: center;
    }

    .direction-course-toggle-meta {
        flex-direction: column;
        gap: 4px;
    }

    .direction-course-panel-inner {
        padding: 12px 10px 10px;
    }

    .direction-course-panel-inner .direction-card,
    .direction-course-panel-inner .direction-card.reverse {
        grid-template-columns: 1fr;
    }

    .direction-card,
    .direction-card.reverse {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .direction-image img {
        height: 320px;
    }
}

/* Pop-up записи на направление */
.direction-enroll-btn {
    margin-top: 12px;
    font-family: inherit;
    cursor: pointer;
    border: none;
}

.direction-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.direction-modal.is-open {
    display: flex;
}

.direction-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.direction-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.35);
    border-left: 6px solid #2A9D8F;
}

.direction-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.direction-modal-close:hover {
    background: var(--color-border);
    color: #1e293b;
}

.direction-modal-close:focus-visible {
    outline: 2px solid #2A9D8F;
    outline-offset: 2px;
}

.direction-modal-panel {
    padding: 44px 40px 40px;
}

.direction-modal-panel h2 {
    font-size: 1.65rem;
    color: var(--color-heading);
    margin-bottom: 8px;
    text-align: center;
}

.direction-modal-direction {
    text-align: center;
    font-size: 1.05rem;
    color: #2A9D8F;
    font-weight: 600;
    margin-bottom: 28px;
}

.direction-form-field {
    margin-bottom: 18px;
}

.direction-form-field label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 8px;
}

.direction-modal-dialog input[type="text"],
.direction-modal-dialog input[type="number"],
.direction-modal-dialog input[type="tel"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.direction-modal-dialog input:focus {
    border-color: #2A9D8F;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

.direction-modal-submit {
    width: 100%;
    margin-top: 8px;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-align: center;
}

.direction-modal-success {
    text-align: center;
}

.direction-modal-success[hidden] {
    display: none !important;
}

.direction-modal-success-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4EDE9, #B8DDD6);
    color: #1d4ed8;
    font-size: 2rem;
    font-weight: 700;
}

.direction-modal-success-text {
    color: var(--color-text-muted);
    margin-bottom: 28px;
    line-height: 1.55;
}

/* === ABOUT PAGE === */
.about-section {
    padding: 90px 0 100px;
    background: var(--color-bg);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: -50px auto 70px;
    position: relative;
    z-index: 2;
}

.about-stat-card {
    background: var(--color-surface);
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 12px 35px rgba(27, 77, 110, 0.1);
    border: 1px solid var(--color-border);
    transition: transform 0.25s, box-shadow 0.25s;
}

.about-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(27, 77, 110, 0.14);
}

.about-stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.1;
    margin-bottom: 8px;
}

.about-stat-label {
    display: block;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: start;
    margin-bottom: 80px;
}

.about-text .tag {
    margin-bottom: 14px;
}

.about-text h2 {
    font-size: 2.6rem;
    color: var(--color-heading);
    margin-bottom: 25px;
    line-height: 1.2;
    text-align: left;
}

.about-text p {
    font-size: 1.12rem;
    margin-bottom: 20px;
    color: var(--color-text);
    line-height: 1.65;
    opacity: 0.88;
}

.about-section .info-box {
    background: var(--color-surface);
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    margin-top: 30px;
    border: 1px solid var(--color-border);
}

.about-section .info-box h3 {
    font-size: 1.35rem;
    color: var(--color-heading);
    margin-bottom: 20px;
}

.about-contacts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-contacts li {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-surface-muted);
}

.about-contacts li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.about-contacts li:first-child {
    padding-top: 0;
}

.about-contact-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-pale-2);
    border-radius: 12px;
    color: var(--color-accent);
}

.about-contact-icon svg {
    display: block;
    flex-shrink: 0;
}

.about-contact-body {
    flex: 1;
    min-width: 0;
}

.about-contacts strong {
    display: block;
    color: var(--color-heading);
    font-size: 0.92rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.95;
}

.about-contact-value {
    display: block;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.5;
}

.about-contacts a.about-contact-value {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s;
}

.about-contacts a.about-contact-value:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

.about-image-frame {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(27, 77, 110, 0.15);
    border: 4px solid var(--color-surface);
}

.about-image-frame img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.about-image-frame--logo {
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.about-image-frame--logo img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

.about-image-caption {
    margin-top: 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.98rem;
    font-style: italic;
}

.mission {
    background: linear-gradient(135deg, var(--color-accent-pale-2) 0%, var(--color-accent-pale) 100%);
    padding: 50px 60px;
    border-radius: 24px;
    text-align: center;
    margin: 80px 0;
    border: 1px solid var(--color-border);
    border-left: 8px solid var(--color-mission-border);
    box-shadow: 0 10px 30px var(--shadow-accent);
}

.mission h2 {
    color: var(--color-heading);
    margin-bottom: 20px;
    font-size: 2rem;
}

.mission p {
    font-size: 1.15rem;
    color: var(--color-text);
    line-height: 1.65;
    max-width: 760px;
    margin: 0 auto;
    opacity: 0.92;
}

.about-section-header {
    text-align: center;
    margin-bottom: 10px;
}

.about-section-header h2 {
    margin-bottom: 16px;
}

.about-section-header p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.about-features {
    margin-top: 40px;
    margin-bottom: 0;
}

.history {
    background: var(--color-surface);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 10px 35px var(--shadow-card);
    margin-top: 80px;
    border: 1px solid var(--color-border);
}

.history .tag {
    margin-bottom: 14px;
}

.history h2 {
    text-align: left;
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--color-heading);
}

.history p {
    font-size: 1.1rem;
    margin-bottom: 18px;
    color: var(--color-text);
    line-height: 1.65;
    opacity: 0.88;
}

.history p:last-child {
    margin-bottom: 0;
}

.about-cta {
    margin-top: 80px;
    padding: 56px 48px;
    border-radius: 24px;
    text-align: center;
    background: var(--gradient-brand);
    color: var(--color-on-gradient);
    box-shadow: 0 20px 50px rgba(27, 77, 110, 0.2);
}

.about-cta h2 {
    color: var(--color-on-gradient);
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.about-cta p {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 640px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.about-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.about-cta .btn.primary {
    background: var(--color-warm);
    color: var(--color-cta-text);
}

.about-cta .btn.primary:hover {
    background: var(--color-warm-dark);
    box-shadow: 0 15px 35px var(--shadow-warm);
}

.about-cta-secondary {
    margin-left: 0;
}

/* Адаптив about */
@media (max-width: 992px) {
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -30px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image-frame img {
        height: 320px;
    }

    .about-image-frame--logo img {
        height: auto;
        max-height: 280px;
    }

    .mission {
        padding: 40px 28px;
    }

    .history {
        padding: 36px 28px;
    }

    .about-cta {
        padding: 40px 24px;
    }
}

@media (max-width: 576px) {
    .about-stats {
        grid-template-columns: 1fr;
    }

    .about-text h2 {
        font-size: 2rem;
    }
}

/* === SCHEDULE PAGE === */
.schedule-section {
    padding: 80px 0;
    background: var(--color-bg);
}

.schedule-header {
    margin-bottom: 40px;
    text-align: center;
}

.schedule-header h2 {
    font-size: 2.4rem;
    color: var(--color-heading);
    margin-bottom: 12px;
}

.filter-buttons {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid #2A9D8F;
    background: var(--color-surface);
    color: var(--color-heading);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: #2A9D8F;
    color: var(--color-on-gradient);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.schedule-table th {
    background: var(--color-primary);
    color: var(--color-on-gradient);
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
}

.schedule-table td {
    padding: 18px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-table strong {
    color: var(--color-heading);
}

.format {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Дистанционно — холодный «онлайн» */
.format.online {
    background: #E8F6F4;
    color: #1A6B7A;
    border-color: #4EC4B0;
}

/* Очно — тёплый «в классе» */
.format.offline {
    background: #FFF6E8;
    color: #8B5E14;
    border-color: #E9C46A;
}

/* Смешанный */
.format.mixed {
    background: #fef3c7;
    color: #b45309;
    border-color: #f59e0b;
    border-style: dashed;
}

.schedule-note {
    background: var(--color-surface);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* === PROFILE PAGE === */
.profile-section {
    padding: 80px 0;
    background: var(--color-bg);
}

.profile-card {
    max-width: 680px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* Важно: после .profile-card — иначе max-width: 680px сужает блок в кабинете */
.profile-card.profile-card--in-dashboard {
    max-width: none;
    width: 100%;
    margin: 0;
}

.profile-card.admin-panel--users {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.profile-card.profile-card--in-dashboard.admin-form-panel {
    max-width: 720px;
}

.profile-header {
    text-align: center;
    margin-bottom: 40px;
}

.avatar {
    font-size: 80px;
    margin-bottom: 15px;
}

.profile-avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.profile-avatar-preview {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #D4EDE9, #B8DDD6);
    border: 4px solid #fff;
    box-shadow: 0 12px 30px rgba(27, 77, 110, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-image--hidden {
    display: none;
}

.profile-avatar-placeholder {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-heading);
    letter-spacing: 0.04em;
}

.profile-avatar-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-avatar-upload {
    cursor: pointer;
    margin: 0;
}

.profile-avatar-remove-btn {
    margin: 0;
}

.profile-avatar-hint {
    margin: 0;
    font-size: 0.88rem;
    color: #A8B5C0;
    text-align: center;
}

.profile-form-divider {
    margin: 35px 0 25px;
    border: none;
    border-top: 1px solid var(--color-border);
}

.profile-form-section-title {
    margin-bottom: 15px;
    color: var(--color-heading);
}

.profile-required {
    color: #ef4444;
}

.profile-status-active {
    color: #10b981;
    font-weight: 600;
}

.sidebar-user {
    text-align: center;
}

.sidebar-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-avatar-placeholder {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
}

.profile-header h2 {
    font-size: 2.2rem;
    color: var(--color-heading);
}

.role {
    color: #2A9D8F;
    font-weight: 600;
}

.profile-card label {
    display: block;
    margin: 20px 0 8px;
    font-weight: 600;
    color: var(--color-heading);
}

.profile-card input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
}

.profile-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
    font-size: 1.05rem;
    line-height: 1.8;
}

.message {
    padding: 18px 20px;
    margin-bottom: 25px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.message.success {
    background: #d1fae5;
    color: #166534;
    border: 2px solid #10b981;
}

.message.error {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #ef4444;
}

/* === ADMIN USERS === */
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.role-admin {
    background: #fef3c7;
    color: #b45309;
}

.role-teacher {
    background: var(--color-accent-pale);
    color: var(--color-primary);
}

.role-student {
    background: #d1fae5;
    color: #166534;
}

/* === PROGRESS (личный кабинет) === */
.progress-content .progress-toolbar {
    margin-bottom: 28px;
}

.filter-buttons--cabinet {
    justify-content: flex-start;
    margin-top: 0;
}

.average-score--cabinet {
    margin-bottom: 32px;
}

.average-score--cabinet .score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 280px;
    padding: 28px 36px;
    border-radius: 20px;
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 12px 32px rgba(27, 77, 110, 0.28);
}

.average-score--cabinet .score-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.average-score--cabinet .score-value {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
}

.average-score--cabinet .score-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    opacity: 0.95;
    text-transform: capitalize;
}

.progress-panel {
    padding: 0;
    overflow: hidden;
}

.progress-panel .schedule-table {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
}

.progress-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.progress-table td small {
    display: block;
    margin-top: 4px;
    color: #5A6B7D;
    font-size: 0.88rem;
    font-weight: 400;
}

.progress-table .grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.15rem;
}

.progress-table .grade.excellent {
    background: #d1fae5;
    color: #166534;
}

.progress-table .grade.good {
    background: #D4EDE9;
    color: var(--color-heading);
}

.progress-note {
    margin-top: 28px;
}

/* === SCHEDULE (личный кабинет) === */
.schedule-content .schedule-toolbar {
    margin-bottom: 28px;
}

.schedule-panel {
    padding: 0;
    overflow: hidden;
}

.schedule-panel .schedule-table {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
}

.schedule-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.schedule-note--cabinet {
    margin-top: 28px;
}

.cabinet-schedule-table {
    width: 100%;
    table-layout: auto;
}

.cabinet-schedule-table td:nth-child(3),
.cabinet-schedule-table td:nth-child(4) {
    white-space: normal;
    min-width: 140px;
}

.filter-btn {
    font-family: inherit;
}

/* === MESSAGES (личный кабинет) === */
.messages-content .messages-section {
    margin-bottom: 40px;
}

.messages-content .messages-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.messages-note {
    margin-bottom: 0;
}

.messages-panel {
    padding: 0;
    overflow: hidden;
}

.messages-list {
    display: flex;
    flex-direction: column;
}

.message-item {
    display: block;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    background: var(--color-bg);
}

.message-item--unread {
    background: #EDF6F4;
    border-left: 4px solid #2A9D8F;
}

.message-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 8px;
}

.message-item-head strong {
    color: var(--color-heading);
    font-size: 1.05rem;
}

.message-date {
    color: #5A6B7D;
    font-size: 0.9rem;
    margin-left: auto;
}

.message-unread-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #2A9D8F;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.message-item-to {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.message-item-preview {
    color: #5A6B7D;
    font-size: 0.92rem;
    line-height: 1.5;
}

.message-view-card {
    padding: 32px 36px;
}

.message-view-meta {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.8;
    color: var(--color-text-muted);
}

.message-view-meta strong {
    color: var(--color-heading);
}

.message-view-body {
    font-size: 1.08rem;
    line-height: 1.7;
    color: #334155;
}

.profile-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
}

.profile-form textarea:focus {
    border-color: #2A9D8F;
    outline: none;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: auto;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.sidebar-nav a {
    justify-content: flex-start;
}

/* === COURSES (личный кабинет) === */
.courses-content .courses-section {
    margin-bottom: 36px;
}

.courses-content .courses-section h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.courses-section-desc {
    color: #5A6B7D;
    margin-bottom: 24px;
    line-height: 1.6;
}

.courses-count {
    color: #5A6B7D;
    font-weight: 500;
    font-size: 1rem;
}

.courses-form-title {
    color: var(--color-heading);
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.courses-empty-hint {
    color: #5A6B7D;
    line-height: 1.6;
}

.course-enroll-card {
    max-width: 720px;
}

.courses-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.course-picker-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.course-picker-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.course-picker-card--active {
    border-color: #2A9D8F;
    background: linear-gradient(135deg, var(--color-accent-pale-2), var(--color-surface));
    box-shadow: 0 10px 28px rgba(42, 157, 143, 0.15);
}

.course-picker-card strong {
    color: var(--color-heading);
    font-size: 1.1rem;
}

.course-picker-leader {
    color: #5A6B7D;
    font-size: 0.92rem;
}

.my-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.my-course-card {
    background: var(--color-surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s;
}

.my-course-card:hover {
    transform: translateY(-4px);
}

.my-course-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.my-course-card-body {
    padding: 24px 26px 28px;
}

.my-course-card-body h2 {
    font-size: 1.45rem;
    color: var(--color-heading);
    margin: 10px 0 14px;
    text-align: left;
}

.my-course-leader,
.my-course-meta,
.my-course-desc {
    color: var(--color-text-muted);
    line-height: 1.55;
    margin-bottom: 10px;
    font-size: 0.98rem;
}

.my-course-desc {
    margin-top: 12px;
}

.my-course-enrolled {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
    color: #2A9D8F;
    font-weight: 600;
    font-size: 0.92rem;
}

/* Компактные карточки курсов (ученик / родитель) */
.my-courses-student {
    grid-template-columns: 1fr;
    gap: 10px;
}

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

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

.my-courses-student .my-course-card--compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.my-courses-student .my-course-card--compact:hover {
    transform: none;
    border-color: rgba(42, 157, 143, 0.35);
    box-shadow: 0 4px 14px rgba(42, 157, 143, 0.1);
}

.my-courses-student .my-course-card--compact.my-course-card--apply {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
}

.my-courses-student .my-course-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
    min-width: 0;
}

.my-courses-student .my-course-card-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-border);
}

.my-courses-student .my-course-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.my-courses-student .my-course-card-main {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.my-courses-student .my-course-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 8px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.my-courses-student .my-course-card-title {
    margin: 0 0 4px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.3;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.my-courses-student .my-course-card-meta {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-courses-student .my-course-card-sep {
    margin: 0 0.35em;
    opacity: 0.55;
}

.my-courses-student .my-course-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--color-border);
    background: var(--color-input-bg, rgba(0, 0, 0, 0.02));
}

.my-courses-student .my-course-card-foot .app-status {
    font-size: 0.82rem;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
}

.course-apply-form--inline {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

.course-apply-form--inline textarea {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 36px;
    max-height: 72px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    background: var(--color-surface);
    color: var(--color-text);
}

.course-apply-form textarea {
    width: 100%;
    min-height: 72px;
    margin: 8px 0 14px;
    padding: 12px 14px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: var(--color-input-bg);
    color: var(--color-text);
}

.courses-muted {
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.courses-applications-table th:nth-child(1),
.courses-applications-table td:nth-child(1) { width: 14%; min-width: 108px; }

.courses-applications-table th:nth-child(2),
.courses-applications-table td:nth-child(2) { width: 22%; min-width: 140px; }

.courses-applications-table th:nth-child(3),
.courses-applications-table td:nth-child(3) { width: 30%; min-width: 120px; }

.courses-applications-table th:nth-child(4),
.courses-applications-table td:nth-child(4) {
    width: 34%;
    min-width: 260px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.course-app-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.course-app-actions__form {
    margin: 0;
}

.course-app-actions__form--approve .btn {
    width: 100%;
    justify-content: center;
}

.course-app-actions__form--reject {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.course-app-reason-input {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}

.course-app-reason-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.85;
}

.course-app-reason-input:focus {
    outline: none;
    border-color: #2A9D8F;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.course-app-actions__form--reject .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .course-app-actions {
        max-width: none;
    }

    .course-app-actions__form--reject {
        grid-template-columns: 1fr;
    }

    .course-app-actions__form--reject .btn {
        width: 100%;
        justify-content: center;
    }
}


.courses-enroll-table th:nth-child(1),
.courses-enroll-table td:nth-child(1) { width: 22%; min-width: 140px; }

.courses-enroll-table th:nth-child(2),
.courses-enroll-table td:nth-child(2) { width: 14%; min-width: 100px; }

.courses-enroll-table th:nth-child(3),
.courses-enroll-table td:nth-child(3) { width: 24%; min-width: 160px; }

.courses-enroll-table th:nth-child(4),
.courses-enroll-table td:nth-child(4) { width: 14%; min-width: 110px; }

.courses-enroll-table th:nth-child(5),
.courses-enroll-table td:nth-child(5) { width: 18%; min-width: 150px; }

.course-admin-form {
    max-width: 760px;
}

.form-hint {
    margin: -4px 0 16px;
    color: #5A6B7D;
    font-size: 0.9rem;
}

.form-hint code {
    background: var(--color-surface-muted);
    padding: 2px 6px;
    border-radius: 4px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-weight: 500 !important;
    color: var(--color-text-muted) !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2A9D8F;
}

.courses-admin-table code {
    background: var(--color-surface-muted);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.88rem;
    color: var(--color-heading);
}

.courses-admin-table td small {
    color: #5A6B7D;
    font-size: 0.85rem;
}

.courses-admin-table th:nth-child(1),
.courses-admin-table td:nth-child(1) { width: 5%; min-width: 48px; }

.courses-admin-table th:nth-child(2),
.courses-admin-table td:nth-child(2) { width: 24%; min-width: 160px; }

.courses-admin-table th:nth-child(3),
.courses-admin-table td:nth-child(3) { width: 12%; min-width: 90px; }

.courses-admin-table th:nth-child(4),
.courses-admin-table td:nth-child(4) { width: 22%; min-width: 140px; }

.courses-admin-table th:nth-child(5),
.courses-admin-table td:nth-child(5) { width: 8%; min-width: 70px; }

.courses-admin-table th:nth-child(6),
.courses-admin-table td:nth-child(6) { width: 10%; min-width: 90px; }

.courses-admin-table th:nth-child(7),
.courses-admin-table td:nth-child(7) { width: 19%; min-width: 170px; }

@media (max-width: 992px) {
    .filter-buttons--cabinet {
        justify-content: center;
    }

    .average-score--cabinet .score-card {
        max-width: 100%;
    }

    .my-courses-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== СТРАНИЦА КУРСЫ ==================== */
.courses-page-section {
    padding: 90px 0;
    background: var(--color-bg);
}

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

.course-card {
    background: var(--color-surface);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
}

.course-img img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.course-body {
    padding: 28px;
}

.course-body .tag {
    padding: 6px 18px;
    font-size: 0.92rem;
    margin-bottom: 14px;
}

.course-body h3 {
    font-size: 1.55rem;
    margin-bottom: 12px;
    color: var(--color-heading);
}

.course-body .description {
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.course-body .teacher {
    color: #5A6B7D;
    margin-bottom: 22px;
}

/* === MATERIALS (личный кабинет) === */
.materials-content .materials-section {
    margin-top: 8px;
}

.materials-content .materials-section h2 {
    margin-top: 0;
    margin-bottom: 8px;
}

.materials-section-desc {
    color: #5A6B7D;
    margin-bottom: 24px;
    line-height: 1.6;
}

.materials-form-title,
.materials-block-title {
    color: var(--color-heading);
    margin: 0 0 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.materials-count {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.materials-upload-section {
    margin-bottom: 0;
}

.materials-catalog-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.materials-upload-card {
    max-width: 720px;
    margin-bottom: 0;
}

.materials-catalog-section .materials-empty {
    margin-top: 0;
}

.materials-file-hint {
    color: #5A6B7D;
    font-size: 0.9rem;
    margin: 8px 0 16px;
    line-height: 1.5;
}

.materials-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.materials-empty {
    padding: 28px 32px;
    border-radius: 16px;
    background: var(--color-surface-muted);
    border: 1px dashed var(--color-border);
    color: var(--color-text-muted);
}

.materials-empty-hint {
    color: #5A6B7D;
    margin-top: 8px;
}

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.material-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.material-card-icon {
    font-size: 2rem;
    line-height: 1;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #EDF6F4, #D4EDE9);
}

.material-card-body h3,
.material-card-title {
    margin: 0 0 8px;
    color: var(--color-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.material-card-desc {
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0 0 10px;
}

.material-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0;
    color: #5A6B7D;
    font-size: 0.9rem;
}

.material-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.material-delete-form {
    display: inline;
    margin: 0;
}

@media (max-width: 768px) {
    .material-card {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .material-card-actions {
        justify-content: flex-start;
    }
}

/* === NEW PLATFORM FEATURES === */
.role-parent {
    background: #f0fdf4;
    color: #166534;
}

.app-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.app-status--new { background: #D4EDE9; color: var(--color-heading); }
.app-status--contacted { background: #fef3c7; color: #92400e; }
.app-status--enrolled { background: #d1fae5; color: #065f46; }
.app-status--rejected { background: #fee2e2; color: #991b1b; }

.application-status-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.application-notes-input {
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.9rem;
}

.role-select--compact {
    max-width: 140px;
    padding: 6px 8px;
    font-size: 0.9rem;
}

.admin-filter-tabs {
    margin-bottom: 24px;
}

.admin-filter-tabs .filter-btn {
    text-decoration: none;
}

.sidebar-child-switch {
    margin: 16px 0 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.sidebar-child-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    margin-bottom: 6px;
}

.sidebar-child-select {
    width: 100%;
    color: var(--color-heading);
}

.sidebar-child-switch--empty p {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
}

.schedule-toolbar--row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.online-join-btn {
    white-space: nowrap;
}

.announcement--reminder {
    border-left: 4px solid #f59e0b;
}

.reminder-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.calendar-day-column {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.calendar-day-title {
    font-size: 1rem;
    color: var(--color-heading);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.calendar-day-empty {
    color: #A8B5C0;
    font-size: 0.9rem;
}

.calendar-event-card {
    background: var(--color-bg);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
}

.calendar-event-card time {
    color: #5A6B7D;
    font-size: 0.85rem;
}

.tag--small {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.materials-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    align-items: center;
}

.materials-search-input {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    font-size: 1rem;
}

.materials-search-results {
    margin-bottom: 32px;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    background: var(--color-surface);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.notification-card--unread {
    border-left: 4px solid var(--color-accent);
    background: var(--color-accent-pale-2);
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-body h3 {
    margin: 0 0 6px;
    color: var(--color-heading);
    font-size: 1.05rem;
}

.notification-body p {
    margin: 0 0 8px;
    color: var(--color-text-muted);
}

.notification-body time {
    font-size: 0.85rem;
    color: #A8B5C0;
}

.notification-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.homework-card {
    margin-bottom: 20px;
}

.homework-submission-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

.homework-grade-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.homework-grade-form input[type="number"] {
    width: 56px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}

.audit-table .audit-details {
    max-width: 220px;
    word-break: break-word;
}

.parent-link-form {
    max-width: 520px;
}

.parent-link-form button[type="submit"] {
    margin-top: 20px;
}

.telegram-admin-panel .telegram-form-submit,
.reminders-form-submit {
    margin-top: 20px;
}

.telegram-test-form,
.telegram-cron-form {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border);
}

.telegram-help-panel .materials-form-title + .materials-form-title,
.telegram-help-panel .telegram-test-form + .materials-form-title {
    margin-top: 28px;
}

.telegram-cron-box {
    background: #1e293b;
    color: var(--color-border);
    padding: 14px 16px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 12px 0;
}

.telegram-help-list {
    margin: 12px 0 16px 20px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.telegram-section-title {
    margin-top: 24px;
}

.telegram-link-box {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.telegram-code-box {
    background: var(--color-primary);
    color: var(--color-on-gradient);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1.05rem;
    margin: 10px 0;
}

.telegram-generate-form {
    margin-top: 12px;
}

.telegram-generate-form button {
    margin-top: 0;
}

.telegram-linked-status {
    margin-top: 12px;
}

@media (max-width: 768px) {
    .notification-card {
        grid-template-columns: 1fr;
    }

    .calendar-week-grid {
        grid-template-columns: 1fr;
    }
}

/* Доп. правки тёмной темы */
[data-theme="dark"] header {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] nav a:hover {
    color: var(--color-accent-light);
}

[data-theme="dark"] .logo-mark {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .logo:hover .logo-mark {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .hero::before {
    opacity: 0.08;
}

[data-theme="dark"] .hero .btn.primary {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .hero .btn.primary:hover {
    color: #F0F5F4;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] .about-section .info-box {
    box-shadow: 0 12px 32px var(--shadow-card);
}

[data-theme="dark"] .about-contact-icon {
    background: rgba(78, 196, 176, 0.14);
    color: var(--color-accent-light);
}

[data-theme="dark"] .about-contacts strong {
    color: var(--color-accent-light);
    opacity: 1;
}

[data-theme="dark"] .about-contact-value {
    color: #B8CCD4;
}

[data-theme="dark"] .about-contacts a.about-contact-value {
    color: var(--color-link);
}

[data-theme="dark"] .about-contacts a.about-contact-value:hover {
    color: var(--color-link-hover);
}

[data-theme="dark"] .mission {
    background: linear-gradient(135deg, #121F28 0%, #1A3545 45%, #1E4248 100%);
    border-color: var(--color-border);
    border-left-color: var(--color-mission-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .mission h2 {
    color: var(--color-heading);
}

[data-theme="dark"] .mission p {
    color: #C5D6DE;
    opacity: 1;
}

[data-theme="dark"] .about-text .tag,
[data-theme="dark"] .history .tag,
[data-theme="dark"] .course-body .tag,
[data-theme="dark"] .direction-content .tag {
    background: rgba(78, 196, 176, 0.14);
    color: var(--color-accent-light);
    border: 1px solid rgba(78, 196, 176, 0.28);
}

[data-theme="dark"] .about-text h2 {
    color: #9DD4CB;
}

[data-theme="dark"] .about-text p {
    color: #B8CCD4;
    opacity: 1;
}

[data-theme="dark"] .history {
    background: linear-gradient(135deg, #121F28 0%, #1A3545 50%, #1E3D48 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .history h2 {
    color: #9DD4CB;
}

[data-theme="dark"] .history p {
    color: #B8CCD4;
    opacity: 1;
}

[data-theme="dark"] .direction-content .leader strong {
    color: #9DD4CB;
}

[data-theme="dark"] .direction-content .leader em {
    color: #8BA8B5;
}

[data-theme="dark"] .direction-content .highlight strong {
    color: #E8C878;
}

[data-theme="dark"] .welcome {
    background: linear-gradient(135deg, var(--color-welcome-bg-start) 0%, var(--color-welcome-bg-end) 100%);
    border-color: var(--color-border);
    border-left-color: var(--color-mission-border);
    color: #C5D6DE;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .welcome strong {
    color: #9DD4CB;
}

[data-theme="dark"] .welcome a {
    color: var(--color-link);
}

[data-theme="dark"] .welcome a:hover {
    color: var(--color-link-hover);
}

[data-theme="dark"] .dashboard-upcoming {
    background: linear-gradient(135deg, rgba(78, 196, 176, 0.1) 0%, var(--color-surface) 60%);
    border-color: var(--color-border);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .dashboard-upcoming-head h2 {
    color: #9DD4CB;
}

[data-theme="dark"] .upcoming-lesson-card {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .upcoming-lesson-card--next {
    background: linear-gradient(135deg, var(--color-surface-muted) 0%, rgba(78, 196, 176, 0.12) 100%);
    border-color: rgba(78, 196, 176, 0.45);
}

[data-theme="dark"] .upcoming-lesson-title {
    color: #9DD4CB;
}

[data-theme="dark"] .upcoming-lesson-badge {
    background: rgba(78, 196, 176, 0.16);
    color: var(--color-accent-light);
}

[data-theme="dark"] .upcoming-lesson-card--next .upcoming-lesson-badge {
    background: rgba(196, 160, 74, 0.2);
    color: #E8C878;
}

[data-theme="dark"] .notification-card--unread {
    background: rgba(78, 196, 176, 0.1);
    border-left-color: var(--color-accent-light);
}

[data-theme="dark"] .notification-body h3 {
    color: #9DD4CB;
}

[data-theme="dark"] .notification-body p {
    color: #B8CCD4;
}

[data-theme="dark"] .notification-body time {
    color: #8BA8B5;
}

[data-theme="dark"] .role-select {
    color: #C5D6DE;
    background: linear-gradient(135deg, #1A3545 0%, #132A38 100%);
    border-color: var(--color-border);
}

[data-theme="dark"] .role-select:hover {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, #1E4248 0%, #1A3545 100%);
}

[data-theme="dark"] .role-select:focus {
    background: var(--color-surface);
    color: #E2EAE8;
}

[data-theme="dark"] .role-select option {
    background: #132A38;
    color: #C5D6DE;
}

/* Дистанционно — холодный голубой (онлайн) */
[data-theme="dark"] .format.online {
    background: rgba(56, 189, 248, 0.16);
    color: #7DD3FC;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

/* Очно — тёплый янтарный (в центре) */
[data-theme="dark"] .format.offline {
    background: rgba(234, 179, 89, 0.16);
    color: #F5D78E;
    border-color: rgba(234, 179, 89, 0.48);
    box-shadow: inset 0 0 0 1px rgba(234, 179, 89, 0.1);
}

/* Смешанный — бирюзовый контур, пунктир */
[data-theme="dark"] .format.mixed {
    background: rgba(78, 196, 176, 0.1);
    color: #9DD4CB;
    border-color: rgba(125, 211, 200, 0.45);
    border-style: dashed;
}

[data-theme="dark"] .content .btn.cabinet-btn.small {
    background: rgba(78, 196, 176, 0.14);
    color: #B8E8E0;
    border: 1px solid rgba(78, 196, 176, 0.32);
}

[data-theme="dark"] .content .btn.cabinet-btn.small:hover {
    background: var(--color-accent);
    color: #0B161F;
    border-color: var(--color-accent);
}

[data-theme="dark"] .content .btn.cabinet-btn.small.danger {
    background: var(--color-danger-soft-bg);
    color: var(--color-danger-soft-text);
    border: 1px solid var(--color-danger-soft-border);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.1);
}

[data-theme="dark"] .content .btn.cabinet-btn.small.danger:hover {
    background: var(--color-danger-soft-bg-hover);
    color: var(--color-danger-soft-text-hover);
    border-color: var(--color-danger-soft-border-hover);
    transform: none;
}

[data-theme="dark"] .sidebar-logout {
    padding: 10px 16px;
    border-radius: 10px;
    color: var(--color-danger-soft-text);
    background: var(--color-danger-soft-bg);
    border: 1px solid var(--color-danger-soft-border);
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.1);
    transform: none;
}

[data-theme="dark"] .sidebar-logout:hover {
    background: var(--color-danger-soft-bg-hover);
    color: var(--color-danger-soft-text-hover);
    border-color: var(--color-danger-soft-border-hover);
    transform: none;
    box-shadow: none;
}

[data-theme="dark"] .content .btn.cabinet-btn.outline {
    border-color: var(--color-border);
    color: #B8E8E0;
}

[data-theme="dark"] .materials-empty {
    background: rgba(78, 196, 176, 0.06);
    border-color: var(--color-border);
    color: #B8CCD4;
}

[data-theme="dark"] .auth-container,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .direction-category {
    background: var(--color-surface);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .direction-category.is-open {
    border-color: rgba(78, 196, 176, 0.4);
}

[data-theme="dark"] .direction-category-toggle {
    background: linear-gradient(135deg, rgba(78, 196, 176, 0.12) 0%, var(--color-surface) 60%);
}

[data-theme="dark"] .direction-category.is-open .direction-category-toggle {
    background: linear-gradient(135deg, rgba(78, 196, 176, 0.18) 0%, var(--color-surface) 75%);
}

[data-theme="dark"] .direction-category-icon {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
}

[data-theme="dark"] .direction-category-count {
    background: rgba(78, 196, 176, 0.14);
    color: var(--color-accent-light);
}

[data-theme="dark"] .direction-category-panel-inner {
    background: var(--color-bg);
}

[data-theme="dark"] .direction-category-empty {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
}

[data-theme="dark"] .direction-course {
    background: var(--color-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .direction-course.is-open .direction-course-toggle {
    background: rgba(78, 196, 176, 0.1);
}

[data-theme="dark"] .direction-course-panel-inner {
    background: var(--color-bg);
}

[data-theme="dark"] .direction-course-panel-inner .direction-card {
    border-color: var(--color-border);
}

[data-theme="dark"] .direction-content h3 {
    color: var(--color-accent-light);
}

[data-theme="dark"] .direction-card,
[data-theme="dark"] .course-card,
[data-theme="dark"] .welcome,
[data-theme="dark"] .dashboard-card,
[data-theme="dark"] .content-card,
[data-theme="dark"] .notification-card,
[data-theme="dark"] .homework-card,
[data-theme="dark"] .message-card,
[data-theme="dark"] .material-card,
[data-theme="dark"] .direction-modal-dialog,
[data-theme="dark"] .calendar-day,
[data-theme="dark"] .schedule-slot-card {
    box-shadow: 0 8px 28px var(--shadow-card);
}

[data-theme="dark"] .filter-btn.active,
[data-theme="dark"] .progress-filter-btn.active,
[data-theme="dark"] .schedule-filter-btn.active {
    box-shadow: 0 4px 14px var(--shadow-accent);
}

[data-theme="dark"] pre,
[data-theme="dark"] .telegram-code-box {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

[data-theme="dark"] .telegram-code-box {
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .grade-badge,
[data-theme="dark"] .status-badge {
    border-color: var(--color-border);
}

[data-theme="dark"] table th {
    background: var(--color-surface-muted);
}

[data-theme="dark"] .sidebar a:hover,
[data-theme="dark"] .sidebar a.active {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-btn:hover {
    background: var(--color-surface);
    color: var(--color-heading);
}

@media (max-width: 992px) {
    [data-theme="dark"] nav a:hover {
        color: var(--color-on-gradient);
    }
}

/* === 404 PAGE === */
.page-hero--404 {
    position: relative;
    overflow: hidden;
    padding: 96px 20px 88px;
}

.page-hero--404::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(255, 255, 255, 0.12), transparent),
        radial-gradient(circle at 15% 20%, rgba(78, 196, 176, 0.2), transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(233, 163, 25, 0.15), transparent 40%);
    pointer-events: none;
}

[data-theme="dark"] .page-hero--404::before {
    background:
        radial-gradient(ellipse 80% 60% at 50% 100%, rgba(78, 196, 176, 0.1), transparent),
        radial-gradient(circle at 15% 20%, rgba(42, 157, 143, 0.18), transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(196, 160, 74, 0.12), transparent 40%);
}

.page-hero--404 .container {
    position: relative;
    z-index: 1;
}

.error-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--color-on-gradient);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    backdrop-filter: blur(6px);
}

.error-code {
    font-size: clamp(5.5rem, 16vw, 10rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    margin: 0 0 4px;
    color: var(--color-on-gradient);
    opacity: 0.35;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.page-hero--404 h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 16px;
}

.page-hero--404 .subtitle {
    max-width: 640px;
    margin: 0 auto 36px;
}

.error-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.error-hero-secondary {
    margin-left: 0;
}

.error-section {
    padding: 80px 0 100px;
    background: var(--color-bg);
}

.error-section h2 {
    margin-bottom: 12px;
}

.error-section-lead {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto 48px;
    line-height: 1.6;
}

.error-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.error-link-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--color-surface);
    padding: 32px 24px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px var(--shadow-card);
    text-align: center;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.error-link-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-card-hover);
    border-color: var(--color-accent);
}

.error-link-icon {
    display: block;
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 12px;
}

.error-link-card h3 {
    font-size: 1.35rem;
    color: var(--color-heading);
    margin-bottom: 10px;
}

.error-link-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

[data-theme="dark"] .error-link-card {
    box-shadow: 0 10px 30px var(--shadow-card);
}

[data-theme="dark"] .error-link-card:hover {
    border-color: var(--color-accent-light);
}

@media (max-width: 992px) {
    .error-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-hero--404 {
        padding: 80px 20px 72px;
    }
}

.site-settings-logo-preview {
    display: block;
    margin-top: 8px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
}

.site-settings-form .admin-form-panel {
    margin-bottom: 24px;
}

/* === Настройки сайта: расширенные текстовые поля === */
.site-settings-form .site-field-rich-wrap {
    margin: 8px 0 20px;
}

.site-settings-form .site-field-rich-wrap label {
    margin-top: 0;
}

.site-settings-form .site-field-rich-wrap .materials-file-hint {
    margin-top: 10px;
    margin-bottom: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--color-accent-pale-2);
    border-left: 3px solid var(--color-accent);
}

.site-settings-form .site-field-rich {
    width: 100%;
    display: block;
    margin: 0;
    padding: 18px 20px 18px 22px;
    border: 2px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 16px;
    font-size: 1.05rem;
    line-height: 1.65;
    font-family: inherit;
    color: var(--color-text);
    background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-accent-pale-2) 55%, var(--color-surface-muted) 100%);
    resize: vertical;
    min-height: 96px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-left-width 0.2s ease;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 18px var(--shadow-card);
}

.site-settings-form .site-field-rich::placeholder {
    color: var(--color-text-muted);
    opacity: 0.75;
}

.site-settings-form .site-field-rich:hover {
    border-color: var(--color-accent-light);
    background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-accent-pale) 100%);
}

.site-settings-form .site-field-rich:focus {
    border-color: var(--color-accent);
    border-left-width: 5px;
    outline: none;
    background: var(--color-surface);
    box-shadow:
        0 0 0 4px var(--shadow-accent),
        0 8px 24px var(--shadow-card-hover),
        inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.site-settings-form .site-field-rich--address {
    min-height: 108px;
}

.site-settings-form .site-field-rich--subtitle {
    min-height: 100px;
}

.site-settings-form .site-field-rich--mission {
    min-height: 168px;
}

.site-settings-form .site-field-rich--footer {
    min-height: 80px;
}

.site-settings-form .site-field-rich--copyright {
    min-height: 100px;
}

.site-settings-form .site-field-rich--maintenance {
    min-height: 140px;
}

[data-theme="dark"] .site-settings-form .site-field-rich {
    background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-surface-muted) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 6px 20px var(--shadow-card);
}

[data-theme="dark"] .site-settings-form .site-field-rich:hover {
    background: linear-gradient(145deg, var(--color-surface-muted) 0%, rgba(78, 196, 176, 0.12) 100%);
    border-color: var(--color-accent-light);
}

[data-theme="dark"] .site-settings-form .site-field-rich:focus {
    background: var(--color-input-bg);
    box-shadow:
        0 0 0 4px var(--shadow-accent),
        0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .site-settings-form .site-field-rich-wrap .materials-file-hint {
    background: rgba(78, 196, 176, 0.1);
    border-left-color: var(--color-accent-light);
    color: var(--color-text-muted);
}

footer .footer-extra {
    margin-top: 8px;
    font-size: 0.95rem;
    opacity: 0.88;
}

.directions-enroll-closed {
    margin-bottom: 32px;
    padding: 16px 20px;
    border-radius: 12px;
}

@media (max-width: 576px) {
    .error-links {
        grid-template-columns: 1fr;
    }

    .error-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .error-hero-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* HTMX-кабинет */
.cabinet-app {
    overflow-x: hidden;
}

.cabinet-dashboard {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: stretch;
}

.cabinet-sidebar {
    flex: 0 0 auto;
    flex-shrink: 0;
    align-self: stretch;
    min-width: 0;
}

@media (max-width: 992px) {
    .cabinet-sidebar > .sidebar {
        width: 100%;
        max-width: 100%;
    }
}

@media (min-width: 993px) {
    .cabinet-sidebar > .sidebar {
        width: 280px;
        min-height: 100%;
    }
}

.cabinet-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    outline: none;
}

.cabinet-main > .content {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.cabinet-app .content .welcome,
.cabinet-app .content .courses,
.cabinet-app .content .profile-card--in-dashboard,
.cabinet-app .content .admin-panel--users,
.cabinet-app .content .admin-table-wrap,
.cabinet-app .content .materials-content,
.cabinet-app .content .messages-layout,
.cabinet-app .content .homework-card,
.cabinet-app .content .notifications-list {
    width: 100%;
    max-width: none;
}

.cabinet-app .content .profile-card.profile-card--in-dashboard.admin-form-panel {
    max-width: 720px;
}

.cabinet-main.htmx-request {
    opacity: 0.72;
    transition: opacity 0.15s ease;
}

.cabinet-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1200;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    border: 3px solid var(--color-border, #ccc);
    border-top-color: var(--color-primary, #0066cc);
    border-radius: 50%;
    animation: cabinet-spin 0.7s linear infinite;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.cabinet-loading.htmx-request {
    opacity: 1;
}

@keyframes cabinet-spin {
    to {
        transform: rotate(360deg);
    }
}

.sidebar-nav a.sidebar-link.active,
.sidebar-submenu a.active {
    font-weight: 600;
}