/* ========================================
   components.css - Переиспользуемые компоненты (карточки сотрудников, дерево)
   ======================================== */

/* --- Карточка подразделения (общая для админки и публичной части) --- */
.department-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.department-header {
    background-color: #0068b1;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.department-header:hover {
    background-color: #0052a3;
}

.department-header i {
    margin-right: 8px;
}

.department-content {
    /* содержимое показывается/скрывается через display */
}

/* --- Карточка сотрудника --- */
.employee-card {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.employee-card:last-child {
    border-bottom: none;
}

.employee-photo {
    width: 133px;
    flex-shrink: 0;
    text-align: center;
}

.employee-photo img {
    width: 100px;
    height: 133px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.employee-info-full {
    flex: 1;
    min-width: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.employee-info-full .employee-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.employee-info-full .employee-position {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.employee-info-full .badge-title {
    font-size: 16px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.employee-info-full .employee-phone-row {
    margin-bottom: 5px;
}

.employee-info-full .phone-label {
    font-style: italic;
}

.employee-info-full .employee-email,
.employee-info-full .employee-room {
    font-size: 16px;
    margin-top: 5px;
}

.employee-info-full .employee-email a,
.employee-info-full .phone-value a {
    text-decoration: none;
}

/* --- Кнопки действий (только для админки, но классы общие) --- */
.employee-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.edit-btn, .delete-btn, .delete-from-dept-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.edit-btn {
    background: #0068b1;
    color: white;
}
.edit-btn:hover {
    background: #0056b3;
}

.delete-btn {
    background: #6c757d;
    color: white;
}
.delete-btn:hover {
    background: #5a6268;
}

.delete-from-dept-btn {
    background: #ffc107;
    color: #212529;
}
.delete-from-dept-btn:hover {
    background: #e0a800;
}

/* --- Адаптивность для карточек --- */
@media (max-width: 768px) {
    .employee-card {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .employee-photo {
        width: 80px;
    }
    .employee-photo img {
        width: 70px;
        height: 93px;
    }
    .employee-info-full {
        min-width: 160px;
    }
    .employee-actions {
        margin-left: 0;
        justify-content: flex-start;
        margin-top: 10px;
        width: 100%;
    }
}