/* style.css — единые базовые стили для всех страниц */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== CSS Custom Properties ===== */
:root {
    /* Backgrounds */
    --bg-body: #f5f5f5;
    --bg-card: #ffffff;
    --bg-subtle: #f8f9fa;
    --bg-nav: #f8f9fa;
    --bg-bottom-nav: #ffffff;
    --bg-heatmap-cell: #ebedf0;
    --bg-cms: #f5f5f5;

    /* Primary palette */
    --primary: #667eea;
    --primary-light: #8b9cf0;
    --primary-dark: #4a63d0;
    --primary-gradient: linear-gradient(135deg, #667eea, #764ba2);

    /* Semantic */
    --success: #4CAF50;
    --success-dark: #45a049;
    --danger: #dc3545;
    --danger-dark: #c82333;
    --warning: #ffc107;
    --green: #27ae60;
    --green-dark: #219a52;

    /* Text */
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #999;
    --text-inverse: #fff;
    --text-link: #667eea;
    --text-heading: #222;

    /* Borders */
    --border-color: #ddd;
    --border-light: #eee;
    --border-input: #ddd;
    --border-input-focus: #667eea;
    --border-auth-input: #e0e0e0;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 6px rgba(0,0,0,0.04);
    --shadow-card: 0 1px 6px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(102,126,234,0.3);
    --shadow-auth: 0 10px 40px rgba(0,0,0,0.2);

    /* Fonts */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-xxl: 28px;

    /* Auth */
    --bg-auth-gradient: linear-gradient(135deg, #667eea, #764ba2);

    /* Calendar */
    --today-bg: rgba(102,126,234,0.08);

    /* Transitions */
    --transition: 0.2s ease;
}

/* ===== Yoga Theme ===== */
[data-theme="yoga"] {
    --bg-body: #fdf8f6;
    --bg-subtle: #f5ecee;
    --bg-nav: #f5ecee;
    --bg-bottom-nav: #fdf8f6;
    --bg-heatmap-cell: #ece0de;

    --primary: #c4a0d4;
    --primary-light: #dcc0e6;
    --primary-dark: #a880b8;
    --primary-gradient: linear-gradient(135deg, #c4a0d4, #e8a8c0);

    --success: #e8a8c0;
    --success-dark: #d890b0;
    --danger: #e87a7a;
    --danger-dark: #d86868;
    --green: #e8a8c0;
    --green-dark: #d890b0;

    --text-primary: #3d3d3d;
    --text-secondary: #5a5a5a;
    --text-muted: #b0a098;
    --text-link: #c4a0d4;
    --text-heading: #3d3d3d;

    --border-color: #e8ddd8;
    --border-light: #f0e8e6;
    --border-input: #e8ddd8;
    --border-input-focus: #c4a0d4;
    --border-auth-input: #e8ddd8;

    --today-bg: rgba(196,160,212,0.15);
    --shadow-lg: 0 4px 16px rgba(196,160,212,0.3);
    --shadow-auth: 0 10px 40px rgba(0,0,0,0.12);
    --bg-auth-gradient: linear-gradient(135deg, #c4a0d4, #e8a8c0);
}

/* ===== Forest Theme ===== */
[data-theme="forest"] {
    --bg-body: #f5f9f4;
    --bg-card: #ffffff;
    --bg-subtle: #edf5eb;
    --bg-nav: #edf5eb;
    --bg-bottom-nav: #ffffff;
    --bg-heatmap-cell: #dce8d8;

    --primary: #5a9e6f;
    --primary-light: #7dba8f;
    --primary-dark: #3d7e52;
    --primary-gradient: linear-gradient(135deg, #5a9e6f, #8bae5a);

    --success: #5a9e6f;
    --success-dark: #3d7e52;
    --danger: #c76b6b;
    --danger-dark: #b05555;
    --green: #5a9e6f;
    --green-dark: #3d7e52;

    --text-primary: #2d3d2d;
    --text-secondary: #4a5a4a;
    --text-muted: #8a9a8a;
    --text-link: #5a9e6f;
    --text-heading: #1d2d1d;

    --border-color: #d4e0d0;
    --border-light: #e4ece2;
    --border-input: #d4e0d0;
    --border-input-focus: #5a9e6f;
    --border-auth-input: #d4e0d0;

    --today-bg: rgba(90,158,111,0.12);
    --shadow-lg: 0 4px 16px rgba(90,158,111,0.3);
    --shadow-auth: 0 10px 40px rgba(0,0,0,0.12);
    --bg-auth-gradient: linear-gradient(135deg, #5a9e6f, #8bae5a);
}

/* ===== Ocean Theme ===== */
[data-theme="ocean"] {
    --bg-body: #f4f7fc;
    --bg-card: #ffffff;
    --bg-subtle: #e8eef8;
    --bg-nav: #e8eef8;
    --bg-bottom-nav: #ffffff;
    --bg-heatmap-cell: #d6e0f0;

    --primary: #4a8dc7;
    --primary-light: #6ea8da;
    --primary-dark: #3070a8;
    --primary-gradient: linear-gradient(135deg, #4a8dc7, #5ab0c7);

    --success: #4a8dc7;
    --success-dark: #3070a8;
    --danger: #c76b6b;
    --danger-dark: #b05555;
    --green: #4a9e8a;
    --green-dark: #358070;

    --text-primary: #1a2a3a;
    --text-secondary: #3a4a5a;
    --text-muted: #7a8a9a;
    --text-link: #4a8dc7;
    --text-heading: #0d1a2a;

    --border-color: #c8d6e8;
    --border-light: #dee8f4;
    --border-input: #c8d6e8;
    --border-input-focus: #4a8dc7;
    --border-auth-input: #c8d6e8;

    --today-bg: rgba(74,141,199,0.12);
    --shadow-lg: 0 4px 16px rgba(74,141,199,0.3);
    --shadow-auth: 0 10px 40px rgba(0,0,0,0.12);
    --bg-auth-gradient: linear-gradient(135deg, #4a8dc7, #5ab0c7);
}

/* ===== Midnight Theme (dark) ===== */
[data-theme="midnight"] {
    --bg-body: #111827;
    --bg-card: #1f2937;
    --bg-subtle: #1a2332;
    --bg-nav: #1a2332;
    --bg-bottom-nav: #1f2937;
    --bg-heatmap-cell: #2a3444;

    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --primary-gradient: linear-gradient(135deg, #818cf8, #a78bfa);

    --success: #34d399;
    --success-dark: #10b981;
    --danger: #f87171;
    --danger-dark: #ef4444;
    --warning: #fbbf24;
    --green: #34d399;
    --green-dark: #10b981;

    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-inverse: #111827;
    --text-link: #818cf8;
    --text-heading: #f3f4f6;

    --border-color: #374151;
    --border-light: #2d3748;
    --border-input: #4b5563;
    --border-input-focus: #818cf8;
    --border-auth-input: #374151;

    --shadow-sm: 0 1px 6px rgba(0,0,0,0.2);
    --shadow-card: 0 1px 6px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(129,140,248,0.2);
    --shadow-auth: 0 10px 40px rgba(0,0,0,0.4);

    --today-bg: rgba(129,140,248,0.12);
    --bg-auth-gradient: linear-gradient(135deg, #1f2937, #111827);
}

[data-theme="midnight"] body,
[data-theme="midnight"] .app-topbar,
[data-theme="midnight"] .modal-overlay,
[data-theme="midnight"] .modal-content {
    background-color: var(--bg-body);
}

[data-theme="midnight"] input,
[data-theme="midnight"] select,
[data-theme="midnight"] textarea {
    background-color: #374151;
    color: var(--text-primary);
    border-color: var(--border-input);
}

[data-theme="midnight"] .bottom-nav {
    background-color: var(--bg-bottom-nav);
    border-top: 1px solid var(--border-color);
}

body {
    font-family: var(--font-family);
    padding: 20px;
    background-color: var(--bg-body);
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.container-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 80px;
}

/* Utility classes */
.hidden { display: none !important; }
.flex-row { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--green) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 14px;
    font-style: italic;
}
.auth-wrapper-page {
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    min-height: 100vh;
    background: var(--bg-body);
    padding: 0;
}
.flex-1 { flex: 1; }

/* Верхняя навигация */
.top-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-nav);
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 16px;
    position: relative;
}

.burger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-primary);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Навигация для главной (без .top-nav) */
.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.site-nav a:hover {
    color: var(--primary);
}

/* Нижняя панель навигации */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-bottom-nav);
    border-top: 1px solid var(--border-light);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 12px;
    transition: color var(--transition);
}

.nav-item.active { color: var(--primary); }

.nav-icon { font-size: 22px; line-height: 1; }

.nav-label { font-size: 10px; font-weight: 500; }

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-inverse);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.35);
}

.btn-secondary {
    background: #6c757d;
    color: var(--text-inverse);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-small {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-sm:hover { background: var(--bg-subtle); }

.avail-session-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-subtle);
    border-radius: 8px;
    margin-bottom: 8px;
}

.avail-session-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
}

.avail-enroll-btn {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.3;
    margin-top: 4px;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
}

.avail-enroll-btn:hover {
    background: var(--primary-dark);
}

.avail-enroll-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

/* Кнопка пополнения на баланс-карте */
.btn-topup {
    display: inline-block;
    margin-top: 16px;
    background: rgba(255,255,255,0.2);
    color: var(--text-inverse);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-md);
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background var(--transition);
}

.btn-topup:hover { background: rgba(255,255,255,0.3); }

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px 24px 24px;
    width: 90%;
    max-width: 380px;
    position: relative;
}

.modal-card-full {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 26px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-field { margin-bottom: 14px; }

.modal-field label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    box-sizing: border-box;
    outline: none;
}

.modal-input:focus { border-color: var(--border-input-focus); }

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button { flex: 1; }

/* Базовый модальный оверлей (для уведомлений и подтверждений) */
.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;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.confirm-msg {
    font-size: 16px;
    color: var(--text-heading);
    margin: 12px 0 20px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions button { flex: 1; }

.warning-message { font-size: var(--font-size-sm); margin-top: 8px; }

.purchase-details { margin: 16px 0; }

.purchase-details p { margin: 8px 0; font-size: var(--font-size-base); }

.section-description { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: 16px; }

/* Заголовки страниц */
.page-title {
    font-size: var(--font-size-xl);
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Ссылка назад */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--text-link);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* Базовые стили форм */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}

.form-group .help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-group .error {
    color: var(--danger);
    font-size: var(--font-size-sm);
    margin-top: 4px;
}

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

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    width: auto;
}

.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    max-width: 700px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

/* Баланс-карта */
.balance-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.balance-row {
    display: flex;
    gap: 24px;
}

.balance-card .balance-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-card .balance-label {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

.balance-card .balance-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.balance-card .subs-remaining {
    font-size: 22px;
    font-weight: 700;
}

.balance-card .subs-name {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Абонементы */
.subscriptions-grid {
    display: grid;
    gap: 12px;
}

.subscription-card {
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.subscription-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--text-primary);
}

.subscription-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.subscription-validity {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0;
}

.subscription-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin: 12px 0;
}

.purchase-subscription-btn { width: 100%; }

/* Секции контента */
.content-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.content-section h2 {
    margin: 0 0 16px;
    color: var(--text-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

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

.section-header h2 { margin: 0; }

/* Карточки занятий (сессий) */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.session-row {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    align-items: center;
}

.session-row.past { opacity: 0.65; }

.session-row-time {
    display: flex;
    flex-direction: column;
    min-width: 44px;
}

.s-date { font-size: 12px; color: var(--text-muted); }

.s-time { font-size: 14px; font-weight: 600; color: var(--text-primary); }

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

.s-name { font-size: 14px; font-weight: 500; color: var(--text-heading); }

.s-meta { font-size: 11px; color: var(--text-muted); }

/* История посещений */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

/* Тепловая карта */
.heatmap-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
}

.heatmap {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.hm-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--bg-heatmap-cell);
    flex-shrink: 0;
}

.hm-cell.l1 { background: #9be9a8; }
.hm-cell.l2 { background: #40c463; }
.hm-cell.l3 { background: #30a14e; }
.hm-cell.l4 { background: #216e39; }

.hm-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    justify-content: flex-end;
}

/* Карусель новостей */
.news-carousel-section { padding: 8px 16px 4px; }

.news-carousel-section .section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.news-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.news-carousel::-webkit-scrollbar { display: none; }

.news-carousel-card {
    position: relative;
    flex: 0 0 80px;
    scroll-snap-align: start;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #ddd;
}

.news-carousel-card.type-schedule_change { outline: 2px solid #e67e22; outline-offset: -2px; }
.news-carousel-card.type-tour { outline: 2px solid #27ae60; outline-offset: -2px; }
.news-carousel-card.type-promo { outline: 2px solid #e74c3c; outline-offset: -2px; }
.news-carousel-card.type-announcement { outline: 2px solid var(--primary); outline-offset: -2px; }

.carousel-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

.carousel-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 6px 8px;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-inverse);
    text-align: center;
    line-height: 1.25;
    overflow-wrap: break-word;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* Stories overlay */
.stories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.stories-container {
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 700px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    position: relative;
}

.stories-header {
    padding: 10px 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stories-progress {
    flex: 1;
    display: flex;
    gap: 3px;
}

.story-dot {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #ddd;
}

.story-dot.active { background: var(--primary); }
.story-dot.seen { background: #bbb; }

.stories-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.stories-body {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.stories-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.stories-nav-left, .stories-nav-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.stories-nav-left { left: 0; }
.stories-nav-right { right: 0; }

.story-image-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.story-image-placeholder.type-announcement { background: var(--primary-gradient); }
.story-image-placeholder.type-schedule_change { background: linear-gradient(135deg, #e67e22, #d35400); }
.story-image-placeholder.type-tour { background: linear-gradient(135deg, #27ae60, #1e8449); }
.story-image-placeholder.type-promo { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.story-body {
    padding: 16px 20px 24px;
    flex: 1;
}

.news-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.news-badge.type-announcement { background: #eef2ff; color: var(--primary); }
.news-badge.type-schedule_change { background: #fef3e2; color: #e67e22; }
.news-badge.type-tour { background: #e8f8f0; color: var(--green); }
.news-badge.type-promo { background: #fde8e8; color: #e74c3c; }

.story-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 8px;
}

.story-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.story-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tour-details {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.tour-details .price {
    font-weight: 700;
    color: var(--green);
    font-size: 18px;
}

.tour-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--green);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.tour-btn:hover { background: var(--green-dark); }

/* Top bar для главной */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
}

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

.topbar-greeting {
    display: flex;
    flex-direction: column;
}

.greeting-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}

.greeting-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-right {
    position: relative;
}

.notification-icon {
    font-size: 22px;
    cursor: pointer;
    position: relative;
}

.badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1100;
    overflow: hidden;
    flex-direction: column;
    margin-top: 8px;
}

.notification-dropdown.show {
    display: flex;
}

.nd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
}

.nd-read-all {
    background: none;
    border: none;
    color: var(--primary, #6366f1);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.nd-read-all:hover {
    background: #f3f4f6;
}

.nd-list {
    overflow-y: auto;
    max-height: 340px;
}

.nd-item {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.nd-item:hover {
    background: #f9fafb;
}

.nd-item.unread {
    background: #eef2ff;
}

.nd-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.nd-item-meta {
    font-size: 11px;
    color: #9ca3af;
}

.nd-empty {
    text-align: center;
    color: #9ca3af;
    padding: 32px 16px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed;
        left: 16px;
        right: 16px;
        top: 72px;
        width: auto;
        max-height: 50vh;
    }
}

/* Профиль (аватар, карточка, данные) */
.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 16px;
}

.profile-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}

.avatar-delete-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--text-inverse);
    background: #e53935;
    color: var(--text-inverse);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-avatar {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 12px;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.profile-row + .profile-row:not(:last-of-type) {
    border-top: 1px solid var(--border-light);
}

.profile-row-label {
    font-size: 14px;
    color: var(--text-muted);
}

.profile-row-value {
    font-size: 15px;
    color: var(--text-heading);
    font-weight: 500;
}

/* Блок мини-баланса в профиле */
.balance-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
}

.balance-mini-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.balance-mini-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.sub-compact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sub-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

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

.sub-compact-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.sub-compact-count {
    font-size: 12px;
    color: var(--text-muted);
}

.sub-compact-date {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
}

/* Достижения */
.achieve-placeholder {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Магазин / страница тарифов */
.shop-page { padding: 0 16px 80px; max-width: 480px; margin: 0 auto; }

.shop-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
}

.shop-topbar h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
}

/* Карточка сессии (версия с date/time слева) */
.session-card {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.session-card.past { opacity: 0.7; }

.session-card .session-time {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.session-card .session-time .date {
    font-size: 12px;
    color: var(--text-muted);
}

.session-card .session-time .time {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.session-card .session-details h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--text-heading);
}

.session-card .session-details .hall-name {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.session-card .session-details .duration {
    font-size: 12px;
    color: #aaa;
    margin: 2px 0 0;
}

/* Боковое меню для обычных страниц (не админка) */
.sidebar-wrapper { margin-bottom: 30px; }

.sidebar-wrapper .custom-sidebar {
    display: block !important;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.sidebar-wrapper .sidebar-section { margin-bottom: 20px; }

.sidebar-wrapper .sidebar-section:last-child { margin-bottom: 0; }

.sidebar-wrapper .sidebar-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}

.sidebar-wrapper .sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-wrapper .sidebar-section ul li { margin-bottom: 8px; }

.sidebar-wrapper .sidebar-section ul li a {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.sidebar-wrapper .sidebar-section ul li a:hover {
    background: var(--primary-gradient);
    color: var(--text-inverse);
}

/* Страница About */
.about-page {
    padding: 0 16px 40px;
    max-width: 600px;
    margin: 40px auto;
}

.about-page h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 20px;
}

.about-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.about-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 12px;
}

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

.about-section td {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.about-section td:first-child {
    color: var(--text-muted);
    width: 140px;
    padding-right: 12px;
}

.agreement-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.agreement-text p { margin: 0 0 10px; }
.agreement-text ol, .agreement-text ul { padding-left: 20px; margin: 8px 0; }
.agreement-text li { margin-bottom: 4px; }

/* Профиль — страница с данными (для страницы профиля) */
.profile-page-wrapper {
    padding: 0 16px 80px;
    max-width: 480px;
    margin: 0 auto;
}

.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.profile-section h2 {
    margin: 0 0 12px;
    color: var(--text-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
}

/* Адаптивность для мобильных */
@media (max-width: 767px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }

    .container {
        padding: 0 4px !important;
        margin: 0 !important;
        border-radius: 0;
        box-shadow: none;
    }

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

    .burger-btn {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        flex-direction: column;
        padding: 10px 15px;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 100;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-links.open,
    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 6px 0;
        width: 100%;
    }

    .site-nav {
        display: none;
    }

    .site-nav.open,
    .site-nav.active {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        padding: 10px 15px;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 100;
    }

    .site-nav a {
        display: block;
        padding: 6px 0;
        width: 100%;
    }

    .balance-card { margin: 0; border-radius: 0; }
    .content-section { margin: 0; border-radius: 0; }
    .profile-page-wrapper { max-width: 100%; }
    .profile-section { border-radius: 0; margin-left: -16px; margin-right: -16px; }
    .profile-card { border-radius: 0; margin-left: -16px; margin-right: -16px; }
    .shop-page { max-width: 100%; padding: 0 0 80px; }
    .balance-card { border-radius: 0; }
    .about-page { max-width: 100%; padding: 0 0 40px; }
    .about-section { border-radius: 0; }
    .news-carousel-section { padding: 16px 0 8px 16px; }

    .form-card {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}