/* ========== iOS 26+ LIQUID GLASS DESIGN ========== */

/* ========== CSS ПЕРЕМЕННЫЕ ========== */
:root {
    /* Основные цвета iOS 26 */
    --ios-blue: #007aff;
    --ios-green: #34c759;
    --ios-red: #ff3b30;
    --ios-orange: #ff9500;
    --ios-purple: #bf5af2;
    --ios-pink: #ff2d55;
    --ios-teal: #5ac8fa;
    --ios-indigo: #5856d6;
    --ios-yellow: #ffcc00;
    
    /* Градации серого - iOS 26 стиль */
    --ios-gray-1: #8e8e93;
    --ios-gray-2: #aeaeb2;
    --ios-gray-3: #c6c6c8;
    --ios-gray-4: #d1d1d6;
    --ios-gray-5: #e5e5ea;
    --ios-gray-6: #f2f2f7;
    
    /* Основные фоны */
    --ios-background: #ffffff;
    --ios-secondary-background: #f2f2f7;
    --ios-tertiary-background: #ffffff;
    --ios-separator: #c6c6c8;
    --ios-label: #000000;
    --ios-secondary-label: #3c3c43;
    --ios-tertiary-label: #8e8e93;
    
    /* Liquid Glass 2.0 эффекты */
    --glass-background: rgba(255, 255, 255, 0.72);
    --glass-background-strong: rgba(255, 255, 255, 0.92);
    --glass-blur: blur(30px);
    --glass-blur-light: blur(20px);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.3);
    
    /* Тени iOS 26 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 20px rgba(0, 122, 255, 0.3);
    
    /* Анимации iOS 26 */
    --spring-ease: cubic-bezier(0.34, 1.2, 0.64, 1);
    --smooth-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --morph-ease: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --bounce-ease: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Parallax */
    --parallax-speed: 0.5;
}

/* Тёмная тема iOS 26 */
[data-theme="dark"] {
    --ios-background: #000000;
    --ios-secondary-background: #1c1c1e;
    --ios-tertiary-background: #2c2c2e;
    --ios-separator: #38383a;
    --ios-label: #ffffff;
    --ios-secondary-label: #ebebf5;
    --ios-tertiary-label: #8e8e93;
    --ios-gray-5: #2c2c2e;
    --ios-gray-6: #1c1c1e;
    --glass-background: rgba(28, 28, 30, 0.72);
    --glass-background-strong: rgba(28, 28, 30, 0.92);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* Автоматическая тёмная тема */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ios-background: #000000;
        --ios-secondary-background: #1c1c1e;
        --ios-tertiary-background: #2c2c2e;
        --ios-separator: #38383a;
        --ios-label: #ffffff;
        --glass-background: rgba(28, 28, 30, 0.72);
        --glass-border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: var(--ios-secondary-background);
    color: var(--ios-label);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s var(--spring-ease);
}

/* ========== КОНТЕЙНЕР ========== */
.ios-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
}

@media (min-width: 769px) {
    .ios-container {
        padding: 24px 32px;
    }
}

@media (max-width: 768px) {
    .ios-container {
        padding: 16px 12px 80px 12px;
    }
}

/* ========== LIQUID GLASS NAVIGATION ========== */
.ios-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
}

.ios-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Десктоп */
@media (min-width: 769px) {
    .ios-nav-left {
        display: flex;
        align-items: center;
        gap: 16px;
        min-width: 120px;
    }
    .ios-nav-center {
        flex: 1;
        text-align: center;
    }
    .ios-nav-right {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 120px;
        justify-content: flex-end;
    }
    .mobile-only {
        display: none !important;
    }
    .ios-logo {
        font-size: 24px;
        font-weight: 700;
        background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple), var(--ios-pink));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        cursor: pointer;
        transition: all 0.3s var(--spring-ease);
    }
    .ios-logo:hover {
        transform: scale(1.02);
    }
    .ios-nav-title {
        font-size: 17px;
        font-weight: 600;
        color: var(--ios-label);
    }
}

/* Мобильные */
@media (max-width: 768px) {
    .ios-nav-left {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 60px;
    }
    .ios-nav-center {
        flex: 1;
        text-align: center;
    }
    .ios-nav-right {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 60px;
        justify-content: flex-end;
    }
    .desktop-only {
        display: none !important;
    }
    .ios-nav-title {
        font-size: 17px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }
    .ios-logo-small {
        font-size: 18px;
        font-weight: 700;
        background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

/* Кнопка назад */
.ios-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ios-gray-6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    font-size: 18px;
    border: none;
    color: var(--ios-blue);
}

.ios-back-btn:active {
    transform: scale(0.92);
    background: var(--ios-gray-5);
}

/* Кнопка обновления */
.ios-refresh-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ios-gray-6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    font-size: 16px;
    border: none;
    position: relative;
    overflow: hidden;
}

.ios-refresh-btn:active {
    transform: scale(0.92);
    background: var(--ios-gray-5);
}

.refresh-spinning {
    animation: spin 0.6s var(--spring-ease);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Кнопка профиля */
.ios-profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--spring-ease);
    font-size: 18px;
    border: none;
    color: white;
    box-shadow: var(--shadow-glow);
}

.ios-profile-btn:active {
    transform: scale(0.92);
}

/* Кнопка переключения темы */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 30px;
    background: var(--ios-gray-6);
    border: var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--spring-ease);
}

.theme-toggle-btn:active {
    transform: scale(0.92);
}

.theme-icon {
    font-size: 20px;
    transition: all 0.4s var(--spring-ease);
}

/* ========== DESKTOP TIPS MENU ========== */
.profile-tips-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--glass-background-strong);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    min-width: 260px;
    overflow: hidden;
    transform-origin: top right;
    animation: menuMorphIn 0.3s var(--morph-ease);
    border: var(--glass-border);
    z-index: 1001;
}

@keyframes menuMorphIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.profile-tips-header {
    padding: 16px;
    border-bottom: var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-tips-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.profile-tips-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-tips-info p {
    font-size: 13px;
    color: var(--ios-tertiary-label);
}

.profile-tips-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--ios-label);
}

.profile-tips-item:hover {
    background: var(--ios-gray-6);
}

.profile-tips-item-icon {
    width: 28px;
    font-size: 20px;
}

.profile-tips-item-label {
    flex: 1;
    font-size: 15px;
}

.profile-tips-divider {
    height: 0.5px;
    background: var(--ios-separator);
    margin: 4px 16px;
}

.profile-tips-footer {
    padding: 12px 16px;
    border-top: var(--glass-border);
    color: var(--ios-red);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-tips-footer:hover {
    background: var(--ios-gray-6);
}

/* ========== MOBILE BOTTOM TAB BAR ========== */
.ios-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border-top: var(--glass-border);
    padding: 8px 16px 20px;
    z-index: 999;
    transform: translateY(0);
    transition: transform 0.3s var(--spring-ease);
}

@media (max-width: 768px) {
    .ios-tab-bar {
        display: flex;
    }
    body {
        padding-bottom: 70px;
    }
}

.ios-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 10px;
    color: var(--ios-tertiary-label);
    transition: all 0.2s var(--spring-ease);
    padding: 8px 0;
    cursor: pointer;
    position: relative;
}

.ios-tab-item:active {
    transform: scale(0.95);
}

.ios-tab-item.active {
    color: var(--ios-blue);
}

.tab-icon {
    font-size: 22px;
    transition: transform 0.2s var(--spring-ease);
}

/* ========== MOBILE BOTTOM MENU ========== */
.ios-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-background-strong);
    backdrop-filter: var(--glass-blur);
    border-radius: 28px 28px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s var(--spring-ease);
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}

.ios-bottom-menu.open {
    transform: translateY(0);
}

.bottom-menu-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: pointer;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background: var(--ios-separator);
    border-radius: 2px;
}

.bottom-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 20px 24px;
}

.bottom-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--ios-tertiary-background);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    border: var(--glass-border);
}

.bottom-menu-item:active {
    transform: scale(0.96);
    background: var(--ios-gray-6);
}

.bottom-menu-icon {
    font-size: 28px;
}

.bottom-menu-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ios-label);
}

.bottom-menu-footer {
    padding: 12px 20px 24px;
    border-top: var(--glass-border);
}

.footer-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-menu-item:active {
    background: var(--ios-gray-6);
    transform: scale(0.98);
}

/* ========== LIQUID GLASS CARDS ========== */
.ios-card {
    background: var(--ios-background);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: var(--glass-border);
    transition: all 0.3s var(--spring-ease);
    position: relative;
    overflow: hidden;
}

.ios-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
    pointer-events: none;
}

.ios-card:active {
    transform: scale(0.98);
}

@media (min-width: 769px) {
    .ios-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }
    .ios-card:hover::before {
        transform: translateX(100%);
    }
}

/* ========== IOS BUTTONS ========== */
.ios-btn {
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 590;
    transition: all 0.3s var(--spring-ease);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.ios-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 80%);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.ios-btn:active::after {
    width: 200px;
    height: 200px;
}

.ios-btn-primary {
    background: linear-gradient(135deg, var(--ios-blue), #0055cc);
    color: white;
    box-shadow: var(--shadow-glow);
}

.ios-btn-primary:active {
    transform: scale(0.96);
}

.ios-btn-secondary {
    background: var(--ios-gray-6);
    color: var(--ios-blue);
}

.ios-btn-secondary:active {
    transform: scale(0.96);
}

/* ========== IOS INPUTS ========== */
.ios-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    border: 0.5px solid var(--ios-separator);
    border-radius: 14px;
    background: var(--ios-tertiary-background);
    color: var(--ios-label);
    transition: all 0.2s var(--smooth-ease);
    margin-bottom: 16px;
}

.ios-input:focus {
    outline: none;
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* ========== IOS MODAL - ПОЛНАЯ БЛОКИРОВКА ФОНА ========== */
.ios-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.ios-modal[style*="display: flex"] {
    display: flex !important;
}

.ios-modal-content {
    background: var(--glass-background-strong);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 32px;
    padding: 24px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    pointer-events: auto;
    z-index: 1000000;
    box-shadow: var(--shadow-xl);
    border: var(--glass-border);
    animation: modalMorphIn 0.35s var(--morph-ease);
}

/* Запрет скролла body */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Блокировка всех элементов под модалкой */
body.modal-open .ios-nav,
body.modal-open .ios-container,
body.modal-open .ios-tab-bar,
body.modal-open .ios-card,
body.modal-open .booking-card-modern,
body.modal-open .stats-wrapper,
body.modal-open .calendar-wrapper,
body.modal-open .filters-wrapper,
body.modal-open .stat-card-modern,
body.modal-open .filter-chip-modern,
body.modal-open button:not(.ios-modal button),
body.modal-open a:not(.ios-modal a),
body.modal-open .booking-swipe-container {
    pointer-events: none !important;
}

/* Разрешаем взаимодействие только с модалкой */
body.modal-open .ios-modal,
body.modal-open .ios-modal * {
    pointer-events: auto !important;
}

.ios-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ios-gray-6);
    border: var(--glass-border);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    color: var(--ios-tertiary-label);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.ios-modal-close:active {
    transform: scale(0.92);
    background: var(--ios-gray-5);
}

/* Анимация появления */
@keyframes modalMorphIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========== IOS TOAST ========== */
.ios-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 15px;
    z-index: 10000;
    transition: transform 0.4s var(--spring-ease);
    white-space: nowrap;
}

@media (min-width: 769px) {
    .ios-toast {
        bottom: 20px;
    }
}

.ios-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ========== DYNAMIC ISLAND ========== */
.dynamic-island {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s var(--spring-ease);
    pointer-events: none;
    color: white;
    font-size: 14px;
    white-space: nowrap;
}

.dynamic-island.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========== IOS SWITCH ========== */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ios-gray-5);
    transition: 0.3s var(--spring-ease);
    border-radius: 31px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s var(--spring-ease);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: var(--ios-blue);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ========== PULL TO REFRESH ========== */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 12px;
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    transform: translateY(-100%);
    transition: transform 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.pull-to-refresh.active {
    transform: translateY(0);
}

.refresh-spinner-icon {
    width: 24px;
    height: 24px;
    border: 2px solid var(--ios-separator);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== GRID SYSTEM ========== */
.ios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .ios-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========== STATUS BADGES ========== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending { background: var(--ios-orange); color: white; }
.status-confirmed { background: var(--ios-green); color: white; }
.status-cancelled { background: var(--ios-red); color: white; }
.status-completed { background: var(--ios-blue); color: white; }

/* ========== АНИМАЦИИ ========== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* ========== СКРОЛЛБАР ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--ios-separator);
    border-radius: 10px;
}

/* ========== ЗАПРЕТ ВЫДЕЛЕНИЯ ТЕКСТА ========== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.ios-input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ МОИ ЗАПИСИ ========== */

/* Горизонтальный скролл */
.stats-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stats-scroll::-webkit-scrollbar {
    display: none;
}

.stats-wrapper {
    width: 100%;
    margin: 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    scroll-behavior: smooth;
}

.stats-wrapper:active {
    cursor: grabbing;
}

.stats-wrapper::-webkit-scrollbar {
    display: none;
}

.stats-inner {
    display: flex;
    gap: 12px;
}

@media (min-width: 768px) {
    .stats-wrapper:not(.has-scroll) .stats-inner {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
    }
    .stats-wrapper.has-scroll .stats-inner {
        display: flex;
        min-width: min-content;
    }
}

.stat-card-modern {
    flex: 0 0 auto;
    min-width: 110px;
    scroll-snap-align: start;
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 16px 12px;
    text-align: center;
    border: var(--glass-border);
    transition: all 0.3s var(--spring-ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card-modern:active {
    transform: scale(0.96);
}

.stat-card-modern.active {
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    color: white;
    border-color: transparent;
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-number-modern {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label-modern {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Календарь */
.calendar-wrapper {
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05), rgba(240,147,251,0.05));
    border-radius: 32px;
    padding: 20px;
    margin-bottom: 24px;
    border: 0.5px solid rgba(102,126,234,0.2);
    backdrop-filter: blur(10px);
}

.calendar-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.calendar-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    color: var(--ios-label);
}

.calendar-nav-btn:active {
    transform: scale(0.92);
}

.calendar-month-modern {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.weekdays-modern {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 16px;
}

.weekday-modern {
    font-size: 13px;
    font-weight: 600;
    color: var(--ios-tertiary-label);
    padding: 8px 0;
}

.calendar-days-modern {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-modern {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s var(--spring-ease);
    font-size: 15px;
    font-weight: 500;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    position: relative;
    overflow: hidden;
}

.calendar-day-modern:active {
    transform: scale(0.94);
}

.calendar-day-modern.has-upcoming {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    animation: softPulse 2s infinite;
}

.calendar-day-modern.has-past {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: white;
    opacity: 0.7;
}

.calendar-day-modern.today {
    border: 2px solid var(--ios-blue);
    background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
}

.calendar-day-modern.selected {
    background: linear-gradient(135deg, var(--ios-blue), #0055cc);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,122,255,0.4);
}

.calendar-day-modern.empty {
    opacity: 0.3;
    cursor: default;
    background: transparent;
    backdrop-filter: none;
}

.day-number {
    font-size: 16px;
    font-weight: 600;
}

.day-indicator {
    font-size: 8px;
    margin-top: 2px;
    opacity: 0.8;
}

/* Фильтры */
.filters-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filters-scroll::-webkit-scrollbar {
    display: none;
}

.filters-wrapper {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    scroll-behavior: smooth;
}

.filters-wrapper:active {
    cursor: grabbing;
}

.filters-wrapper::-webkit-scrollbar {
    display: none;
}

.filter-chip-modern {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 10px 20px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    border: var(--glass-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-chip-modern:active {
    transform: scale(0.95);
}

.filter-chip-modern.active {
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    color: white;
    border-color: transparent;
}

.filter-chip-modern .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
}

.filter-chip-modern.active .count {
    background: rgba(255,255,255,0.2);
}

/* Карточка записи */
.booking-card-modern {
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 12px;
    border: var(--glass-border);
    transition: all 0.3s var(--spring-ease);
    cursor: pointer;
    animation: fadeInUp 0.4s var(--spring-ease);
}

.booking-card-modern:active {
    transform: scale(0.98);
}

/* Статус бейджи для записей */
.status-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
}

.status-today-modern {
    background: linear-gradient(135deg, #34c759, #28a745);
    color: white;
    animation: subtlePulse 1.5s infinite;
}

.status-upcoming-modern {
    background: linear-gradient(135deg, var(--ios-blue), #0055cc);
    color: white;
}

.status-completed-modern {
    background: var(--ios-gray-4);
    color: var(--ios-label);
}

.status-cancelled-modern {
    background: linear-gradient(135deg, #ff3b30, #cc2a20);
    color: white;
}

.status-pending-modern {
    background: linear-gradient(135deg, #ff9500, #cc7a00);
    color: white;
}

/* Детали записи */
.detail-row-modern {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 0.5px solid var(--ios-separator);
}

.detail-label-modern {
    color: var(--ios-tertiary-label);
    font-size: 14px;
}

.detail-value-modern {
    font-weight: 500;
    text-align: right;
}

/* Скелетон загрузки */
.skeleton-modern {
    background: linear-gradient(90deg, var(--ios-gray-6) 25%, var(--ios-separator) 50%, var(--ios-gray-6) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Пустое состояние */
.empty-state-modern {
    text-align: center;
    padding: 60px 20px;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border-radius: 32px;
}

.empty-icon-modern {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Спиннер */
.ios-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ios-separator);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

/* Календарь переноса */
/* ========== ИСПРАВЛЕННЫЙ КАЛЕНДАРЬ ПЕРЕНОСА - АДАПТИВНЫЙ ========== */
.reschedule-calendar-wrapper {
    background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08), rgba(240,147,251,0.08));
    border-radius: 28px;
    padding: 16px;
    margin-bottom: 20px;
    border: 0.5px solid rgba(102,126,234,0.2);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.reschedule-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.reschedule-month-title {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.reschedule-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.reschedule-nav-btn:active {
    transform: scale(0.92);
}

/* АДАПТИВНАЯ СЕТКА ДНЕЙ - НЕ ВЫХОДИТ ЗА ГРАНИЦЫ */
.reschedule-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 12px;
    gap: 4px;
}

.reschedule-weekday {
    font-size: 12px;
    font-weight: 600;
    color: var(--ios-tertiary-label);
    padding: 6px 0;
    text-align: center;
}

.reschedule-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.reschedule-day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s var(--spring-ease);
    font-size: 14px;
    font-weight: 500;
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    min-width: 0; /* Важно для сжатия */
    width: 100%;
    padding: 4px;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    .reschedule-calendar-wrapper {
        padding: 12px;
    }
    
    .reschedule-days {
        gap: 4px;
    }
    
    .reschedule-day {
        border-radius: 12px;
    }
    
    .reschedule-day .day-num {
        font-size: 12px;
    }
    
    .reschedule-day .day-status {
        font-size: 7px;
    }
    
    .reschedule-weekday {
        font-size: 10px;
        padding: 4px 0;
    }
}

@media (max-width: 380px) {
    .reschedule-days {
        gap: 3px;
    }
    
    .reschedule-day {
        border-radius: 10px;
    }
    
    .reschedule-day .day-num {
        font-size: 11px;
    }
    
    .reschedule-day .day-status {
        font-size: 6px;
        display: none; /* Скрываем статус на очень маленьких экранах */
    }
}

/* Свайп-карточки */
.booking-swipe-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
    border-radius: 24px;
}

.booking-swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
    pointer-events: none;
}

.booking-swipe-actions .swipe-action {
    pointer-events: auto;
}

.swipe-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 80px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.swipe-action:active {
    transform: scale(0.95);
}

.swipe-action span:first-child {
    font-size: 24px;
}

.swipe-reschedule {
    color: var(--ios-blue);
}

.swipe-reschedule span:first-child {
    color: var(--ios-blue);
}

.swipe-cancel {
    color: var(--ios-red);
}

.swipe-cancel span:first-child {
    color: var(--ios-red);
}

/* Адаптив */
@media (max-width: 768px) {
    .calendar-day-modern {
        font-size: 13px;
    }
    .filter-chip-modern {
        padding: 8px 16px;
        font-size: 12px;
    }
    .stat-card-modern {
        min-width: 90px;
        padding: 12px 8px;
    }
    .stat-number-modern {
        font-size: 22px;
    }
    .time-slots-reschedule {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    }
    .ios-toast {
        white-space: normal;
        max-width: 90%;
        text-align: center;
    }
}

