/* Team Structure - Departments Header + Employees Grid */

.ts-org-chart {
    max-width: 100%;
    margin: 40px auto;
    padding: 20px;
    font-family: "Poppins", sans-serif;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Właściciel - na górze, większy */
.ts-owner-section {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.ts-card-owner {
    background: white;
    border: 3px solid #2271b1;
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 280px;
    max-width: 320px;
}

.ts-card-owner .ts-card-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.ts-card-owner .ts-card-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 24px;
    margin: 15px 0 8px;
    color: #1a1a1a;
}

.ts-card-owner .ts-card-position {
    font-size: 16px;
    color: #86868b;
    margin: 0;
}

/* Sekcja z działami - wszystkie w jednej linii */
.ts-departments-header {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    margin-bottom: 20px;
}

.ts-department-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    min-height: 120px;
}

.ts-dept-signet {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
}

.ts-dept-signet img {
    max-width: 60px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ts-dept-name {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #2271b1;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Grid z pracownikami */
.ts-employees-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

/* Podstawowa karta pracownika */
.ts-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    justify-content: flex-start;
    height: auto;
}

.ts-card-empty {
    visibility: hidden;
    min-height: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

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

/* Zdjęcie pracownika */
.ts-card-photo {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.ts-card-photo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* Imię i nazwisko */
.ts-card-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 5px;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Stanowisko */
.ts-card-position {
    font-size: 13px;
    color: #86868b;
    margin: 0;
    line-height: 1.3;
}

/* Karta kierownika */
.ts-card-kierownik {
    border-color: #2271b1;
    border-width: 2px;
}

.ts-card-kierownik .ts-card-name {
    color: #2271b1;
}

/* Karta specjalisty */
.ts-card-specjalista {
    border-color: #e0e0e0;
}

.ts-card-specjalista .ts-card-name {
    font-size: 15px;
    font-weight: 600;
}

.ts-card-specjalista .ts-card-photo img {
    width: 55px;
    height: 55px;
}

/* Style dla niestandardowych typów stanowisk (domyślnie jak specjalista) */
.ts-card:not(.ts-card-owner):not(.ts-card-kierownik):not(.ts-card-specjalista) {
    border-color: #e0e0e0;
}

.ts-card:not(.ts-card-owner):not(.ts-card-kierownik):not(.ts-card-specjalista) .ts-card-name {
    font-size: 15px;
    font-weight: 600;
}

.ts-card:not(.ts-card-owner):not(.ts-card-kierownik):not(.ts-card-specjalista) .ts-card-photo img {
    width: 55px;
    height: 55px;
}

/* Responsywność */
@media (max-width: 1024px) {
    .ts-departments-header {
        gap: 15px;
    }
    
    .ts-employees-grid {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .ts-departments-header {
        gap: 10px;
    }
    
    .ts-department-header {
        padding: 15px 10px;
        min-height: 100px;
    }
    
    .ts-dept-signet img {
        max-width: 50px;
        max-height: 40px;
    }
    
    .ts-dept-name {
        font-size: 12px;
    }
    
    .ts-employees-grid {
        gap: 15px;
    }
    
    .ts-card {
        padding: 12px;
    }
    
    .ts-card-owner {
        padding: 25px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ts-departments-header {
        flex-wrap: wrap;
    }
    
    .ts-department-header {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
    
    .ts-employees-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ts-card {
        padding: 10px;
    }
}
