/* SOLUTION FINALE OPTIMISÉE */
.suivi-apporteurs-container {
    width: 100%;
    padding: 20px 20px 20px 40px;
    box-sizing: border-box;
}

.suivi-apporteurs-h1 {
    font-size: 1.8em;
    color: #002b5c;
    font-weight: bold;
    margin-bottom: 1em;
    text-align: left;
    border-bottom: 3px solid #002b5c;
    padding-bottom: 5px;
}

/* TABLEAU AVEC COLONNES INTELLIGENTES */
.table-profils {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    table-layout: auto; /* Permet l'ajustement automatique */
}

/* EN-TÊTES OPTIMISÉS */
.table-profils th {
    background-color: #002b5c;
    color: white;
    padding: 12px 15px;
    text-align: left;
    white-space: nowrap;
}

/* CELLULES ADAPTATIVES */
.table-profils td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    position: relative;
    max-width: 0; /* Nécessaire pour text-overflow */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LARGEURS SPÉCIFIQUES PAR COLONNE */
.table-profils td:nth-child(1), 
.table-profils th:nth-child(1) { /* Nom */
    width: 15%;
    min-width: 80px;
}

.table-profils td:nth-child(2), 
.table-profils th:nth-child(2) { /* Prénom */
    width: 15%;
    min-width: 80px;
}

.table-profils td:nth-child(3), 
.table-profils th:nth-child(3) { /* Téléphone */
    width: 15%;
    min-width: 100px;
}

.table-profils td:nth-child(4), 
.table-profils th:nth-child(4) { /* Type profil */
    width: 15%;
    min-width: 120px;
}

.table-profils td:nth-child(5), 
.table-profils th:nth-child(5) { /* Mission */
    width: 30%;
    min-width: 200px;
    white-space: normal; /* Permet le retour à la ligne */
}

.table-profils td:nth-child(6), 
.table-profils th:nth-child(6) { /* CRA */
    width: 10%;
    min-width: 100px;
}

/* ÉDITION AVEC VISUEL MODIFIÉ */
.editable-cell.editable {
    cursor: pointer;
    position: relative;
}

.editable-cell.editing {
    background-color: #f8f9fa;
}

.edit-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: 10px 15px;
    margin: 0;
    border: 2px solid #002b5c;
    box-sizing: border-box;
    font: inherit;
    background: white;
    z-index: 10;
}

/* TEXTE MODIFIÉ */
.modified {
    color: red !important;
    font-weight: bold !important;
}

/* BOUTON CRA */
.btn-cra {
    background-color: #002b5c;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cra:hover {
    background-color: #004a8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .suivi-apporteurs-container {
        overflow-x: auto;
    }
    
    .table-profils {
        display: block;
        white-space: nowrap;
    }
    
    .table-profils td, 
    .table-profils th {
        display: inline-block;
        width: auto !important;
    }
}

/* Bouton principal de sauvegarde */
.suivi-apporteurs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.save-all-btn {
    background-color: #002b5c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: none;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    margin-left: auto; /* Alignement à droite */
}

.save-all-btn:hover {
    background-color: #004a8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.save-all-btn.visible {
    display: block !important; /* Force l'affichage */
    opacity: 1;
    transition: opacity 0.3s;
}

/* Ajout pour le rechargement */
.suivi-apporteurs-container.reloading {
    position: relative;
    pointer-events: none;
}

.suivi-apporteurs-container.reloading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 100;
}

.suivi-apporteurs-container.reloading::before {
    content: "Sauvegarde en cours...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #002b5c;
    font-weight: bold;
    z-index: 101;
}

/* Statut recrutement */
.status-recrutement {
    display: inline-block;
    margin-left: .5em;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .85em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-recrutement.recruited {
    background: #2ecc71;
    color: #fff;
}

.status-recrutement.proposed {
    background: #e67e22;
    color: #fff;
} 