.tabs {
    display: flex;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    
    /* NOUVEAU : Permet le scroll horizontal doux sur mobile */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    
    /* NOUVEAU : Cache la barre de défilement (scrollbar) pour un design plus propre */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

/* Cache la scrollbar sur Chrome/Safari/Webkit */
.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    flex-shrink: 0;
    padding: 14px 8px;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--teal-light);
    color: var(--teal);
}

.tab-btn.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
    background: var(--teal-light);
}

/* Sections associées aux Tabs */
.section { display: none; }
.section.active { display: block; }

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-title {
    font-family: 'GFS Didot', serif;
    font-size: 20px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 3px;
}

/* ==========================================================================
   2. CARTES (CARDS)
   ========================================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

/* ==========================================================================
   3. BOUTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--teal);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--teal-dark);
}

.btn-secondary {
    background: var(--teal-light);
    color: var(--teal-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #fef2f2;
    color: var(--red);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.logout-btn {
    padding: 6px 12px;
    border-radius: 7px;
    border: 1.5px solid var(--text);
    background: transparent;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    white-space: nowrap;
}

.logout-btn:hover {
    background: var(--text);
    color: var(--white);
}

/* ==========================================================================
   4. FORMULAIRES & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--teal); }

.form-textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus { border-color: var(--teal); }

.form-hint {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 4px;
}

/* Barre de filtres (Dashboard PP/Admin) */
.filters-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.filter-select {
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus { border-color: var(--teal); }

.search-input {
    flex: 1;
    min-width: 200px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--teal); }

/* ==========================================================================
   5. ALERTES & TOASTS
   ========================================================================== */
.alert-info {
    background: var(--teal-light);
    border: 1px solid var(--border);
    color: var(--teal-dark);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--red);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.alert-error.show { display: block; }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none;
}

.toast.show {
    display: block;
    animation: toastIn 0.3s ease;
}

.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. SPINNERS & LOADERS
   ========================================================================== */
.loader {
    text-align: center;
    padding: 40px;
    color: var(--text-soft);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { display: none; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   7. MODALES
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-family: 'GFS Didot', serif;
    font-size: 20px;
    margin-bottom: 20px;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==========================================================================
   8. BADGES & PILLS
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fef3c7; color: #92400e; }

.talent-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Zone d'upload de PDF réutilisable (Admin) */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: var(--text-soft);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--teal);
    background: var(--teal-light);
    color: var(--teal);
}

.progress-wrap {
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    display: none;
    margin-top: 4px;
}

.progress-fill {
    height: 100%;
    background: var(--teal);
    transition: width 0.3s;
    width: 0%;
}

/* ==========================================================================
   9. COMPORTEMENT RESPONSIVE DES COMPOSANTS
   ========================================================================== */

@media (max-width: 768px) {
    /* La carte des filtres prend toute la largeur dispo sans dépasser */
    .filters-card {
        flex-direction: column;
        gap: 12px;
        padding: 16px 12px;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* On empile le label au-dessus du champ (au lieu de les mettre côte à côte) */
    .filter-group, .search-wrap {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
    }

    /* Le select prend 100% de la largeur dispo */
    .filter-select, .search-input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Sur mobile, on réduit un peu le padding des KPIs pour qu'ils respirent */
    .stats-bar {
        gap: 10px;
    }
    .stat-chip {
        flex: 1 1 120px; /* Les chips s'adaptent et passent à la ligne au besoin */
        justify-content: center;
        text-align: center;
        padding: 12px 10px;
    }
    .stat-chip div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    /* Modales fixées en bas sur mobile (UX Friendly) */
    .modal-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .modal {
        padding: 18px 16px;
        border-radius: 12px 12px 0 0;
        margin-bottom: 0;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .logout-btn {
        font-size: 10px;
        padding: 4px 8px;
    }
}