/* Общие настройки */
body { font-family: sans-serif; margin: 0; padding: 20px; }
nav { margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #ccc; }
nav a { margin-right: 15px; text-decoration: none; color: #333; }
nav a b { color: #007bff; }
.controls { margin-bottom: 15px; }

/* === Layout 3:2 === */
.main-layout {
    display: flex;
    gap: 20px; /* Отступ между колонками */
    height: calc(100vh - 100px); /* Высота на весь экран минус шапка */
}

.left-panel {
    flex: 3; /* Занимает 3 части (60%) */
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow: auto;
    background: #fff;
}

.right-panel {
    flex: 2; /* Занимает 2 части (40%) */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Карточки дашборда */
.dashboard-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dashboard-card h3 { margin-top: 0; }

/* Универсальные кнопки-иконки */
.btn-icon {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: 2px;
    transition: all 0.2s;
}

/* Цвета кнопок */
.btn-edit { color: #007bff; border-color: #cce5ff; background: #f0f8ff; }
.btn-edit:hover { background: #007bff; color: white; }

.btn-archive { color: #856404; border-color: #ffeeba; background: #fff3cd; }
.btn-archive:hover { background: #ffc107; color: white; }

.btn-restore { color: #155724; border-color: #c3e6cb; background: #d4edda; }
.btn-restore:hover { background: #28a745; color: white; }

.btn-del { color: #721c24; border-color: #f5c6cb; background: #f8d7da; }
.btn-del:hover { background: #dc3545; color: white; }

/* Группа кнопок в дереве или таблице */
.actions-cell, .btn-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* === TABULATOR STYLES === */
.tabulator {
    border: none !important;
    font-size: 13px;
}

/* Шапка таблицы (компактная) */
.tabulator-header {
    border-bottom: 2px solid #ddd !important;
    background-color: #f8f9fa !important;
}
.tabulator-header .tabulator-col {
    background-color: #f8f9fa !important;
    border-right: 1px solid #eee;
}
.tabulator-header .tabulator-col-content {
    padding: 4px 6px !important; /* Меньше отступы сверху/снизу */
    height: auto !important;
}
.tabulator-col-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #555;
    text-align: center;
}

/* Строки */
.tabulator-row {
    border-bottom: 1px solid #f0f0f0 !important;
    min-height: 28px !important; /* Высота строки */
}
.tabulator-cell {
    padding: 4px 8px !important;
    border-right: 1px solid #f9f9f9;
    height: 28px !important;
    display: flex;
    align-items: center;
}

/* Цвета строк */
.row-dept { background-color: #e9ecef !important; font-weight: 700; color: #333; }
.row-emp { background-color: #fff !important; font-weight: 600; border-left: 3px solid #007bff; }
.row-work { background-color: #fff; color: #444; }

/* Кнопка + в строке */
.btn-add-row {
    background: #fff; border: 1px solid #28a745; color: #28a745;
    border-radius: 4px; width: 20px; height: 20px; font-size: 14px;
    line-height: 18px; cursor: pointer; margin-left: auto; /* Прижимает вправо */
    text-align: center;
    transition: all 0.2s;
}
.btn-add-row:hover { background: #28a745; color: white; }

/* Редактирование */
.tabulator-editing {
    border: 1px solid #007bff !important;
    box-shadow: 0 0 5px rgba(0,123,255,0.2);
}

/* Ячейки с нагрузкой */
.cell-overload { background: #ffe3e3 !important; color: #c92a2a; font-weight: 600; }
.cell-full { background: #d8f5a2 !important; color: #5c940d; font-weight: 600; }
.cell-partial { background: #fff9db !important; }