:root {
    --primary: #5171ff;
    --light: #f3f4f6;
    --primary-dark: #3f5ad9;
    --bs-primary: #5171ff;
    --bs-primary-rgb: 81, 113, 255;
    --bs-body-color: #4b4d4c;
}

body {
    font-family: 'Gotham', sans-serif;
    font-weight: 400; /* Regular */
    font-size: 14px;
}

.btn, button {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
}

.table {
    padding-left: 10px;
    padding-right: 10px;
    --bs-table-hover-bg: rgba(81, 162, 255, 0.12) !important;
    /* --bs-table-hover-bg: rgba(81, 113, 255, 0.12) !important; */
}

.table thead {
    font-family: 'Gotham' !important;
    font-size: 14px !important;
    background: transparent;
    border-bottom: 2px solid #000;
}

thead tr th {
    white-space: nowrap;
}

.table-striped thead tr th {
    background: none !important;
    border-bottom: 2px solid #000;
}

.table td, .table th {
  padding-top: .8rem;
  padding-bottom: .8rem;
}

.table th {
    text-transform: uppercase;
    font-weight: 600;
    /* 
    font-size: 0.85rem;
    letter-spacing: 0.025em; */
}

tbody tr {
  font-family: 'Gotham' !important;
  font-size: 14px !important;
}


.table td, .table tr, .table th {
    vertical-align: middle;
}


.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Layout */
.wrapper {
  display: flex;
  min-height: 100vh;
}


ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* Sidebar */
.sidebar {
    width: 280px;
    transition: transform 0.3s ease;
    background: #fff;
    height: 100vh;
    position: fixed; /* Clé pour rester figée */
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 1px 0 6px rgba(0, 0, 0, 0.06);
    font-weight: 400;
    font-size: 18px;
}

.sidebar .sidebar-links-container {
    height: 100%;
    overflow-y: auto; /* Scroll interne */
    padding: 1rem;
}

.main-content {
    position: relative;
    max-width: 100vw;
    width: 100%;
    overflow:auto;
    flex-grow: 1;
}

.my-main {
    position: relative;
    max-width: 100vw;
    width: 100%;
    overflow: hidden;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.sidebar ul.sidebar-items {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 130px);
    /* max-height: 100vh; */
    overflow-x: hidden !important;
    overflow-y: scroll !important;
}

.sidebar .nav-link {
  padding: 0.8rem 1rem;
  opacity: 1;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  color: #4b4d4c !important;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  opacity: 1;
  background: rgba(75, 77, 76, 0.1);
  color: #4b4d4c !important;
}

.sidebar .submenu .nav-link {
  padding-left: 3.5rem;
  color: #4b4d4c !important;
}

.sidebar .nav-link i.fa-chevron-right {
  font-size: 0.75rem;
  transition: transform 0.2s ease-in-out;
}

.sidebar .nav-link[aria-expanded="true"] i.fa-chevron-right {
  transform: rotate(90deg);
}

.navbar {
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.sidebar div.logo {
    display: block;
}

.navbar div.logo-container {
    display: none;
}

/* Style pour le bouton toggle */
#sidebarToggle, #sidebarTogglelg {
  padding: 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  background: transparent;
  border: 0;
  color: #a2a1a1;
}

#sidebarToggle:hover,
#sidebarTogglelg:hover {
  color: #5171ff;
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  background: #5171ff;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.avatar:hover {
  background: #3f5ad9;
}

/* Dropdown menu
.custom-dropdown-menu.dropdown-menu {
  min-width: 210px;
  border-radius: 0.5rem;
}

.dropdown-item {
  padding: 0.7rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #5171ff;
}

.dropdown-item i {
  width: 20px;
} */

.toggle-password:hover {
  color: #333;
}


/* Responsive */
@media (max-width: 991.98px) {
  .wrapper {
    padding-top: 60px;
  }
  
  .navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1025;
    padding: 0.5rem 1rem;
    background: white;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    z-index: 1000;
    transition: left 0.3s ease;
    margin-top: 50px;
    padding-top: 20px;
  } 

  .sidebar.show {
    left: 0;
  }

  /* ✅ Overlay (for mobile only) */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(59, 69, 81, 0.79);
    z-index: 998; /* Doit être supérieur à .sidebar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .main-content {
    margin-left: 0 !important;
  }

  main.p-4 {
    padding-top: 1rem !important;
  }

  /* Ajustement pour les modales */
  .modal {
    z-index: 1100;
  }

  .sidebar div.logo {
    display: none;
  }

  .navbar div.logo-container {
    display: block;
  }
  
  .navbar div.logo-container .logo-nav {
    height: 30px;
    width: auto;
  }

  .sidebar.show {
    display: block;
  }
}

.btn-check:checked + .btn-outline-primary {
  background-color: #5171ff;
  border-color: #5171ff;
  color: white;
}

.btn-check:hover + .btn-outline-primary {
  background-color: #5171ff;
  border-color: #5171ff;
  color: white;
}

.btn-check:active + .btn-outline-primary {
  background-color: #3f5ad9;
  border-color: #3f5ad9;
}

.btn-primary {
  background-color: #5171ff;
  border-color: #5171ff;
}

.btn-primary:hover {
  background-color: #3f5ad9;
  border-color: #3f5ad9;
}

.btn-outline-primary {
  color: #5171ff;
  border-color: #5171ff;
}

.btn-outline-primary:hover {
  color: #ffffff;
  background-color: #5171ff;
  border-color: #5171ff;
}

.btn-outline-primary:active {
  background-color: #5171ff;
  border-color: #5171ff;
}

.text-primary {
  color: #5171ff !important;
}

.card {
  transition: all 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
}

.form-control:focus {
  border-color: #5171ff;
  box-shadow: 0 0 0 0.25rem rgba(81, 113, 255, 0.25);
}

.form-control[readonly] {
  background-color: #e9ecef;
  border-color: #dee2e6;
  opacity: 0.7;
  cursor: not-allowed;
}

.border-dashed {
  border-style: dashed !important;
}

.logo-upload-zone {
  transition: all 0.3s ease;
}

.logo-upload-zone:hover {
  background-color: var(--light-gray);
  border-color: #5171ff;
  transform: translateY(-2px);
}

.dropzone-container {
  border: 2px dashed #dee2e6;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8f9fa;
  cursor: pointer;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone-container:hover,
.dropzone-container.dragover {
  border-color: #5171ff;
  background: #fff;
}

.dropzone-message {
  color: #6c757d;
}

.dropzone-container.has-file {
  border-style: solid;
  background: #fff;
}

.dropzone-container img {
  max-height: 150px;
  width: auto;
  margin: 0 auto;
}

.max-h-150 {
  max-height: 150px;
  width: auto;
}

.dragover {
  background-color: rgba(81, 113, 255, 0.05);
}

.login-page {
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.login-page .col-md-8 {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  width: 400px;
}

.login-page .form-control {
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.login-page .form-control:focus {
  border-color: #5171ff;
  box-shadow: 0 0 0 0.25rem rgba(81, 113, 255, 0.25);
}

.login-page .btn-primary {
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-weight: 500;
}

.login-page .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(81, 113, 255, 0.3);
}

.login-page img {
  margin-bottom: 2rem;
}

.login-page a {
  color: #5171ff;
  text-decoration: none;
}

.login-page a:hover {
  color: #3f5ad9;
}

#evolutionChart {
  min-height: 400px !important;
}

/* Ajout du style pour le logo dans la sidebar */
.sidebar .logo {
  border-bottom: 1px solid rgba(75, 77, 76, 0.1);
  padding-bottom: 1rem;
}
/* Styles de table et responsive
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
}

.table td {
    vertical-align: middle;
}

.table-responsive {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background: white;
} */

.btn-group {
    display: flex;
    gap: 0.25rem;
}

/* Badge styles */
.badge {
    padding: 0.5em 1em;
    font-weight: 500;
}

@media (max-width: 768px) {
    /*
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
        border: 0;
    }
    
    .table {
        background: transparent;
        border: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: grid;
        gap: 0.5rem;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .table td {
        display: grid;
        grid-template-columns: 120px 1fr;
        align-items: center;
        padding: 0.5rem 0;
        text-align: left;
        border: 0 !important;
    }
    
    .table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
    } */
    
    /* Style spécial pour la description */
    .table td[data-label="Description"] {
        grid-template-columns: 1fr;
    }

    .table td[data-label="Description"]::before {
        margin-bottom: 0.5rem;
    }
    
    /* Style spécial pour les actions */
    .table td[data-label="Actions"] {
        grid-template-columns: 1fr;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #dee2e6 !important;
    }

    .table td[data-label="Actions"] .btn-group {
        justify-content: flex-start;
        width: 100%;
    }
    
    .table td[data-label="Actions"] .btn {
        flex: 1;
        padding: 0.5rem;
    }

    /* Ajustements pour les filtres */
    .input-group {
        width: 100%;
        max-width: none;
    }

    .input-group-filter {
        width: 50%;
        max-width: none;
    }
    

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
    }

    /* Ajustements modaux */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* Ajustements cartes et conteneurs */
    .card-body {
        padding: 1rem;
    }

    .row.g-3 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    /* Ajustements des badges */
    .badge {
        width: fit-content;
    }
}

/* Style de pagination */
.pagination {
    gap: 0.25rem;
    /* gap: 0.25rem; */
}

.page-link {
  border: 1px solid #dee2e6;
  color: #333;
  transition: all 0.2s;
}

.page-link:hover {
  background-color: #f0f0f0;
  color: #000;
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.next-prev-btn {
  color: #676767;
}

.next-prev-btn:hover {
  color: var(--primary);
}




/* Styles spécifiques pour la page devis */
.devis-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Style pour le header du devis */
.devis-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

/* Style pour les informations société et client */
.info-section {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.info-section img {
    max-width: 150px;
    height: auto;
    margin-bottom: 1rem;
}

/* Style pour le tableau de devis */
.devis-table {
    margin-top: 1.5rem;
}

.devis-table .form-control {
    padding: 0.5rem;
}

/* Style pour la barre de recherche client */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive design */
@media (max-width: 768px) {
    /* #tableau_devis {
        background: transparent;
        border: 0;
    }
    
    #tableau_devis thead {
        display: none;
    }
    
    #tableau_devis tbody tr {
        display: grid;
        gap: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    #tableau_devis td {
        display: grid;
        grid-template-columns: 120px 1fr;
        align-items: center;
        padding: 0.5rem 0;
        text-align: left;
        border: 0 !important;
    }
    
    #tableau_devis td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
        text-align: left;
    } */

    .info-section {
        margin-bottom: 1rem;
    }

    .devis-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .btn-group {
        display: flex;
        gap: 0.5rem;
    }

    .btn-group .btn {
        flex: 1;
    }

    /* Ajustement pour la zone de totaux
    #tableau_devis tfoot {
        display: block;
        background: white;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        margin-top: 1rem;
    }

    #tableau_devis tfoot tr {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 1rem;
    }

    #tableau_devis tfoot td {
        padding: 0.25rem 0;
    }

    .modal-footer {
        flex-wrap: nowrap;
    }

    .modal-footer .btn {
        flex: 1;
    } */
}

/* Améliorations esthétiques générales */
/* .table th {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
    background: #f8f9fa;
} */

.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

.btn-light {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.btn-light:hover {
    background: #e9ecef;
}

/* Style pour les infobulles */
.tooltip {
    font-size: 0.875rem;
}

/* Styles pour l'en-tête du tableau */
/* .table th {
    background: #f8f9fa;
    padding: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.table th.designation {
    width: 40%;
}

.table th.quantite {
    width: 10%;
}

.table th.unite {
    width: 5%;
}

.table th.prix {
    width: 15%;
}

.table th.tva {
    width: 10%;
}

.table th.total {
    width: 10%;
}

.table th.actions {
    width: 10%;
} */

@media (max-width: 768px) {
    /* .table thead {
        display: none;
    }
    
    .table tbody td {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 1rem;
        padding: 0.75rem;
        border: none !important;
    }
    
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    } */
}

/* Styles pour la liste des devis */
.devis-list {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Style du tableau
.table th {
    background: #f8f9fa;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
}

.table td {
    vertical-align: middle;
} */

/* Style des boutons */
.btn-group {
    display: flex;
    gap: 0.25rem;
}

.btn-light {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.btn-light:hover {
    background: #e9ecef;
}

/* Responsive design */
@media (max-width: 768px) {
    /* .table-responsive {
        margin: 0 -1rem;
        padding: 0 1rem;
        border: 0;
    }
    
    .table {
        background: transparent;
        border: 0;
    }
    
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: grid;
        gap: 0.5rem;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .table td {
        display: grid;
        grid-template-columns: 120px 1fr;
        align-items: center;
        padding: 0.5rem 0;
        text-align: left;
        border: 0 !important;
    }
    
    .table td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
    }
    
    .table td[data-label="Actions"] {
        grid-template-columns: 1fr;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #dee2e6 !important;
    }

    .table td[data-label="Actions"] .btn-group {
        justify-content: flex-end;
    }

    .table td[data-label="Statut"] .badge {
        width: fit-content;
        margin-left: auto;
    } */

    .btn-group .btn {
        padding: 0.5rem 1rem;
    }

    /* Ajustements pour le filtrage */
    .input-group {
        margin-bottom: 1rem;
    }

    /* Pagination responsive */
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.375rem 0.75rem;
    }
}
/* Style pour l'autocomplétion */
.resultats-produit,
#resultats_recherche {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
}


/* Style mobile pour l'autocomplétion */
@media (max-width: 768px) {
    #resultats_recherche {
        position: absolute; /* Garder la position absolue au lieu de fixed */
        top: 100%; /* Garder sous le champ */
        bottom: auto;
        max-height: 300px;
        border-radius: 0.5rem;
        margin-top: 2px;
    }
    .resultats-produit,
    #resultats_recherche {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        border-radius: 1rem 1rem 0 0;
        margin: 0;
        border: none;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    }

    .produit-suggestion,
    .client-suggestion,
    .ajouter-produit-btn,
    .ajouter-client-btn {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }

    .produit-suggestion:last-child,
    .client-suggestion:last-child {
        border-bottom: none;
    }

    /* Ajout d'un overlay sombre quand l'autocomplétion est ouverte */
    .autocomplete-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }

    .autocomplete-overlay.show {
        display: block;
    }
}

/* Style des suggestions */
.produit-suggestion,
.client-suggestion,
.ajouter-produit-btn,
.ajouter-client-btn {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    background: white;
    border-bottom: 1px solid #dee2e6;
}

.produit-suggestion:hover,
.client-suggestion:hover,
.ajouter-produit-btn:hover,
.ajouter-client-btn:hover {
    background-color: #f8f9fa;
}

/* Style des résultats de recherche actifs */
.recherche-active .resultats-produit,
.recherche-active #resultats_recherche {
    display: block;
}
/* Styles spécifiques pour le tableau devis en responsive */
@media (max-width: 768px) {
    /*
    #tableau_devis {
        width: 100%;
        background: transparent;
    }

    #tableau_devis thead {
        display: none;
    }

    #tableau_devis tbody tr {
        display: block;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #tableau_devis td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
    }

    #tableau_devis td::before {
        content: attr(data-label);
        font-weight: 500;
    }

    #tableau_devis td[data-label="Désignation"] {
        padding-bottom: 1rem;
    }

    #tableau_devis td[data-label="Désignation"] input {
        width: 100%;
    }

    #tableau_devis td[data-label="Désignation"] .resultats-produit {
        width: 100%;
        left: 0;
        right: 0;
        position: fixed;
        bottom: 0;
        top: auto;
        max-height: 50vh;
        overflow-y: auto;
        margin: 0;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        z-index: 1050;
    }

    #tableau_devis td[data-label="Quantité"] input,
    #tableau_devis td[data-label="TVA %"] input {
        width: 100%;
        text-align: right;
    }

    #tableau_devis td[data-label="Prix HT"],
    #tableau_devis td[data-label="Total HT"] {
        text-align: right;
    }

    #tableau_devis td[data-label="Actions"] {
        padding-top: 1rem;
        border-top: 1px solid #dee2e6;
        margin-top: 0.5rem;
    }

    #tableau_devis td[data-label="Actions"] .btn {
        width: 100%;
    }

    #tableau_devis tfoot {
        background: white;
        border-top: 1px solid #dee2e6;
        margin-top: 1rem;
    }

    #tableau_devis tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
    } */

    /* Boutons fixes en bas */
    .devis-container .btn-outline-primary,
    .devis-container .btn-success {
        position: fixed;
        bottom: 1rem;
        z-index: 1030;
        border-radius: 2rem;
        padding: 0.75rem 1.5rem;
    }

    .devis-container .btn-outline-primary {
        right: 1rem;
    }

    .devis-container .btn-success {
        left: 1rem;
    }
}

/* Styles de l'overlay pour l'autocomplétion */
.autocomplete-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
}

.autocomplete-overlay.show {
    display: block;
}

/* Styles des résultats d'autocomplétion */
.produit-suggestion,
.client-suggestion {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.produit-suggestion:last-child,
.client-suggestion:last-child {
    border-bottom: none;
}
/* Styles pour les résultats de recherche */
#resultats_recherche,
.resultats-produit {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
}

/* Style de la barre d'actions fixe en bas */


@media (max-width: 768px) {
    /* Styles du tableau
    #tableau_devis tbody tr {
        display: block;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #tableau_devis td {
        display: block;
        padding: 0.5rem 0;
        border: none;
    }

    #tableau_devis td::before {
        content: attr(data-label);
        font-weight: 500;
        display: block;
        margin-bottom: 0.5rem;
        color: #6c757d;
    }

    .devis-container {
        padding-bottom: 120px;
    } */


    /* Style des totaux */
    .totals-section {
        background: white;
        padding: 1rem;
        border-top: 1px solid #dee2e6;
        margin-bottom: 1rem;
    }

    .totals-section .row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    /* Retrait de l'overlay */
    .autocomplete-overlay {
        display: none !important;
    }

    /* Ajustement de l'autocomplétion */
    #resultats_recherche,
    .resultats-produit {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: 200px;
        border-radius: 0.5rem;
        margin-top: 2px;
        z-index: 1050;
    }
}

/* Style des suggestions */
.produit-suggestion,
.client-suggestion {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

.produit-suggestion:hover,
.client-suggestion:hover {
    background-color: #f8f9fa;
}
@media (max-width: 768px) {
    /* Ajout d'un padding en bas pour éviter que le contenu soit caché par la barre de boutons */
    .devis-container {
        margin-bottom: 100px;
    }


    /* Ajustement des totaux pour qu'ils soient au-dessus des boutons
    #tableau_devis tfoot {
        margin-bottom: 80px;
    } */
}
/*
.devis-table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

#tableau_devis tfoot {
    background: white;
    border-top: 1px solid #dee2e6;
}
*/
/* Style de la section des actions */
.devis-actions {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 1rem;
}

.devis-actions .btn {
    min-width: 140px;
}


/* Style du tableau et des totaux */
.devis-table-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

/* #tableau_devis tfoot {
    background: white;
    border-top: 1px solid #dee2e6;
} */

/* Style de la section des actions */
.devis-actions {
    background: white;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.devis-actions .btn {
    min-width: 140px;
}

@media (max-width: 768px) {
    .devis-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .devis-actions .btn {
        width: 100%;
        min-width: auto;
    }

    /* #tableau_devis td[data-label="Actions"] {
        padding-top: 0.5rem;
    } */
}
/* Supprimer le positionnement fixe existant */
@media (max-width: 768px) {
    .devis-container {
        padding-bottom: 1rem; /* Réduire le padding car les boutons ne sont plus fixes */
    }

    /* Style pour les totaux sur mobile
    #tableau_devis tfoot {
        position: relative;
        background: white;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        margin-bottom: 1rem;
    } */

    /* Conteneur pour les boutons */
    .devis-actions {
        position: relative; /* Au lieu de fixed */
        bottom: auto;
        left: auto;
        right: auto;
        background: white;
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: none;
        display: flex;
        gap: 0.5rem;
        justify-content: center; /* Centrer les boutons */
    }

    /* Style des boutons */
    .devis-actions .btn {
        flex: 1;
        max-width: 100%; /* Limiter la largeur maximale */
        border-radius: 0.375rem;
        padding: 0.75rem 1rem;
    }

    /* Assurer que les boutons restent de la même taille */
    .devis-actions .btn-outline-primary,
    .devis-actions .btn-success {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
    }

    /* Ajuster l'espacement du contenu */
    .devis-table-container {
        margin-bottom: 1rem;
    }
}
/* Style de base pour les résultats de recherche */
#resultats_recherche,
.resultats-produit {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
}

/* Styles spécifiques pour mobile */
@media (max-width: 768px) {
    .recherche-active #resultats_recherche,
    .recherche-active .resultats-produit {
        display: block;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        width: 100%;
        margin: 0;
        border: none;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        z-index: 1050;
    }

    /* Style pour le conteneur de recherche */
    .position-relative {
        position: relative !important;
    }

    /* S'assurer que l'overlay fonctionne correctement */
    .autocomplete-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049;
    }

    .autocomplete-overlay.show {
        display: block;
    }

    /* Style des suggestions en mobile */
    .client-suggestion,
    .produit-suggestion {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }

    .ajouter-client-btn,
    .ajouter-produit-btn {
        padding: 1rem;
        border-bottom: 1px solid #dee2e6;
    }
}
/* Style de base pour les résultats de recherche */
#resultats_recherche {
    display: none;
    position: absolute !important; /* Force la position absolute */
    top: 100% !important; /* Force la position en dessous du champ */
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important; /* Empêche le positionnement en bas */
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    width: 100%;
    max-height: 300px !important; /* Force la hauteur maximale */
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
    transform: none !important; /* Empêche toute transformation */
}

/* Styles spécifiques pour mobile */
@media (max-width: 768px) {
    .recherche-active #resultats_recherche {
        display: block;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 50vh;
        width: 100%;
        margin: 0;
        border: none;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    }

    .autocomplete-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .autocomplete-overlay.show {
        display: block !important;
    }
}

/* Style des suggestions */
.client-suggestion,
.ajouter-client-btn {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

.client-suggestion:hover,
.ajouter-client-btn:hover {
    background-color: #f8f9fa;
}
@media (max-width: 768px) {
    #resultats_recherche {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        transform: none !important;
        border-radius: 0.5rem !important;
        margin-top: 2px !important;
        max-height: 300px !important;
    }

    /* Désactive spécifiquement l'overlay pour la recherche client */
    #recherche_client:focus ~ .autocomplete-overlay,
    #recherche_client:focus + .autocomplete-overlay,
    #resultats_recherche ~ .autocomplete-overlay {
        display: none !important;
    }

    /* Empêche l'application des styles mobiles pour le client */
    #recherche_client.recherche-active,
    #resultats_recherche.recherche-active {
        position: static !important;
        transform: none !important;
    }
}

/* Style des suggestions client */
.client-suggestion,
.ajouter-client-btn {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    background: white;
}

.client-suggestion:hover,
.ajouter-client-btn:hover {
    background-color: #f8f9fa;
}

/* Correction spécifique pour le conteneur de recherche client */
#recherche_client {
    position: relative;
    z-index: 1050;
}

.position-relative {
    position: relative !important;
}
@media (max-width: 768px) {
    /*
    .table-responsive {
        border: none;
        margin: 0;
        padding: 0;
    }

    #facturesTable thead {
        display: none;
    }

    #facturesTable tbody tr {
        display: block;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #facturesTable td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none !important;
    }

    #facturesTable td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
        padding-right: 1rem;
    }

    #facturesTable td[data-label="PDF"],
    #facturesTable td[data-label="Avoir"] {
        display: block;
        text-align: center;
        padding-top: 0.5rem;
    }

    #facturesTable td[data-label="PDF"] .btn,
    #facturesTable td[data-label="Avoir"] .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    */
    /* .custom-dropdown-menu.dropdown-menu {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 1rem 1rem 0 0;
    } */

    .input-group {
        margin-bottom: 1.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
}
/* Styles pour le tableau devis en responsive */
@media (max-width: 768px) {
    /*
    #tableau_facture tbody tr {
        display: block;
        background: white;
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.8rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #tableau_facture td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    #tableau_facture td::before {
        content: attr(data-label);
        font-weight: 500;
        color: #6c757d;
        flex: 1;
        text-align: left;
        font-size: 0.9rem;
        margin: 0;
    }

    #tableau_facture td > *:not(:first-child) {
        flex: 2;
        text-align: left;
    }

    #tableau_facture td input,
    #tableau_facture td select {
        max-width: 200px;
        margin-left: auto;
    }

    #tableau_facture td[data-label="Désignation"] {
        flex-direction: column;
        align-items: stretch;
    }

    #tableau_facture td[data-label="Désignation"]::before {
        margin-bottom: 0.5rem;
    }

    #tableau_facture td[data-label="Désignation"] .position-relative {
        width: 100% !important;
        min-width: 100% !important;
    }

    #tableau_facture td[data-label="Prix HT"],
    #tableau_facture td[data-label="Total HT"] {
        font-weight: 500;
    }

    #tableau_facture td[data-label="Actions"] {
        border-bottom: none !important;
        margin-top: 0.5rem;
    }

    #tableau_facture tfoot {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 0.8rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    #tableau_facture tfoot td {
        text-align: right;
        padding: 0.5rem 0;
    } */

    .btn-sm {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .resultats-produit,
    #resultats_recherche {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: auto;
        max-height: 50vh !important;
        margin: 0;
        border: none;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    }

    .position-relative {
        position: relative !important;
    }

    /* Suggestions mobile */
    .produit-suggestion,
    .client-suggestion,
    .ajouter-produit-btn,
    .ajouter-client-btn {
        padding: 1rem;
    }

    /* Overlay */
    .autocomplete-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1049;
    }

    .autocomplete-overlay.show {
        display: block !important;
    }

    /*
    #tableau_facture td[data-label="Désignation"] .resultats-produit {
        display: none;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
    }

    #tableau_facture td[data-label="Désignation"] .resultats-produit.show {
        display: block;
    } */
}
/* Styles de base pour les résultats de recherche */
.resultats-produit {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
}

/* Styles spécifiques pour mobile */
@media (max-width: 768px) {
    .resultats-produit.mobile-results {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 50vh !important;
        margin: 0;
        border: none;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        z-index: 1051;
    }

    /* Suggestions en mode mobile */
    .produit-suggestion,
    .ajouter-produit-btn {
        padding: 1rem !important;
        border-bottom: 1px solid #dee2e6;
    }

    /* Overlay pour mobile */
    .autocomplete-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1050;
    }

    .autocomplete-overlay.show {
        display: block;
    }

    /* Empêcher le défilement du body quand l'autocomplétion est active */
    body.modal-open {
        overflow: hidden;
    }
}

/* Style des suggestions */
.produit-suggestion,
.ajouter-produit-btn {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.produit-suggestion:hover,
.ajouter-produit-btn:hover {
    background-color: #f8f9fa;
}
@media (max-width: 768px) {
    .resultats-produit {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        transform: none !important;
        border-radius: 0.5rem !important;
        margin-top: 2px !important;
        max-height: 300px !important;
    }

    /* Désactiver tous les overlays et styles fixes */
    .recherche-produit:focus ~ .autocomplete-overlay,
    .recherche-produit:focus + .autocomplete-overlay,
    .resultats-produit ~ .autocomplete-overlay {
        display: none !important;
    }

    .position-relative {
        position: relative !important;
    }

    /* Suggestions en mode mobile */
    .produit-suggestion,
    .ajouter-produit-btn {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #dee2e6;
    }

    /* S'assurer que la recherche produit reste dans le flux normal
    #tableau_facture td[data-label="Désignation"] .resultats-produit {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
    } */
}
/* Style de base pour les résultats de recherche client */
#resultats_recherche {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    max-height: 300px !important;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2px;
}

/* Style des suggestions client */
.client-suggestion,
.ajouter-client-btn {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #dee2e6;
}

.client-suggestion:last-child {
    border-bottom: none;
}

.client-suggestion:hover,
.ajouter-client-btn:hover {
    background-color: #f8f9fa;
}

/* Conteneur de recherche client */
.position-relative {
    position: relative !important;
}

/* Fix spécifique pour mobile */
@media (max-width: 768px) {
    #resultats_recherche {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        transform: none !important;
        border-radius: 0.5rem !important;
        margin-top: 2px !important;
        max-height: 300px !important;
    }

    /* Retirer les styles qui interfèrent */
    #recherche_client:focus ~ .autocomplete-overlay,
    #recherche_client:focus + .autocomplete-overlay,
    #resultats_recherche ~ .autocomplete-overlay {
        display: none !important;
    }

    #recherche_client,
    #resultats_recherche {
        position: relative !important;
        transform: none !important;
    }
}
/* Ajustements pour le tableau en mobile */
@media (max-width: 768px) {
    /*
    #tableau_facture tbody tr {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    #tableau_facture td {
        padding: 0.4rem 0;
        gap: 0.5rem;
    }

    #tableau_facture td[data-label="Désignation"] {
        padding-bottom: 0.5rem;
    }

    #tableau_facture td[data-label="Quantité"] input,
    #tableau_facture td[data-label="TVA %"] input {
        max-width: 80px;
        text-align: right;
        padding: 0.25rem 0.5rem;
    }

    #tableau_facture td[data-label="Prix HT"],
    #tableau_facture td[data-label="Total HT"] {
        font-weight: 500;
    }

    #tableau_facture td[data-label="Actions"] {
        padding-top: 0.5rem;
        margin-top: 0.25rem;
    }

    #tableau_facture tfoot {
        background: white;
        padding: 0.75rem;

    }

    #tableau_facture tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0;
    }

    #tableau_facture tfoot td {
        padding: 0;
        text-align: right;
    }

    #tableau_facture tfoot td:first-child {
        font-weight: 500;
        color: #666;
    }

    #tableau_facture tfoot td.fw-bold {
        font-size: 1.1em;
        color: #000;
    }
    */

    /* Réduction des marges des textareas */
    .mb-4 {
        margin-bottom: 1rem !important;
    }

    /* Ajustement des marges des boutons */
    #ajouter_ligne {
        /* margin-bottom: 0.75rem !important; */
    }

    /* Réduire l'espace entre les éléments du formulaire */
    .form-label {
        margin-bottom: 0.25rem;
    }

    .form-control, .form-select {
        padding: 0.4rem 0.75rem;
    }

    /* Marges plus petites autour des sections */
    .mt-3 {
        margin-top: 0.75rem !important;
    }

    .mt-4 {
        margin-top: 1rem !important;
    }
}
/* Enlever les traits de séparation pour les totaux
#tableau_facture tfoot tr {
    border-bottom: none !important;
} */

/* Espacer les sections d'informations */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

/* Style du champ désignation et recherche produit */
@media (max-width: 768px) {
    
    /* #tableau_facture td[data-label="Désignation"]::before {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #6c757d;
    }
#tableau_facture td[data-label="Désignation"] input {
        width: 100%;
    }

    #tableau_facture tfoot tr {
        border: none !important;
        margin-bottom: 0.5rem;
    }

    #tableau_facture tfoot tr:last-child {
        margin-bottom: 0;
    }

    #tableau_facture td,
    #tableau_facture tr {
        border: none !important;
    } */

    /* Style de ligne unique uniquement autour de chaque ligne produit */
    .ligne-facture {
        border: 1px solid #dee2e6 !important;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }

    /* Mise en page pour le total en bas
    #tableau_facture tfoot td {
        padding: 0.3rem 0;
    } */

    /* Espacement entre sections */
    .informations-debut,
    .informations-supplementaires {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Style spécifique pour les champs texte */
.form-control::placeholder {
    color: #adb5bd;
}

/* Augmenter la visibilité du libellé Désignation
#tableau_facture td[data-label="Désignation"]::before {
    color: #495057;
    font-weight: 600;
}
#tableau_facture .recherche-produit {
    width: 100% !important;
} */

@media (max-width: 768px) {
    /*
    #tableau_facture td[data-label="Désignation"] {
        display: block !important;
        width: 100% !important;
        padding: 0.75rem 0.5rem !important;
    }

    #tableau_facture td[data-label="Désignation"] > div {
        width: 100%;
    }

    #tableau_facture td[data-label="Désignation"]::before {
        display: none !important;
    }

    #tableau_facture td[data-label="Désignation"] label {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #6c757d;
    }

    #tableau_facture td[data-label="Désignation"] .position-relative {
        width: 100% !important;
        min-width: 0 !important;
    }

    #tableau_facture td[data-label="Désignation"] .recherche-produit {
        width: 100% !important;
        box-sizing: border-box;
    }

    #tableau_facture td[data-label="Désignation"] div[style*="min-width"] {
        min-width: 0 !important;
        width: 100% !important;
    }
    #tableau_facture td[data-label="Désignation"] {
        width: 100%;
    }

    #tableau_facture td[data-label="Désignation"] > div {
        width: 100%;
    }

    #tableau_facture td[data-label="Désignation"] .position-relative {
        width: 100%;
    }

    #tableau_facture td[data-label="Désignation"] .recherche-produit {
        width: 100% !important;
    }

    #tableau_facture td[data-label="Désignation"] div[style*="min-width"] {
        min-width: 0 !important;
        width: 100% !important;
}
    #tableau_facture td[data-label="Désignation"],
    #tableau_facture td[data-label="Désignation"] > div,
    #tableau_facture td[data-label="Désignation"] .position-relative,
    #tableau_facture td[data-label="Désignation"] .recherche-produit,
    #tableau_facture td[data-label="Désignation"] label {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }

    #tableau_facture td[data-label="Désignation"] {
        padding: 0 !important;
    }

    #tableau_facture td[data-label="Désignation"] .position-relative {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
    }

    #tableau_facture tr {
        display: grid !important;
    }

    #tableau_facture td[data-label="Désignation"] {
        grid-column: 1 / -1 !important;
    }
    #tableau_facture tfoot {
        margin-top: 2rem;
        padding: 1rem;
    }

    #tableau_facture tfoot tr {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        border: none !important;
        margin-bottom: 0.5rem;
    }

    #tableau_facture tfoot td {
        padding: 0;
        margin-left: 1rem;
    }

    #tableau_facture tfoot td:first-child {
        color: #6c757d;
    }

    #tableau_facture tfoot tr:last-child td {
        font-weight: 600;
        font-size: 1.1em;
    }

    #tableau_facture tfoot td:last-child {
        min-width: 100px;
        text-align: right;
    } */
}

.table td[data-label="Statut"] {
    position: relative;
}

/* Reset du style table et table-responsive */
.table-responsive {
    overflow: unset !important;
}

.table {
    position: relative;
    z-index: 1;
}

/* Style du conteneur dropdown */
.table td[data-label="Statut"] {
    position: static; /* Change de relative à static */
}

/* Style du menu dropdown
.table .dropdown {
    position: relative;
}

.table .custom-dropdown-menu.dropdown-menu {
    z-index: 9999999 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 200px;
    background: white;
    padding: 8px 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    margin: 0;
}

.table .dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
}

.table .dropdown-item:hover {
    background-color: rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .table .custom-dropdown-menu.dropdown-menu {
        width: 90vw;
    }
}

.table td[data-label="Statut"] {
    position: relative !important;
}

.table .dropdown {
    position: static;
}

.table .custom-dropdown-menu.dropdown-menu {
    position: absolute !important;
    top: auto !important;
    left: -50px !important;
    right: auto !important;
    transform: none !important;
    min-width: 160px;
    z-index: 99999 !important;
    margin-top: -10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

.table tr {
    position: relative;
}

.custom-dropdown-menu.dropdown-menu.show {
    display: block !important;
}

@media (max-width: 768px) {
    .table .custom-dropdown-menu.dropdown-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 300px;
    }
}
     */

/* Nettoyer les styles en conflit */
.table-responsive {
    position: relative !important;
    overflow: visible !important;
}

.table {
    position: relative !important;
}

.table tbody tr {
    position: relative !important;
}

/* Style de base pour le dropdown */
.table td[data-label="Statut"] {
    position: relative !important;
}

.table .dropdown {
    position: relative !important;
}

/* .table .custom-dropdown-menu.dropdown-menu {
    position: absolute !important;
    inset: auto auto auto 0 !important;
    transform: none !important;
    margin-top: 0 !important;
    min-width: 160px;
    background: white;
    z-index: 9999999 !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.table td[data-label="Statut"] .custom-dropdown-menu.dropdown-menu,
.table .dropdown .custom-dropdown-menu.dropdown-menu,
.custom-dropdown-menu.dropdown-menu {
    position: absolute !important;
    float: none !important;
    transform: none !important;
} */

/* Fix spécifique pour mobile */
@media (max-width: 768px) {
    /* .table .custom-dropdown-menu.dropdown-menu {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        max-width: 300px !important;
    } */
}
.produit-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border-left: 3px solid #dee2e6;
    font-style: italic;
}
.produit-description {
    white-space: pre-line;
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    font-style: italic;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #dee2e6;
}

.btn-label {
    position: relative;
    padding-left: 44px
}

.btn-label .label-icon {
    position: absolute;
    width: 32px;
    height: 100%;
    left: 0;
    top: 0;
    background-color: hsla(0,0%,100%,.1);
    border-right: 1px solid hsla(0,0%,100%,.1);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center
}

.btn-label.btn-light .label-icon {
    background-color: rgba(52,58,64,.1);
    border-right: 1px solid rgba(52,58,64,.2)
}

@media (min-width: 768px) {
    .w-md-25 {
        width: 25% !important;
    }
}

/* masociete */
.image-container {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 5px;
}
.image-container img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}
.delete-certification-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: red;
    color: white;
    border: none;
    width: 15px;
    height: 15px;
    font-size: 10px;
    line-height: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
}
.add-container {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    border: 1px dashed #999;
    border-radius: 4px;
    cursor: pointer;
}

.grip-icon {
    cursor: grab;
}