* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f6fa;
    color: #333;
    height: 100vh;
    overflow: auto; /* включаем скролл */
    
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.info-panels {
    display: flex;
    width: 100%;
    padding: 15px;
    gap: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    align-items: stretch; /* Это обеспечит одинаковую высоту */
}


.info-panel {
    flex: 1;
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.info-panel {
    flex: 1;
    background: white;
    border-radius: 6px;
    padding: 15px; /* ← можно уменьшить до 10px или 12px */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #2c3e50;
    font-weight: 500;
}

#employee-selector {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

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

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

#search-dept {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#lines-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.line-item {
    padding: 12px 15px;
    /* padding-left теперь устанавливается динамически в JS */
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.line-item:hover {
    background-color: #f0f5ff;
}

.department {
    font-weight: 600;
    background-color: #f8f9fa;
    border-left: 4px solid #4b6cb7;
}

.sub-item {
    /* padding-left: 30px; ← УДАЛИТЬ ЭТУ СТРОКУ */
    color: #555;
    position: relative;
    gap: 4px;
}

.sub-item::before {
    content: "→";
    position: absolute;
    left: 15px;
    color: #888;
}

.toggle-icon {
    margin-right: 8px;
    transition: transform 0.3s;
    font-size: 12px;
}

.department.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.control-panel {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.primary-button {
    padding: 10px 20px;
    background: #4b6cb7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.primary-button:hover {
    background: #3a5795;
}

.date-range-display {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    text-align: center;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.dropdown-toggle:hover {
    border-color: #4b6cb7;
    color: #4b6cb7;
}

.dropdown-arrow {
    font-size: 10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    min-width: 120px;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f0f5ff;
}

.dropdown-item[data-selected="true"] {
    background-color: #4b6cb7;
    color: white;
}

.calendar-header {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Не сжимается */
    z-index: 10; /* Чтобы был поверх всего при скролле */
}
/* Основной контейнер календаря */
.calendar-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden; /* Важно: скрываем переполнение у родителя */
}


.user-cell {
    position: sticky;
    left: 0;
    z-index: 4;
    width: 300px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: white;
    font-weight: 500;
    color: #2c3e50;
    border-right: 1px solid #eee;
    cursor: pointer;
}

/* Ячейка для событий (занимает всё оставшееся пространство) */
.events-cell {
    position: relative;
    flex: 1;
    min-width: max-content; /* Важно: чтобы события не обрезались */
    overflow: visible;
}

.calendar-row.department-row .user-cell {
    background-color: #f0f9ff !important;
    font-weight: 700;
    color: #1a73e8;
    border-left: 4px solid #1a73e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.user-cell:hover {
    background-color: #f0f5ff !important;
    box-shadow: inset 4px 0 0 #4b6cb7;
}

.calendar-row {
    display: flex;
    height: 40px;
    border-bottom: 1px solid #9a9a9a;
    background: white;
    position: relative;
    overflow: visible;
    min-width: max-content; /* Важно: чтобы строки не сжимались */
}
.user-rows-container {
    position: relative;
    min-width: max-content; /* Критически важно для правильной ширины */
    overflow: visible !important;
}

.scroll-container.unified-container {
    flex: 1;
    overflow: auto;
    position: relative;
    min-height: 0;
    scroll-behavior: smooth;
}

.scroll-container.unified-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Показываем тень, когда контент можно прокрутить вправо */
.scroll-container.unified-container:not(:hover):not(.at-end)::after {
    opacity: 1;
}

/* Скрываем тень, когда пользователь доскроллил до конца */
.scroll-container.unified-container.at-end::after {
    opacity: 0;
}
.calendar-header h2 {
    color: #2c3e50;
    white-space: nowrap;
}

.calendar-controls {
    display: flex;
    gap: 10px;
}

.calendar-controls button {
    padding: 8px 15px;
    background: #4b6cb7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.calendar-controls button:hover {
    background: #3a5795;
}

.calendar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
    border-top: 1px solid #eee;
    position: relative;
}

.calendar-content {
    display: flex;
    min-height: 0;
}

.user-list {
    display: none !important; /* Скрываем старый отдельный список */
}
.days-container {
    display: flex;
    flex-direction: column;
    min-width: max-content; /* Чтобы контент не сжимался */
}

.days-header {
    display: flex;
    height: 40px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f9f9f9;
    border-bottom: 2px solid #4b6cb7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: max-content;
    width: 100%;
}


.day-cell {
    position: relative;
    width: 40px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    border-right: 1px solid #eee;
    background: #f9f9f9;
    font-size: 12px;
    color: #555;
}

.day-number {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.2;
}
.weekday {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Подсветка выходных дней === */
.weekend-cell {
    background-color: #f0f4ff !important;
}
.weekend-cell .day-number {
    color: #d32f2f;
    font-weight: 600;
}
.weekend-cell .weekday {
    color: #9c27b0;
    font-weight: 600;
}

/* === СЕГОДНЯШНИЙ ДЕНЬ — ЭЛЕГАНТНОЕ ВЫДЕЛЕНИЕ === */
.today-cell {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 -2px 0 #1976d2;
}
.day-number.today {
    color: #1565c0;
    font-weight: 800;
}
.scroll-container {
    flex: 1;
    overflow: auto; /* Скролл по горизонтали и вертикали */
    position: relative;
    min-height: 0;
    scroll-behavior: smooth;
}

/* Контейнер для полосок событий */
.user-bars-container {
    position: relative;
    min-width: max-content;
}

.user-bars {
    position: absolute;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    will-change: transform;
}
.empty-cell {
    background: #f9f9f9;
    border-right: 1px solid #eee;
    color: transparent;
    cursor: default;
}
/*.user-row {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 15px;
    border-bottom: 1px solid #eee;
    background: white;
    min-width: max-content;
    font-weight: 500;
    color: #2c3e50;
    transition: background-color 0.2s;
}*/
.department-row {
    background-color: #f0f9ff !important;
    font-weight: 700;
    color: #1a73e8;
    border-left: 4px solid #1a73e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.bar {
    position: absolute;
    height: 25px;
    border-radius: 4px;
    top: 7px;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Плавная анимация */
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bar:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 10;
}

.bar.orange { background: linear-gradient(to right, rgba(245, 166, 35, 0.9), rgba(245, 166, 35, 0.7)); }
.bar.blue { background: linear-gradient(to right, rgba(74, 144, 226, 0.9), rgba(74, 144, 226, 0.7)); }
.bar.green { background: linear-gradient(to right, rgba(80, 227, 194, 0.9), rgba(80, 227, 194, 0.7)); }
.bar.purple { background: linear-gradient(to right, rgba(155, 89, 182, 0.9), rgba(155, 89, 182, 0.7)); }
.bar.red { background: linear-gradient(to right, rgba(231, 76, 60, 0.9), rgba(231, 76, 60, 0.7)); }

/* Линия "Сегодня" */
.today-line {
    position: absolute;
    top: 40px; /* ← Возвращаем, потому что шапка теперь sticky и занимает 40px сверху */
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, red, transparent);
    z-index: 1;
    pointer-events: none;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.bar.yellow {
    background: linear-gradient(to right, rgba(255, 203, 5, 0.9), rgba(255, 171, 0, 0.7));
}
.event-tooltip {
    position: absolute;
    background: rgba(30, 30, 40, 0.92);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 260px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #4b6cb7;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-available {
    color: #28a745;
    background: #f0f9f0;
}

.status-unavailable {
    color: #dc3545;
    background: #fce8e8;
}
.status-busy { background-color: #e74c3c; }
.status-unknown { background-color: #95a5a6; }


.expandable {
    cursor: pointer;
    position: relative;
}
.info-panel.vacations-info {
    max-height: none; /* Убираем ограничение высоты */
    overflow: visible; /* Убираем скролл */
    display: flex;
    flex-direction: column;
}

.expandable-list {
    font-size: 13px;
    color: #555;
}

.expandable-list div {
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
}


/* Стили для статистики отдела */
.dept-name {
    font-weight: 600;
    margin-right: 5px;
}
.dept-stats {
    font-size: 13px;
    color: #666;
    font-weight: normal;
}
.on-vacation-count {
    font-weight: bold;
    color: #e74c3c;
}
.on-vacation-percent {
    font-weight: bold;
    color: #f39c12;
}

.bar.gray {
    background: linear-gradient(to right, rgba(149, 165, 166, 0.9), rgba(149, 165, 166, 0.7));
}

/* Стиль для Equip Group */
.department[data-dept-id="1"] {
    background-color: #e3f2fd !important; /* Светло-голубой фон */
    border-left: 4px solid #2196F3 !important;
    font-weight: 700;
    color: #1565c0;
}

.department[data-dept-id="1"]:hover {
    background-color: #bbdefb !important; /* Чуть темнее при наведении */
}



/* ============ СТИЛИ ДЛЯ НОВОГО БЛОКА "КАЛЕНДАРЬ ОТПУСКОВ" ============ */

.vacations-info .info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.stat-cards-container {
    display: flex;
    gap: 12px;
    flex: 1;
}

.stat-card {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 120px; /* Минимальная высота для одинакового размера */
}

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

.stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-icon {
    font-size: 24px;
}

/*.user-row:hover {
    background-color: #f0f5ff !important;
    box-shadow: inset 4px 0 0 #4b6cb7;
}*/

/* Стиль для строки сотрудника в календаре, чтобы было видно, что на нее можно кликать */
/*.user-list .user-row {
    cursor: pointer;
    transition: background-color 0.2s ease; 
}*/

/* 
.user-list .user-row:hover {
    background-color: #f0f5ff !important; 
}*/

/* Опционально: Добавляем легкую тень или границу при наведении */
/*.user-list .user-row:hover {
    box-shadow: inset 4px 0 0 #4b6cb7; 
}*/

.stat-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    flex: 1;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.value-number {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.value-percent {
    font-size: 16px;
    font-weight: 600;
    color: #059669;
}

.value-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

/* Цвета прогресс-бара в зависимости от нагрузки */
.progress-fill.yellow {
    background: #f59e0b;
}

.progress-fill.red {
    background: #ef4444;
}

.expandable-list-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.stat-card.active .expandable-list-container {
    max-height: 200px;
}

.expandable-list {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}

.expandable-list div {
    padding: 6px 0;
    border-bottom: 1px dashed #cbd5e1;
    display: flex;
    justify-content: space-between;
}

.expandable-list div:last-child {
    border-bottom: none;
}

/* Стиль для даты в списке */
.expandable-list .event-date {
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}

/* Анимация при обновлении чисел */
.value-number,
.value-percent {
    transition: all 0.3s ease;
}



/* ===== СТИЛИ ДЛЯ УРОВНЕЙ ВЛОЖЕННОСТИ ОТДЕЛОВ ===== */

/* Главные отделы (уровень 1, дети Equip Group) */
.department-level-1 {
    background-color: #e8f4ff !important; /* Очень светло-голубой фон */
    border-left: 4px solid #2196F3 !important;
    font-weight: 600;
    color: #1976d2;
}

.department-level-1:hover {
    background-color: #bbdefb !important; /* Чуть темнее при наведении */
}

/* Подотделы первого уровня (уровень 2) */
.department-level-2 {
    background-color: #f0f8ff !important; /* Светло-голубой фон, но светлее чем у level-1 */
    border-left: 3px solid #64b5f6 !important;
    font-weight: 500;
    color: #42a5f5;
}

.department-level-2:hover {
    background-color: #e3f2fd !important;
}

/* Подотделы второго уровня и глубже (уровень 3+) */
.department-level-3 {
    background-color: #f5f9ff !important; /* Почти белый с легким оттенком */
    border-left: 2px solid #90caf9 !important;
    font-weight: 400;
    color: #64b5f6;
    font-size: 14px;
}

.department-level-3:hover {
    background-color: #e8f4ff !important;
}

/* ===== КОНЕЦ СТИЛЕЙ ДЛЯ УРОВНЕЙ ВЛОЖЕННОСТИ ===== */


/* ===== СТИЛИ ДЛЯ КВАРТАЛЬНОГО ПРЕДСТАВЛЕНИЯ ===== */
.month-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #ddd;
    min-width: fit-content;
}

.month-container:last-child {
    border-right: none;
}

.month-header {
    font-weight: bold;
    padding: 5px 0;
    background-color: #f0f0f0;
    width: 100%;
    text-align: center;
    border-bottom: 2px solid #4b6cb7;
    font-size: 14px;
}

.days-subcontainer {
    display: flex;
    border-bottom: 1px solid #eee;
}
/* ============================================== */



/* Кастомные скроллбары для WebKit (Chrome, Safari, Edge) */
.scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Анимация появления полосок при смене периода */
.user-bars-container {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.user-bars-container.visible {
    opacity: 1;
}

/* Эффект загрузки для шапки дней */
@media (max-width: 768px) {
    .user-cell {
        width: 200px;
    }
    
    .user-cell--header-placeholder {
        width: 200px;
    }
    
    .day-cell {
        width: 35px;
    }
}

/* АНИМАЦИЯ ЗАГРУЗКИ */
.days-header.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ */
.calendar-row.department-row {
    background-color: #f0f9ff !important;
    font-weight: 700;
}

.calendar-row.user-row:hover {
    background-color: #f8fafc !important;
}

.bar {
    position: absolute;
    height: 25px;
    border-radius: 4px;
    top: 7px;
    z-index: 2;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 10;
}



/* 🚀 НОВЫЙ КОНТЕЙНЕР ДЛЯ ФИКСИРОВАННОЙ ШАПКИ */
.calendar-fixed-header {
    display: flex;
    height: 40px;
    background: #f9f9f9;
    border-bottom: 2px solid #4b6cb7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: max-content; /* Важно: чтобы шапка не сжималась */
}

/* 🚀 ЗАГОЛОВОЧНАЯ ЯЧЕЙКА С ИМЕНЕМ (ФИКСИРОВАННАЯ СЛЕВА) */
.user-cell--header-placeholder {
    position: sticky;
    left: 0;
    z-index: 11;
    width: 300px;
    flex-shrink: 0;
    background: #f9f9f9 !important;
    font-weight: 600;
    color: #2c3e50;
    border-right: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: default;
}

/* 🚀 КОНТЕЙНЕР ДЛЯ ШАПКИ ДНЕЙ (СДВИНУТ ВПРАВО) */
.days-header-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* 🚀 УБИРАЕМ СТАРЫЙ POSITION: STICKY У .days-header, ТАК КАК ЕГО БУДЕТ ИМЕТЬ РОДИТЕЛЬ */
.days-header {
    display: flex;
    background: transparent;
    border-bottom: none;
    height: 100%;
    min-width: max-content; /* Важно: чтобы дни не переносились */
}



.month-cell {
    font-weight: 600;
    background: #f0f8ff;
    border-right: 1px solid #ddd;
    justify-content: center;
    font-size: 13px;
}

.scroll-spacer {
    display: none; /* Скрываем невидимый элемент */
}

/* УЛУЧШАЕМ СКРОЛЛБАРЫ */
.scroll-container.unified-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.scroll-container.unified-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scroll-container.unified-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

.scroll-container.unified-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}





/* ===== СТИЛИ ДЛЯ КРАСИВОГО БЛОКА СОТРУДНИКА ===== */
/* ===== КОМПАКТНЫЙ БЕЛЫЙ СТИЛЬ ДЛЯ БЛОКА СОТРУДНИКА ===== */
.employee-info {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: auto;
}

.employee-info h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #2c3e50;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.employee-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #e9ecef;
    overflow: hidden; /* Важно: обрезаем всё что выходит за границы */
    position: relative;
}

.employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Важно: равномерно заполняет контейнер */
    border-radius: 50%;
    display: none;
}

.employee-avatar img.loaded {
    display: block;
}

.avatar-placeholder {
    font-size: 20px;
    color: #6c757d;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.employee-details {
    flex: 1;
    min-width: 0;
}

.employee-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-position {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    line-height: 1.3;
}

.employee-status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.vacation-days {
    border-top: 1px solid #f1f3f4;
    padding-top: 10px;
}

.days-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.years-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.year-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    padding: 3px 0;
}

.days-count {
    font-weight: 600;
    color: #e74c3c;
    background: #fff5f5;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

/* Анимация при обновлении данных */
.days-count {
    transition: all 0.3s ease;
}

.year-item:hover .days-count {
    transform: scale(1.05);
    background: #ffecec;
}




/* Кнопка-переключатель */
.toggle-info-button {
  width: 100%;
  padding: 12px;
  background: #4b6cb7;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 100;
  position: relative;
}
.toggle-info-button:hover {
  background: #3a5795;
}

/* Скрытие панели по умолчанию */
#info-panels {
  height: 0;
  overflow: hidden;
  transition: height 0.4s ease;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

/* Когда панель активна */
#info-panels.active {
  height: auto; /* но это не анимируется */
}

/* Поэтому используем max-height для анимации */
#info-panels {
  max-height: 0;
  transition: max-height 0.5s ease, padding 0.5s ease;
}
#info-panels.active {
  max-height: 500px; /* достаточно для содержимого */
  padding: 15px;
}








/* Стили для календаря выбора даты Windows-style */
.date-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.date-picker-content {
    background: white;
    border-radius: 6px;
    padding: 20px;
    width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 1px solid #e1e5e9;
}

.date-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.date-picker-nav {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    color: #4b6cb7;
    transition: background-color 0.2s;
}

.date-picker-nav:hover {
    background: #f0f5ff;
}

.date-picker-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.date-picker-title:hover {
    background: #f0f5ff;
}

.date-picker-grid {
    display: grid;
    gap: 4px;
    margin-bottom: 15px;
}

/* Для месяцев - 4 колонки */
.date-picker-grid.months {
    grid-template-columns: repeat(4, 1fr);
}

/* Для кварталов - 2 колонки */
.date-picker-grid.quarters {
    grid-template-columns: repeat(2, 1fr);
}

/* Для годов - 4 колонки */
.date-picker-grid.years {
    grid-template-columns: repeat(4, 1fr);
}

.date-picker-item {
    padding: 10px 6px;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    background: white;
}

.date-picker-item:hover {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.date-picker-item.selected {
    background: #4b6cb7;
    color: white;
    border-color: #4b6cb7;
}

.date-picker-item.today {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.date-picker-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.date-picker-today, .date-picker-cancel {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.date-picker-today {
    background: #4b6cb7;
    color: white;
    border-color: #4b6cb7;
}

.date-picker-today:hover {
    background: #3a5795;
    border-color: #3a5795;
}

.date-picker-cancel {
    background: white;
    color: #666;
}

.date-picker-cancel:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* Сделать date-range-display кликабельным */
.date-range-display {
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 150px;
    text-align: center;
    border: 1px solid transparent;
}

.date-range-display:hover {
    background: #e9ecef;
    border-color: #4b6cb7;
}




.total-item {
    margin-top: 8px;
    border-top: 1px solid #e9ecef;
    padding-top: 8px;
}
.total-item .days-count {
    background: #fff8e1;
    color: #e65100;
    font-weight: bold;
}





.expandable-list-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.stat-card.active .expandable-list-container {
    max-height: 200px; /* Ограничиваем высоту */
    overflow-y: auto;  /* Добавляем скролл */
}

/* Стили для скроллбара */
.expandable-list-container::-webkit-scrollbar {
    width: 6px;
}

.expandable-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.expandable-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.expandable-list-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}