:root {
  --primary: #e67131;
  --light: #f3f4f6;
  --primary-dark: #f6b800;
  --bs-primary: #e67131;
  --bs-primary-rgb: 230, 113, 49;
  --bs-light-rgb: 248, 249, 250;
  --bs-primary-dark-rgb: 246, 184, 0;
  --bs-body-color: #505151;
  --border: #dee2e6;
  --btn-disabled-bg: #ffd65140;
  --btn-disabled-border-color: #ffd65140;
  --secondary-rgb: #6c757d;

  --accent-color: #e74c3c;
  --blue-dark-bg: #2c3e50;
  --blue-bg: #667eea;
  --purple-bg: #764ba2;
  --success: #198754;
  --main-sidebar-width: 240px;
  --bg-light: #f8f9fc;
}

body {
  font-family: "Gotham", sans-serif;
  font-weight: 400;
  font-size: 13px;
}

.list-group-item.active {
  /* background: var(--primary-dark) !important; */
  background: rgba(var(--bs-secondary-rgb), 1) !important;
  border-color: rgba(var(--bs-secondary-rgb), 1) !important;
  color: #fff !important;
}

.list-group-item.active .badge {
  color: rgba(var(--bs-secondary-rgb), 1) !important;
  background: #fff !important;
}

.btn-primary.active {
  background-color: var(--bs-btn-bg, #e67131);
  border-color: var(--bs-btn-border-color, #e67131);
}

.btn-outline-secondary.active {
  background-color: var(--bs-btn-bg, #e67131);
  border-color: var(--bs-btn-border-color, #e67131);
}

/* Pour validation  */
/* Validation Bootstrap */
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: #198754;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Animation pour les onglets */
.tab-pane {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Style pour la zone de dépôt de fichiers */
.border-dashed {
  border-style: dashed !important;
}

.modal-xxl {
  max-width: 90% !important;
}

/*
 * Variante partagée pour les panneaux larges Bootstrap.
 * On s'appuie sur la variable native d'offcanvas plutôt que sur un width forcé page par page.
 */
.offcanvas-wide {
  --bs-offcanvas-width: min(960px, 100vw);
}

@media (max-width: 575.98px) {
  .offcanvas-wide {
    --bs-offcanvas-width: 100vw;
  }
.modal-xxl {
  max-width: 100% !important;
}

}

/* Style pour les boutons de navigation */
.nav-tabs .nav-link {
  transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Styles pour les erreurs de validation */
#errorContainer {
  margin-bottom: 1rem;
}

#errorContainer .alert {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styles pour la navigation des documents */
.doc-navigation {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Correction pour les boutons radio Bootstrap */
.btn-check:checked + .btn-outline-primary {
  background-color: #e67131;
  border-color: #e67131;
  color: white;
}

/* Amélioration de la visibilité des champs invalides */
.is-invalid {
  border-color: #dc3545 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") !important;
}

/* Style pour les onglets actifs */
.nav-tabs .nav-link.active {
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 600;
}

.modal-header-produit {
  background: linear-gradient(135deg, #ff9900 0%, #ff6600 100%);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.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: 13px !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 th {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.table td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-size: 12px;
}

#dataPreviewSection .table td {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.table th {
  text-transform: uppercase;
  font-weight: 600;
}

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: var(--main-sidebar-width);
  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: 14px;
}

.navbar,
.fixed-to-top {
  position: relative;
  z-index: 900;
}

.navbar .dropdown-menu,
.fixed-to-top .dropdown-menu {
  z-index: 950;
}

.sidebar-icon-label {
  display: inline-flex;
  column-gap: 5px;
  align-items: center;
  padding: 0;
  margin: 0;
}

.sidebar-icon-label i {
  min-width: 18px; /* 20px; */
}

.nav-link {
  white-space: nowrap !important;
}

.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;
}

@media (min-width: 992px) {
  .sidebar.collapsed + .main-content {
    margin-left: 0;
  }

  .sidebar:not(.collapsed) + .main-content {
    margin-left: var(--main-sidebar-width);
  }
}

.sidebar .sidebar-items {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  /* max-height: calc(100vh - 130px); */
  overflow-x: hidden !important;
  overflow-y: scroll !important;
}

@media (min-width: 768px) {
  .sidebar .sidebar-items {
    justify-content: space-between;
  }
}

.sidebar .nav-link {
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.15rem;
  opacity: 1;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  color: var(--bs-body-color);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  opacity: 1;
  background-color: #e9ecef;
  color: var(--bs-body-color);
}

.sidebar .promo-link {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0.25rem 1rem;
  font-size: 12px;
  border-radius: 50px;
  color: #fff;
  background: linear-gradient(135deg, var(--stv-accent-1), var(--stv-accent-3));
  box-shadow: 0 8px 8px -6px color-mix(in srgb, var(--stv-accent-3) 50%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
}

.sidebar .promo-link:hover,
.sidebar .promo-link.active {
  transform: translateY(-2px);
  background: var(--stv-accent-1);
}

.sidebar .promo-link.active {
  box-shadow: 0 12px 20px -6px color-mix(in srgb, var(--stv-accent-1) 60%, transparent);
}

.sidebar .promo-link i { transition: transform .2s ease; }
.sidebar .promo-link:hover i { transform: translateX(3px); }




.nav-item .btn-full {
  position: relative;
  width: 100%;
}

.sidebar .submenu .nav-link {
  padding-left: 1.35rem;
  color: var(--bs-body-color);
}

.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);
}

.sidebar-list-group {
  margin-bottom: 0.8rem;
}

.sidebar-list-group .group-title {
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.navbar {
  background: #fff;
  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: var(--primary);
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  margin-right: 6px;
}

.avatar:hover {
  background: var(--primary-dark);
}

.toggle-password:hover {
  color: #333;
}

.accordion-button:not(.collapsed) {
  color: var(--bs-body-color);
  background-color: var(--light);
}

.accordion-button:focus {
  border-color: var(--bs-accordion-btn-focus-border-color);
  border-bottom: 1px;
  box-shadow: none;
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: 13, 110, 253;
  --bs-btn-active-bg: var(--primary);
  --bs-btn-active-border-color: var(--primary);
  --bs-btn-disabled-color: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: #var(--primary-dark);
  --bs-btn-hover-border-color: #var(--primary-dark);
  /* --bs-btn-focus-shadow-rgb: 49,132,253; */
  --bs-btn-focus-shadow-rgb: 253, 212, 49;
  --bs-btn-active-bg: #var(--primary-dark);
  --bs-btn-active-border-color: #var(--primary-dark);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-active-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-dark);
}

.btn-close:focus {
  box-shadow: 0 0 0 0.25rem rgba(246, 184, 0, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.text-primary {
  color: var(--primary) !important;
}

.text-blue-dark {
  color: var(--blue-dark-bg);
}

.bg-primary-subtle {
  background-color: #e6703155 !important;
}

.form-check-input {
  flex-shrink: 0;;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(255, 214, 81, 0.25) !important;
}

.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
  background-color: var(--primary);
  border-color: var(--primary);
}

.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: var(--primary);
  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; */
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone-container:hover,
.dropzone-container.dragover {
  border-color: var(--primary);
  background: #fff;
}

.dropzone-message {
  color: var(--secondary-rgb);
}

.dropzone-container.has-file {
  border-style: solid;
  background: #fff;
}

.dropzone-container img {
  max-height: 150px;
  width: auto;
  margin: 0 auto;
}

.dropzone-container-compact {
  min-height: 108px;
  padding: 1rem;
  align-items: center;
}

.dropzone-container-compact img {
  max-height: 92px;
}

.dropzone-preview img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  margin-top: 10px;
}

.max-h-150 {
  max-height: 150px;
  width: auto;
}

.min-h-40 {
  min-height: 40vh;
}

.max-h-50 {
  max-height: 50vh;
  overflow: auto;
}

.max-h-70 {
  max-height: 70vh;
  overflow: auto;
}

.h-420-px {
  height: 420px;
}

.onboarding-societe-modal .modal-dialog {
  max-height: calc(100dvh - 1rem);
  margin-top: .5rem;
  margin-bottom: .5rem;
}

.onboarding-societe-modal .modal-content,
.onboarding-societe-modal #societe-wizard-form,
.onboarding-societe-modal .onboarding-societe-form {
  max-height: calc(100dvh - 1rem);
  min-height: 0;
  overflow: hidden;
}

.onboarding-societe-modal .modal-content,
.onboarding-societe-modal #societe-wizard-form,
.onboarding-societe-modal .onboarding-societe-form {
  display: flex;
  flex-direction: column;
}

.onboarding-societe-modal .modal-header,
.onboarding-societe-modal .modal-footer {
  flex: 0 0 auto;
}

.onboarding-societe-modal .onboarding-societe-form {
  flex: 1 1 auto;
}

.onboarding-societe-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.onboarding-societe-modal .societe-step .h-420-px {
  height: auto;
}

.onboarding-societe-modal .onboarding-step-hint {
  margin-bottom: .75rem;
  color: #5f6368;
}

.onboarding-societe-modal .onboarding-base-scroll {
  padding-bottom: .25rem;
}

.onboarding-societe-modal .onboarding-base-step .form-label {
  margin-bottom: .25rem;
}

.onboarding-societe-modal .onboarding-base-step .form-control,
.onboarding-societe-modal .onboarding-base-step .form-select,
.onboarding-societe-modal .onboarding-base-step .input-group-text {
  min-height: 42px;
}

.onboarding-societe-modal .onboarding-base-step .form-text {
  font-size: .75rem;
  line-height: 1.2;
}

.onboarding-societe-modal .onboarding-logo-dropzone {
  min-height: 151px;
  height: 151px;
  padding: .85rem;
  border-radius: .5rem;
}

.onboarding-societe-modal .onboarding-logo-dropzone .dropzone-message p {
  line-height: 1.25;
}

.onboarding-societe-modal .onboarding-logo-dropzone .dropzone-preview img {
  max-height: 124px;
  margin-top: 0;
}

.onboarding-societe-modal .onboarding-section-title {
  margin: .25rem 0 .5rem;
  font-size: .95rem;
}

@media (max-width: 767.98px) {
  .onboarding-societe-modal .modal-dialog {
    max-height: 100dvh;
    margin: 0;
  }

  .onboarding-societe-modal .modal-content,
  .onboarding-societe-modal #societe-wizard-form,
  .onboarding-societe-modal .onboarding-societe-form {
    max-height: 100dvh;
    border-radius: 0;
  }

  .onboarding-societe-modal .onboarding-logo-dropzone {
    height: auto;
    min-height: 104px;
  }
}

.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: #fff;
  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: var(--primary);
  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: var(--primary);
  text-decoration: none;
}

.login-page a:hover {
  color: var(--primary-dark);
}

.etroit {
  letter-spacing: -0.5px;
}

#evolutionChart {
  min-height: 400px !important;
}

/* Ajout du style pour le logo dans la sidebar */
.sidebar .logo {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1rem;
}

.btn-group {
  display: flex;
  gap: 0.1rem;
}

.file-upload-label {
  display: block;
  background-color: #e9ecef;
  color: #495057;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  border: 1px dashed #ced4da;
  transition: all 0.3s ease;
}

.file-upload-label:hover {
  background-color: #dee2e6;
  border-color: #adb5bd;
}

/* Responsive */
@media (max-width: 991.98px) {
  .wrapper {
    padding-top: 0; /* 60px; */
  }

  .fixed-to-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1025;
    padding: 0.5rem 1rem;
    background: #fff;
  }

  .top-bar {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 10px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--main-sidebar-width));
    width: var(--main-sidebar-width);
    height: 100%;
    z-index: 1000;
    transition: left 0.3s ease;
    /* margin-top: 40px; */
    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;
    margin-left: -20px;
    width: auto;
  }

  .sidebar.show {
    display: block;
  }

  #sidebarToggle,
  #sidebarTogglelg {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  /* Style spécial pour la description */
  .table td[data-column="designation"],
  .table td[data-column="description"] {
    grid-template-columns: 1fr;
  }

  .table td[data-column="description"]::before {
    margin-bottom: 0.5rem;
  }

  .table td[data-column="actions"] {
    grid-template-columns: 1fr;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid #dee2e6 !important;
  }

  .table td[data-column="actions"] .btn-group {
    justify-content: flex-start;
    width: 100%;
  }

  .table td[data-column="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 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;
  }

  /* .sidebar, .my-main {
        padding-top: 10px;
    } */
}

@media (max-width: 564px) {
  .top-bar {
    flex-wrap: wrap;
  }

  /* .sidebar, .my-main {
        padding-top: 10px;
    } */
}

/* Style de pagination */
.pagination {
  gap: 0.25rem;
}

.page-link {
  border: 1px solid var(--border);
  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: #fff;
  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 var(--border);
}

/* 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: #fff;
  border: 1px solid var(--border);
  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) {
  .info-section {
    margin-bottom: 1rem;
  }

  .devis-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .btn-group {
    display: flex;
    gap: 0.1rem;
  }

  .btn-group .btn {
    flex: 1;
  }
}

/* Améliorations esthétiques générales */

.badge {
  padding: 0.5em 0.75em;
  font-weight: 500;
  height: fit-content;
}

.btn-light {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.btn-light:hover {
  background: #e9ecef;
}

/* Style pour les infobulles */
.tooltip {
  font-size: 12px;
}

@media (max-width: 768px) {
}

/* Styles pour la liste des devis */
.devis-list {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Style des boutons */
.btn-group {
  display: flex;
  gap: 0.1rem;
}

.btn-light {
  background: #f8f9fa;
  border-color: #dee2e6;
}

.btn-light:hover {
  background: #e9ecef;
}

/* Style pour l'autocomplétion */
.resultats-produit,
#resultats_recherche,
.drop-search {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 990;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 2px;
}

.autocomplete-items {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 990;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 2px;
}

.autocomplete-items div {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  transition: background-color 0.2s;
  cursor: pointer;
}

.autocomplete-items div:hover {
  background-color: #f8f9fa;
}

.selected-department {
  font-weight: 500;
  color: var(--primary);
}

/* Style mobile pour l'autocomplétion */
@media (max-width: 768px) {
  .produit-suggestion,
  .client-suggestion,
  .ajouter-produit-btn,
  .ajouter-client-btn {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
  }

  .produit-suggestion,
  .client-suggestion,
  .ajouter-produit-btn,
  .ajouter-client-btn {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .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: #fff;
  border-bottom: 1px solid var(--border);
}

.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) {
  /* 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 var(--border);
}

.produit-suggestion:last-child,
.client-suggestion:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  /* Style des totaux */
  .totals-section {
    background: #fff;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    margin-bottom: 1rem;
  }

  /* Style des totaux */
  .totals-section {
    background: #fff;
    padding: 1rem;
    border-top: 1px solid var(--border);
    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;
  }
}

/* Style des suggestions */
.produit-suggestion,
.client-suggestion {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  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;
  }
}

/* Style de la section des actions */
.devis-actions {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

.devis-actions .btn {
  min-width: 140px;
}

/* Style du tableau et des totaux */
.devis-table-container {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

/* Style de la section des actions */
.devis-actions {
  background: #fff;
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.devis-actions .btn {
  min-width: 140px;
}

/*styles pour leads illimites */
.first-pack-badge {
  padding: 0.2rem 0.75rem;
  background: linear-gradient(
    45deg,
    var(--blue-dark-bg) 0%,
    var(--purple-bg) 50%,
    var(--blue-bg) 100%
  );
  color: #fff;
  border-radius: 1rem;
  font-weight: 500;
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .devis-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .devis-actions .btn {
    width: 100%;
    min-width: auto;
  }
}

/* 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 */
  }

  /* Conteneur pour les boutons */
  .devis-actions {
    position: relative;
    /* Au lieu de fixed */
    bottom: auto;
    left: auto;
    right: auto;
    background: #fff;
    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;
  }
}

/* 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: 990;
  }

  /* 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 var(--border);
  }

  .ajouter-client-btn,
  .ajouter-produit-btn {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
}

/* 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 var(--border);
  cursor: pointer;
}

.client-suggestion:hover,
.ajouter-client-btn:hover {
  background-color: #f8f9fa;
}

@media (max-width: 768px) {
  /* 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 var(--border);
  cursor: pointer;
  background: #fff;
}

.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: 990;
} */

.position-relative {
  position: relative !important;
}

@media (max-width: 768px) {
  .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;
  }
}

/* Styles de base pour les résultats de recherche */
.resultats-produit {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 990;
  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 var(--border);
  }

  /* 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: 990;
  }

  .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 var(--border);
  }
}

/* Style des suggestions client */
.client-suggestion,
.ajouter-client-btn {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--border);
}

.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) {
  /* Retirer les styles qui interfèrent */
  #recherche_client:focus ~ .autocomplete-overlay,
  #recherche_client:focus + .autocomplete-overlay,
  #resultats_recherche ~ .autocomplete-overlay {
    display: none !important;
  }
}



/* Style du champ désignation et recherche produit */
@media (max-width: 768px) {
  /* 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;
}

/* Reset du style table et table-responsive */
.table-responsive {
  overflow: unset !important;
}

.table {
  position: relative;
  z-index: 1;
}

.produit-description {
  font-size: 11px;
  /* white-space: pre-line; */
  color: #666;
  margin-top: 4px;
  padding: 4px 8px;
  background-color: #f8f9fa;
  border-left: 3px solid var(--border);
  font-style: italic;
}

/* Zone des badges dans la cellule désignation */
.options-badges-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.options-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: flex-start;
}

/* Badge individuel */
.options-badges .option-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  width: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  background-color: #f8f9fa !important;
  color: #212529 !important;
  border: 1px solid #dee2e6 !important;
  font-weight: 400;
  line-height: 1.3;
  padding: .35em .6em;
  border-radius: .375rem;
}

/* Texte interne du badge - doit pouvoir être tronqué */
.options-badges .option-badge .badge-content {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* Pastille de couleur + son nom doivent rester visibles ensemble */
.option-shade-name {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  flex-shrink: 0;
  max-width: 100%;
}

.option-shade-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  flex-shrink: 0;
  border: 1px solid #adb5bd;
  border-radius: 50%;
  vertical-align: middle;
}

td[data-column="designation"] {
  min-width: 0;
  max-width: 0;
  overflow: hidden;
}

td[data-column="designation"] > * {
  min-width: 0;
  max-width: 100%;
}

.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%, 0.1);
  border-right: 1px solid hsla(0, 0%, 100%, 0.1);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-label.btn-light .label-icon {
  background-color: rgba(52, 58, 64, 0.1);
  border-right: 1px solid rgba(52, 58, 64, 0.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-doc-btn,
.delete-logo-btn,
.delete-certification-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: #fff;
  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;
  z-index: 10;
}

.delete-scan-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 10;
  padding: 0px 5px;
}

.delete-scan-btn i {
  font-size: 8px;
}

#scanSection img {
  background-color: rgba(44, 62, 80, 0.12);
  padding: 8px;
}

.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;
}

/* iframe style */
.iframe-container {
  position: relative;
}

#page-iframe {
  position: relative;
  width: auto;
  min-width: 100%;
  height: auto;
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  .options-badges-wrap,
  .options-badges {
    max-width: 100%;
    overflow: hidden;
  }

  .options-badges .option-badge {
    max-width: calc(100% - 4px);
  }
}





