/* ========================================
   БАЗОВЫЕ СТИЛИ
   ======================================== */

:root {
    /* Цвета MAX */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Нейтральные цвета */
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Радиусы */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Шрифты */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   FLASH СООБЩЕНИЯ
   ======================================== */

.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.flash-success {
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.flash-error {
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.flash-info {
    border-left-color: var(--info-color);
    color: var(--info-color);
}

.flash-message i {
    font-size: 20px;
}

.flash-message span {
    flex: 1;
    color: var(--text-primary);
}

.flash-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.flash-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   СТРАНИЦА АВТОРИЗАЦИИ
   ======================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    gap: 40px;
}



.auth-card-compact {
    max-width: 450px;  /* Компактная ширина для страницы входа */
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px;
    width: 100%;
    max-width: 600px;
}

.auth-card-compact {
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ========================================
   ФОРМЫ
   ======================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 15px;
}

.form-section-header i {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    transition: all 0.2s;
    background: var(--card-bg);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-hint i {
    margin-right: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Input с кнопкой */
.input-with-button {
    display: flex;
    gap: 10px;
}

.input-with-button input {
    flex: 1;
}

.btn-check-code {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-check-code:hover {
    background: var(--primary-dark);
}

.btn-check-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Статус кода */
.code-status {
    margin-top: 10px;
}

.status-success {
    padding: 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-error {
    padding: 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Пароль с кнопкой показа */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Чекбокс */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-family);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ========================================
   ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ
   ======================================== */

.auth-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    display: inline-block;
    background: var(--card-bg);
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Информационная карточка */
.auth-info {
    max-width: 350px;
}

.info-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
}

.info-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========================================
   DASHBOARD (ЛИЧНЫЙ КАБИНЕТ)
   ======================================== */

.dashboard-container {
    min-height: 100vh;
    background: var(--bg-color);
}

.dashboard-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-left .logo i {
    color: var(--primary-color);
    font-size: 28px;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    border-color: var(--primary-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu-dropdown a:hover {
    background: var(--bg-color);
}

.user-menu-dropdown a i {
    width: 20px;
    color: var(--text-muted);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Контент дашборда */
.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px;
}

.welcome-section {
    margin-bottom: 32px;
}

.welcome-section h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-section p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Быстрые действия */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.quick-action-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn i {
    font-size: 32px;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Баннер с информацией */
.info-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.banner-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.banner-content {
    flex: 1;
}

.banner-content h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.banner-content p {
    opacity: 0.9;
    font-size: 14px;
}

.teacher-code {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.code-value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Секции */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: var(--primary-color);
}

/* Сетка групп */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.group-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
}

.group-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.group-card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
    font-size: 14px;
    color: var(--text-secondary, #64748b);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.group-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.group-card-body {
    margin-bottom: 20px;
}

.group-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.group-stat i {
    color: var(--primary-color);
    width: 20px;
}

.group-card-footer {
    display: flex;
    gap: 10px;
}

.empty-card {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
}

.empty-card i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========================================
   СТАТИСТИКА
======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* Компактные карточки для веб-версии */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 👆 4 карточки в один ряд */
        gap: 20px;
    }
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-icon-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d3436;  /* ✅ Темный, контрастный цвет */
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 13px;
    color: #636e72;  /* ✅ Серый, но читаемый */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Мобильная адаптация */
@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        padding: 16px 20px;
    }

    .dashboard-content {
        padding: 24px 20px;
    }

    .welcome-section h1 {
        font-size: 24px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .groups-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Страница группы */
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.group-info h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.group-description {
    color: #7f8c8d;
    margin: 5px 0;
}

.group-schedule {
    color: #3498db;
    font-weight: 500;
}

.group-actions {
    display: flex;
    gap: 10px;
}


/* Вкладки */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2c3e50;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Карточки учеников */
.students-list {
    display: grid;
    gap: 20px;
}

.student-card {
    display: grid;
    grid-template-columns: 100px 1fr 300px;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.student-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.student-info h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.student-info p {
    margin: 5px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.student-parents h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #95a5a6;
    text-transform: uppercase;
}

.student-parents ul {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
}

.student-parents li {
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.relation-type {
    font-size: 12px;
    color: #95a5a6;
}

.no-parents {
    color: #e74c3c;
    font-size: 14px;
    font-style: italic;
}

/* Карточки родителей */
.parents-controls {
    display: flex;
    gap: 10px;
}

.parents-list {
    display: grid;
    gap: 15px;
}




/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
/* Контейнер страницы */
.page-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.content-wrapper {
    width: 100%;
}

/* Страница группы */
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.group-info {
    flex: 1;
    min-width: 300px;
}

.group-info h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 28px;
}

.group-description {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 16px;
}

.group-schedule {
    color: #3498db;
    font-weight: 500;
    font-size: 16px;
}

.group-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}






/* Вкладки */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #ecf0f1;
}

.tab-btn {
    padding: 14px 28px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #2c3e50;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.section-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
}

/* Карточки учеников */
.students-list {
    display: grid;
    gap: 20px;
}

.student-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


.student-photo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ecf0f1;
}

.photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 3px solid #ecf0f1;
}

.student-info h3 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
}

.student-info p {
    margin: 6px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.student-parents {
    grid-column: 1 / -1;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

@media (min-width: 768px) {
    .student-parents {
        grid-column: 3 / 4;
        padding-top: 0;
        border-top: none;
        border-left: 1px solid #ecf0f1;
        padding-left: 20px;
    }
}

.student-parents h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.student-parents ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.student-parents li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.relation-type {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

.no-parents {
    color: #e74c3c;
    font-size: 14px;
    font-style: italic;
    margin: 0 0 12px 0;
}

/* Карточки родителей */
.parents-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.parents-list {
    display: grid;
    gap: 15px;
}

.parent-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.parent-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.parent-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.parent-card label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.parent-info h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 17px;
}

.parent-info p {
    margin: 4px 0;
    color: #7f8c8d;
    font-size: 14px;
}


/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: #7f8c8d;
    font-size: 16px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 35px;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin: 0 0 25px 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.radio-group label:hover {
    background: #f8f9fa;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .page-container {
        padding: 15px;
    }

    .group-header {
        padding: 20px;
    }

    .group-info h1 {
        font-size: 22px;
    }

    .group-actions {
        width: 100%;
    }

    .group-actions .btn {
        flex: 1;
    }

    .stat-number {
        font-size: 32px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 25px;
    }
}
.settings-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}



/* ===== КОМПАКТНЫЕ КАРТОЧКИ РОДИТЕЛЕЙ ===== */
.parent-card-compact {
    display: grid;
    grid-template-columns: 30px 200px 1fr 150px 120px 40px;
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
    position: relative;
}

.parent-card-compact:hover {
    background: #f8f9fa;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Чекбокс */
.parent-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ФИО родителя */
.parent-name-label {
    cursor: pointer;
    margin: 0;
    font-size: 15px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parent-name-label:hover {
    color: #007bff;
}

/* Дети в одну строку */
.parent-children-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.child-item-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: transform 0.2s;
}

.child-item-inline:hover {
    transform: scale(1.1);
}

.child-photo-tiny {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
    cursor: pointer;
}

.child-photo-placeholder-tiny {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid #dee2e6;
}

.child-name-tiny {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-children-inline {
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
}

/* Контактная информация */
.parent-contact-inline {
    display: flex;
    align-items: center;
}

.parent-phone-inline {
    font-size: 13px;
    color: #495057;
}

.parent-max-inline {
    display: flex;
    align-items: center;
}

.parent-max-id-inline {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Кнопка удаления */
.btn-delete-parent-inline {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-delete-parent-inline:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ УВЕЛИЧЕННОГО ФОТО ===== */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.photo-modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.photo-modal-close:hover,
.photo-modal-close:focus {
    color: #bbb;
}

.photo-modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 1200px) {
    .parent-card-compact {
        grid-template-columns: 30px 180px 1fr 130px 100px 40px;
        gap: 10px;
    }
}

@media (max-width: 992px) {
    .parent-card-compact {
        grid-template-columns: 30px 1fr 40px;
        gap: 10px;
    }

    .parent-children-inline,
    .parent-contact-inline,
    .parent-max-inline {
        grid-column: 2 / 3;
        margin-top: 5px;
    }
}

.group-code-section {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

.code-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.code-display code {
    background: #fff;
    padding: 8px 12px;
    border: 2px solid #007bff;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #007bff;
    flex: 1;
    text-align: center;
}

.btn-copy-small {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-copy-small:hover {
    background: #0056b3;
}

.btn-copy-small i {
    font-size: 14px;
}

.help-text {
    color: #6c757d;
    font-size: 11px;
    margin-top: 5px;
    display: block;
}

.alert-warning-small {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 8px;
    border-radius: 5px;
    color: #856404;
    font-size: 12px;
}

/* Карточки групп */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.group-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.group-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.group-card h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 20px;
}

.group-description {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

/* Модальное окно - увеличенная версия */
.modal-large {
    max-width: 700px !important;
}

/* Радио-кнопки */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #6c5ce7;
    background-color: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + .radio-text {
    font-weight: 600;
    color: #6c5ce7;
}

/* Textarea */
textarea.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea.form-control:focus {
    outline: none;
    border-color: #6c5ce7;
}

.char-counter {
    display: block;
    text-align: right;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* ✅ НОВЫЕ СТИЛИ: Загрузка файлов */
.file-upload-area {
    margin-top: 0.5rem;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-preview {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.file-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.file-preview-item .file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-item .file-remove:hover {
    background: #ff3b30;
}

.file-preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.25rem;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.75rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* Кнопка отправки */
.btn-send {
    min-width: 150px;
}

/* Datetime input */
input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

input[type="datetime-local"]:focus {
    outline: none;
    border-color: #6c5ce7;
}

/* Загрузка файлов */
.file-upload-area {
    margin-top: 10px;
}

.btn-upload {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-upload:hover {
    background: #2980b9;
}

/* Превью файлов */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.file-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove:hover {
    background: rgba(255, 0, 0, 1);
}

.file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Увеличенное модальное окно */
.modal-large {
    max-width: 700px;
    width: 90%;
}

/* Базовые стили */
.media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Папки */
.folders-section {
    margin-bottom: 30px;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.folder-card {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.folder-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.folder-card.active {
    border-color: #3498db;
    background: #e3f2fd;
}

.folder-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.folder-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.folder-count {
    color: #666;
    font-size: 14px;
}

/* Фильтры */
.filters-section {
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select, .search-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-input {
    flex: 1;
}

/* Действия с выбранными */
.selection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 20px;
}
.project-pres-details {
    width: 100%;
    margin-top: 6px;
    padding: 10px 0 0;
    border-top: 1px solid #ddd;
}

.project-pres-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #444;
    user-select: none;
}

.project-pres-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    max-width: 720px;
}

.project-pres-fields label {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
}

.project-pres-input,
.project-pres-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.project-pres-textarea {
    resize: vertical;
    min-height: 44px;
}

/* Сетка файлов */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.media-card {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.media-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.media-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    z-index: 10;
    cursor: pointer;
}

.media-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview {
    position: relative;
    width: 100%;
    height: 100%;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.media-info {
    padding: 10px;
}

.media-filename {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.media-size, .media-date {
    font-size: 12px;
    color: #666;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.file-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.2s;
}

.file-drop-zone:hover {
    border-color: #3498db;
    background: #f5f5f5;
}

.file-preview {
    margin-top: 15px;
}

.file-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-preview-item button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}


@media (max-width: 768px) {
    /* Шапка */
    .media-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .header-actions .btn {
        width: 100%;
    }

    /* Папки */
    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .folder-icon {
        font-size: 36px;
    }

    /* Фильтры */
    .filters-form {
        flex-direction: column;
        gap: 10px;
    }

    .filter-select, .search-input {
        width: 100%;
    }

    /* Сетка файлов */
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .media-preview {
        height: 150px;
    }

    /* Действия с выбранными */
    .selection-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .selection-actions .btn {
        flex: 1 1 45%;
    }

    /* Модальные окна */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .file-drop-zone {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    /* Ещё меньше экран */
    .folders-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .folder-name {
        font-size: 14px;
    }

    .media-filename {
        font-size: 12px;
    }
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card.clickable:active {
    transform: translateY(0);
}

/* ========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
======================================== */

/* Отступы для контента (чтобы не перекрывал таббар) */
@media (max-width: 768px) {
    .dashboard-content {
        padding: 15px;
        padding-bottom: 80px; /* Место для нижнего меню */
    }

    /* Компактные карточки групп */
    .group-card {
        padding: 15px;
    }

    .group-card h4 {
        font-size: 18px;
    }

    .group-actions {
        flex-direction: column;
        gap: 8px;
    }

    .group-actions .btn {
        width: 100%;
    }

    /* Код группы компактнее */
    .code-display {
        flex-direction: column;
        align-items: stretch;
    }

    .code-display code {
        font-size: 16px;
        padding: 10px;
    }

    .btn-copy-small {
        width: 100%;
        margin-top: 8px;
    }

    /* Приветствие */
    .welcome-section {
        padding: 20px 0;
    }

    .welcome-section p {
        font-size: 14px;
    }

    /* Настройки */
    .settings-section {
        padding: 15px;
    }

    /* Скрыть выпадающее меню на мобильных (используем таббар) */
    .user-menu-dropdown {
        display: none !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .dashboard-header .logo span {
        display: none; /* Скрываем текст логотипа */
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }
}

/* ========================================
   PWA СТИЛИ (для установки как приложение)
======================================== */
@media (display-mode: standalone) {
    /* Когда открыто как PWA */
    .dashboard-header {
        padding-top: env(safe-area-inset-top, 15px);
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }
}
/* ========================================
   СТАТИСТИКА
======================================== */

/* Дашборд: белые карточки */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.stats-grid .stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stats-grid .stat-card.clickable {
    cursor: pointer;
}

.stats-grid .stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stats-grid .stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-icon-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stats-grid .stat-content {
    flex: 1;
    min-width: 0;
}

.stats-grid .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d3436;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stats-grid .stat-label {
    font-size: 13px;
    color: #636e72;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ========================================
   СТАТИСТИКА ГРУППЫ (градиентные карточки)
======================================== */

.group-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Специфичные стили для карточек внутри .group-stats */
.group-stats .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: none;
    display: block; /* Отменяем flex из .stats-grid */
}

.group-stats .stat-number {
    display: block;
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 8px;
    color: white;
}

.group-stats .stat-label {
    display: block;
    font-size: 16px;
    opacity: 0.9;
    color: white;
    text-transform: none; /* Отменяем uppercase */
    letter-spacing: normal;
}

/* Мобильная адаптация */
@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stats-grid .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stats-grid .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stats-grid .stat-value {
        font-size: 20px;
    }

    .stats-grid .stat-label {
        font-size: 11px;
    }
}

/* ========================================
   НИЖНЯЯ НАВИГАЦИЯ (только для мобильных)
======================================== */

.bottom-nav {
    display: none; /* По умолчанию скрыта на десктопе */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 10px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Показывать только на мобильных устройствах */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
}

.bottom-nav-item.active {
    color: #6366f1;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item:hover {
    color: #6366f1;
    background: #f9fafb;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .dashboard-content,
    .page-container {
        padding-bottom: 80px; /* Место для нижней панели */
    }
    .user-menu {
        display: none; /* Скрываем выпадающее меню на мобильных */
    }
}

/* ========================================
   МОДАЛЬНОЕ ОКНО (улучшенная версия)
======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000; /* ✅ Выше нижней панели (z-index: 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* ✅ Прокрутка всего модального окна */
    padding: 20px 0; /* ✅ Отступы сверху и снизу */
}

.modal-content {
    background-color: white;
    margin: 0 auto; /* ✅ Центрирование по горизонтали */
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: calc(100vh - 40px); /* ✅ Максимальная высота с учетом отступов */
    overflow-y: auto; /* ✅ Прокрутка содержимого */
}

.modal-content h2 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 22px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    z-index: 10;
}

.close:hover {
    color: #000;
}

/* ========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ МОДАЛЬНОГО ОКНА
======================================== */

@media (max-width: 768px) {
    .modal {
        padding: 10px 0 100px 0; /* ✅ Дополнительный отступ снизу для нижней панели */
    }

    .modal-content {
        width: 95%;
        padding: 20px 15px;
        margin: 10px auto;
        max-height: calc(100vh - 120px); /* ✅ Учитываем нижнюю панель */
    }

    .modal-content h2 {
        font-size: 18px;
        padding-right: 30px; /* ✅ Место для кнопки закрытия */
    }

    .close {
        top: 10px;
        right: 10px;
        font-size: 28px;
    }

    /* Компактные формы на мобильных */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 14px;
    }

    textarea.form-control {
        font-size: 14px;
        padding: 10px;
    }

    .radio-label {
        padding: 10px;
        font-size: 14px;
    }

    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .file-preview-item img,
    .file-preview-item video {
        height: 80px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   СТИЛИ ФОРМЫ ВНУТРИ МОДАЛЬНОГО ОКНА
======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + .radio-text {
    font-weight: 600;
    color: #667eea;
}

textarea.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

textarea.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.char-counter {
    display: block;
    text-align: right;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

/* ========================================
   ПРЕВЬЮ ФАЙЛОВ
======================================== */

.file-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.file-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.file-preview-item .file-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.file-preview-item .file-remove:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.file-preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1;
}

.group-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.group-card h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

/* ========================================
   КНОПКА УДАЛЕНИЯ ПАПКИ
   ======================================== */

.folder-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.folder-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Показать кнопку при наведении на папку */
.folder-card:hover .folder-delete-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Эффект при наведении на саму кнопку */
.folder-delete-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.2);
}

/* Анимация нажатия */
.folder-delete-btn:active {
    transform: scale(0.95);
}
/* ========================================
   МОДАЛЬНОЕ ОКНО ДЛЯ ВИДЕО/ФОТО
   ======================================== */

.video-modal-content,
.image-modal-content {
    max-width: 900px;
    width: 90%;
    padding: 25px;
}

.video-modal-content h3,
.image-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.video-modal video {
    background: #000;
}

/* ========================================
   МОДАЛЬНЫЕ ОКНА: ПОДТВЕРЖДЕНИЕ
   ======================================== */

.confirm-modal-content {
    max-width: 400px;
    text-align: center;
}

.confirm-modal-content h3 {
    margin-top: 0;
    color: #e74c3c;
}

.confirm-modal-content p {
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

/* ========================================
   МОДАЛЬНЫЕ ОКНА: УВЕДОМЛЕНИЯ
   ======================================== */

.notification-modal-content {
    max-width: 400px;
}

.notification-modal-content.success {
    border-top: 4px solid #27ae60;
}

.notification-modal-content.error {
    border-top: 4px solid #e74c3c;
}

.notification-modal-content.warning {
    border-top: 4px solid #f39c12;
}

.notification-modal-content.info {
    border-top: 4px solid #3498db;
}

/* ✅ ДОБАВЛЕНО AI: Кнопка-папка для галереи медиа родителя */
.btn-folder-parent {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-left: 5px;
}

.btn-folder-parent:hover {
    background: #45a049;
    transform: scale(1.1);
}
.media-info {
    position: relative;
}

.media-description {
    font-size: 12px;
    color: #555;
    margin: 4px 0;
    min-height: 2.6em;
    max-height: 4.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.35;
    cursor: pointer;
    padding-right: 24px;
}

.media-description-empty {
    font-style: italic;
    color: #999;
    cursor: pointer;
}

.media-description-more {
    color: var(--primary-color);
    font-size: 11px;
}

.btn-edit-description {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    opacity: 0.7;
}

.btn-edit-description:hover {
    opacity: 1;
}
.folder-card.drag-over {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
    transform: translateY(-2px);
}
