/* ============================= */
/* RESET */
/* ============================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}


/* ============================= */
/* NAVBAR */
/* ============================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    backdrop-filter: blur(15px);
    background: rgba(255,255,255,0.08);
    padding: 15px 40px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid lightgray;
    z-index: 1000;
}

.navbar h2 {
    font-weight: 600;
}

.navbar ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 25px;
}

.navbar ul li a {
    text-decoration: none;
    color: black;
    font-weight: 500;
    transition: 0.2s;
}

.navbar ul li a:hover {
    color: #FF8C28;
}

#logout {
    background: linear-gradient(45deg,#ff4b2b,#ff416c);
    color : white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

#logout:hover {
    color: lightgray;
    background: linear-gradient(45deg,#ff416c,#ff4b2b);
}

/* ============================= */
/* LOGIN / REGISTER */
/* ============================= */

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Utilise toute la hauteur de l'écran */
}

.card {
    width: 400px;

    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(15px);

    border-radius: 20px;
    padding: 40px;

    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.card h2 {
    text-align: center;
    margin-bottom: 30px;
}

input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #E5E7EF; /* Bordure discrète */
    background: #F3F4F8;
    color: black;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: #FF8C28;
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.2);
}

input::placeholder {
    color: rgba(0,0,0,0.7);
}

/* Empêche les boutons radio de prendre toute la largeur */
input[type="radio"] {
    width: auto;
    margin-bottom: 0; /* Aligne mieux avec le texte */
}

button {
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    border: none;
    background:  #FF8C28;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
}

button:active {
    transform: translateY(0);
}

/* ============================= */
/* DASHBOARD */
/* ============================= */

.dashboard-content {
    text-align: center;
    margin-top: 60px;
}

.dashboard-content h1 {
    font-size: 32px;
}

/* ============================= */
/* FORMULAIRES (simulation + demande) */
/* ============================= */

.form-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 120px; /* C'est ici que l'on gère l'espace pour la navbar */
    padding-bottom: 50px;
    overflow-y: auto;
}

.simulation-form {
    width: 600px; /* On élargit un peu (de 520 à 600) pour que les 5 options tiennent */
    background: #FFFFFF;
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid lightgray;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 40px;
}

.simulation-form h2 {
    text-align: center;
    margin-bottom: 25px;
}



/* ============================= */
/* RADIO GROUPS */
/* ============================= */

.radio-group {
    margin-bottom: 25px;
}

.radio-options {
    display: flex;
    justify-content: space-between; /* Distribue les options uniformément */
    gap: 10px;
    margin-top: 10px;
    flex-wrap: nowrap; /* Interdit le passage à la ligne */
}

.radio-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Garde le cercle et le texte attachés */
    font-size: 14px;
}

/* ============================= */
/* TABLEAU SUIVI DEMANDES */
/* ============================= */

.table-container {
    width: 90%;
    margin: 0 auto; /* Centrage horizontal */
    padding-top: 120px; /* Espace de sécurité pour la navbar */
    padding-bottom: 50px;
}

/* On harmonise aussi le titre du tableau avec le style des autres pages */
.table-container h2 {
    font-weight: 700;
    letter-spacing: 1px;
    color: #FF8C28;
    
    margin-bottom: 30px;
    text-align: center;
}

.demandes-table {
    width: 100%;

    border-collapse: collapse;

    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(15px);

    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.demandes-table th, 
.demandes-table td {
    padding: 15px;
    text-align: center; /* Centre le texte horizontalement */
    vertical-align: middle; /* Centre le texte verticalement */
    border-bottom: 1px solid #E5E7EF;
}

/* Optionnel : pour donner un peu plus de poids aux titres */
.demandes-table th {
    background: #E9ECEF;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
    user-select: none; /* Empêche la sélection du texte au clic */
}

.demandes-table th:hover {
    background: #F8F9FA;
}

.demandes-table tr:hover {
    background: rgba(194, 134, 22, 0.05);
}

/* État de base de la flèche (muette) */
.sort-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    vertical-align: middle;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(3, 3, 3, 0.212); /* flèche vers le bas par défaut */
    opacity: 0.5;
}

/* Style quand on trie du plus récent au plus ancien (DESC) */
.sort-arrow.desc {
    border-top: 6px solid #963CFF !important;
    border-bottom: none !important;
    opacity: 1;
}

/* Style quand on trie du plus ancien au plus récent (ASC) */
.sort-arrow.asc {
    border-bottom: 6px solid #963CFF !important;
    border-top: none !important;
    opacity: 1;
}

/* ===== STRUCTURE PAGE ===== */

.page-content{
    width:100%;
    display:flex;
    justify-content:center;
}

/* évite que la navbar cache le contenu */

body {
    padding-top: 0; /* On remet à 0 ici */
    color: black;
    margin: 0;
}

body, html {
    min-height: 100%;
    background: white; 
}

.form-container{
    width:100%;
}

/* Positionnement de l'icône de mot de passe */
.password-wrapper {
    position: relative; /* Indispensable pour que l'icône se place par rapport à ce bloc */
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 12px; /* Ajuste selon la hauteur de ton input */
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    z-index: 10;
}

/* On s'assure que l'input ne cache pas l'icône */
.password-wrapper input {
    padding-right: 45px; 
    margin-bottom: 20px; /* On garde la marge ici */
}

/* Titres avec dégradé sur les formulaires */
.card h2, .simulation-form h2 {
    font-weight: 700;
    letter-spacing: 1px;
    color: #FF8C28;
    margin-bottom: 30px;
}

.message {
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    transition: 0.3s;
}

/* Style pour les erreurs (déjà présent) */
.message:not(:empty) {
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(255, 75, 43, 0.15);
    border: 1px solid rgba(255, 75, 43, 0.3);
    color: #ff8e7a;
    border-radius: 8px;
    text-align: center;
}

/* Si vous voulez un style spécifique pour le succès (dans register.php) */
.message a {
    color: #00c6ff;
    text-decoration: underline;
}

/* Style pour le succès (ton nouveau style) */
.message-demande {
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(46, 204, 113, 0.15); /* Vert transparent */
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71; /* Vert vif */
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.link {
    text-align: center;
    margin-top: 25px;
}

.link a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

.link a:hover {
    color: #963CFF;
    text-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}



/* Le conteneur rectangulaire principal */
.segmented-control {
    display: flex;
    width: 100%; /* Prend toute la largeur du parent */
    max-width: 100%; /* Aligné sur les autres inputs qui font 100% */
    background: #F3F4F8;
    border: 1px solid #E5E7EF;
    border-radius: 12px;
    padding: 4px;
    margin-top: 10px;
    overflow: hidden;
    box-sizing: border-box; /* Évite que la bordure ne fasse dépasser la boite */
}

/* Chaque moitié du rectangle */
.segment {
    flex: 1;
    text-align: center;
    cursor: pointer;
}

/* Cache l'input radio */
.segment input {
    display: none;
}

/* Le texte à l'intérieur */
.label-text {
    padding: 12px 0;
    background-color: #F3F4F8;
    color: black;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.25s ease;
}

/* Style de l'option sélectionnée */
.segment input:checked + .label-text {
    background: linear-gradient(to right,#ff4b2b , #FF8C28);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 114, 255, 0.3);
}


/* Effet de survol sur l'option non sélectionnée */
.segment:hover .label-text:not(.segment input:checked + .label-text) {
    background-color: rgba(150,60,255,0.08);
    color: black;
}




/* Style général des badges et selects de statut */
.status-badge, .status-select {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    color: white;
    text-transform: uppercase;
   
    display: inline-block; /* Permet le centrage via text-align: center du parent */
    margin: 0 auto;
    width: 130px;      /* Donne une largeur fixe pour une colonne harmonieuse */
    text-align: center;

}

.status-select {
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Couleurs spécifiques selon le statut */
.status-prise-en-charge { background-color: #f39c12 !important; } /* Orange */
.status-refus { background-color: #e74c3c !important; }    /* Rouge */
.status-accord { background-color: #2ecc71 !important; }   /* Vert */
.status-documents-à-fournir { background-color: #3498db !important; } /* Bleu */
/*.status-mise-en-place-du-contrat { background-color: #9b59b6 !important; }  Violet */

/* Optionnel : assombrir les options du select pour la lisibilité */
.status-select option {
    background-color: white;
    color: black;
}

/* Style bouton pdf simulation */

/* Bouton rouge Offre */
.btn-offre {
    background: #963CFF;
    margin-top: 10px;
}

/* Fenêtre Modale */
.modal {
    display: none; 
    position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(204, 204, 204, 0.8); backdrop-filter: blur(5px); border-radius: 15px;
}
.modal-content {
    background: #F8F9FA; margin: 15% auto; padding: 30px;
    border: 1px solid #333; width: 400px; border-radius: 15px;
}
.modal-content input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #E5E7EF; /* Bordure discrète */
    background: #F3F4F8;
    color: black;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}




/* ============================= */
/* BARRE DE RECHERCHE CORRIGÉE */
/* ============================= */

.search-container {
    position: relative;
    margin-bottom: 15px;
    width: 350px;

    display: flex;
    align-items: center; /* centre verticalement tout */
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-65%);

    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%; /* prend toute la hauteur du container */
    
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);

    pointer-events: none;
    z-index: 2;
}

#searchInput {
    width: 100%;
    /* 45px de padding à gauche pour laisser la place à la loupe */
    padding: 12px 15px 12px 45px; 
    
    border-radius: 25px;
    border: 1px solid #ffab5c88;
    background: rgba(255, 255, 255, 0.08);
    color: black;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    position: relative; /* Pour le z-index */
    z-index: 1;
}

/* Petit effet au survol/focus pour faire propre */
#searchInput:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffab5cc9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}


/* Style pour le message "Aucun résultat" */
#noResultsRow td {
    text-align: center;
    padding: 40px;
    color: lightgray;
    font-style: italic;
    font-size: 1.1em;
}



/* ============================================================
   DASHBOARD COMPONENTS (Cartes Vitrées)
   ============================================================ */
.dashboard-container {
    max-width: 1200px;
    margin: 100px auto 40px;
    padding: 0 20px;
}

.dashboard-container h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 1px;
    
    margin-bottom: 15px;
}

.welcome-section { margin-bottom: 30px; }
.welcome-section p{
    color: #FF8C28;
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card, .dashboard-section {
    background: #F8F9FA;
    backdrop-filter: blur(10px);
    border: 1px solid lightgray;
    
    border-radius: 15px;
    padding: 20px;
}

.stat-card { 
    border-left: 6px solid transparent; /* Bordure colorée à gauche */
}

.dashboard-section {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-card.orange { border-left-color: #FF8C28; }
.stat-card.purple { border-left-color: #963CFF; }
.stat-card.gray { border-left-color: #1A1B41; }

.stat-label {
    display: block;
    color: black;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

/* Grilles et Tableaux */
.main-dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.view-all {
    color: #0084ff;
    text-decoration: none;
    font-size: 0.85rem;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table th {
    text-align: left;
    color: gray;
    font-size: 0.75rem;
    padding: 10px;
    border-bottom: 1px solid lightgray;
}

.mini-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-contrat-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EF;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.contrat-info span {
        display: block;
        font-size: 13px;
        color: #718096;
        margin-top: 2px;
    }

    .contrat-date {
        font-size: 13px;
        color: #A0AEC0;
        align-self: center;
        justify-content: left;
    }

/* Status Tags */
.status-tag {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
}
/* ==========================================
   CONFIGURATION DU BURGER (PAR DÉFAUT EN PC)
   ========================================== */
.hamburger {
    display: none; /* Caché sur ordinateur */
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: black;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ============================= */
/* BOUTON CRÉER UN COMPTE (ADMIN) */
/* ============================= */

.btn-new-account {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(45deg, #963CFF, #FF8C28);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 15px rgba(150, 60, 255, 0.25);
    transition: all 0.3s ease;
}

/* On force la couleur blanche sur le lien (pour écraser les règles de la navbar) */
.btn-new-account, .btn-new-account:visited {
    color: white !important;
}

.btn-new-account:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(150, 60, 255, 0.4);
}

/* Animation subtile de l'icône SVG au survol */
.btn-new-account svg {
    transition: transform 0.3s ease;
}


/* Adaptation pour la version mobile */
@media screen and (max-width: 768px) {
    .btn-new-account {
        width: 100%;
        justify-content: center;
        padding: 15px;
    }
}

/* ==========================================
   MODE MOBILE (ÉCRANS < 768px)
   ========================================== */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .hamburger {
        display: flex; /* On affiche le burger sur mobile */
    }

    .navbar ul {
        display: none; /* Caché par défaut sur mobile */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        
        /* Positionnement sous la navbar fixe */
        position: absolute;
        top: 100%; 
        left: 0;
        width: 100%;
        padding: 40px 0;
        
        /* Style visuel */
        background: rgba(255, 255, 255, 0.98); 
        backdrop-filter: blur(20px);
        border-bottom: 1px solid lightgray;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    /* CLASSE SÉLECTIONNÉE EN JS : Quand le menu est ouvert */
    .navbar ul.active {
        display: flex !important; /* Force l'affichage */
    }

    /* ANIMATION DU BURGER : Transformation en "X" quand il est actif */
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0; /* La ligne du milieu disparaît */
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* ADAPTATION GÉNÉRALE DU DASHBOARD POUR MOBILE */

   /* ==========================================
       HARMONISATION DU DASHBOARD (MOBILE)
       ========================================== */

    /* 1. Ajustement des espaces globaux */
    .dashboard-container {
        margin: 90px auto 20px; /* Réduction de l'espace haut */
        padding: 0 16px;
    }

    /* Évite que le titre de bienvenue soit trop massif */
    .dashboard-container h1 {
        font-size: 26px; 
        line-height: 1.3;
    }

    /* 2. Correction de la grille des statistiques (Empilage vertical) */
    .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; /* Une carte par ligne pour une lecture immédiate */
        gap: 12px;
        margin-bottom: 25px;
    }

    .stat-card {
        padding: 16px;
        display: flex;
        justify-content: space-between; /* Label à gauche, Chiffre à droite */
        align-items: center;
    }

    .stat-value {
        font-size: 1.8rem; /* Légèrement plus petit pour mobile */
        margin-top: 0;
    }

    /* 3. Ajustement de la grille principale */
    .main-dashboard-grid {
        grid-template-columns: 1fr !important; /* Forçage de l'empilement vertical */
        gap: 20px;
    }

    /* 4. Transformation de la mini-table en liste ergonomique */
    /* ==========================================
   DERNIÈRES DEMANDES — VERSION MOBILE PREMIUM
   ========================================== */

.mini-table {
    width: 100%;
}

.mini-table thead {
    display: none;
}

.mini-table tbody,
.mini-table tr,
.mini-table td {
    display: block;
    width: 100%;
}

.mini-table tr {
    background: #FFFFFF;
    border: 1px solid #EAECEF;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.04);

    transition: all 0.2s ease;
}

.mini-table tr:active {
    transform: scale(0.98);
}

.mini-table td {
    border: none;
    padding: 0;
}

/* CLIENT */

.mini-table td:nth-child(1) {
    font-size: 16px;
    font-weight: 800;
    color: #1A1B41;

    margin-bottom: 14px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MONTANT */

.mini-table td:nth-child(2) {
    font-size: 16px;
    font-weight: 600;
    color: #111827;

    margin-bottom: 14px;
}

/* STATUT */

.mini-table td:nth-child(3) {
    display: flex;
    justify-content: flex-start;
}

/* BADGES */

.status-tag {
    padding: 8px 14px;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;

    min-width: auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Couleurs plus modernes */

.status-documents-à-fournir {
    background: rgba(37, 99, 235, 0.12);
    color : white;
}

.status-prise-en-charge {
    background: rgba(245, 158, 11, 0.14);
    color : white;
}

.status-accord {
    background: rgba(34, 197, 94, 0.14);
    color : white;
}

.status-refus {
    background: rgba(239, 68, 68, 0.14);
    color : white;
}

    /* Ajustement de la taille des petits tags de statut du Dashboard */
 /* .status-tag {
        padding: 4px 8px;
        font-size: 0.65rem;
        border-radius: 6px;
        display: inline-block;
        text-align: center;
        min-width: 85px;
    } */

    /* 5. Optimisation des cartes de contrats récents */
    .mini-contrat-card {
        padding: 14px;
        margin-bottom: 10px;
        background: #FFFFFF;
        border: 1px solid #E5E7EF;
    }

    .contrat-info span {
        display: block;
        font-size: 13px;
        color: #718096;
        margin-top: 2px;
    }

    .contrat-date {
        font-size: 13px;
        color: #A0AEC0;
        align-self: center;
    }



    /* SIMULATION + DEMANDE */

    /* 1. Ajustement du conteneur du formulaire */
    .form-container {
        padding-top: 100px; /* Légèrement réduit pour mobile */
        padding-bottom: 30px;
    }

    /* 2. Le formulaire s'adapte à l'écran */
    .simulation-form {
        width: 90%; /* Prend 90% de l'écran au lieu de 600px fixe */
        padding: 25px 20px; /* On réduit le padding interne pour gagner de la place */
    }

    /* 3. Refonte des boutons de durée (UX tactile) */
    .radio-options {
        /* On remplace le flex nowrap par une grille 3x2 propre */
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px 10px;
    }
    
    .radio-options label {
        font-size: 13px; /* On réduit très légèrement la police */
        justify-content: flex-start;
        padding: 5px 0; /* Ajoute une zone de clic (touch target) plus confortable */
    }

    /* 4. Ajustement du segmented control (Mensuel/Trimestriel) */
    .label-text {
        font-size: 13px;
        padding: 10px 0; /* Légèrement moins haut pour mobile */
    }

    /* 5. Adaptation de la Modale (PDF) */
    .modal-content {
        width: 90%; /* S'adapte à l'écran au lieu de 400px */
        margin: 25% auto; /* Remonte un peu pour éviter que le clavier mobile ne la cache */
        padding: 20px;
    }
    
    .modal-content h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    /* 6. Espacement des boutons d'action */
    button {
        padding: 12px;
        font-size: 15px;
    }
    
    .btn-offre {
        margin-top: 15px;
    }

    /* ==========================================
       PAGE CONTRATS (MOBILE)
       ========================================== */

    /* 1. Barre de recherche fluide */
    .search-container {
        width: 100%; /* Annule les 350px fixes du mode bureau */
    }

    /* 2. En-tête de l'accordéon (Boîte cliquable) */
    .accordion-header {
        padding: 15px; /* Légère réduction du padding pour les petits écrans */
        align-items: flex-start; /* Aligne la flèche en haut plutôt qu'au centre */
    }

    .header-info-grid {
        /* On abandonne les 5 colonnes pour une grille hybride */
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 colonnes max pour la ligne des dates */
        gap: 6px;
    }

    /* Autorise le texte à revenir à la ligne si besoin */
    .header-info-grid span {
        white-space: normal; 
    }

    /* Le Titre, le Client et le Loyer s'empilent sur toute la largeur (100%) */
    .header-info-grid span:nth-child(1),
    .header-info-grid span:nth-child(2),
    .header-info-grid span:nth-child(3), 
    .header-info-grid span:nth-child(4),
    .header-info-grid span:nth-child(5) {
        grid-column: 1 / -1; 
    }


    /* Mise en valeur du Titre et du Loyer */
    .header-info-grid span:nth-child(1) {
        font-size: 15px; 
    }
    
    .header-info-grid span:nth-child(3) {
        font-size: 16px;
        margin-bottom: 5px; /* Ajoute un espace avant les dates */
    }


    /* 3. Contenu de l'accordéon (Détails du contrat) */
    .info-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; 
        padding: 15px !important;
        gap: 12px !important;
    }
    
    .info-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ==========================================
       OPTIMISATION DU TABLEAU DE SUIVI (MOBILE)
       ========================================== */

    /* 1. On casse la structure rigide du tableau */
    .demandes-table {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        overflow: visible;
    }

    /* On cache l'en-tête devenue inutile sur mobile */
    .demandes-table thead {
        display: none; 
    }

    /* Chaque élément du tableau passe en bloc vertical complet */
    .demandes-table tbody, 
    .demandes-table tr, 
    .demandes-table td {
        display: block;
        width: 100%;
    }

    /* 2. Transformation de la ligne (tr) en Carte (Card) */
    .demandes-table tr {
        background: #FFFFFF;
        border: 1px solid #E5E7EF;
        border-radius: 16px;
        padding: 18px;
        margin-bottom: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
        transition: transform 0.2s ease;
    }

    /* Effet au clic/survol de la carte */
    .demandes-table tr:hover {
        background: #FFFFFF !important; /* Annule l'effet hover de la version bureau */
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(194, 134, 22, 0.1);
    }

    /* 3. Agencement des cellules (td) en Flexbox (Label à gauche, Valeur à droite) */
    .demandes-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid #F3F4F8;
        text-align: right;
        font-size: 14px;
    }

    /* Style spécifique pour la première cellule (Le Client) pour servir de "Titre" à la carte */
    .demandes-table td:nth-child(1) {
        font-size: 16px;
        font-weight: 700;
        border-bottom: 2px solid #E5E7EF;
        padding-bottom: 14px;
        margin-bottom: 6px;
    }

    /* On retire la bordure basse de la dernière cellule */
    .demandes-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* 4. Injection dynamique des en-têtes via le pseudo-élément ::before */
    .demandes-table td::before {
        font-weight: 600;
        color: #718096;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.8px;
        text-align: left;
        flex-shrink: 0;
        margin-right: 15px;
    }

    /* Assignation des labels correspondants à l'ordre de vos colonnes */
    .demandes-table td:nth-child(1)::before { content: "Client"; color: #FF8C28; }
    .demandes-table td:nth-child(2)::before { content: "SIREN"; }
    .demandes-table td:nth-child(3)::before { content: "Matériel"; }
    .demandes-table td:nth-child(4)::before { content: "Montant"; }
    .demandes-table td:nth-child(5)::before { content: "Durée"; }
    .demandes-table td:nth-child(6)::before { content: "Périodicité"; }
    .demandes-table td:nth-child(7)::before { content: "Statut"; }
    .demandes-table td:nth-child(8)::before { content: "Date"; }
    .demandes-table td:nth-child(9)::before { content: "Pièces jointes"; }

    /* Ajustement du badge de statut pour qu'il s'aligne proprement à droite */
    .status-badge {
        margin: 0 !important; 
    }

    /* 5. Cas particulier de la ligne "Aucun résultat" */
    #noResultsRow {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    #noResultsRow td {
        display: block !important;
        text-align: center !important;
        color: #A0AEC0;
        padding: 40px 0 !important;
    }
    #noResultsRow td::before {
        display: none !important; /* Enlève le label "Client" sur cette ligne */
    }
}