/* Компонент выбора даты и времени с расписанием */

.datetime-picker-wrapper {
    position: relative;
    width: 100%;
}

.datetime-picker-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.datetime-picker-input:hover {
    border-color: #3b82f6;
}

.datetime-picker-input i:first-child {
    color: #3b82f6;
    font-size: 16px;
}

.datetime-picker-input .datetime-value {
    flex: 1;
    color: #1e293b;
    font-size: 14px;
}

.datetime-picker-input i:last-child {
    color: #94a3b8;
    font-size: 12px;
}

/* Модальное окно пикера */
.datetime-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.datetime-picker-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.datetime-picker-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.datetime-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.datetime-picker-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.datetime-picker-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.datetime-picker-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.datetime-picker-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Левая часть: быстрый выбор + календарь */
.datetime-picker-left {
    width: 320px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.quick-select {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.quick-select button {
    padding: 6px 12px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}

.quick-select button:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

/* Календарь */
.calendar-container {
    padding: 12px;
}

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

.calendar-header button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    color: #64748b;
    transition: all 0.2s;
}

.calendar-header button:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.calendar-header span {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

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

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px;
}

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

.calendar-day {
    text-align: center;
    padding: 8px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #1e293b;
}

.calendar-day:hover:not(.empty):not(.past) {
    background: #eff6ff;
    color: #3b82f6;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.past {
    color: #cbd5e1;
    cursor: not-allowed;
}

.calendar-day.today {
    background: #dbeafe;
    color: #3b82f6;
    font-weight: 600;
}

.calendar-day.selected {
    background: #3b82f6 !important;
    color: #fff !important;
    font-weight: 600;
}

/* Правая часть: расписание */
.datetime-picker-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}

.schedule-refresh-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-refresh-btn:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    color: #3b82f6;
}

.schedule-refresh-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.schedule-date {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
    letter-spacing: -0.3px;
}

.schedule-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Фильтр по пользователю в расписании */
.schedule-user-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
}

.schedule-user-filter i {
    color: #3b82f6;
    font-size: 14px;
}

.schedule-user-filter select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.schedule-user-filter select:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.schedule-user-filter select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.schedule-container {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}

/* Селектор длительности */
.schedule-duration-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.duration-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.duration-label::before {
    content: '';
    width: 4px;
    height: 4px;
    background: #94a3b8;
    border-radius: 50%;
}

.btn-15min {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-15min:hover {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.15);
}

.btn-15min.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.btn-15min i {
    font-size: 12px;
}

.schedule-timeline {
    position: relative;
    padding: 0;
    user-select: none;
    cursor: crosshair;
    background: repeating-linear-gradient(
        180deg,
        #fff 0px,
        #fff 43px,
        #f8fafc 43px,
        #f8fafc 44px
    );
}

.schedule-row {
    display: flex;
    border-bottom: 1px solid transparent;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    box-sizing: border-box;
}

.schedule-row::after {
    content: '';
    position: absolute;
    left: 58px;
    right: 8px;
    bottom: 0;
    height: 1px;
    background: #f1f5f9;
}

.schedule-row:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%);
}

.schedule-row.selected {
    background: #eff6ff;
    border-radius: 0 8px 8px 0;
    border-left: 3px solid #3b82f6;
}

.schedule-row.selected::after {
    display: none;
}

.schedule-row.selected .schedule-time {
    color: #2563eb;
    font-weight: 700;
}

.schedule-row.selected .schedule-slot {
    background: transparent;
}

.schedule-row.in-range {
    background: #f5f9ff;
    border-left: 3px solid #93c5fd;
}

.schedule-row.in-range .schedule-time {
    color: #3b82f6;
    font-weight: 600;
}

.schedule-row.in-range .schedule-slot {
    background: transparent;
}

.schedule-row.half-hour {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
}

.schedule-row.half-hour .schedule-time {
    color: #cbd5e1;
    font-size: 11px;
}

.schedule-row.half-hour::after {
    background: #f8fafc;
}

.schedule-time {
    width: 54px;
    padding: 12px 10px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    border-right: 2px solid #e2e8f0;
    flex-shrink: 0;
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, #fafbfc 0%, #fff 100%);
}

.schedule-slot {
    flex: 1;
    padding: 4px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.schedule-slot.has-tasks {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08) 0%, rgba(251, 191, 36, 0.03) 100%);
}

.schedule-task-continuation {
    height: 100%;
    min-height: 28px;
    background: linear-gradient(90deg, 
        rgba(251, 191, 36, 0.12) 0%, 
        rgba(251, 191, 36, 0.05) 100%
    );
    border-left: 3px solid rgba(245, 158, 11, 0.4);
    border-radius: 0 8px 8px 0;
    margin: 2px 0;
}

.schedule-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin: 3px 0;
    transition: all 0.2s ease;
}

.schedule-task:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.schedule-task .task-time {
    color: #b45309;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    min-width: 40px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: -0.3px;
    background: rgba(180, 83, 9, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.schedule-task .task-title {
    color: #1e293b;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.schedule-task .task-client {
    color: #78716c;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(120, 113, 108, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Обёртка для timeline с абсолютным позиционированием событий */
.schedule-timeline-wrapper {
    position: relative;
    overflow: visible;
}

.schedule-events-layer {
    position: absolute;
    top: 0;
    left: 50px;
    right: 8px;
    pointer-events: none;
}

/* Overlay для выделения времени — поверх событий */
.schedule-selection-overlay {
    position: absolute;
    top: 0;
    left: 50px;
    right: 8px;
    pointer-events: none;
    z-index: 25;
}

.selection-highlight {
    position: absolute;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(96, 165, 250, 0.08) 100%);
    border: 2px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    transition: top 0.15s ease, height 0.15s ease;
}

/* Блок события с растяжкой */
.schedule-event-block {
    position: absolute;
    left: 4px;
    right: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(4px);
}


.schedule-event-block:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(3px) scale(1.01);
}

/* Группа перекрывающихся событий */
.schedule-event-group {
    position: absolute;
    left: 4px;
    right: 12px;
    z-index: 15;
    pointer-events: auto;
    transition: height 0.25s ease, top 0.25s ease;
}

/* Круглые иконки-табы — внутри блока, справа вверху */
.event-group-tabs {
    position: absolute;
    top: 4px;
    right: 6px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    z-index: 5;
    pointer-events: auto;
}

.event-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2.5px solid rgba(0,0,0,0.35);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    opacity: 0.75;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.event-tab i {
    font-size: 11px;
    line-height: 1;
}

.event-tab:hover {
    opacity: 1;
    transform: scale(1.12);
    border-color: rgba(0,0,0,0.5);
}

.event-tab.active {
    opacity: 1;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25);
    transform: scale(1.18);
}

/* Цвета табов-иконок — насыщенные для контраста */
.event-tab.event-other {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
}

.event-tab.event-current {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
}

.event-tab.event-personal {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff;
}

.event-tab.event-deal {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: #fff;
}

.event-tab.event-editing-tab {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
    opacity: 1;
}

/* Контент табов — заполняет весь блок, как одиночное событие */
.event-tab-content {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 40px 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
}

.event-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Цвета контента */
.event-tab-content.event-other {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.event-tab-content.event-current {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.event-tab-content.event-personal {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.event-tab-content.event-deal {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 4px solid #8b5cf6;
    color: #5b21b6;
}

.event-block-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    overflow: hidden;
}

/* Строка внутри события — горизонтальный ряд */
.ev-row {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.3;
}

/* 1 строка (30 мин) */
.ev-1row .event-block-content {
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.ev-1row .ev-row {
    width: 100%;
}

/* 2 строки (60 мин) */
.ev-2row .event-block-content {
    justify-content: center;
}

.ev-2row .event-owner {
    margin-left: auto;
}

.ev-2row .event-title {
    font-weight: 500;
}

.ev-2row .event-description {
    display: inline;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Полный вид (90+ мин) */
.ev-full .ev-row {
    margin-bottom: 2px;
}

.ev-full .event-owner {
    margin-left: auto;
}

/* Контент таба — 2 строки */
.ev-2row-content {
    justify-content: center;
}

.ev-2row-content .event-owner {
    margin-left: auto;
}

.ev-2row-content .event-description {
    display: inline;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-description {
    display: block;
    width: 100%;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-tab-content.ev-full .event-description {
    white-space: normal;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
}

.schedule-event-block .event-time,
.event-tab-content .event-time {
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.schedule-event-block .event-title,
.event-tab-content .event-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

.schedule-event-block .event-client,
.event-tab-content .event-client {
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
}

.schedule-event-block .event-owner,
.event-tab-content .event-owner {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: auto;
}

.schedule-event-block.event-other .event-owner,
.event-tab-content.event-other .event-owner {
    background: rgba(217, 119, 6, 0.15);
    color: #92400e;
}

.schedule-event-block.event-current .event-owner,
.event-tab-content.event-current .event-owner {
    background: rgba(37, 99, 235, 0.15);
    color: #1e40af;
}

.schedule-event-block.event-personal .event-owner,
.event-tab-content.event-personal .event-owner {
    background: rgba(5, 150, 105, 0.15);
    color: #065f46;
}

.schedule-event-block.event-deal .event-owner,
.event-tab-content.event-deal .event-owner {
    background: rgba(124, 58, 237, 0.15);
    color: #5b21b6;
}

/* Цвета событий */
/* Оранжевый - другие задачи */
.schedule-event-block.event-other {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.schedule-event-block.event-other .event-time {
    color: #d97706;
}

/* Синий - текущий клиент */
.schedule-event-block.event-current {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.schedule-event-block.event-current .event-time {
    color: #2563eb;
}

/* Зелёный - личные дела */
.schedule-event-block.event-personal {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.schedule-event-block.event-personal .event-time {
    color: #059669;
}

/* Фиолетовый - сделки */
.schedule-event-block.event-deal {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 4px solid #8b5cf6;
    color: #5b21b6;
}

.schedule-event-block.event-deal .event-time {
    color: #7c3aed;
}

/* Подсветка редактируемого события (до перемещения) — приглушённый красный фон, белый текст */
.schedule-event-block.event-editing-initial {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.55) 0%, rgba(185, 28, 28, 0.45) 100%) !important;
    border-left: 4px solid #dc2626 !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25), 0 3px 10px rgba(239, 68, 68, 0.2) !important;
    animation: editing-pulse 2.5s ease-in-out infinite;
}

.schedule-event-block.event-editing-initial .event-time {
    color: rgba(255, 255, 255, 0.9) !important;
}

.schedule-event-block.event-editing-initial .event-title {
    color: #fff !important;
}

.schedule-event-block.event-editing-initial .event-client {
    color: rgba(255, 255, 255, 0.85) !important;
}

.schedule-event-block.event-editing-initial .event-description {
    color: rgba(255, 255, 255, 0.8) !important;
}

.schedule-event-block.event-editing-initial .event-owner {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.schedule-event-block.event-editing-initial .event-icon {
    opacity: 1 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.schedule-event-block.event-editing-initial .event-editing-badge {
    color: #fff;
}

@keyframes editing-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25), 0 3px 10px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35), 0 3px 15px rgba(239, 68, 68, 0.3); }
}

.event-editing-badge {
    font-size: 12px;
    margin-left: 4px;
}

/* Иконка типа события */
.schedule-event-block .event-header {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.schedule-event-block .event-icon,
.event-tab-content .event-icon {
    font-size: 10px;
    opacity: 0.7;
}

/* Статистика на день */
.day-stats {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.day-stats-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.day-stats-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.day-stat-item i {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.day-stat-item .stat-label {
    flex: 1;
    font-size: 13px;
    color: #475569;
}

.day-stat-item .stat-value {
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    text-align: right;
}

.day-stat-item.tasks {
    border-left: 3px solid #f59e0b;
}

.day-stat-item.tasks i {
    color: #f59e0b;
}

.day-stat-item.tasks .stat-value {
    color: #d97706;
}

.day-stat-item.personal {
    border-left: 3px solid #10b981;
}

.day-stat-item.personal i {
    color: #10b981;
}

.day-stat-item.personal .stat-value {
    color: #059669;
}

/* Футер пикера */
.datetime-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.selected-datetime {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: 14px;
}

.selected-datetime i {
    color: #3b82f6;
}

.selected-datetime span {
    font-weight: 600;
}

.datetime-picker-actions {
    display: flex;
    gap: 10px;
}

.datetime-picker-actions .btn {
    padding: 8px 20px;
    font-size: 14px;
}

/* ===== МОБИЛЬНАЯ АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .datetime-picker-container {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .datetime-picker-body {
        flex-direction: column;
        flex: 1;
        overflow: hidden;
    }
    
    /* Табы для переключения между календарем и расписанием */
    .datetime-picker-tabs {
        display: flex !important;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc;
        padding: 0;
    }
    
    .datetime-picker-tab {
        flex: 1;
        padding: 14px;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        color: #64748b;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        border-bottom: 3px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .datetime-picker-tab.active {
        color: #3b82f6;
        border-bottom-color: #3b82f6;
        background: #fff;
    }
    
    .datetime-picker-tab i {
        font-size: 16px;
    }
    
    .datetime-picker-left {
        width: 100%;
        border-right: none;
        border-bottom: none;
        flex: 1;
        overflow-y: auto;
        display: none;
    }
    
    .datetime-picker-left.active {
        display: block;
    }
    
    .datetime-picker-right {
        width: 100%;
        max-height: none;
        flex: 1;
        overflow-y: auto;
        display: none;
    }
    
    .datetime-picker-right.active {
        display: flex;
        flex-direction: column;
    }
    
    /* Быстрый выбор */
    .quick-select {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px;
    }
    
    .quick-select button {
        padding: 8px 12px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    
    /* Календарь */
    .calendar-container {
        padding: 8px 12px;
    }
    
    .calendar-days span {
        width: calc(100% / 7);
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Статистика */
    .day-stats {
        margin: 12px;
        padding: 12px;
    }
    
    .day-stat-item {
        padding: 12px;
    }
    
    /* Расписание на мобильном */
    .schedule-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .schedule-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .schedule-timeline-wrapper {
        padding: 0;
    }
    
    .schedule-row {
        min-height: 50px;
    }
    
    .schedule-row .schedule-time {
        width: 60px;
        font-size: 13px;
        padding-left: 12px;
    }
    
    .schedule-row .schedule-slot {
        flex: 1;
    }
    
    .schedule-duration-selector {
        padding: 10px 12px;
        background: #f8fafc;
    }
    
    .schedule-duration-selector .duration-label {
        font-size: 11px;
    }
    
    /* Блоки событий на мобильном */
    .schedule-event-block {
        padding: 8px 10px;
        border-radius: 6px;
    }
    
    .schedule-event-block .event-time {
        font-size: 11px;
    }
    
    .schedule-event-block .event-title {
        font-size: 12px;
    }
    
    .schedule-event-block .event-client {
        font-size: 10px;
    }
    
    .schedule-event-block .event-owner {
        font-size: 9px;
    }
    
    /* Выбранный временной слот */
    .schedule-row.selected .schedule-slot {
        background: rgba(59, 130, 246, 0.15);
    }
    
    .schedule-row.selected .schedule-time {
        color: #3b82f6;
        font-weight: 600;
    }
    
    /* Футер на мобильном */
    .datetime-picker-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    
    .selected-datetime {
        width: 100%;
        justify-content: center;
        padding: 10px;
        background: #f1f5f9;
        border-radius: 8px;
    }
    
    .datetime-picker-actions {
        width: 100%;
        gap: 12px;
    }
    
    .datetime-picker-actions .btn {
        flex: 1;
        padding: 14px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* Скрываем табы на десктопе */
.datetime-picker-tabs {
    display: none;
}

