:root {
    --primary-color: #239bd7;
    --primary-dark: #1a7ba3;
    --primary-light: #4db3e0;
}
.text-primary-root { color: var(--primary-color); }
.bg-primary-root { background-color: var(--primary-color); }
.badge.bg-primary-root { color: #fff; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    padding-top: 0;
}

.btn-vert{
	background:#ffffff;
	border-color: #00b3b9;
	color:#00b3b9;
}

.btn-vert:hover:enabled{
	background:#00b3b9;
	border-color: #00b3b9;
	color:#ffffff;
}

.btn-vert:hover:disabled{
	color:#00b3b9;
	cursor: not-allowed;
}

/* Header */
.header-custom {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo-header {
    height: 50px;
    max-width: 200px;
    object-fit: contain;
}

.badge-agent {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-agent i {
    font-size: 1.2rem;
}

/* Bouton déconnexion */
#btn-deconnexion {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 500;
}

#btn-deconnexion:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

/* Badge non lus boîte mail – au-dessus des autres éléments du header */
#bm-gen-unread-badge {
    z-index: 1050;
}

/* Boîte mail adhérent : sélection dans la liste */
.boite-mail-list-item.boite-mail-selected {
    background-color: #e9f4fb;
    border-left: 3px solid var(--primary-color);
}
.boite-mail-list-item.boite-mail-selected:hover {
    background-color: #e1eff8;
}

/* Boîte mail adhérent : présentation type messagerie moderne */
.boite-mail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 56px;
    flex-shrink: 0;
    min-width: 0;
    padding: 6px 0 12px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.boite-mail-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #d6336c;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.boite-mail-row .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
    line-height: 1.3;
}
.boite-mail-meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: flex-end;
}
.boite-mail-line-secondary {
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-bottom: 2px;
}
.boite-mail-line-main {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Petit point indicateur pour les non lus */
.boite-mail-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0d6efd;
    vertical-align: middle;
}

/* Iframe d'affichage des emails (isole les styles du message) */
.boite-mail-iframe {
    border: none;
    width: 100%;
    min-height: 300px;
}

/* Bouton principal – charte graphique (remplace btn-primary) */
.btn-principal {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-principal:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(35, 155, 215, 0.35);
}

.btn-principal:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-principal:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 155, 215, 0.4);
}

.btn-principal:disabled {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    opacity: 0.85;
}

/* Bouton outline principal – charte graphique (remplace btn-outline-primary) */
.btn-outline-principal {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-principal:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(35, 155, 215, 0.35);
}

.btn-outline-principal:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-outline-principal:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 155, 215, 0.4);
}

/* Barre nouvelle demande fixe */
.barre-nouvelle-demande {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 1050;
    background-color: #f8f9fa !important;
}

/* Barre actions + bandeau appel en cours : restent visibles au scroll (sticky sous le header) */
.barre-actions-container {
    position: sticky;
    top: 130px; /* Header + barre nouvelle demande */
    z-index: 50;
    flex-shrink: 0;
    background-color: white;
}

.barre-actions-container .d-flex {
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    /* background-color: white; */
    height: 66px;
    min-height: 66px;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

/* Bandeau appel en cours : 2e ligne fixe sous les boutons d'action */
.barre-actions-container .barre-call-banner {
    background-color: #f0f7ff;
    border-left: 4px solid #239bd7;
    border-radius: 0;
    margin: 0;
    font-size: 0.95rem;
    padding: 0rem 1rem;
}
.barre-actions-container .barre-call-banner:last-child {
    border-bottom: none;
}

/* Liste des réclamations - Colonne gauche fixe */
.liste-container-fixed {
    position: fixed;
    left: 0;
    top: 130px;
    width: 25%;
    height: calc(100vh - 130px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 100;
    background-color: white;
}

.commercial-search-wrapper {
    flex-shrink: 0;
}

.liste-container-header {
    height: 66px;
    min-height: 66px;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.liste-container-fixed h5 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.filtres-header {
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.filtres-header:hover {
    background-color: #e9ecef !important;
}

/* Styles pour le bouton toggle filtres */
#toggle-filtres {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

#toggle-filtres:hover {
    color: var(--primary-color);
    text-decoration: none;
}

#toggle-filtres-text {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

#toggle-filtres-text::before {
    content: "▼";
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    display: inline-block;
    margin-right: 0.25rem;
}

.filtres-header.active #toggle-filtres-text::before {
    transform: rotate(180deg);
}

.filtres-container {
    background-color: #f8f9fa;
    flex-shrink: 0;
    overflow-y: auto;
    transition: max-height 0.3s ease;
    /* Limiter la hauteur du bloc filtres pour garder le scroll dans la colonne gauche */
    max-height: calc(100vh - 130px - 100px);
}

.filtres-container.collapsed {
    max-height: 0;
    padding: 0 !important;
    overflow: hidden;
    border: none;
}

/* Masquer la liste quand les filtres sont ouverts */
.filtres-container:not(.collapsed) ~ .liste-reclamations {
    display: none;
}

/* Styles pour le bouton Filtrer */
#btn-filtrer {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
    transition: all 0.2s ease;
}

#btn-filtrer:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#btn-filtrer:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#btn-filtrer i {
    margin-right: 0.25rem;
}

/* Styles pour le bouton Réinitialiser */
#btn-reinitialiser-filtres {
    border-color: #6c757d;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.2s ease;
}

#btn-reinitialiser-filtres:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#btn-reinitialiser-filtres:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#btn-reinitialiser-filtres i {
    margin-right: 0.25rem;
}

/* Indicateur filtres actifs */
#filtres-actif-indicator {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85em;
}

.liste-reclamations {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Accordéon pour les réclamations groupées */
.liste-reclamations .accordion {
    border: none;
}

.liste-reclamations .accordion-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
}

.liste-reclamations .accordion-button {
    background-color: #f8f9fa;
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.liste-reclamations .accordion-button:not(.collapsed) {
    background-color: #e9ecef;
    color: var(--primary-color);
    box-shadow: none;
}

.liste-reclamations .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.liste-reclamations .accordion-body {
    padding: 0;
    max-height: none;
}

.reclamation-item {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
}

.reclamation-item:hover {
    background-color: #e9ecef;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1rem - 4px);
}

.reclamation-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1rem - 4px);
}

.reclamation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.reclamation-numero {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.reclamation-id-fiche {
    font-size: 0.75rem;
    color: #6c757d;
}

.reclamation-id-fiche.missing {
    color: #dc3545 !important;
    font-weight: 700;
}

.reclamation-badges-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.badge-fiche-manquante {
    font-size: 0.7rem;
    font-weight: 600;
}

.reclamation-date {
    font-size: 0.75rem;
    color: #6c757d;
}

.reclamation-dates {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.reclamation-dates > div {
    margin-bottom: 0.2rem;
}

.reclamation-dates > div:last-child {
    margin-bottom: 0;
}

.reclamation-dernier-traitement {
    margin-top: 0.15rem;
}

.reclamation-date-label {
    font-weight: 600;
    color: #495057;
}

.reclamation-ecart {
    color: var(--primary-color);
    font-weight: 500;
}

.reclamation-adherent {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.25rem;
}

.reclamation-categorie {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--primary-light);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.reclamation-avancement {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.reclamation-avancement.en-cours {
    background-color: #ffc107;
    color: #000;
}

.reclamation-avancement.termine {
    background-color: #28a745;
    color: white;
}

.reclamation-compagnie {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.reclamation-origine-line {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 0.35rem;
}

.reclamation-agent-line {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 0.35rem;
}

.badge-origine {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Badge commercial (Ringover) */
.badge-commercial {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: #e8f4fc;
    color: var(--primary-dark);
    border: 1px solid rgba(35, 155, 215, 0.3);
    margin-left: 0.25rem;
}

/* Item recherche adhérent : fond légèrement grisé quand fiche fermée */
.fiche-item-closed {
    background-color: #f5f5f5;
}

/* Contenu des détails */
.details-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Ajustement pour la colonne droite avec colonne gauche fixe */
.col-md-9 {
    margin-left: 25%;
    padding-top: 130px; /* Header + barre nouvelle demande */
    min-height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
}

.details-placeholder {
    color: #6c757d;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Spinners : couleur primaire de l'app */
.spinner-border.text-primary {
    color: var(--primary-color) !important;
}

/* Animation chargement fiche */
.details-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 280px;
    padding: 4rem 2rem;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Animation d'apparition des détails */
.details-fade-in {
    animation: fadeInSlideUp 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.details-section {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Réserve de l'espace au scroll (bouton Poursuivre la demande) */
#section-contrats-portefeuilles-vue-adherent {
    scroll-margin-top: 220px;
}

.details-section h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.info-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-label {
    font-weight: 600;
    color: #495057;
    width: 150px;
    flex-shrink: 0;
}

.info-value {
    color: #212529;
    flex: 1;
}

.info-row-synthese .info-value {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Résumé du traitement : alignement identique aux autres lignes (Synthèse, Compagnie) */
.info-row-synthese .info-value.d-flex .flex-grow-1 {
    min-width: 0; /* évite débordement avec texte long */
}

/* Boutons d'action */
.actions-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

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

.btn-action:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-action.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-action.btn-success:hover {
    background-color: #218838;
    border-color: #218838;
}

.btn-action.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-action.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: white;
}

/* Historique */
.historique-texte-info {
    white-space: pre-wrap;
    word-break: break-word;
    color: #212529;
    line-height: 1.6;
}

.historique-texte-brut {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    line-height: 1.6;
    color: #212529;
}

.historique-item {
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    transition: all 0.2s;
}

.historique-item:last-child {
    margin-bottom: 0;
}

.historique-item:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.historique-date {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.historique-date i {
    font-size: 0.9rem;
}

.historique-agent {
    font-weight: 600;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.historique-agent.agent-nom {
    background-color: rgba(35, 155, 215, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(35, 155, 215, 0.2);
}

.historique-agent.agent-adherent {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.historique-agent i {
    font-size: 1.1rem;
}

.historique-action {
    font-weight: 500;
    color: #495057;
    margin: 0.5rem 0 0.5rem 1.75rem;
    font-style: italic;
}

.historique-commentaire {
    color: #212529;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: white;
    border-radius: 4px;
    border-left: 2px solid #dee2e6;
    line-height: 1.6;
}

.historique-commentaire a {
    color: var(--primary-color);
    text-decoration: none;
}

.historique-commentaire a:hover {
    text-decoration: underline;
}

.historique-commentaire code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: #d63384;
}

.historique-callid {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.historique-callid i {
    color: var(--primary-color);
}

/* Styles pour les contrats */
.contrats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.contrats-grid > .contrats-warning {
    grid-column: 1 / -1;
}

.contrat-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
}

.contrat-item-clickable {
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.contrat-item-clickable:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Modal Détails contrat portefeuille */
#modal-portefeuille-detail-content .info-grid {
    display: flex;
    flex-direction: column;
}
#modal-portefeuille-detail-content .info-grid .info-row {
    padding: 0.4rem 0;
}

.contrat-header {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.contrat-body {
    display: grid;
    gap: 0.5rem;
}

.contrat-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.contrat-body .info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.contrat-body .info-value {
    color: #212529;
    font-size: 0.9rem;
    text-align: right;
}

.contrats-warning {
    margin-bottom: 0;
}

/* Scrollbar personnalisée */
.liste-reclamations::-webkit-scrollbar,
.details-content::-webkit-scrollbar,
.filtres-container::-webkit-scrollbar {
    width: 8px;
}

.liste-reclamations::-webkit-scrollbar-track,
.details-content::-webkit-scrollbar-track,
.filtres-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.liste-reclamations::-webkit-scrollbar-thumb,
.details-content::-webkit-scrollbar-thumb,
.filtres-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.liste-reclamations::-webkit-scrollbar-thumb:hover,
.details-content::-webkit-scrollbar-thumb:hover,
.filtres-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Historique des précédentes demandes */
.historique-col-gauche {
    flex: 0 0 25%;
    max-width: 25%;
}

.historique-col-droite {
    flex: 0 0 75%;
    max-width: 75%;
}

.historique-item-liste {
    cursor: pointer;
    transition: background-color 0.2s;
}

.historique-item-liste:hover {
    background-color: #e9ecef !important;
}

.historique-item-liste.bg-light {
    background-color: #e3f2fd !important;
    border-left: 3px solid var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-custom {
        position: relative;
    }
    
    .barre-nouvelle-demande {
        position: relative;
        top: 0;
    }
    
    .barre-actions {
        position: relative;
        top: 0;
    }
    
    .liste-container-fixed {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
    }
    
    .col-md-9 {
        margin-left: 0;
        width: 100%;
        padding-top: 0;
    }
    
    .details-content {
        min-height: auto;
    }
    
    .details-loading {
        min-height: auto;
    }
    
    .col-md-9 {
        display: block;
    }
    
    .filtres-container {
        max-height: none;
    }
    
    .liste-reclamations {
        max-height: 400px;
    }
    
    .contrats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .contrats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Chat gestion / commercial - style type WhatsApp */
.chat-modal-content .modal-body {
    background-color: #cfe2ff;
}
.chat-message {
    display: flex;
    margin-bottom: 0.5rem;
    clear: both;
}
.chat-message.gestion {
    justify-content: flex-end;
}
.chat-message.gestion.gestion-moi {
    justify-content: flex-end;
}
.chat-message.gestion.gestion-destinataire {
    justify-content: flex-start;
}
.chat-message.commercial {
    justify-content: flex-start;
}
.chat-message-bubble {
    max-width: 75%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
}
.chat-message.gestion.gestion-moi .chat-message-bubble {
    background-color: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-message.gestion.gestion-destinataire .chat-message-bubble {
    background-color: #fff;
    color: #333;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    border-bottom-left-radius: 4px;
}
.chat-message.gestion.gestion-destinataire .chat-message-date,
.chat-message.gestion.gestion-destinataire .chat-message-agent {
    color: #667;
}
.chat-message.commercial .chat-message-bubble {
    background-color: #fff;
    color: #333;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    border-bottom-left-radius: 4px;
}
.chat-message-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 0.2rem;
}
.chat-message-agent {
    font-size: 0.7rem;
    opacity: 0.9;
}
.chat-message-date {
    font-size: 0.7rem;
    opacity: 0.85;
}
.chat-message-check {
    font-size: 0.85rem;
    opacity: 0.9;
}
.chat-message-check.lu {
    color: #4ade80;
}
.chat-message-check.non-lu {
    color: rgba(255,255,255,0.7);
}
.chat-message-text {
    white-space: pre-wrap;
}
.chat-message.commercial .chat-message-date {
    color: #667;
}
#chat-message-input {
    resize: vertical;
    min-height: 2.5rem;
}
#chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
/* Chat vue adhérent - liste demandes */
.chat-adherent-demandes-list .chat-adherent-demande-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    background-color: #fff;
}
.chat-adherent-demandes-list .chat-adherent-demande-item:hover {
    background-color: rgba(35, 155, 215, 0.06);
}
.chat-adherent-demandes-list .chat-adherent-demande-item.active {
    background-color: rgba(35, 155, 215, 0.12);
    border-left: 3px solid var(--primary-color);
    margin-left: 0;
    padding-left: calc(0.85rem - 3px);
}
.chat-adherent-demandes-list .chat-adherent-demande-item.chat-adherent-demande-termine {
    opacity: 0.92;
}
.chat-adherent-demande-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.chat-adherent-demande-num {
    font-weight: 600;
    color: var(--primary-dark, #1a6b8a);
    font-size: 0.95rem;
}
.chat-adherent-demande-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}
.chat-adherent-demande-date {
    font-size: 0.8rem;
    color: #6c757d;
}
.chat-adherent-demandes-list .chat-adherent-demande-item .badge {
    font-size: 0.7rem;
    font-weight: 500;
}
.chat-adherent-demandes-list .chat-adherent-demande-item .badge.badge-principal {
    background-color: var(--primary-color);
    color: #fff;
}
.chat-adherent-demandes-list .chat-adherent-demande-item .badge.bg-danger {
    font-size: 0.65rem;
    min-width: 1.25rem;
}

#chat-messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
#chat-adherent-messages-container::-webkit-scrollbar {
    width: 6px;
}
#chat-adherent-messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Modal Chat commercial : hauteur fixe dès l'ouverture */
#modalChatAdherent .chat-adherent-modal-body-fixed {
    height: 480px;
    min-height: 480px;
}

/* Pré-modal choix demande pour Echanges gestion */
.chat-gestion-choix-modal .modal-dialog {
    max-width: 420px;
}
.chat-gestion-choix-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.chat-gestion-choix-demande-item {
    padding: 0.85rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.chat-gestion-choix-demande-item:hover {
    background-color: rgba(35, 155, 215, 0.08);
    border-color: rgba(35, 155, 215, 0.3);
}
.chat-gestion-choix-demande-item:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(35, 155, 215, 0.25);
}

/* Echanges gestion (liste agents à gauche) */
#modalChatGestion .chat-gestion-modal-body-fixed {
    height: 440px;
    min-height: 440px;
}
.chat-gestion-agents-list {
    background-color: #f8f9fa;
}
.chat-gestion-agents-list .chat-gestion-group {
    margin-top: 0;
    padding: 0.5rem 0.75rem 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.chat-gestion-agents-list .chat-gestion-group.chat-gestion-group-danger {
    background-color: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}
.chat-gestion-agents-list .chat-gestion-group.chat-gestion-group-muted {
    background-color: #e9ecef;
    color: #6c757d;
}
.chat-gestion-agents-list .chat-gestion-group:first-child {
    margin-top: 0;
}
.chat-gestion-agents-list .chat-gestion-agent-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background-color: #fff;
    font-size: 0.875rem;
    min-height: 44px;
    transition: background-color 0.15s ease;
}
.chat-gestion-agents-list .chat-gestion-agent-item:hover {
    background-color: rgba(35, 155, 215, 0.08);
}
.chat-gestion-agents-list .chat-gestion-agent-item.active {
    background-color: rgba(35, 155, 215, 0.15);
    font-weight: 600;
}
.chat-gestion-agents-list .chat-gestion-agent-item .chat-gestion-agent-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #239bdb 0%, #1a7ab8 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-gestion-agents-list .chat-gestion-agent-item.active .chat-gestion-agent-avatar {
    background: linear-gradient(135deg, #1a7ab8 0%, #1565a0 100%);
}
.chat-gestion-agents-list .chat-gestion-agent-item .chat-gestion-agent-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-gestion-agents-list .chat-gestion-agent-item .chat-gestion-agent-unread {
    font-size: 0.65rem;
    flex-shrink: 0;
}
.chat-gestion-agents-list .chat-gestion-agent-item.cursor-pointer {
    cursor: pointer;
}

/* Modal Sélection agent (attribution demande) - liste avec cercle initiales */
#modal-select-agent-list .modal-select-agent-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background-color: #fff;
    font-size: 0.875rem;
    min-height: 44px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}
#modal-select-agent-list .modal-select-agent-item:last-child {
    border-bottom: none;
}
#modal-select-agent-list .modal-select-agent-item:hover {
    background-color: rgba(35, 155, 215, 0.08);
}
#modal-select-agent-list .modal-select-agent-item .modal-select-agent-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #239bdb 0%, #1a7ab8 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#modal-select-agent-list .modal-select-agent-item .modal-select-agent-name {
    min-width: 0;
}

/* Modal Nouveaux messages gestion */
#modalEchangesGestionListe .modal-content {
    border-radius: 10px;
    overflow: hidden;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap {
    max-height:  min(70vh, 420px);
    overflow-y: auto;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap tbody td {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap tbody tr:hover {
    background-color: rgba(35, 155, 215, 0.06);
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap .td-demande-id {
    font-weight: 600;
    color: var(--primary-color, #239bdb);
}
#modalEchangesGestionListe .btn-echanges-gestion-ouvrir-fiche {
    white-space: nowrap;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap .table {
    margin-bottom: 0;
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
#modalEchangesGestionListe .echanges-gestion-liste-table-wrap tbody tr:last-child {
    border-bottom: 0;
}

/* Boîte mail (style Gmail) */
#modalBoiteMail .modal-content {
    display: flex;
    flex-direction: column;
}
#modalBoiteMail .modal-body {
    min-height: 0; /* permet au flex de rétrécir → scroll dans la liste */
    overflow: hidden;
    display: flex;
    flex-direction: row; /* sidebar à gauche, zone liste/détail à droite */
}
#modalBoiteMail .boite-mail-main {
    min-height: 0;
    overflow: hidden;
}
#modalBoiteMail #boite-mail-list-wrap {
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
#modalBoiteMail #boite-mail-list {
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Boîte mail généraliste : même chaîne flex pour scroll correct */
#modalBoiteMailGenerale .modal-content {
    display: flex;
    flex-direction: column;
}
#modalBoiteMailGenerale .modal-body {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#modalBoiteMailGenerale #bm-gen-content-wrap {
    min-height: 0;
    overflow: hidden;
}
#modalBoiteMailGenerale .bm-gen-main {
    min-height: 0;
    overflow: hidden;
}
#modalBoiteMailGenerale #bm-gen-list-wrap {
    min-height: 0;
    overflow: hidden;
}
#modalBoiteMailGenerale #bm-gen-list {
    min-height: 0;
    overflow-y: auto;
}
#modalBoiteMailGenerale #bm-gen-detail-wrap,
#modalBoiteMailGenerale #bm-gen-compose-wrap {
    min-height: 0;
    overflow-y: auto;
}
.boite-mail-sidebar .btn.active {
    background-color: rgba(35, 155, 215, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}
#modalBoiteMail .boite-mail-list-item {
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    min-height: 66px;
    overflow: visible;
    box-sizing: border-box;
}
#modalBoiteMail .boite-mail-list-item.boite-mail-item-chrono {
    min-height: 96px;
}
#modalBoiteMail .sup .badge {
    font-weight: normal;
}
.boite-mail-unread {
    background-color: rgba(35, 155, 215, 0.06);
}
.boite-mail-unread.boite-mail-list-item {
    border-left-color: var(--primary-color);
}
#boite-mail-detail-body {
    max-width: 100%;
    overflow-x: auto;
}
#boite-mail-detail-body .email-body-html {
    max-width: 100%;
    word-wrap: break-word;
    line-height: 1.5;
}
#boite-mail-detail-body .email-body-html img {
    max-width: 100%;
    height: auto;
}
#boite-mail-detail-body img {
    max-width: 100%;
    height: auto;
}

/* Cartes liaisons adhérent (boîte mail détail) */
#boite-mail-detail-liens-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-start;
}
.boite-mail-lien-carte {
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    margin-bottom: 0;
}
.boite-mail-lien-carte:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color, #0d6efd);
}
.boite-mail-lien-carte-header {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    background-color: var(--primary-color) !important;
    color: #fff !important;
}
.boite-mail-lien-carte-body {
    padding: 0.5rem 0.75rem;
}
.boite-mail-lien-carte-email {
    word-break: break-all;
}
.boite-mail-lien-carte-demande {
    font-style: italic;
}

/* Vue compose email — styles modernes */
.compose-info-banner {
    background-color: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    color: #1a6fa0;
}

.compose-input {
    border: none;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0;
    padding-left: 0;
    font-size: 0.9rem;
    box-shadow: none !important;
}

.compose-input:focus {
    border-bottom-color: var(--primary-color);
}

.compose-input:read-only {
    background-color: transparent;
}

/* Autocomplete email compose */
.compose-autocomplete {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1080;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    margin-top: 2px;
}

.compose-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.compose-autocomplete-item:hover,
.compose-autocomplete-item.active {
    background-color: #f0f7fc;
}

.compose-autocomplete-item:first-child {
    border-radius: 8px 8px 0 0;
}

.compose-autocomplete-item:last-child {
    border-radius: 0 0 8px 8px;
}

.compose-autocomplete-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.compose-autocomplete-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
}

.compose-autocomplete-email {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
}

.compose-autocomplete-empty {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
}

#boite-mail-summernote.note-editor {
    border: 1px solid #ffffff;
    border-radius: 0.25rem;
}

#boite-mail-summernote + .note-editor .note-toolbar {
    background-color: #ffffff !important;
}

/* Supprime le caret Bootstrap sur les dropdowns de la toolbar Summernote Lite (évite double flèche) */
.note-editor .note-toolbar .dropdown-toggle::after {
    display: none;
}

/* Isolation CSS du corps cité (Répondre / Transférer) : limiter l’impact des styles globaux */
#modalBoiteMail .note-editable .email-quoted-body {
    word-wrap: break-word;
    line-height: 1.5;
}
#modalBoiteMail .note-editable .email-quoted-body img {
    max-width: 100%;
    height: auto;
}
/* Neutraliser les classes Bootstrap / utilitaires qui s’appliquent au contenu du mail */
#modalBoiteMail .note-editable .email-quoted-body .table {
    width: auto;
    border-collapse: collapse;
    background-color: transparent;
}
#modalBoiteMail .note-editable .email-quoted-body table {
    border-collapse: collapse;
}
#modalBoiteMail .note-editable .email-quoted-body .table td,
#modalBoiteMail .note-editable .email-quoted-body .table th,
#modalBoiteMail .note-editable .email-quoted-body table td,
#modalBoiteMail .note-editable .email-quoted-body table th {
    border: 1px solid #dee2e6;
    padding: 0.25em 0.5em;
    background-color: transparent;
}
#modalBoiteMail .note-editable .email-quoted-body .btn {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: inherit;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}
#modalBoiteMail .note-editable .email-quoted-body .small,
#modalBoiteMail .note-editable .email-quoted-body small {
    font-size: 0.875em;
}
#modalBoiteMail .note-editable .email-quoted-body .text-muted {
    color: #6c757d;
}
#modalBoiteMail .note-editable .email-quoted-body .mb-2 {
    margin-bottom: 0.5rem;
}
#modalBoiteMail .note-editable .email-quoted-body p {
    margin-bottom: 0.5em;
}
#modalBoiteMail .note-editable .email-quoted-body a {
    color: #0d6efd;
    text-decoration: underline;
}

/* Pièces jointes : mini-cartes */
.boite-mail-pj-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.boite-mail-pj-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    min-width: 0;
    flex: 1 1 200px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.boite-mail-pj-card-body {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}
.boite-mail-pj-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.boite-mail-pj-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.boite-mail-pj-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}
.boite-mail-pj-size {
    display: block;
    font-size: 0.75rem;
}
.boite-mail-pj-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* Modal recherche adhérent depuis boîte mail : au-dessus du modal boîte mail */
#modalRechercheAdherentDepuisBoiteMail.modal {
    z-index: 1075;
}
/* Modal liaison email ↔ adhérent : au-dessus du modal boîte mail */
#modalBoiteMailLierAdherent.modal {
    z-index: 1075;
}
/* Modaux au-dessus du modal boîte mail */
#modalModeleEmail.modal,
#modalRemplaceObjetEmail.modal,
#modalSelectEmailAdherent.modal {
    z-index: 1075;
}

/* Modal viewer pièce jointe */
#modalBoiteMailPjViewer .modal-body {
    flex: 1;
    min-height: 0;
}
.boite-mail-pj-viewer-iframe {
    width: 100%;
    height: 75vh;
    min-height: 300px;
    border: 0;
    display: block;
}

/* ========== Page Administration (layout isolé, sans grille index) ========== */
body.admin-page {
    padding-top: 0;
}
/* Hauteur header : padding 1rem*2 + logo 50px */
.admin-layout {
    --admin-header-h: 82px;
    display: flex;
    flex-direction: row;
    padding-top: var(--admin-header-h);
    min-height: 100vh;
    width: 100%;
}
.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: var(--admin-header-h);
    align-self: flex-start;
    min-height: calc(100vh - var(--admin-header-h));
    max-height: calc(100vh - var(--admin-header-h));
    overflow-y: auto;
    background-color: #fff;
    border-right: 1px solid #dee2e6;
}
.admin-sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
}
.admin-btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.admin-btn-retour:hover {
    color: var(--primary-dark);
    text-decoration: none;
}
.admin-menu {
    display: flex;
    flex-direction: column;
}
.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #212529;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}
.admin-menu-item:hover {
    background-color: rgba(35, 155, 215, 0.08);
    border-left-color: var(--primary-light);
    color: #212529;
}
.admin-menu-item.active {
    background-color: var(--primary-color);
    border-left-color: var(--primary-dark);
    color: #fff;
}
.admin-menu-item.active:hover {
    background-color: var(--primary-dark);
    color: #fff;
}
.admin-main {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - var(--admin-header-h));
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    overflow-y: auto;
}
/* Switch Bootstrap – couleur charte primaire */
.form-check-input:checked {
    background-color: #239bd7;
    border-color: #239bd7;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 155, 215, 0.35);
}

.filtres-actif-indicator {
    font-size: 0.8rem;
    font-weight: 500;
}
.filtres-actif-indicator .btn-link {
    color: inherit;
    text-decoration: none;
}
.filtres-actif-indicator .btn-link:hover {
    color: #dc3545; /* danger */
}

/* Vue Agents Gestion : cartes modernes */
.admin-view-agents {
    max-width: 900px;
}
.admin-view-agents .admin-view-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}
.admin-agent-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.admin-agent-card:hover {
    box-shadow: 0 4px 12px rgba(35, 155, 215, 0.12);
    border-color: var(--primary-light);
}
.admin-agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-agent-info {
    flex: 1;
    min-width: 0;
}
.admin-agent-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.15rem;
}
.admin-agent-email {
    font-size: 0.875rem;
    color: #6c757d;
}
.admin-agent-id-ringover {
    margin-top: 0.2rem;
}
.admin-agent-services {
    font-size: 0.8125rem;
    color: #495057;
    margin-top: 0.35rem;
    line-height: 1.4;
}
.admin-agent-services-label {
    font-weight: 500;
    color: #212529;
}
.admin-agent-services-empty .admin-agent-services-label {
    display: none;
}
.admin-btn-services {
    font-size: 0.8125rem;
    color: var(--primary-color);
}
.admin-btn-services:hover {
    color: var(--primary-dark);
}
.admin-agent-switches {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
}
.admin-agent-switch-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.admin-agent-switch-item .form-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
}
.admin-agent-switch-item .form-check-input {
    margin-top: 0;
}
.admin-agent-switch-item .form-check-label {
    font-size: 0.875rem;
    color: #495057;
    user-select: none;
}

/* Bloc "Droits complémentaires" : empiler le titre + switches */
.admin-agent-switch-droits {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
.admin-agent-switch-droits .form-check {
    align-items: center;
}

/* Vue Admin Compagnies – liste en cartes */
.admin-view-compagnies {
    max-width: 720px;
}
.admin-view-compagnies .admin-view-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
}
.admin-compagnies-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.admin-compagnie-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.admin-compagnie-card:hover {
    box-shadow: 0 4px 12px rgba(35, 155, 215, 0.12);
    border-color: var(--primary-light);
}
.admin-compagnie-name {
    font-weight: 500;
    color: #212529;
    flex: 1;
    min-width: 0;
}
.admin-compagnie-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.admin-btn-compagnie-edit,
.admin-btn-compagnie-delete {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.15s, color 0.15s;
}
.admin-btn-compagnie-edit {
    color: var(--primary-color);
    background: rgba(35, 155, 215, 0.1);
    border: none;
}
.admin-btn-compagnie-edit:hover {
    background: var(--primary-color);
    color: #fff;
}
.admin-btn-compagnie-delete {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    border: none;
}
.admin-btn-compagnie-delete:hover {
    background: #dc3545;
    color: #fff;
}

/* Vue Admin Catégories – cartes + chips modernes */
.admin-view-categories {
    max-width: 900px;
}
.admin-view-categories .admin-view-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.25rem;
}
.admin-categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.admin-categorie-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.admin-categorie-card:hover {
    box-shadow: 0 4px 12px rgba(35, 155, 215, 0.12);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}
.admin-categorie-title {
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.admin-categorie-title i {
    font-size: 1.1rem;
}
.admin-categorie-actions .btn {
    border-radius: 999px;
}
.admin-sous-categories {
    margin-top: 0.35rem;
}
.admin-sous-categories-chips {
    margin-top: 0.15rem;
}
.admin-sous-categorie-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #495057;
}
.admin-sous-categorie-chip .btn {
    font-size: 0.8rem;
}
/* Chargement boite mail : limité à la colonne liste */
#boite-mail-loading {
    flex: 0 0 380px;
    max-width: 420px;
}

/* ============================================================
   TUTORIEL
   ============================================================ */

/* Header */
.tuto-header {
    background: var(--color-primary, #0d6efd);
    color: #fff;
}
.tuto-header .modal-title { color: #fff; }

/* Sidebar */
.tuto-sidebar {
    width: 280px;
    min-width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 1rem 0;
}
.tuto-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.9rem;
    color: #495057;
    user-select: none;
}
.tuto-nav-item:hover {
    background: #e9ecef;
}
.tuto-nav-item.active {
    background: #fff;
    border-left-color: var(--color-primary, #0d6efd);
    font-weight: 600;
    color: #212529;
}
.tuto-nav-item.visited .tuto-nav-check {
    display: flex;
}
.tuto-nav-num {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: #dee2e6;
    color: #495057;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tuto-nav-item.active .tuto-nav-num {
    background: var(--color-primary, #0d6efd);
    color: #fff;
}
.tuto-nav-item.visited .tuto-nav-num {
    background: #198754;
    color: #fff;
}
.tuto-nav-check {
    display: none;
    margin-left: auto;
    color: #198754;
    font-size: 0.85rem;
}
.tuto-nav-essentiel {
    font-size: 0.7rem;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 2px;
    white-space: nowrap;
}

/* Zone de contenu */
.tuto-content {
    padding: 2rem 2.5rem;
}
.tuto-chapter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}
.tuto-chapter-header .tuto-chapter-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--color-primary, #0d6efd);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.tuto-chapter-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}
.tuto-chapter-intro {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Accordéon tutoriel */
.tuto-accordion .accordion-button {
    font-weight: 600;
    font-size: 0.95rem;
}
.tuto-accordion .accordion-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #343a40;
}
.tuto-accordion .accordion-body ul {
    padding-left: 1.2rem;
}
.tuto-accordion .accordion-body li {
    margin-bottom: 0.4rem;
}
.tuto-badge-action {
    display: inline-block;
    background: #e7f1ff;
    color: var(--color-primary, #0d6efd);
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.tuto-badge-ia {
    display: inline-block;
    background: #f0e6ff;
    color: #6f42c1;
    border: 1px solid #d8b4fe;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.tuto-tip {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.87rem;
    margin: 0.5rem 0;
}

/* Timeline procédure (chapitre 3) */
.tuto-timeline {
    position: relative;
    padding-left: 2.5rem;
}
.tuto-timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}
.tuto-timeline-step {
    position: relative;
    margin-bottom: 1.5rem;
}
.tuto-timeline-step::before {
    content: attr(data-step);
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary, #0d6efd);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.tuto-timeline-step h6 {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.tuto-timeline-step p,
.tuto-timeline-step ul {
    font-size: 0.875rem;
    color: #495057;
}

/* Footer navigation */
.tuto-footer {
    background: #fff;
    min-height: 60px;
}
.tuto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dee2e6;
    transition: background 0.2s;
}
.tuto-dot.active {
    background: var(--color-primary, #0d6efd);
}
.tuto-dot.visited {
    background: #198754;
}
