/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.content-scroll {
    height: 100vh;
    overflow-y: auto;
    padding: 0 0 120px;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}

/* ========== ВЕРХНИЙ БЛОК (КАЛЕНДАРЬ) ========== */
.top-section {
    background: var(--surface);
    border-radius: 0 0 24px 24px;
    padding: 16px 16px 12px;
    box-shadow: var(--shadow);
}

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

.month-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.today-btn {
    background: var(--surface-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 0.5px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.today-btn:active {
    transform: scale(0.95);
}

/* ========== НЕДЕЛЬНАЯ СЕТКА ========== */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0;
    text-align: center;
    transition: all 0.3s ease;
    max-height: 80px;
    overflow: hidden;
}

.week-grid.hidden {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.week-day-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 0;
}

.week-day-number {
    font-size: 16px;
    padding: 8px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
    color: var(--text-primary);
}

.week-day-number.today {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.week-day-number.selected {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    background: transparent;
}

.week-day-number.other-month {
    color: var(--text-secondary);
    opacity: 0.4;
}

/* ========== РАЗДЕЛИТЕЛЬ (ЧЁРНЫЙ ПРОМЕЖУТОК) ========== */
.section-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    background: transparent;
    cursor: row-resize;
    touch-action: none;
    margin: 0 16px;
    height: 20px;
}

.handle-line {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

/* ========== НИЖНИЙ БЛОК (РАСПИСАНИЕ) ========== */
.bottom-section {
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 16px 16px 20px;
    box-shadow: var(--shadow);
}

.timeline {
    width: 100%;
    position: relative;
}

.hour-slot {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    gap: 12px;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.hour-slot:last-child {
    border-bottom: none;
}

.hour-slot:active {
    background: var(--surface-secondary);
}

.hour-time {
    width: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.hour-events {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.event-card {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding: 4px 10px;
    font-size: var(--font-size-small);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.event-card.delegated {
    border-left-color: var(--success);
}

.current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--current-time);
    z-index: 2;
    pointer-events: none;
}

.current-time-dot {
    position: absolute;
    left: -5px;
    top: -4px;
    width: 8px;
    height: 8px;
    background: var(--current-time);
    border-radius: 50%;
}

/* ========== НИЖНЕЕ МЕНЮ (TELEGRAM STYLE) ========== */
.bottom-bar-modern {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 0.5px solid var(--glass-border);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 12px;
}

.bottom-menu-inner {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
}

.menu-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 10px;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 50px;
    transition: all 0.2s;
    cursor: pointer;
}

.menu-item i {
    font-size: 22px;
}

.menu-item span {
    line-height: 1.2;
}

.menu-item.active {
    color: var(--accent);
}

.avatar-small {
    width: 26px;
    height: 26px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* ========== FAB КНОПКА ========== */
.fab-modern {
    position: fixed;
    bottom: 88px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    cursor: pointer;
    z-index: 21;
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-modern:active {
    transform: scale(0.9);
}

/* ========== ЗОНА ПЕРЕКЛЮЧЕНИЯ ДНЯ ========== */
.day-change-zone {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-secondary);
    border-radius: 0 0 24px 24px;
    margin-top: 10px;
    transition: background 0.2s;
    cursor: pointer;
}

.day-change-zone.dragging {
    background: var(--border);
}

.day-change-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.day-change-label {
    text-align: center;
}

.day-change-label span {
    color: var(--accent);
    font-weight: 600;
}

.day-change-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.day-change-zone.dragging .day-change-arrow {
    transform: translateY(-5px);
}

/* ========== МЕСЯЧНАЯ СЕТКА (С ПРОКРУТКОЙ) ========== */
.month-grid-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.2, 0.9, 0.4, 1), opacity 0.3s;
    opacity: 0;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    padding: 0 4px;
}

.month-grid-container.expanded {
    max-height: 500px;
    opacity: 1;
    padding: 8px 4px 16px;
}

.month-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 0 12px;
    color: var(--text-secondary);
}

.month-grid-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 14px;
}

.month-grid-grid .cal-day {
    padding: 8px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-primary);
}

.month-grid-grid .cal-day.today {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.month-grid-grid .cal-day.selected {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    background: transparent;
}

.month-grid-grid .cal-day.other-month {
    color: var(--text-secondary);
    opacity: 0.4;
}

/* ========== ЗАГОЛОВОК МЕСЯЦА С КНОПКАМИ ========== */
.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px 12px;
}

.month-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    text-align: center;
    flex: 1;
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}

.month-nav-btn:active {
    background: var(--border);
}

.month-nav-btn i {
    font-size: 14px;
}

/* ========== ОБНОВЛЁННАЯ СЕТКА ========== */
.month-grid-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 14px;
}

.month-grid-grid .cal-day {
    padding: 8px 0;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-primary);
}

.month-grid-grid .cal-day.today {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.month-grid-grid .cal-day.selected {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    background: transparent;
}

.month-grid-grid .cal-day.other-month {
    color: var(--text-secondary);
    opacity: 0.4;
}