/* Общие стили в стиле Apple */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    position: relative;
}

/* Убеждаемся, что контейнеры интерфейсов не создают новый stacking context */
#userInterface,
#adminInterface {
    z-index: 1 !important;
    position: relative;
    isolation: isolate; /* Создаем новый stacking context, но с низким z-index */
}

/* Модальное окно всегда должно быть доступно и поверх всего */
#subscriptionModal {
    z-index: 999999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    isolation: auto !important; /* Не создаем новый stacking context */
    pointer-events: auto !important;
}

/* Убеждаемся, что модальное окно всегда поверх интерфейсов */
.modal#subscriptionModal {
    z-index: 999999 !important;
    position: fixed !important;
    display: none; /* По умолчанию скрыто, но будет показано через JS */
}

/* Когда модальное окно видимо */
.modal#subscriptionModal[style*="display: flex"],
.modal#subscriptionModal[style*="display:flex"] {
    display: flex !important;
    z-index: 999999 !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Стили для страницы авторизации */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.auth-form {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 50px 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-form h1,
.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    color: #1d1d1f;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6e6e73;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #0071e3;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0071e3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.btn:hover {
    background-color: #0077ed;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background-color: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.btn-secondary:hover {
    background-color: #e8e8ed;
}

.btn-danger {
    background-color: #ff3b30;
}

.btn-danger:hover {
    background-color: #ff453a;
}

.btn-success {
    background-color: #34c759;
}

.btn-success:hover {
    background-color: #30d158;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Стили для основного интерфейса */
.main-container {
    display: none;
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Боковое меню */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-right: 1px solid #e5e5e7;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e5e5e7;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* Логотип в sidebar */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
    flex-shrink: 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 16px;
    pointer-events: none;
    z-index: 1;
}

.logo-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
}

.logo-text {
    flex: 1;
    min-width: 0;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.logo-subtitle {
    font-size: 11px;
    color: #6e6e73;
    font-weight: 500;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Логотип на странице авторизации */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo-icon-large {
    width: 180px;
    height: 180px;
    min-width: 180px;
    min-height: 180px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 32px;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.5);
    animation: float 3s ease-in-out infinite;
    padding: 0;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo-icon-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
    border-radius: 32px;
    pointer-events: none;
    z-index: 1;
}

.logo-icon-large::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: rotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.logo-img-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.auth-title {
    font-size: 38px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 15px;
    color: #6e6e73;
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #6e6e73;
}

.nav-item:hover {
    background-color: #f5f5f7;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border-right: 3px solid #667eea;
    font-weight: 600;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f5f5f7;
    background: #fafafa;
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.user-login {
    font-size: 12px;
    color: #6e6e73;
}

.sidebar-logout {
    width: 100%;
    padding: 10px;
    text-align: center;
}

/* Форма входа в сайдбаре */
.sidebar-login-section {
    padding: 20px;
    border-top: 1px solid #e5e5e7;
    border-bottom: 1px solid #e5e5e7;
    background: #fafafa;
}

.sidebar-login-section .form-group {
    margin-bottom: 15px;
}

.sidebar-login-section .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
}

.sidebar-login-section .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.sidebar-login-section .form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.sidebar-login-section .btn-block {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

/* Контейнер новостей */
.news-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 100%;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 40px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.content-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.content-header .page-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}

.content-body {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

header {
    background: white;
    border-bottom: 1px solid #d2d2d7;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #0071e3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
}

.logout-btn {
    background: none;
    border: none;
    color: #0071e3;
    cursor: pointer;
    font-size: 14px;
}

.content {
    padding: 40px 0;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1d1d1f;
}

/* Специальный стиль для заголовка в шапке */
.content-header .page-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 0;
}

/* Стили для карточек абонементов */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.subscription-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.subscription-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.subscription-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.subscription-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: #6e6e73;
}

.detail-value {
    font-weight: 500;
}

.progress-bar {
    height: 6px;
    background-color: #f5f5f7;
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background-color: #0071e3;
    border-radius: 3px;
}

.status-active {
    color: #34c759;
}

.status-expired {
    color: #ff3b30;
}

.days-left {
    color: #0071e3;
    font-weight: 600;
}

/* Стили для истории посещений в карточках */
.subscription-visits {
    border-top: 1px solid #f5f5f7;
    padding-top: 12px;
    margin-top: 16px;
}

.visit-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f7;
    transition: background-color 0.2s;
}

.visit-record:hover {
    background-color: #f5f5f7;
}

.visit-record:last-child {
    border-bottom: none;
}

/* Стили для админ-панели */
.admin-panel {
    display: none;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #d2d2d7;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.tab.active {
    border-bottom-color: #0071e3;
    color: #0071e3;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.users-table th, .users-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f5f5f7;
}

.users-table th {
    background-color: #f5f5f7;
    font-weight: 600;
}

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

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-admin {
    background-color: #ffd700;
    color: #1d1d1f;
}

.role-user {
    background-color: #f5f5f7;
    color: #6e6e73;
}

.role-moderator {
    background-color: #ff9500;
    color: white;
}

/* Стили для форм */
.form-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 200px;
}

/* Для формы пользователя - более гибкая раскладка */
#userModal .form-row {
    gap: 20px;
}

#userModal .form-row .form-group {
    min-width: 250px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.schedule-children-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-participant-wrapper {
    background: #f8f8fa;
    border: 1px solid #e5e5e7;
    border-radius: 10px;
    padding: 12px;
}

.schedule-participant-wrapper label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d1d1f;
}

.schedule-participant-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.schedule-participant-wrapper select:disabled {
    background: #f5f5f7;
    color: #a1a1a6;
    cursor: not-allowed;
}

/* Стили для списка посещений */
.visits-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.visit-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f7;
}

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

.no-data {
    text-align: center;
    color: #6e6e73;
    padding: 40px 0;
}

/* Стили для профиля */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #0071e3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 500;
}

.profile-info h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.profile-info p {
    color: #6e6e73;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-label {
    color: #6e6e73;
    font-size: 14px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 99999 !important;
    justify-content: center;
    align-items: center;
    visibility: visible;
    margin: 0 !important;
    padding: 0 !important;
}

/* Специфичный селектор для модального окна абонемента - максимальный приоритет */
#subscriptionModal.modal {
    z-index: 999999 !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 100000;
}

/* Увеличенная ширина для формы пользователя с детьми */
#userModal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Стили для редактора новостей */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-btn:hover {
    background: #e5e5e7;
    border-color: #007AFF;
}

.editor-btn:active {
    background: #d2d2d7;
}

.news-editor {
    min-height: 200px;
    padding: 16px;
    border: 1px solid #d2d2d7;
    border-radius: 0 0 8px 8px;
    background: white;
    font-size: 16px;
    line-height: 1.6;
    color: #1d1d1f;
    outline: none;
    overflow-y: auto;
}

.news-editor:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.news-editor:empty:before {
    content: attr(placeholder);
    color: #8e8e93;
    pointer-events: none;
}

.news-editor p {
    margin: 0 0 12px 0;
}

.news-editor ul,
.news-editor ol {
    margin: 12px 0;
    padding-left: 24px;
}

.news-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

/* Стили для отображения форматированного контента новостей */
.news-content-formatted {
    margin: 0 0 16px 0;
    color: #424245;
    font-size: 16px;
    line-height: 1.6;
}

.news-content-formatted p {
    margin: 0 0 12px 0;
}

.news-content-formatted ul,
.news-content-formatted ol {
    margin: 12px 0;
    padding-left: 24px;
}

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

.news-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 40px;
    padding: 8px 12px;
    font-size: 14px;
}

.pagination .btn.btn-secondary {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.pagination .btn.btn-secondary:hover {
    background-color: #e5e5e7;
}

/* Улучшенная адаптивность для контента */
.content-body {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.container {
    max-width: 100%;
    width: 100%;
    padding: 0 20px;
}

/* Расширение объектов для полной ширины при необходимости */
.form-card,
.analytics-container,
.subscriptions-grid,
.visits-list {
    width: 100%;
    max-width: 100%;
}

/* Новости должны быть ограничены по ширине и центрированы */
.news-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Улучшенное отображение элементов детей в форме */
.child-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.child-item input {
    flex: 1;
    min-width: 200px;
}

.child-item button {
    flex-shrink: 0;
}

/* Адаптивность для модальных окон */
@media (max-width: 768px) {
    #userModal .modal-content {
        max-width: 95vw;
        padding: 20px;
    }
    
    .modal-content {
        max-width: 95vw;
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .child-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .child-item input {
        min-width: 100%;
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6e6e73;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1100;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #34c759;
}

.notification.error {
    background-color: #ff3b30;
}

/* Стили для календаря */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f5f5f7;
}

.calendar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #6e6e73;
    padding: 12px 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.calendar-day {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 12px 8px;
    min-height: 100px;
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.calendar-day:hover {
    background: #e8e8ed;
    border-color: #0071e3;
}

.calendar-day.other-month {
    background: #fafafa;
    color: #d2d2d7;
}

.calendar-day.today {
    border-color: #0071e3;
    background: #f0f7ff;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.calendar-lessons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-lesson {
    background: #0071e3;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-lesson:hover {
    background: #0056b3;
}

.calendar-lesson.other-user {
    background: #34c759;
}

.calendar-lesson.expired {
    background: #ff3b30;
    opacity: 0.7;
}

.calendar-more-lessons {
    background: #6e6e73;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    text-align: center;
    margin-top: 4px;
    transition: background-color 0.2s;
}

.calendar-more-lessons:hover {
    background: #1d1d1f;
}

.lesson-details {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    border-left: 4px solid #0071e3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lesson-details h4 {
    margin-bottom: 8px;
    color: #1d1d1f;
}

.lesson-details p {
    margin: 4px 0;
    color: #6e6e73;
    font-size: 14px;
}

.lesson-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Модальное окно для занятия */
.lesson-modal .modal-content {
    max-width: 600px;
}

.lesson-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.lesson-form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.lessons-list {
    margin-top: 24px;
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f7;
    transition: background-color 0.2s;
}

.lesson-item:hover {
    background: #f5f5f7;
}

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

.lesson-info h4 {
    margin-bottom: 4px;
    color: #1d1d1f;
}

.lesson-info p {
    margin: 2px 0;
    color: #6e6e73;
    font-size: 14px;
}

.lesson-time {
    font-weight: 500;
    color: #0071e3;
}

.lesson-actions-small {
    display: flex;
    gap: 8px;
}

.lesson-actions-small span {
    display: inline-block;
    font-size: 11px;
    color: #6e6e73;
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: column;
        border-right: none;
        border-bottom: 1px solid #e5e5e7;
        box-shadow: none;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }

    .sidebar-nav .nav-item {
        flex: 1 1 calc(50% - 8px);
        border-right: none;
        border-radius: 12px;
        justify-content: flex-start;
    }

    .main-content {
        margin-left: 0;
        margin-top: 0;
    }

    .content-header {
        position: relative;
        top: 0;
        border-radius: 0 0 24px 24px;
        padding: 32px 24px;
    }

    .content-body {
        padding: 24px;
    }

    .calendar-container {
        padding: 20px;
    }

    .form-card,
    .visits-list,
    .analytics-card,
    .subscription-card {
        padding: 20px;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        padding-bottom: 20px;
    }

    .sidebar-nav {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-nav .nav-item {
        flex: 1 1 100%;
        border-radius: 0;
    }

    .subscriptions-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 8px 4px;
    }
    
    .calendar-day-number {
        font-size: 12px;
    }
    
    .calendar-lesson {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .lesson-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .users-table {
        font-size: 14px;
    }
    
    .users-table th, .users-table td {
        padding: 12px 8px;
    }

    .content-header {
        padding: 24px 16px;
    }

    .content-body {
        padding: 20px 16px 60px;
    }

    .calendar-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 90px;
    }

    .news-card {
        padding: 20px;
    }

    .lesson-actions-small {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 540px) {
    .sidebar-nav .nav-item {
        font-size: 14px;
        padding: 10px 14px;
    }

    .content-header .page-title {
        font-size: 24px;
    }

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

    .form-card,
    .visits-list,
    .subscription-card {
        padding: 16px;
    }

    .btn {
        width: 100%;
    }

    .schedule-participant-wrapper {
        padding: 10px;
    }

    .schedule-participant-wrapper label {
        font-size: 12px;
    }

    .tabs {
        gap: 4px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 14px;
    }

    .lesson-info p {
        font-size: 13px;
    }
}

/* Стили для модального окна абонемента */
.subscription-details-modal {
    padding: 20px 0;
}

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

.visits-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.visit-timeline-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: #f5f5f7;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.visit-timeline-item:hover {
    background: #e8e8ed;
}

.visit-date-badge {
    min-width: 80px;
    text-align: center;
    background: #0071e3;
    color: white;
    padding: 12px;
    border-radius: 8px;
}

.visit-day {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

.visit-month {
    font-size: 12px;
    text-transform: uppercase;
    margin-top: 4px;
}

.visit-year {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

.visit-content {
    flex: 1;
}

.visit-day-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.visit-notes {
    font-size: 14px;
    color: #6e6e73;
    margin-top: 4px;
}

/* Стили для аналитики */
.analytics-container {
    padding: 20px 0;
}

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

.analytics-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.analytics-card-wide {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1d1d1f;
}

.stat-big {
    font-size: 48px;
    font-weight: 600;
    color: #0071e3;
    margin-bottom: 16px;
}

.stat-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f7;
}

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

.stat-label {
    color: #6e6e73;
    font-size: 14px;
}

.stat-value {
    font-weight: 500;
    color: #1d1d1f;
}

.chart-container {
    margin-top: 20px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, #0071e3, #5ac8fa);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    transition: opacity 0.2s;
}

.bar:hover {
    opacity: 0.8;
}

.bar-value {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.bar-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6e6e73;
    font-weight: 500;
}

.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f5f5f7;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.top-user-item:hover {
    background: #e8e8ed;
}

.top-user-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0071e3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.top-user-info {
    flex: 1;
}

.top-user-name {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.top-user-login {
    font-size: 14px;
    color: #6e6e73;
}

.top-user-count {
    font-weight: 600;
    color: #0071e3;
    font-size: 16px;
}

/* Стили для аналитики неиспользованных занятий */
.unused-lessons-analytics {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 24px;
}

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

.unused-lesson-card {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #0071e3;
    transition: transform 0.2s, box-shadow 0.2s;
}

.unused-lesson-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.unused-lesson-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.unused-badge {
    background: #0071e3;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.unused-lesson-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.detail-row .detail-label {
    color: #6e6e73;
}

.detail-row .detail-value {
    font-weight: 500;
    color: #1d1d1f;
}

.detail-row .detail-value.warning {
    color: #ff3b30;
    font-weight: 600;
}

/* Стили для круговых диаграмм */
.charts-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 20px;
}

.pie-chart-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.pie-chart {
    width: 300px;
    height: 300px;
    flex-shrink: 0;
}

.pie-segment {
    cursor: pointer;
    transition: opacity 0.2s;
}

.pie-segment:hover {
    opacity: 0.8;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    color: #6e6e73;
}

.legend-value {
    font-weight: 600;
    color: #1d1d1f;
}

.role-moderator {
    background-color: #ff9500;
    color: white;
}