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

:root {
    --primary: #2d3748;
    --primary-dark: #1a202c;
    --secondary: #d4a574;
    --accent: #b8956a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;
    
    --gradient-1: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --gradient-2: linear-gradient(135deg, #d4a574 0%, #b8956a 100%);
    --gradient-3: linear-gradient(135deg, #475569 0%, #334155 100%);
    --gradient-4: linear-gradient(135deg, #c89968 0%, #a67c52 100%);
    --gradient-5: linear-gradient(135deg, #64748b 0%, #475569 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

/* Контейнер */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Навигация платформы */
.platform-nav {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.platform-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.platform-logo {
    padding: 16px 18px;
    font-size: 19px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.platform-logo.brand-lockup,
.auth-logo.brand-lockup {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    background: none;
    -webkit-text-fill-color: unset;
}

.brand-lockup .brand-name {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.platform-logo.brand-lockup .brand-name {
    font-size: 20px;
}

.brand-lockup .brand-division {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    margin-top: 3px;
}

.brand-lockup .brand-name .brand-letter-accent {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.platform-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: white;
    color: var(--primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: var(--transition);
}

.platform-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: var(--transition);
}

.platform-menu-toggle:hover {
    border-color: var(--secondary);
    background: var(--bg-secondary);
}

.platform-nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    margin-left: 18px;
    flex-wrap: wrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--secondary);
}

.nav-link svg {
    width: 15px;
    height: 15px;
}

.nav-link .nav-badge {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: 2px;
}

.platform-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lessons-balance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-right: 4px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    color: var(--primary);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: var(--transition);
}

.lessons-balance-badge:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.28);
}

.lessons-balance-badge svg,
.lessons-balance-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.lessons-balance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.lessons-balance-icon--stat {
    width: auto;
    height: auto;
    font-size: 22px;
    color: white;
}

.lessons-balance-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lessons-balance-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 600;
}

.lessons-balance-text strong {
    font-weight: 700;
    color: var(--text-primary);
}

.lessons-balance-debt {
    font-size: 11px;
    font-weight: 600;
    color: var(--warning);
}

.lessons-balance-badge--low {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}

.lessons-balance-badge--debt {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.stat-note {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-note-warning {
    color: var(--warning);
    font-weight: 600;
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

.btn-logout:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Основной контент */
.platform-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: calc(100vh - 100px);
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title svg {
    width: 32px;
    height: 32px;
    color: var(--secondary);
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* Карточки */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.card-header-content {
    flex: 1;
}

.card-title {
    font-size: 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg {
    width: 24px;
    height: 24px;
    color: var(--secondary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Сетка курсов */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.course-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--secondary);
}

.course-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 16px;
}

.course-icon svg {
    width: 24px;
    height: 24px;
}

.course-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.course-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.course-meta {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-secondary);
    font-size: 13px;
    color: var(--text-light);
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-meta-item svg {
    width: 14px;
    height: 14px;
}

.course-progress {
    margin-top: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Уроки */
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Список уроков */
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.lesson-item:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.lesson-item-locked {
    opacity: 0.62;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.lesson-item-locked:hover {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: none;
    transform: none;
}

.lesson-info {
    flex: 1;
}

.lesson-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.lesson-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.lesson-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

.lesson-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.lesson-status.in-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.lesson-status.not-started {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Кнопки */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.2);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline svg {
    width: 16px;
    height: 16px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-ghost svg {
    width: 14px;
    height: 14px;
}

/* Чат/Сообщения */
.messages-container {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img,
.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.message.sent .message-bubble {
    background: var(--primary);
    color: white;
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
    padding: 0 16px;
}

.message-form {
    display: flex;
    gap: 12px;
}

.message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--bg-secondary);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
}

.message-input:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Расписание */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-item {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    border-left: 4px solid var(--secondary);
    transition: var(--transition);
}

.schedule-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.schedule-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.schedule-date svg {
    width: 14px;
    height: 14px;
}

.schedule-duration {
    font-size: 12px;
    padding: 4px 12px;
    background: white;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 600;
}

.schedule-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.schedule-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.schedule-meta svg {
    width: 14px;
    height: 14px;
}

.schedule-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.schedule-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--secondary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.schedule-link:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.schedule-link svg {
    width: 14px;
    height: 14px;
}

/* Информация о группе */
.group-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.group-info-item {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.group-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.group-info-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Домашние задания */
.homework-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.homework-item {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 2px solid var(--bg-secondary);
}

.homework-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.homework-title {
    font-size: 18px;
    font-weight: 600;
}

.homework-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.homework-status svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.homework-status.submitted {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.homework-status.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.homework-status.checked {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.homework-status.pending {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.homework-description {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.homework-deadline {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.file-upload-zone {
    position: relative;
    border: 2px dashed var(--border, #d1d5db);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-zone:hover,
.file-upload-zone.is-dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.file-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content svg {
    width: 36px;
    height: 36px;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-upload-title {
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.file-upload-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.file-upload-queue {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-upload-queue li {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--bg-secondary);
    border-radius: var(--radius-sm, 8px);
    color: var(--text-secondary);
    min-width: 0;
}

.file-queue-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-queue-meta {
    flex-shrink: 0;
    white-space: nowrap;
}

.attached-files-list {
    margin-top: 16px;
}

.attached-files-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.attached-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--bg-secondary);
    border-radius: var(--radius-sm, 8px);
    margin-bottom: 8px;
    min-width: 0;
}

.attached-file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.attached-file-name {
    display: block;
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attached-file-size {
    font-size: 12px;
    color: var(--text-light);
}

.attached-file-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.homework-attachments-staff {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.homework-attachment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 8px 16px;
    margin-right: 8px;
    margin-bottom: 8px;
    max-width: min(100%, 280px);
    min-width: 0;
}

.homework-attachment-btn-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

@media (max-width: 640px) {
    .homework-attachment-btn {
        max-width: 100%;
    }

    .attached-file-item {
        flex-wrap: wrap;
    }
}

.homework-review-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
    gap: 16px;
    padding: 0 20px 20px;
}

.homework-review-filters .form-group {
    margin-bottom: 0;
}

.homework-review-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    align-self: end;
}

.homework-review-filter-actions .btn-primary,
.homework-review-filter-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    width: 130px;
    height: 44px;
    padding: 12px 18px;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid transparent;
    line-height: 1;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
}

.homework-review-filter-actions .btn-outline {
    border-color: rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
    .homework-review-filter-actions {
        grid-column: 1 / -1;
        align-items: stretch;
    }

    .homework-review-filter-actions .btn-primary,
    .homework-review-filter-actions .btn-outline {
        flex: 1;
        width: auto;
        height: 44px;
        justify-content: center;
    }
}

.progress-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
    gap: 16px;
    padding: 0 20px 20px;
}

.progress-filters .form-group {
    margin-bottom: 0;
}

.progress-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}

.progress-filter-actions .btn-primary,
.progress-filter-actions .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 44px;
    padding: 12px 18px;
    box-sizing: border-box;
    border: 1px solid transparent;
    line-height: 1;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    flex-shrink: 0;
}

.progress-filter-actions .btn-outline {
    border-color: rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
    .progress-filter-actions {
        flex-wrap: wrap;
    }

    .progress-filter-actions .btn-primary,
    .progress-filter-actions .btn-outline {
        flex: 1;
        width: auto;
        min-width: 0;
    }
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-secondary);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

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

/* Авторизация */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 24px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 32px;
}

.auth-logo.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 32px;
    text-align: center;
}

.auth-logo.brand-lockup .brand-name {
    font-size: 32px;
}

.auth-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 32px;
}

.auth-link {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
}

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

.auth-link a:hover {
    text-decoration: underline;
}

/* Уведомления */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    border-left: 4px solid var(--secondary);
}

.notification-item.unread {
    background: rgba(212, 165, 116, 0.05);
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-light);
}

/* Адаптивность */
@media (max-width: 768px) {
    .platform-nav-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Статистика админ-панели */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: var(--warning);
}

.stat-card-info {
    background: rgba(212, 165, 116, 0.05);
    border-color: var(--secondary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Админ списки */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.homework-admin-list,
.messages-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.homework-admin-item {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.homework-admin-item:hover {
    background: white;
    border-color: var(--secondary);
}

.homework-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.homework-admin-student {
    font-weight: 600;
    color: var(--text-primary);
}

.homework-admin-time {
    font-size: 12px;
    color: var(--text-light);
}

.homework-admin-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.homework-admin-lesson {
    font-size: 13px;
    color: var(--text-secondary);
}

.message-admin-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.message-admin-item.unread {
    background: white;
    border-left-color: var(--secondary);
}

.message-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-admin-sender {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.message-admin-time {
    font-size: 11px;
    color: var(--text-light);
}

.message-admin-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Таблица студентов */
.students-table {
    overflow-x: auto;
}

.students-table table {
    width: 100%;
    border-collapse: collapse;
}

.students-table thead {
    background: var(--bg-secondary);
}

.students-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.students-table td {
    padding: 16px;
    border-bottom: 1px solid var(--bg-secondary);
    font-size: 14px;
}

.students-table tbody tr:hover {
    background: var(--bg-secondary);
}

.role-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-self_study {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.role-individual {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.role-group {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Проверка домашки */
.homework-check-info {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 120px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

.homework-section {
    margin-bottom: 24px;
}

.section-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.section-subtitle svg {
    width: 18px;
    height: 18px;
    color: var(--secondary);
}

.homework-task-box {
    padding: 16px;
    background: rgba(212, 165, 116, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.homework-solution-box {
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.homework-check-form {
    padding-top: 24px;
    border-top: 1px solid var(--bg-secondary);
}

/* Модули */
.module-header {
    display: flex;
    align-items: start;
    gap: 20px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.module-number {
    width: 56px;
    height: 56px;
    background: var(--gradient-2);
    color: white;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-header-content {
    flex: 1;
    min-width: 0;
}

.lesson-item-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.lesson-item-meta svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.card-header-actions,
.admin-lesson-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.status-badge svg {
    width: 14px;
    height: 14px;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Lesson content */
.lesson-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.lesson-content strong {
    color: var(--primary);
    font-weight: 600;
}

.lesson-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Уведомления */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

.notification-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.notification-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--secondary);
}

.notification-item.unread {
    background: rgba(212, 165, 116, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
}

/* Счетчик в кнопках */
.btn-primary .notification-badge {
    width: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.notification-time {
    font-size: 12px;
    color: var(--text-light);
}

/* Расписание по датам */
.schedule-date-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
}

.schedule-date-day {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    color: white;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.member-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schedule-date-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.schedule-date-weekday {
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-week-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.schedule-week-header,
.schedule-week-grid {
    display: grid;
    grid-template-columns: 86px repeat(7, minmax(170px, 1fr));
    min-width: 1280px;
}

.schedule-week-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: white;
    border-bottom: 1px solid var(--bg-secondary);
}

.schedule-time-head,
.schedule-day-head,
.schedule-time-cell,
.schedule-calendar-cell {
    border-right: 1px solid var(--bg-secondary);
    border-bottom: 1px solid var(--bg-secondary);
}

.schedule-time-head,
.schedule-day-head {
    padding: 10px 12px;
    font-weight: 700;
}

.schedule-day-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-day-head span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.schedule-time-cell {
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--bg-secondary);
}

.schedule-calendar-cell {
    min-height: 104px;
    padding: 8px;
    background: white;
    position: relative;
    transition: var(--transition);
}

.schedule-week-card-compact .schedule-calendar-cell {
    min-height: 42px;
    padding: 5px;
}

.schedule-week-card-compact .schedule-calendar-cell:has(.schedule-event-card) {
    min-height: 92px;
}

.schedule-week-card-compact .schedule-time-cell {
    padding: 8px 10px;
    font-size: 12px;
}

.schedule-week-card-compact .schedule-event-card {
    margin-bottom: 4px;
}

.schedule-calendar-cell.is-clickable {
    cursor: pointer;
}

.schedule-calendar-cell.is-clickable:hover {
    background: rgba(212, 165, 116, 0.06);
}

.schedule-cell-placeholder {
    color: var(--text-light);
    font-size: 22px;
    line-height: 1;
}

.schedule-event-card {
    padding: 9px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 4px solid var(--teacher-color, var(--secondary));
    background: var(--teacher-bg, rgba(212, 165, 116, 0.12));
}

.schedule-event-card.is-editable {
    cursor: pointer;
}

.schedule-event-card.is-group {
    border-left-color: var(--teacher-color, var(--primary));
    background: var(--teacher-bg, rgba(45, 55, 72, 0.08));
}

.schedule-event-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 4px;
}

.schedule-event-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.schedule-event-meta {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

.schedule-event-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 700;
}

.schedule-event-actions a {
    color: var(--primary);
    text-decoration: none;
}

.schedule-link-status {
    display: inline-flex;
    margin-top: 7px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.schedule-link-status.is-added {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.schedule-link-status.is-missing,
.schedule-link-missing {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.lesson-status-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
}

.lesson-status-badge.is-completed {
    color: #047857;
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.schedule-delete-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.schedule-delete-section h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.schedule-delete-section p {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.schedule-delete-btn {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.35);
}

.schedule-delete-btn:hover {
    background: rgba(185, 28, 28, 0.06);
    border-color: #b91c1c;
}

.lesson-status-badge.is-pending {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
}

.schedule-link-missing {
    display: inline-flex;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    width: min(880px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.modal-card-small {
    width: min(560px, 100%);
}

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

.modal-header h2 {
    margin-bottom: 6px;
}

.modal-header p {
    color: var(--text-secondary);
    margin: 0;
}

/* Сообщения */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: clamp(360px, calc(100vh - 360px), 680px);
    height: clamp(360px, calc(100dvh - 360px), 680px);
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: start;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.message.sent .message-avatar {
    background: var(--gradient-1);
}

.message-content {
    max-width: 60%;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message.sent .message-content {
    background: var(--primary);
    color: white;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 12px;
}

.message-sender {
    font-weight: 600;
    font-size: 13px;
}

.message.sent .message-sender {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
}

.message.sent .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.message.sent .message-text {
    color: white;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.message-form {
    display: flex;
    gap: 12px;
    align-items: end;
}

.message-input {
    flex: 1;
    min-height: 80px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: var(--transition);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.05);
}

/* Дополнительные стили stat-card */
.stat-card-success {
    background: rgba(16, 185, 129, 0.05);
    border-color: #10b981;
}

/* Мета информация домашки */
.homework-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.homework-meta-grade {
    font-weight: 600;
    color: var(--primary);
}

/* Обратная связь */
.homework-feedback {
    padding: 16px;
    background: rgba(212, 165, 116, 0.08);
    border-left: 4px solid var(--secondary);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-header svg {
    width: 18px;
    height: 18px;
    color: var(--secondary);
    flex-shrink: 0;
}

/* Вкладки чатов */
.chat-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: white;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-page-content {
    height: calc(100vh - 58px);
    height: calc(100dvh - 58px);
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-page-content .chat-tabs {
    flex-shrink: 0;
}

.chat-page-card {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-page-card .card-header,
.chat-page-card .chat-composer {
    flex-shrink: 0;
}

.chat-page-card .messages-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 12px;
}

.chat-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.chat-tab svg {
    width: 18px;
    height: 18px;
}

.chat-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.chat-tab.active {
    background: var(--primary);
    color: white;
}

.chat-tab.active:hover {
    background: var(--primary-dark);
}

/* Админ курсы */
.admin-courses-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-course-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.admin-course-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.admin-course-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-course-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.admin-course-content {
    flex: 1;
}

.admin-course-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.admin-course-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.admin-course-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.admin-course-actions {
    display: flex;
    gap: 8px;
}

/* Админ уроки */
.admin-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-lesson-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: var(--transition);
}

.admin-lesson-item:hover {
    background: white;
}

.lesson-order {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-lesson-content {
    flex: 1;
}

.admin-lesson-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.lesson-homework-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.homework-mini-link {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(212, 165, 116, 0.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.homework-mini-link:hover {
    background: rgba(212, 165, 116, 0.2);
}

/* Редактор уроков */
.lesson-editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

.form-row-equal {
    grid-template-columns: 1fr 1fr;
}

.lesson-section-editor {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.section-editor-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.section-number {
    width: 32px;
    height: 32px;
    background: var(--gradient-2);
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    width: 120px;
}

.form-select-full {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 15px;
}

.form-help {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.section-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.section-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.05);
}

.btn-delete {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.btn-delete svg {
    width: 16px;
    height: 16px;
}

/* Урок с боковым меню */
.lesson-with-sidebar {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    margin-bottom: 32px;
    min-width: 0;
}

.lesson-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
}

.lesson-sidebar::-webkit-scrollbar {
    width: 6px;
}

.lesson-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-secondary);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
    margin-bottom: 4px;
}

.sidebar-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-number {
    width: 24px;
    height: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-link:hover .sidebar-number {
    background: var(--secondary);
    color: white;
}

.lesson-main-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.lesson-section {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
    max-width: 100%;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-secondary);
}

.section-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Стили для контента из TinyMCE */
.section-content h1,
.section-content h2,
.section-content h3,
.section-content h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-content h1 { font-size: 28px; }
.section-content h2 { font-size: 24px; }
.section-content h3 { font-size: 20px; }
.section-content h4 { font-size: 18px; }

.section-content p {
    margin-bottom: 16px;
}

.section-content strong,
.section-content b {
    font-weight: 600;
    color: var(--primary);
}

.section-content em,
.section-content i {
    font-style: italic;
}

.section-content ul,
.section-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.section-content li {
    margin-bottom: 8px;
}

.section-content a {
    color: var(--primary);
    text-decoration: underline;
}

.section-content a:hover {
    color: var(--primary-dark);
}

.section-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.section-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.section-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.section-content pre code {
    background: transparent;
    padding: 0;
}

.section-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.section-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    table-layout: fixed;
}

.section-content th,
.section-content td {
    border: 1px solid var(--bg-secondary);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.section-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
    margin: 16px 0;
}

.code-block code {
    color: inherit;
    background: transparent;
}

.trainer-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius);
    padding: 20px;
}

.trainer-instructions {
    margin-bottom: 18px;
    color: var(--text-primary);
    line-height: 1.7;
}

.trainer-instructions p {
    margin-bottom: 12px;
}

.trainer-instructions ul,
.trainer-instructions ol {
    margin: 12px 0;
    padding-left: 22px;
}

.trainer-editor-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.trainer-editor-pane,
.trainer-preview-pane,
.trainer-checks {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 16px;
}

.trainer-pane-title {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.trainer-editor {
    width: 100%;
    min-height: 320px;
    padding: 16px;
    border: 1px solid var(--bg-secondary);
    border-radius: 10px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.trainer-editor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.trainer-editor-pane .CodeMirror {
    min-height: 360px;
    border: 1px solid var(--bg-secondary);
    border-radius: 10px;
    font-family: 'Courier New', Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.trainer-editor-pane .CodeMirror-gutters {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.CodeMirror-hints {
    z-index: 3000;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    font-family: 'Courier New', Monaco, monospace;
}

.CodeMirror-hint {
    padding: 6px 10px;
}

li.CodeMirror-hint-active {
    background: var(--primary);
    color: white;
}

.trainer-preview {
    width: 100%;
    min-height: 320px;
    border: 1px solid var(--bg-secondary);
    border-radius: 10px;
    background: white;
}

.trainer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.trainer-checks {
    margin-top: 18px;
}

.trainer-check {
    position: relative;
    padding: 10px 12px 10px 34px;
    margin-top: 8px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 14px;
}

.trainer-check::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fb923c;
}

.trainer-check.is-passed {
    background: #ecfdf5;
    color: #047857;
}

.trainer-check.is-passed::before {
    background: #10b981;
}

@media (max-width: 968px) {
    .lesson-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .lesson-sidebar {
        position: static;
    }

}

/* Список студентов */
.students-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.student-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.student-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.student-avatar {
    width: 56px;
    height: 56px;
    background: var(--gradient-1);
    color: white;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
}

.student-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.student-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.unread-indicator {
    color: var(--primary);
    font-weight: 500;
}

/* Список групп */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-card:hover {
    border-color: var(--secondary);
    background: var(--bg-secondary);
}

.checkbox-card span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-card small {
    color: var(--text-secondary);
    font-size: 12px;
}

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

.access-course-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--bg-secondary);
}

.access-course-toggle {
    margin-bottom: 0;
}

.access-modules-nested {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    margin-left: 8px;
    padding-left: 14px;
    border-left: 2px solid var(--border);
}

.access-modules-empty {
    margin: 8px 0 0 8px;
}

.form-hint {
    margin: 0 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

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

.info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-secondary);
}

.info-list span {
    color: var(--text-secondary);
}

.teacher-reminder-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    width: min(360px, calc(100vw - 48px));
    padding: 16px 18px;
    border-radius: 18px;
    background: #fff7ed;
    border: 1px solid rgba(245, 158, 11, 0.35);
    box-shadow: var(--shadow-lg);
    color: #9a3412;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.student-homework-toast {
    flex-direction: row;
    gap: 12px;
}

.reminder-toast-link {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    color: inherit;
    text-decoration: none;
}

.teacher-reminder-toast strong,
.reminder-toast-link strong {
    color: #7c2d12;
}

.teacher-reminder-toast span,
.reminder-toast-link span {
    color: #9a3412;
    font-size: 14px;
    line-height: 1.4;
}

.reminder-toast-close {
    width: 28px;
    height: 28px;
    margin: -6px -8px 0 0;
    border: 0;
    border-radius: 50%;
    background: rgba(124, 45, 18, 0.08);
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reminder-toast-close:hover {
    background: rgba(124, 45, 18, 0.14);
}

.student-homework-toast {
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.28);
    color: #1d4ed8;
}

.student-homework-toast strong,
.student-homework-toast .reminder-toast-link strong {
    color: #1e3a8a;
}

.student-homework-toast span,
.student-homework-toast .reminder-toast-link span {
    color: #1d4ed8;
}

.student-homework-toast .reminder-toast-close {
    background: rgba(29, 78, 216, 0.08);
}

.student-homework-toast .reminder-toast-close:hover {
    background: rgba(29, 78, 216, 0.14);
}

.progress-student-item {
    align-items: flex-start;
}

.student-progress-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.student-progress-row > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.student-progress-row strong {
    display: block;
    font-size: 18px;
    color: var(--text-primary);
}

.student-progress-row span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.course-progress-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.course-progress-tags span {
    padding: 5px 9px;
    border-radius: var(--radius-full);
    background: rgba(45, 55, 72, 0.08);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.progress-details {
    margin-top: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.progress-details summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.progress-empty-detail,
.progress-homework-empty {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 10px 0;
}

.progress-course-detail {
    padding: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.progress-course-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
}

.progress-course-header span {
    color: var(--primary);
    font-weight: 800;
}

.progress-module-detail {
    margin-top: 14px;
}

.progress-module-detail h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-lesson-list,
.progress-homework-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-lesson-detail {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bg-secondary);
}

.progress-lesson-detail.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.22);
}

.progress-lesson-detail.available {
    background: rgba(212, 165, 116, 0.1);
    border-color: rgba(212, 165, 116, 0.28);
}

.progress-lesson-detail.locked {
    opacity: 0.72;
}

.progress-lesson-main,
.progress-homework-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.progress-lesson-main strong,
.progress-homework-row strong {
    display: block;
    font-size: 14px;
}

.progress-lesson-main span:not(.progress-pill),
.progress-homework-row span:not(.homework-status) {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-pill {
    flex-shrink: 0;
    padding: 5px 9px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
}

.progress-pill.completed {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.progress-pill.available {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.progress-pill.locked {
    background: rgba(100, 116, 139, 0.14);
    color: var(--text-secondary);
}

.progress-homework-list {
    margin-top: 10px;
}

.progress-homework-row {
    padding: 10px;
    border-radius: 10px;
    background: #fff;
}

.payment-balance-card {
    margin-top: 24px;
}

.payment-balance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 20px;
}

.payment-balance-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(140px, 1fr));
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: #fff;
}

.payment-balance-row:nth-child(even) {
    background: var(--bg-secondary);
}

.payment-balance-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-balance-row > div:not(:first-child) {
    padding-left: 12px;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.payment-balance-row span {
    color: var(--text-secondary);
    font-size: 13px;
}

.payment-balance-teacher {
    font-size: 12px;
    color: var(--text-light);
}

.admin-payments-page .students-table tbody tr {
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.admin-payments-page .students-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.9);
}

.admin-payments-page .students-table tbody tr:hover {
    background: rgba(212, 165, 116, 0.08);
}

.admin-payments-page .students-table td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
}

.admin-payments-page .students-table td + td {
    border-left: 1px solid rgba(15, 23, 42, 0.05);
}

.payment-flow {
    display: grid;
    gap: 12px;
    padding: 0 24px 24px;
}

.payment-flow-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid rgba(45, 55, 72, 0.08);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.035), rgba(212, 165, 116, 0.08));
}

.payment-flow-item-accent {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.14), rgba(245, 158, 11, 0.08));
}

.payment-flow-step {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
}

.payment-flow-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.payment-flow-item span {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.finance-report-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.finance-income-card .card-header {
    padding-bottom: 12px;
}

.finance-income-card .payment-flow,
.finance-income-flow {
    padding: 0 16px 16px;
    gap: 8px;
}

.finance-income-card .payment-flow-item {
    grid-template-columns: 30px 1fr;
    gap: 10px;
    padding: 10px;
    min-width: 0;
}

.finance-income-item-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.finance-income-item-body strong {
    display: block;
    margin-bottom: 0;
    color: var(--text-primary);
    line-height: 1.35;
}

.finance-income-item-body span {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.finance-rates-list {
    padding: 0 24px;
}

.finance-rate-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.finance-rate-row:last-child {
    border-bottom: 0;
}

.finance-rate-row-head {
    padding-top: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.finance-rate-name {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.finance-rate-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.finance-rate-label {
    display: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.finance-rates-list .form-input {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
}

.finance-rates-actions {
    padding: 16px 24px 24px;
}

.finance-rates-card .card-header {
    padding-bottom: 12px;
}

.finance-income-card .payment-flow-step {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 12px;
}

.payment-subscription-input,
.payment-subscription-actions .btn-outline,
.payment-subscription-actions .btn-primary {
    font-size: 12px;
    padding: 7px 9px;
}

.payment-subscription-input[type="number"] {
    max-width: 90px;
}

.payment-subscription-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}

.payment-subscription-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .payment-balance-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .payment-balance-row > div:not(:first-child) {
        padding-left: 0;
        border-left: 0;
        padding-top: 10px;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
    }

    .payment-balance-row > div:first-child {
        grid-column: 1 / -1;
        padding-bottom: 4px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }
}

.profile-photo-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    font-size: 32px;
}

.role-badge.role-admin,
.role-badge.admin {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.role-badge.role-manager,
.role-badge.manager {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.role-badge.role-teacher,
.role-badge.teacher {
    background: rgba(45, 55, 72, 0.1);
    color: var(--primary);
}

@media (max-width: 900px) {
    .admin-layout,
    .finance-report-layout,
    .form-row,
    .form-row-equal {
        grid-template-columns: 1fr;
    }

    .profile-photo-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

.group-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.group-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.group-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.group-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.group-info-text {
    flex: 1;
}

.group-info-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.group-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Участники группы */
.group-members-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.member-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.member-avatar-small {
    width: 24px;
    height: 24px;
    background: var(--gradient-1);
    color: white;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Чат */
.chat-container {
    display: flex;
    flex-direction: column;
    height: clamp(460px, calc(100vh - 260px), 780px);
    height: clamp(460px, calc(100dvh - 260px), 780px);
    min-height: 0;
    border-top: 1px solid var(--bg-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-item {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.message-item.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-item.sent .message-avatar {
    background: var(--gradient-2);
}

.message-content-wrapper {
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-item.sent .message-content-wrapper {
    align-items: flex-end;
}

.message-sender {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.message-item .message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
}

.message-item.sent .message-text {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.message-item.sent .message-sender {
    color: var(--text-secondary);
}

.message-item.sent .message-time {
    color: var(--text-light);
}

.message-time {
    font-size: 12px;
    color: var(--text-light);
}

.chat-input-form {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-input-form textarea {
    flex: 1;
    min-height: 50px;
    max-height: 120px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    transition: var(--transition);
}

.chat-input-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.05);
}

.chat-input-form button {
    align-self: flex-end;
}

.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-composer-field {
    flex: 1;
    min-width: 0;
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--primary-dark);
    transform: none;
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

.chat-shell {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    height: clamp(560px, calc(100vh - 170px), 860px);
    height: clamp(560px, calc(100dvh - 170px), 860px);
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.platform-content.admin-chats-page {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
}

body:has(.platform-content.admin-chats-page) {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body:has(.platform-content.admin-chats-page) .platform-nav {
    flex-shrink: 0;
    width: 100%;
    align-self: stretch;
}

.admin-chats-page .admin-chats-header,
.admin-chats-page .page-header {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.admin-chats-page .chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.admin-chats-page .chat-shell > .chat-sidebar,
.admin-chats-page .chat-shell > .chat-window {
    min-height: 0;
}

.admin-chats-page .chat-sidebar {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-chats-page .chat-window {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.admin-chats-page .chat-window-header,
.admin-chats-page .chat-members-row,
.admin-chats-page .chat-input-form,
.admin-chats-page .chat-composer {
    flex-shrink: 0;
}

.admin-chats-page .chat-messages,
.admin-chats-page .chat-messages-split {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.chat-sidebar {
    border-right: 1px solid var(--bg-secondary);
    background: var(--bg-secondary);
    overflow-y: auto;
}

.chat-sidebar-title {
    padding: 18px 20px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.chat-empty-list {
    padding: 24px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: var(--transition);
}

.chat-list-item:hover,
.chat-list-item.active {
    background: white;
}

.chat-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-list-avatar.is-group {
    border-radius: 12px;
    background: var(--gradient-2);
}

.chat-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-list-info {
    min-width: 0;
    flex: 1;
}

.chat-list-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-window-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--bg-secondary);
}

.chat-window-header h2 {
    margin: 0;
    font-size: 20px;
}

.chat-window-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.chat-members-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--bg-secondary);
}

.chat-messages-split {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border-bottom: 1px solid var(--bg-secondary);
}

.chat-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
    transition: var(--transition);
}

.chat-back-btn:hover {
    border-color: var(--secondary);
    background: var(--bg-secondary);
}

.chat-back-btn svg {
    width: 20px;
    height: 20px;
}

.chat-window-placeholder {
    display: none;
}

@media (max-width: 1024px) {
    .finance-report-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .chat-shell:not(.is-list-view):not(.is-chat-view) {
        grid-template-columns: 1fr;
    }

    .chat-shell:not(.is-list-view):not(.is-chat-view) .chat-sidebar {
        max-height: 260px;
        border-right: 0;
        border-bottom: 1px solid var(--bg-secondary);
    }
}

@media (max-width: 1024px) {
    body.platform-menu-open {
        overflow: hidden;
    }

    .platform-nav {
        position: sticky;
    }

    .platform-nav-content {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 0;
        padding: 0 18px;
    }

    .platform-logo {
        padding: 14px 0;
        font-size: 18px;
    }

    .platform-menu-toggle {
        display: inline-flex;
    }

    .platform-nav.is-open .platform-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .platform-nav.is-open .platform-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .platform-nav.is-open .platform-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .platform-nav-links,
    .platform-user-menu,
    .lessons-balance-badge {
        display: none;
    }

    .platform-nav.is-open .platform-nav-content {
        max-height: calc(100dvh - 56px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: stretch;
    }

    .platform-nav.is-open .platform-nav-links,
    .platform-nav.is-open .platform-user-menu,
    .platform-nav.is-open .lessons-balance-badge {
        display: flex;
        grid-column: 1 / -1;
        width: 100%;
    }

    .platform-nav.is-open .lessons-balance-badge {
        margin: 8px 2px 18px;
        padding: 10px 12px;
        white-space: normal;
        border-radius: 14px;
    }

    .platform-nav.is-open .platform-nav-links {
        flex-direction: column;
        max-height: none;
        margin: 6px 0 0;
        padding: 10px 2px 12px;
        overflow: visible;
        align-items: stretch;
        gap: 8px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-link {
        width: 100%;
        min-height: 44px;
        padding: 12px 12px;
        border-bottom: 0;
        border-radius: 12px;
        font-size: 14px;
    }

    .nav-link.active {
        background: rgba(212, 165, 116, 0.12);
        border-bottom-color: transparent;
    }

    .nav-link svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .nav-link .nav-badge {
        margin-left: auto;
    }

    .platform-nav.is-open .platform-user-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 2px 16px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        flex-shrink: 0;
    }

    .platform-user-menu .user-info {
        min-width: 0;
        flex: 1;
        width: 100%;
    }

    .platform-nav.is-open .btn-logout {
        width: 100%;
        justify-content: center;
    }

    .user-name,
    .user-role {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .platform-nav.is-open .user-name,
    .platform-nav.is-open .user-role {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .btn-logout {
        padding: 9px 14px;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .platform-nav-content {
        padding: 0 14px;
    }

    .platform-nav.is-open .platform-nav-content {
        max-height: calc(100dvh - 52px);
    }

    .platform-nav.is-open .platform-nav-links {
        margin: 4px 0 0;
        padding: 8px 0 10px;
        gap: 6px;
    }

    .nav-link {
        min-height: 46px;
        padding: 12px 10px;
    }

    .platform-nav.is-open .platform-user-menu {
        gap: 10px;
        padding: 10px 0 14px;
    }

    .platform-nav.is-open .lessons-balance-badge {
        margin-bottom: 20px;
    }

    .btn-logout {
        padding: 9px 12px;
    }

    .platform-content {
        padding: 24px 14px;
        min-height: calc(100vh - 70px);
    }

    .container {
        padding: 0 14px;
    }

    .page-header {
        margin-bottom: 22px;
    }

    .page-title {
        align-items: flex-start;
        font-size: 26px;
        gap: 10px;
    }

    .page-title svg {
        width: 26px;
        height: 26px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .page-actions,
    .card-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .page-actions .btn-primary,
    .page-actions .btn-outline,
    .card-header > .btn-primary,
    .card-header > .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .btn-ghost {
        width: auto;
        justify-content: flex-start;
        align-self: flex-start;
    }

    .dashboard-title-icon {
        display: none;
    }

    .dashboard-title {
        gap: 0;
    }

    .dashboard-notifications-card {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .dashboard-notifications-card .card-header {
        margin-bottom: 12px;
    }

    .dashboard-notifications-card .card-title {
        margin-bottom: 0;
    }

    .dashboard-notifications-card .all-notifications-link {
        padding: 4px 0;
        margin-top: -4px;
    }

    .dashboard-notifications-card .notifications-list {
        gap: 10px;
    }

    .card,
    .course-card {
        padding: 20px;
        border-radius: 14px;
    }

    .card-title {
        align-items: flex-start;
        font-size: 18px;
    }

    .courses-grid,
    .stats-grid,
    .dashboard-grid,
    .admin-grid,
    .finance-report-layout,
    .form-row,
    .form-row-equal,
    .payment-balance-row,
    .payment-subscription-dates {
        grid-template-columns: 1fr;
    }

    .payment-balance-list {
        padding: 0 14px 16px;
        gap: 10px;
    }

    .payment-balance-row {
        padding: 14px;
    }

    .payment-balance-row > div:not(:first-child) {
        grid-column: 1 / -1;
        padding-left: 0;
        border-left: 0;
    }

    .admin-payments-page .students-table td + td {
        border-left: 0;
    }

    .admin-payments-page .payment-subscriptions-table table {
        min-width: 860px;
    }

    .admin-payments-page .payment-subscriptions-table th:last-child,
    .admin-payments-page .payment-subscriptions-table td:last-child {
        min-width: 280px;
        width: 280px;
    }

    .admin-payments-page .payment-subscriptions-table td:last-child .payment-subscription-input {
        width: 100%;
        max-width: none;
    }

    .admin-payments-page .payment-subscription-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .admin-payments-page .payment-subscription-actions .btn-outline,
    .admin-payments-page .payment-subscription-actions .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
    }

    .admin-payments-page .payment-subscription-actions form {
        width: 100%;
    }

    .admin-payments-page .payment-subscription-actions form button {
        width: 100%;
        justify-content: center;
    }

    .admin-finance-page .finance-report-layout {
        gap: 16px;
    }

    .admin-finance-page .finance-income-card .payment-flow,
    .admin-finance-page .finance-income-flow {
        padding: 0 14px 14px;
    }

    .admin-finance-page .finance-income-card .payment-flow-item {
        padding: 12px;
    }

    .admin-finance-page .finance-income-item-body {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .admin-finance-page .finance-income-item-body strong {
        flex: 1;
        min-width: 0;
        font-size: 14px;
    }

    .admin-finance-page .finance-income-item-body span {
        flex-shrink: 0;
        font-size: 14px;
    }

    .admin-finance-page .finance-rates-list {
        padding: 0 14px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .admin-finance-page .finance-rate-row-head {
        display: none;
    }

    .admin-finance-page .finance-rate-row {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
        padding: 14px;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 12px;
        background: #fff;
    }

    .admin-finance-page .finance-rate-row:nth-child(even) {
        background: var(--bg-secondary);
    }

    .admin-finance-page .finance-rate-name {
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }

    .admin-finance-page .finance-rate-label {
        display: block;
    }

    .admin-finance-page .finance-rates-actions {
        padding: 12px 14px 16px;
    }

    .admin-finance-page .finance-rates-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .admin-finance-page .form-row .form-group:last-child {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .admin-finance-page .form-row .form-group:last-child .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .admin-finance-page .students-table td + td {
        border-left: 0;
    }

    .course-meta {
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 4px;
        padding-top: 10px;
        font-size: 12px;
    }

    .course-meta-item {
        min-width: 0;
    }

    .courses-grid {
        gap: 14px;
    }

    .course-card {
        gap: 10px;
        min-width: 0;
    }

    .course-card:hover {
        transform: none;
    }

    .course-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 4px;
        border-radius: 10px;
    }

    .course-icon svg {
        width: 20px;
        height: 20px;
    }

    .course-card h3 {
        font-size: 17px;
        line-height: 1.25;
        margin-bottom: 4px;
    }

    .course-card p {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 8px;
    }

    .admin-course-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .admin-course-content {
        width: 100%;
        min-width: 0;
    }

    .admin-course-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .admin-course-sep {
        display: none;
    }

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

    .admin-lesson-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .admin-lesson-content,
    .module-header-content,
    .lesson-info {
        width: 100%;
        min-width: 0;
    }

    .lesson-homework-links {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header-actions,
    .admin-lesson-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .card-header-actions .btn-primary,
    .card-header-actions .btn-outline,
    .card-header-actions .btn-ghost,
    .admin-lesson-actions .btn-primary,
    .admin-lesson-actions .btn-outline,
    .admin-lesson-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .course-progress {
        margin-top: 10px;
    }

    .course-card .btn-primary,
    .course-card .btn-outline {
        min-height: 44px;
        margin-top: 10px !important;
        padding: 11px 14px;
    }

    .module-header {
        gap: 12px;
        padding: 16px;
        flex-direction: column;
    }

    .module-number {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        font-size: 18px;
    }

    .module-header h3 {
        font-size: 18px !important;
        line-height: 1.25;
    }

    .module-header p {
        font-size: 13px !important;
        line-height: 1.5;
    }

    .module-header .progress-bar {
        max-width: none !important;
    }

    .lesson-item,
    .student-item,
    .group-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .lesson-status {
        width: 100%;
        justify-content: center;
        align-self: stretch;
    }

    .breadcrumb {
        font-size: 12px;
        line-height: 1.5;
        word-break: break-word;
    }

    .lesson-with-sidebar,
    .lesson-main-content,
    .lesson-section,
    .lesson-content,
    .section-content,
    .trainer-card,
    .trainer-editor-layout,
    .trainer-editor-pane,
    .trainer-preview-pane,
    .trainer-checks {
        min-width: 0;
        max-width: 100%;
    }

    .lesson-section {
        padding: 16px;
        overflow: hidden;
    }

    .lesson-content,
    .section-content {
        padding: 16px;
        font-size: 14px;
        line-height: 1.65;
        border-radius: 12px;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .lesson-content img,
    .section-content img,
    .lesson-content iframe,
    .section-content iframe,
    .lesson-content video,
    .section-content video {
        max-width: 100%;
        height: auto;
    }

    .lesson-content pre,
    .section-content pre,
    .code-block {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: pre;
    }

    .section-content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .section-content th,
    .section-content td {
        padding: 8px;
        white-space: nowrap;
    }

    .trainer-card {
        padding: 14px;
        overflow: hidden;
    }

    .trainer-editor-pane,
    .trainer-preview-pane,
    .trainer-checks {
        padding: 12px;
        overflow: hidden;
    }

    .trainer-editor,
    .trainer-preview,
    .trainer-editor-pane .CodeMirror,
    .trainer-editor-pane .CodeMirror-scroll {
        max-width: 100%;
        min-width: 0;
    }

    .trainer-editor-pane .CodeMirror {
        min-height: 300px;
        overflow: hidden;
    }

    .trainer-editor-pane .CodeMirror-scroll {
        overflow: auto !important;
    }

    .trainer-actions .btn-primary,
    .trainer-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .lesson-with-sidebar {
        gap: 16px;
        margin-bottom: 20px;
    }

    .lesson-sidebar {
        padding: 12px;
        max-height: none;
        overflow: visible;
    }

    .sidebar-title {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .sidebar-link {
        padding: 9px 10px;
        font-size: 13px;
    }

    .homework-admin-header,
    .message-admin-header,
    .progress-course-header,
    .info-list > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .homework-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .homework-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .homework-meta-sep {
        display: none;
    }

    .homework-meta-course,
    .homework-meta-lesson,
    .homework-meta-extra,
    .homework-meta-grade,
    .homework-meta-date {
        display: block;
        line-height: 1.4;
    }

    .student-info {
        width: 100%;
        min-width: 0;
    }

    .student-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .student-meta-sep {
        display: none;
    }

    .group-info-text {
        width: 100%;
        min-width: 0;
    }

    .group-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .group-meta-sep {
        display: none;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .info-label {
        width: auto;
    }

    .students-table,
    .section-table-wrap,
    .schedule-week-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .schedule-week-header,
    .schedule-week-grid {
        grid-template-columns: 46px repeat(7, minmax(150px, 1fr));
        min-width: 1096px;
    }

    .schedule-time-head,
    .schedule-time-cell {
        padding: 6px 3px;
        font-size: 11px;
        text-align: center;
        line-height: 1.2;
    }

    .schedule-time-head {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 10px;
        font-weight: 600;
    }

    .schedule-week-card-compact .schedule-time-cell {
        padding: 6px 3px;
        font-size: 11px;
    }

    .schedule-event-card {
        min-width: 0;
        overflow: hidden;
    }

    .schedule-event-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .students-table table {
        min-width: 640px;
    }

    .chat-page-content {
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .chat-page-content .chat-tabs {
        flex-shrink: 0;
        margin-bottom: 10px;
    }

    .chat-page-card {
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 0;
        padding: 14px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .chat-page-card .card-header {
        flex-shrink: 0;
        margin-bottom: 10px;
    }

    .chat-page-card .card-title {
        margin-bottom: 4px;
    }

    .chat-messages,
    .chat-messages-split {
        max-height: none;
    }

    .messages-container {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        max-height: none;
        margin-bottom: 10px;
    }

    .chat-container {
        height: calc(100vh - 245px);
        height: calc(100dvh - 245px);
        min-height: 390px;
    }

    .chat-shell {
        height: calc(100vh - 150px);
        height: calc(100dvh - 150px);
        min-height: 0;
    }

    .platform-content.admin-chats-page,
    .admin-chats-page {
        width: 100%;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 10px 14px;
        box-sizing: border-box;
    }

    .admin-chats-page.is-chat-active {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .admin-chats-page.is-chat-active .admin-chats-header {
        display: none;
    }

    .admin-chats-page .admin-chats-header,
    .admin-chats-page .page-header {
        margin-bottom: 10px;
    }

    .admin-chats-page .chat-shell {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .chat-shell.is-list-view {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        min-height: 0;
    }

    .chat-shell.is-list-view .chat-sidebar {
        display: block;
        max-height: none;
        height: 100%;
        min-height: 0;
        border-right: 0;
        border-bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-shell.is-list-view .chat-window {
        display: none;
    }

    .chat-shell.is-chat-view {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        min-height: 0;
    }

    .chat-shell.is-chat-view .chat-sidebar {
        display: none;
    }

    .chat-shell.is-chat-view .chat-window {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .chat-shell.is-list-view .chat-sidebar-title {
        padding: 12px 14px;
        font-size: 14px;
    }

    .chat-shell.is-list-view .chat-list-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .chat-shell.is-list-view .chat-list-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .chat-shell.is-list-view .chat-list-title {
        font-size: 14px;
    }

    .chat-shell.is-list-view .chat-list-subtitle {
        display: none;
    }

    .chat-shell.is-chat-view .chat-back-btn {
        display: inline-flex;
    }

    .chat-shell.is-chat-view .chat-window-header {
        padding: 12px 14px;
        gap: 10px;
    }

    .chat-shell.is-chat-view .chat-window-header h2 {
        font-size: 16px;
    }

    .chat-shell.is-chat-view .chat-window-header p {
        display: none;
    }

    .chat-shell.is-chat-view .chat-members-row {
        padding: 8px 14px;
        max-height: 72px;
        overflow-y: auto;
    }

    .chat-window {
        min-height: 0;
    }

    .chat-messages,
    .chat-messages-split {
        flex: 1 1 auto;
        min-height: 0;
    }

    .message-content {
        max-width: 88%;
    }

    .messages-container,
    .chat-messages {
        padding: 14px;
    }

    .message-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .message.sent .message-header {
        align-items: flex-end;
    }

    .message-content-wrapper {
        max-width: 82%;
    }

    .message-item.sent .message-content-wrapper {
        align-items: flex-end;
    }

    .message-sender,
    .message-time {
        display: block;
        line-height: 1.3;
    }

    .message-header {
        width: 100%;
    }

    .message-time {
        align-self: flex-start;
        padding: 0;
        text-align: left;
    }

    .message.sent .message-time,
    .message-item.sent .message-time {
        align-self: flex-end;
        text-align: right;
    }

    .chat-composer {
        align-items: flex-end;
        gap: 8px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid rgba(15, 23, 42, 0.08);
    }

    .chat-composer-field,
    .chat-composer .message-input,
    .chat-composer textarea {
        min-height: 76px;
        max-height: 160px;
        padding: 12px 16px;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 21px;
        background: #f8fafc;
        font-size: 16px;
        line-height: 1.35;
        resize: none;
        box-shadow: none;
    }

    .chat-composer-field:focus,
    .chat-composer .message-input:focus,
    .chat-composer textarea:focus {
        outline: none;
        border-color: var(--secondary);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
    }

    .chat-send-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        box-shadow: none;
    }

    .chat-send-btn svg {
        width: 17px;
        height: 17px;
    }

    .teacher-reminder-toast {
        right: 14px;
        bottom: 14px;
        width: calc(100vw - 28px);
        padding: 14px;
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .platform-nav-content {
        padding: 0 12px;
    }

    .platform-content,
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-title {
        font-size: 24px;
    }

    .card,
    .course-card {
        padding: 16px;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .chat-send-btn {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.student-payment-page .student-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.student-payment-balance-value {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0 4px;
}

.student-payment-ruble {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 24px;
}

.student-payment-balance-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.student-payment-balance-caption {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.student-payment-prices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-payment-price-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.student-payment-price-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

.student-payment-price-item strong {
    font-size: 22px;
    color: var(--text-primary);
    white-space: nowrap;
}

.student-payment-price-item-accent {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

.student-payment-note {
    margin: 0 0 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.student-payment-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.student-payment-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: var(--transition);
}

.student-payment-contact:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
}

.student-payment-contact-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 600;
}

.student-payment-contact strong {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

@media (max-width: 768px) {
    .student-payment-price-item strong {
        font-size: 18px;
    }

    .student-payment-balance-number {
        font-size: 24px;
    }
}

/* Site leads admin */
.admin-leads-filters {
    display: grid;
    gap: 20px;
}

.admin-leads-filters .filter-group {
    display: grid;
    gap: 10px;
}

.admin-leads-filters .filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-leads-filters .filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-leads-filters .filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.admin-leads-filters .filter-tab:hover,
.admin-leads-filters .filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.lead-status-badge,
.lead-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.lead-status-new {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.lead-status-in_progress {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.lead-status-done {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.lead-status-archived {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
}

.lead-source-school {
    background: rgba(45, 55, 72, 0.1);
    color: var(--primary);
}

.lead-source-studio {
    background: rgba(212, 165, 116, 0.18);
    color: #9a6b3f;
}

.lead-meta-line {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.lead-message-cell {
    max-width: 280px;
    font-size: 14px;
    line-height: 1.5;
}

.lead-status-form {
    display: grid;
    gap: 8px;
    min-width: 170px;
}

.lead-status-form .form-input {
    width: 100%;
    font-size: 13px;
}

.lead-status-form .btn-outline.small {
    font-size: 12px;
    padding: 6px 10px;
}

.admin-leads-page .students-table td {
    vertical-align: top;
}

@media (max-width: 1024px) {
    .admin-leads-page .students-table {
        overflow-x: auto;
    }
}
