:root {
    --bg-body: #fafafa; /* Светлый нейтральный фон */
    --bg-card: #ffffff;
    --primary: #1e4c82; /* Оставляем фирменный синий для текста/шапки */
    --primary-light: #eef4fb;
    --accent-kanban: #f5b041; /* Легкий оранжево-желтый акцент */
    --accent-hover: #e69e22;
    --accent-admin: #00838f; 
    --text-main: #333333;
    --text-muted: #666666;
    --border: #e8e8e8;
    --radius: 8px;
}

/* --- КАНБАН-ДОСКА И ПРОЕКТЫ --- */
.views-container { display: flex; flex-direction: column; gap: 20px; }
.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.kanban-board { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col { background: #f4f5f7; border-radius: var(--radius); min-width: 320px; width: 320px; padding: 15px; display: flex; flex-direction: column; gap: 12px; }
.kanban-col h3 { margin: 0 0 10px 0; font-size: 15px; color: var(--text-main); display: flex; justify-content: space-between; align-items: center;}
.kanban-col h3 span { background: var(--accent-kanban); color: white; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.kanban-tasks { display: flex; flex-direction: column; gap: 10px; min-height: 50px; }

.kanban-card { background: var(--bg-card); padding: 15px; border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-left: 4px solid var(--accent-kanban); cursor: pointer; transition: 0.2s; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.kanban-card-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--text-main); }
.kanban-card-meta { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }

.project-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--accent-kanban); transition: 0.2s; }
.project-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.btn-accent { background: var(--accent-kanban); color: white; border: none; padding: 10px 20px; border-radius: var(--radius); cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-accent:hover { background: var(--accent-hover); }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-body); 
    color: var(--text-main); 
    margin: 0; 
}

/* --- ШАПКА --- */
header { 
    background: #ffffff; 
    padding: 0 30px; 
    height: 70px; 
    display: flex; align-items: center; justify-content: space-between; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    position: sticky; top: 0; z-index: 100;
}
.brand-container { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 55px; width: auto; }
.brand-text { display: none !important; }

nav { display: flex; align-items: center; gap: 5px; }
nav a { 
    text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 14px; 
    padding: 8px 16px; border-radius: 6px; transition: 0.2s; 
}
nav a:hover, nav a.active { color: var(--primary); background-color: var(--primary-light); }

.user-profile { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.avatar { width: 36px; height: 36px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* --- ОСНОВНОЙ КОНТЕНТ --- */
.content-wrapper { padding: 30px; max-width: 1400px; margin: 0 auto; }
.calendar-card { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid var(--border); }

/* --- МОДАЛЬНЫЕ ОКНА --- */
.modal { 
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; 
    background: rgba(30, 76, 130, 0.4); backdrop-filter: blur(3px);
    align-items: center; justify-content: center; padding: 20px; box-sizing: border-box;
}
.modal[style*="display: block"] { display: flex !important; }

.modal-content { 
    background: white; position: relative; display: flex; flex-direction: column; 
    border-radius: 12px; box-shadow: 0 25px 50px rgba(0,0,0,0.2); overflow: hidden; 
    max-height: 90vh; animation: zoomIn 0.2s ease-out;
}
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

#dateActionModal .modal-content { width: 350px; }
#taskModal .modal-content { width: 500px; }
#viewTaskModal .modal-content { width: 600px; }
#employeeModal .modal-content, #reportModal .modal-content { width: 1000px; max-width: 100%; }

.modal-header { background: var(--primary); color: white; padding: 18px 25px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
#employeeModal .modal-header, #reportModal .modal-header { background: var(--accent-admin) !important; }
.modal-content > div:not(.modal-header), .modal-content > form { overflow-y: auto; padding: 25px; flex-grow: 1; }
.close { font-size: 28px; cursor: pointer; color: rgba(255,255,255,0.7); line-height: 1; }

/* --- СПИСКИ (РОВНЫЕ СТРОКИ) --- */
.user-list-styled { list-style: none; padding: 0; margin: 0; }
.user-row { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 15px; border-bottom: 1px solid #eee; background: #fff;
}
.user-row:hover { background: #f8fafc; }
.user-info { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.user-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* --- КРАСИВАЯ КАРТОЧКА СОТРУДНИКА --- */
#employeeForm {
    background: #ffffff; padding: 30px; border-radius: 12px; 
    box-shadow: 0 15px 40px -5px rgba(0,0,0,0.1); 
    border: 1px solid #edf2f7; border-top: 5px solid var(--accent-admin); 
    margin-bottom: 40px; position: relative;
}
#empFormTitle { margin-top: 0; margin-bottom: 25px; color: var(--accent-admin); font-size: 22px; font-weight: 800; }
#employeeForm input, #employeeForm select { background-color: #f8fafc; border-color: #e2e8f0; color: #334155; font-weight: 500; transition: 0.2s; }
#employeeForm input:focus, #employeeForm select:focus { background-color: #fff; border-color: var(--accent-admin); box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.15); }
#employeeForm label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; margin-bottom: 8px; font-weight: 700; }

/* --- ФИЛЬТРЫ В ОТЧЕТАХ --- */
.report-filters { background: #ffffff; padding: 15px; border-radius: 10px; border: 1px solid #e2e8f0; margin-bottom: 20px; display: flex; gap: 15px; align-items: flex-end; }
.dropdown-check-list { display: inline-block; position: relative; width: 100%; }
.dropdown-check-list .anchor { position: relative; cursor: pointer; display: block; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #f8fafc; font-size: 14px; }
.dropdown-check-list .anchor:after { content: ""; border-left: 2px solid #666; border-top: 2px solid #666; padding: 3px; position: absolute; right: 12px; top: 40%; transform: rotate(-135deg); }
.dropdown-check-list .items { padding: 5px; display: none; margin: 5px 0 0 0; border: 1px solid #d1d5db; position: absolute; background: white; width: 100%; z-index: 1000; max-height: 200px; overflow-y: auto; border-radius: 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.dropdown-check-list.visible .items { display: block; }
.dropdown-check-list .items li { list-style: none; margin: 0; padding: 0; }
.dropdown-check-list .items li label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-radius: 6px; transition: 0.1s; width: 100%; box-sizing: border-box; }
.dropdown-check-list .items li label:hover { background-color: #f1f5f9; }
.dropdown-check-list .items input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-admin); }

/* --- КНОПКИ И ЭЛЕМЕНТЫ --- */
.btn-primary { width: 100%; background: var(--primary); color: white; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.action-btn { cursor: pointer; font-size: 16px; border: 1px solid #ddd; background: #fff; width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.action-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 20px; }
.half { width: 50%; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: #444; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; box-sizing: border-box; font-size: 14px; transition: 0.2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 76, 130, 0.1); }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { background: #f1f5f9; color: var(--primary); padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0; }
.report-table td { padding: 10px 12px; border-bottom: 1px solid #eee; }
.fc-button-primary { background-color: var(--primary) !important; border-color: var(--primary) !important; font-weight: 600 !important; text-transform: capitalize !important; font-size: 13px !important; padding: 8px 16px !important; }
.file-card { display: flex; align-items: center; justify-content: space-between; background: #f0f7ff; border: 1px solid #cce5ff; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.btn-sm { text-decoration: none; font-size: 12px; padding: 6px 10px; border-radius: 4px; display: flex; align-items: center; gap: 4px; transition: 0.2s; }
.btn-view { background: #e2e6ea; color: #333; }
.btn-download { background: var(--primary); color: white; }
.checkbox-list { max-height: 150px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 10px; background: #fcfcfc; }
.checkbox-item { display: flex; align-items: center; padding: 6px 10px; border-radius: 4px; cursor: pointer; transition: 0.1s; border-bottom: 1px solid #f0f0f0; }
.checkbox-item:hover { background: #eef4fb; }
.checkbox-item input { width: auto; margin-right: 10px; }

/* --- ПЕЧАТЬ --- */
@media print {
    body * { visibility: hidden; } /* Скрываем всё */
    
    #reportModal, #reportModal * { visibility: visible; } /* Показываем только модалку */
    
    #reportModal { 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 100%; 
        background: white; 
        z-index: 9999;
    }
    
    .modal-content { 
        box-shadow: none; 
        border: none; 
        width: 100% !important; 
        max-height: none; 
        overflow: visible; 
        position: static; 
        transform: none; 
        margin: 0;
        padding: 0;
    }

    .modal-header { 
        background: white !important; 
        color: black; 
        border-bottom: 2px solid black; 
        padding: 10px 0;
    }
    
    .modal-header h3 { color: black; font-size: 24px; }

    /* Скрываем кнопки, крестики и фильтры при печати */
    .close, button, .report-filters { 
        display: none !important; 
    }

    /* ВАЖНО: График теперь ВИДЕН */
    .chart-container {
        display: block !important;
        page-break-inside: avoid; /* Чтобы график не разрывался */
        height: 350px !important; /* Фиксированная высота для листа А4 */
        width: 100% !important;
        border-bottom: 1px solid #000;
        margin-bottom: 20px;
    }

    .report-table { border: 1px solid black; width: 100%; }
    .report-table th, .report-table td { border: 1px solid black; color: black; }
    .report-table th { background: #eee !important; -webkit-print-color-adjust: exact; }

}/* --- ФАЙЛЫ (ИСПРАВЛЕНИЕ ДЛИННЫХ ИМЕН) --- */
.file-card { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #f0f7ff; 
    border: 1px solid #cce5ff; 
    border-radius: 6px; 
    padding: 8px 12px; 
    margin-bottom: 10px; 
    gap: 15px; /* Гарантированный отступ между именем и кнопками */
}

/* Обертка для иконки и имени */
.file-info { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    min-width: 0; /* МАГИЯ: Позволяет блоку сжиматься, если текст длинный */
    flex-grow: 1; /* Занимает всё свободное место слева */
}

/* Само имя файла */
.file-name { 
    font-weight: 600; 
    color: #1e4c82; 
    white-space: nowrap;       /* Текст в одну строку */
    overflow: hidden;          /* Обрезаем лишнее */
    text-overflow: ellipsis;   /* Ставим троеточие (...) */
    display: block;
    width: 100%;               /* Растягиваемся внутри родителя */
}

/* Блок с кнопками */
.file-actions { 
    display: flex; 
    gap: 5px; 
    flex-shrink: 0; /* ЗАПРЕЩАЕМ кнопкам сжиматься */
}

.btn-sm { 
    text-decoration: none; 
    font-size: 12px; 
    padding: 6px 10px; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    transition: 0.2s; 
}
.btn-view { background: #e2e6ea; color: #333; }
.btn-view:hover { background: #dbe2e8; }
.btn-download { background: var(--primary); color: white; }
.btn-download:hover { background: var(--primary-hover); }
.btn-download:hover { background: var(--primary-hover); }
/* =========================================================
   АДАПТИВНОСТЬ ДЛЯ ТЕЛЕФОНОВ И ПЛАНШЕТОВ (MOBILE RESPONSIVE)
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Шапка и мобильное скролл-меню */
    header { 
        flex-direction: column; 
        height: auto; 
        padding: 10px 15px; 
        gap: 12px; 
        align-items: stretch; 
    }
    nav { 
        width: 100%; 
        overflow-x: auto; /* Меню можно будет свайпать влево-вправо */
        white-space: nowrap; 
        padding-bottom: 5px; 
        -webkit-overflow-scrolling: touch; 
    }
    nav::-webkit-scrollbar { display: none; } /* Прячем некрасивый скроллбар */
    
    .user-profile { justify-content: flex-end; }

    /* 2. Отступы контента */
    .content-wrapper { padding: 15px; }
    .stat-card { padding: 15px; }
    
    /* 3. Модальные окна (чтобы влезали в экран) */
    .modal { padding: 10px; }
    .modal-content { 
        width: 100% !important; /* Отменяем жесткую ширину */
        max-width: 100%;
        margin: 0;
    }
    .modal-content > div:not(.modal-header), .modal-content > form { padding: 15px; }
    
    /* 4. Формы в один столбик */
    .form-row { flex-direction: column; gap: 0; }
    .half { width: 100%; }
    
    /* 5. Вкладки внутри проектов и отчетов */
    div[style*="border-bottom: 2px solid var(--border)"] { flex-wrap: wrap; gap: 8px !important; }
    .proj-tab-btn, .report-tab-btn { flex: 1 1 calc(50% - 10px); text-align: center; font-size: 12px; padding: 8px 5px; }
    
    /* 6. Графики и таблицы */
    .chart-container { height: 250px; }
    .report-table { font-size: 12px; }
    .report-table th, .report-table td { padding: 8px 5px; }
    
    /* 7. Колокольчик уведомлений */
    .notif-box { 
        right: -10px; /* Чтобы окошко не уезжало за край экрана */
        width: 280px; 
    }
}
}