html {
  font-size: unset;
  color: #2a2a2a;
}

body {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  /* font-family: cursive; */
  /* font-family: Verdana, Arial, Helvetica, sans-serif; */
  margin: 0.5em 1em;
  /* margin: 2em; */
  background-color: #f5f5f5;
  /* background-color: lightblue !important; */
  /* border: 2px solid yellow; */
  /* color: red; */
  color: #737373;
}

/* Centrage horizontal */
body {
  /* text-align: center; */
}

h1 {
  color: #333;
  font-size: 1.8em;
  margin-bottom: 0.2em;
}

h1 span {
  font-size: 0.5em;
}

h2 {
  font-size: 1.2em;
  margin-top: 0;
  margin-bottom: 1em;
  color: #333;
}

body hr:nth-of-type(3) {
  border-top: 2px solid #ccc;
  margin-top: 1em;
}

.version {
    font-size: 0.6em;
    margin-left: 1em;
}
.center {
    text-align: center!important;
}
input.is-locked { background:#f7f7f7; cursor:pointer; }

/* ======================================================================================= */
/* COMMON     COMMON     COMMON     COMMON     COMMON     COMMON     COMMON     COMMON     */
/* ======================================================================================= */

[hidden] { display: none !important; }

.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  background-color: #fff;
  color: #333;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #727272;
  position: absolute;
  top: 100%;          /* positionnée en dessous du bouton */
  left: 50px;        /* décalage vers la droite */
  margin-top: 10px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  width: 180px;
  max-width: 250px;
  white-space: normal;
  font-family: Arial, sans-serif;
  font-weight: normal;
  font-size: 0.8em;
}

/* Pour les tooltips proches du bord droit de l'écran */
.tooltip-container.tooltip-right .tooltip-text {
  right: 0;
  left: auto;
  transform: none;      /* on ne centre plus, on colle à droite */
  max-width: 320px;     /* au besoin, limite la largeur pour qu'il se replie sur plusieurs lignes */
  white-space: normal;  /* permet le retour à la ligne */
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}


.first-line-table-row {
  display: grid;
  grid-template-columns: 80px 350px 100px 490px 1fr 400px;
  gap: 5px;
  justify-items: center;

}



.first-line-table-row img {
  border: 1px solid #ddd;
  border-radius: 4px;
  height: 60px; /* Exemple de taille */
  width: 60px;
  padding: 0.3em;
}

.first-line-table-row .version {
  display: flex;
  align-items: center;     /* centre verticalement */
  justify-content: flex-start; /* optionnel : centre horizontalement */
  height: 88px;           /* ou la hauteur de ta ligne/colonne */
  width: 100%;  
}


.first-line-table-row  .auth-column {
  display: flex;
  flex-direction: column;
  justify-content: center; /* centre verticalement si hauteur définie */
  align-items: center;     /* centre horizontalement */
/*   height: 150px;    */        /* ou selon la hauteur de ta colonne */
  padding: 10px;
  box-sizing: border-box;
}

.first-line-table-row  .auth-column.go-to-top {
  padding-top: 0px;
}

.first-line-table-row .welcome-message {
  margin-bottom: 10px;
  /* color: #333; */
  font-size: 1.1em;
}

.first-line-table-row  .auth-buttons {
  display: flex;
  gap: 10px;
  flex-direction: column;
  font-size: 1.1em;
}

.first-line-table-row  .auth-buttons button {
  /* padding: 2px 0; */
  /* font-size: 0.9rem; */
  cursor: pointer;
  /* border: none; */
  /* background-color: #0078D4; */
  /* color: white; */
  /* border-radius: 4px; */
  width: 8rem;
  margin: 0 2rem;
}
.first-line-table-row  .auth-buttons .hello-message {
  text-align: center;
  padding-top: 0px;
}
	
.first-line-table-row .tooltip-container img {
  height: 45px;
  width: 45px;
  border: none;
  padding: 0;
  margin: 0 0.3em;
  cursor: pointer;
}

.first-line-table-row .auth-buttons  .user-line {
  padding-top: 10px;
}

.first-line-table-row .auth-buttons .user-line.go-to-top {
  padding-top: 0px;
}

.first-line-table-row .auth-buttons  .user-line .tooltip-container {
  padding: 0 15px;
}
.first-line-table-row .auth-buttons  .user-line  .tooltip-container  span,
.first-line-table-row .auth-buttons  .user-line  .tooltip-container  a  {
  text-decoration: none;
  color: #888;
  font-size: 0.8em;
  font-weight: bold;
}

.btn:hover {
  background-color: #005A9E;
}





.first-line {
    /* border: 1px solid #ddd; */
    display: flex; /* Active Flexbox */
    align-items: center; /* Centre verticalement les éléments enfants */
    justify-content: space-between; /* Distribue l'espace : image/h1 à gauche, nouveau texte à droite */
    width: 100%; /* Assure que le conteneur prend toute la largeur disponible */
    /* Ajoutez d'autres styles si nécessaire, par exemple : */
    /* margin-bottom: 20px; /* Un peu d'espace sous cette ligne */
}

.first-line img {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.3em;
  height: 60px; /* Exemple de taille */
  width: 60px;
  margin: 0 1em; /* Espace entre l'image et le titre */
}

.first-line h1 {
    /* Assurez-vous que le h1 ne prend pas tout l'espace disponible */
    margin: 0; /* Supprime les marges par défaut du h1 */
    flex-grow: 0; /* Empêche le h1 de prendre tout l'espace restant */
}

.first-line .right-text {
    /* padding: 2em; */
    /* color: white; */
    margin: 0.5em;
    margin-left: auto; /* Pousse cet élément le plus à droite possible */
    font-size: 1.1em;
    /* color: #555; */
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
    align-self: flex-start; /* ALIGNE CE TEXTE SPÉCIFIQUEMENT EN HAUT */
}

.first-line .right-text .user-line{
    margin: 0 calc(50vw - 10rem) 0 0;
    font-size: 0.8em;
    font-weight: bold;
    color: #888;
}

.first-line .right-text .user-line a {
     /* margin-left: 10px; */

     text-decoration: none;
    color: #888;
     /* color: #007bff; */

}

.first-line .right-text .welcome{
    margin: 0 calc(50vw - 15rem) 0 0;
}

.first-line .right-text .welcome div{
    display: flex;
    gap: 0.8em;
    margin: 0.5rem 3.5rem;
}

.first-line .right-text button {
    /* margin: 0.5rem calc(37vw - 20rem) 0 9rem; */
    width: 8rem;
}

.first-line .right-text img {
  height: 45px; /* Exemple de taille */
  width: 45px;
  border: none;
  padding: 0;
  margin: 0 0.3em;
  cursor: pointer; 
}

.main-menu {
  margin-left: 1em;
}

.main-menu ul {
  display: flex;
  list-style-type: none;
  padding-left: 0;
  gap: 1.75em;
  margin: 0;
}

.main-menu a {
  text-decoration: none;
  font-size: 1em;
  font-weight: bold;
  color: #2a2a2a;
}

.main-menu a:hover {
  color: #0077cc;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0em 0;
}

.mode-label {
  font-weight: bold;
  margin-left: 2em;
  white-space: nowrap;
}

.header-flex-container {
  display: flex;
  /* align-items: stretch; */
  align-items: center;
  background-color: #eee;
  /* background-color: #f00; */
  /* flex-wrap: wrap; */
}

#flash-messages {
  position: fixed;
  top: 20em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  width: max-content;
  max-width: 80%;
  text-align: center;
  padding: 0.5em;
}

.flash {
  background-color: #f8d7da; /* défaut danger */
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  margin-bottom: 0.5em;
  padding: 0.75em 1em;
  font-weight: bold;
  font-size: 1.5em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Couleurs selon catégorie */
.flash-success {
  background-color: #D6F9C5;
  color: #565656;
  border-color: #c3e6cb;
}

.flash-warning {
  background-color: #FEDF9E;
  color: #856404;
  border-color: #ffeeba;
}

.flash-danger {
  background-color: #FB7512;
  color: #565656;
  color: #856404;
  border-color: #f5c6cb;
}

.flash-message {
  margin: 4px 0;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9em;
}

.flash-success { background-color: #d4edda; color: #155724; }
.flash-danger  { background-color: #f8d7da; color: #721c24; }
.flash-warning { background-color: #fff3cd; color: #856404; }
.flash-info    { background-color: #d1ecf1; color: #0c5460; }

/* === Élément de fermeture === */

.close {
  position: absolute;
  top: 0.4em;        /* plus haut */
  right: 0.6em;      /* plus à droite */
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* style="position:absolute;right:.4rem;top:50%;transform:translateY(-50%); */
                     /* border:0;background:transparent;font-size:1rem;line-height:1; */
                     /* cursor:pointer;opacity:.6;display:none;" */

button#qClear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0px;
    background: transparent;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    display: none;
    font-weight: bold;
}

input#q {
    flex:1;
    padding-right:2rem;
}






/* .clearable { position: relative; } */
/* .clearable input, .clearable textarea { padding-right: 2rem; } */
/* .clearable .clear-btn{ */
  /* position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); */
  /* border: 0; background: transparent; font: inherit; cursor: pointer; */
  /* opacity: .5; display: none; line-height: 1; */
/* } */
/* .clearable .clear-btn:hover { opacity: .9; } */
/* .clearable.has-value .clear-btn { display: inline-block; } */


/* =============================================================================================== */
/* PAGE HOME   PAGE HOME   PAGE HOME   PAGE HOME   PAGE HOME   PAGE HOME   PAGE HOME   PAGE HOME   */
/* =============================================================================================== */


.main-container {
  text-align: center;
  padding: 16px;
  background-color: #fff;
  border-radius: 8px;
  /* border: 2px solid red; */
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  margin: 2em auto;

  /* Largeur plus réduite et responsive */
  width: fit-content;
  max-width: 60vw; /* ← Plus petit qu’avant */
}

.image-wrapper img {
  max-width: 500px;
  max-width: 40vw;
  width: 100%;
  height: auto;
}

.image-wrapper {
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
}

.illustration {
  width: 50%;
  /* height: 100%; */
  background-image: url('/static/images/illustration.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid green;
}

.btn-home {
    display:none;
}

/* =========================================================================================== */
/* PAGE BASE    PAGE BASE    PAGE BASE    PAGE BASE    PAGE BASE    PAGE BASE    PAGE BASE     */
/* =========================================================================================== */

/* .user-line, */
.welcome-text {
    text-align: left;
    /* margin-right:  20em; */
    margin-right: calc(1rem + 40vw);
    padding-left:4rem;
}

.title-block {
  text-align: center;      /* centre tout le contenu du bloc (h1 + texte) */
}

.eval-badge {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: bold;
  color: #b30000;
}

#horloge-fluide {
  position: absolute;
  top: 10px;
  right: 30px;
  text-align: right;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 1.2em;
  color: #333; /* Assure une bonne lisibilité */
  z-index: 1000; /* Toujours au-dessus */
}

.date-js {
  font-size: 0.9em;
}

.heure-js {
  font-size: 1.2em;
  margin-top: 0.2em;
}

.avatarfolder {
    text-align: left;
    margin-right:  20em;
}

.header-flex-container .button-home {
  background-color: #38B4F2;
  font-weight: bold;
}

.header-flex-container button:hover {
  background-color: #6FD3F7;
  color: #eee;
}

.header-flex-container a {
  text-decoration: none;
  /* font-weight: bold; */
  font-size: 1.2em;
  color: #0077cc;
  padding: 0.35rem 0.5rem;
  margin-right: 2rem;
  /* background-color: #38B4F2; */
  background-color: #eee;
  border-radius: 5px;
  transition-property: background-color, color;
  transition-duration: 2s;
  transition-delay: 0.5s;
}

.header-flex-container a:hover {
  /* font-weight: bold; */
  /* background-color: #DCF4D9; */
  /* transition: background-color 0.3s ease; */
  /* color: #0077cc; */
  color: gray;
  /* transition: color 1.8s ease; */
  background-color: #6FD3F7;
  color: #eee;
}
.header-flex-container h2 {
    /* margin-left: 1em; */
    margin: 0.25em 1em;
}

.header-flex-container > div {
  /* background-color: DodgerBlue; */
  /* color: white; */
  /* margin: 0 1em; */
  text-align: left;
  display: flex;
  /* line-height: 75px; */
  /* font-size: 30px; */
}

/* Styles pour le journal lumineux */
.ticker-container {
  width: 60%; /* Largeur du conteneur du bandeau */
  /* max-width: 900px; */ /* Largeur maximale */
  /* background-color: #f0ad4e;  *//* Couleur de fond du bandeau (orange pour un avertissement) */
  /* color: white; */ /* Couleur du texte */
  color: #555;
  /* padding: 10px 0; */ /* Padding vertical, pas de padding horizontal pour le défilement */
  overflow: hidden; /* TRÈS IMPORTANT : Cache le texte qui dépasse */
  white-space: nowrap; /* Empêche le texte de passer à la ligne */
  /* border-radius: 8px;  *//* Coins arrondis */
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);  *//* Ombre pour un effet de profondeur */
  position: relative; /* Nécessaire pour le positionnement du texte défilant */
  /* margin: 20px auto; */ /* Centre le bandeau et ajoute une marge */
  margin: 0 auto;
  text-align: center; /* Centre le texte si l'animation ne le fait pas complètement */
}

.ticker-text {
  display: inline-block; /* Permet au texte de défiler sur une seule ligne */
  padding-left: 100%; /* Commence le texte en dehors de la vue à droite */
  animation: defilement 15s linear infinite; /* Applique l'animation */
  /* font-size: 1.2em; */
  /* font-weight: bold; */
}

/* Définition de l'animation de défilement */
@keyframes defilement {
  0% {
    transform: translateX(0%); /* Position de départ (tout à droite du conteneur) */
  }
  100% {
    transform: translateX(-100%); /* Position de fin (tout à gauche du conteneur) */
  }
}

.btn-logout {
  /* padding: 0.4em 1em; */
  /* background-color: #dc3545; */
  /* color: white; */
  /* border: none; */
  /* border-radius: 6px; */
  cursor: pointer;
  text-decoration: none;
  position: absolute;
  top: 70px;
  right: 30px;
  background-color: #eee;
  font-size: .75em;
  border: 1px solid black;
  border-radius: 4px;
  /* margin: 0 8em; */
  padding: .1em .4em;
  color: black;
}

.btn-logout:hover {
  background-color: #d8d8d8;
}

.debug-context {
  display: block;
}

/* === Modal principal === */
.modal {
  display: none;             /* Caché par défaut */
  position: fixed;
  z-index: 10000;
  width: 100%;
  top: 0;
  left: 0;
  pointer-events: none;      /* Ignore les clics hors contenu */
}

/* Quand le modal est actif */
.modal.show .modal-content {
  margin-top: 30vh;          /* Fait glisser vers le bas */
}

.modal.show { pointer-events: auto; }

#dossierCompanyModal.modal.show  .modal-content {
  margin-top: 0vh;          /* Fait glisser vers le bas */
  width: 500px;
}

#dossierCompanyModal.modal.show  .modal-content label {
  margin-top: 0vh;          /* Fait glisser vers le bas */
  /* font-size: 0.8em; */
  width: 30%;
}

#dossierCompanyModal.modal.show  .modal-content .label-input.code-email label {
  width: 50%;
}

#dossierCompanyModal.modal.show  .modal-content .label-input {
  margin-top: 0vh;          /* Fait glisser vers le bas */
  font-size: 0.8em;
}

#dossierCompanyModal.modal.show  .modal-content input {
  margin-top: 0vh;          /* Fait glisser vers le bas */
  /* font-size: 0.8em; */
}

#createDossierModal.modal.show  .modal-content {
  margin-top: 10vh;          /* Fait glisser vers le bas */
}

/* === Contenu du modal === */
.modal-content {
  position: relative;
  background-color: #fefefe;
  background-color: rgba(255, 255, 255, 0.98);  /* ← Opacité légère */
  margin: 0 auto;
  margin-top: -100%;         /* Position cachée initiale */
  padding: 2em;
  width: 300px;
  border-radius: 8px;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  /* transition: margin-top 0.5s ease-in-out; */
  transition: margin-top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  /* transition: margin-top 1s cubic-bezier(0.68, -0.25, 0.27, 1.55); */
  pointer-events: auto;
}

/* === Champs formulaire === */
.modal-content h2 {
  text-align: center;
  margin-top: 0.1em;
    font-size: 1.5em;
}

.modal-content input {
  width: 93%;
  padding: 0.5em;
  /* margin: 0.5em auto 1em auto;  */ /* Centre horizontalement */
  margin: 0.5em 0;
  display: block;               /* Nécessaire pour que margin auto fonctionne */
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #EAFFFF;
}

.modal-content button {
  width: 97%;
  /* width: 33%; */
  /* display: block; */
  /* margin: 0 auto; */
  padding: 0.6em;
  /* background-color: #007bff; */
  background-color: #67E78A;
  /* color: white; */
  /* color: black; */
  color: #333;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1em;
}

.modal-content button:hover {
  /* background-color: #0056b3; */
  background-color: #57D77A;
}

.modal-content.modal-content--user {
  width: 480px;
  max-width: 95vw;
  max-height: 88vh;          /* ne dépasse pas la hauteur de la fenêtre */
  display: flex;
  flex-direction: column;
  padding: 1.5em;
}

/* Position verticale un peu plus haute que les autres modales */
.modal.show .modal-content.modal-content--user {
  margin-top: 6vh;
}

.modal-content.hide {
  animation: slideUp 0.5s forwards;
}

#contactErrorMsg {
    color: red;
    margin-bottom: 10px;
    font-weight: bold;
}

@keyframes slideUp {
  from {
    margin-top: 100px;
    opacity: 1;
  }
  to {
    margin-top: -50px;
    opacity: 0;
  }
}

#carnet {
     margin-top: 10px;
     text-align: center;
}

#carnet img {
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

#selectDossierModal table {
    width: 100%;
    margin-bottom: 1em;
}

#registerModal .modal-content {
  width: 250px;
}

#loginModal .modal-content {
  width: 200px;
}

#create-modal-content {
  width: 450px;
}

#create-modal-content.modal-content div{
   margin-top: 1em;
   /* text-align: right; */
}

#create-modal-content.modal-content td{
    text-align: center;
}

#create-dossier-form textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 95%;
    height: 90px;
    background-color: #EAFFFF;
}

#customerSearchModal.modal.show .modal-content {
    width: 350px;
}

#docSearchModal.modal.show .modal-content {
    width: 600px;
    margin-top: 10vh;
}

#invoiceToModal.modal.show button {
    width: 33%;
    display: block;
    margin: 1em auto 0 auto;
}

.doc-row {
    display:grid;
    grid-template-columns: 140px 1fr 140px auto;
    gap:10px;
    padding:.5rem;
    border-bottom:1px solid #eee;
}

.modal-content table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
}

.modal-content th {
  /* background-color: #0077cc; */
  background-color: #67E78A;
  /* color: #fff; */
  padding: 0.75em 1em;
  text-align: left;
  font-size: 1em;
}

.modal-content td {
  padding: 0.6em 1em;
  border-bottom: 1px solid #eee;
  font-size: 0.95em;
  color: #333;
}

.modal-content tr:hover {
  background-color: #f2f8fc;
  transition: background-color 0.3s ease;
}

  /* Style personnalisé uniquement dans le modal de sélection de dossier */
  #selectDossierModal input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #888;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
  }

  #selectDossierModal input[type="radio"]:checked {
    /* border-color: #007bff; */
    /* border-color: #67E78A; */
    background-color: #67E78A;
  }

  #selectDossierModal input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    /* background: white; */
    border-radius: 50%;
  }

  /* Style personnalisé pour les boutons radio uniquement dans le modal de sélection */
  #selectDossierModal input[type="radio"] {
    /* transform: scale(1.2);  */
    accent-color: #67E78A; /* Définit uniquement la couleur du point intérieur */
  }

.modal-content form select{
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 150px;
    height: 30px;
    margin: 0 45px;
    color: #666;
}


/* ---------------  Overlay de présentation d'entrée --------------- */
.entry-intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.entry-intro-box {
  background: #ffffff;
  max-width: 640px;
  width: 90%;
  padding: 24px 28px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  font-size: 0.95rem;
  line-height: 1.4;
}

.entry-intro-box h2 {
  margin-top: 0;
  margin-bottom: 0.75em;
}

.entry-intro-box ul {
  margin: 0.5em 0 0.5em 1.2em;
}

.entry-intro-box button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #007bff;
  background: #007bff;
  color: #fff;
  cursor: pointer;
}

.entry-intro-box button:hover {
  filter: brightness(0.95);
}



/* ============================================================================================== */
/* PAGE CUSTOMER   PAGE CUSTOMER   PAGE CUSTOMER   PAGE CUSTOMER   PAGE CUSTOMER   PAGE CUSTOMER  */
/* ============================================================================================== */

@keyframes slideUp {
  0% {
                                /* transform: translateY(0); */
    opacity: 1;
  }
  100% {
                                /* transform: translateY(-100%); */
    opacity: 0;
  }
}

.tab.closing {
                                /* animation: slideUp 0.8s ease forwards; */
}

/* Conteneur des onglets */
.tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
  border-bottom: 2px solid #ccc;
  flex-wrap: wrap; /* utile si l’écran est petit */
}

.tab {
  width: 170px;
  text-align: center;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  border: 1px solid #ccc;
  border-bottom: none;
  /* border-bottom: 2px solid transparent; */
  border-radius: 5px 5px 0 0;
          /* transition: background-color 0.3s ease; */
}

/* Effet au survol */
.tab:hover {
  background-color: #e0e0e0;
}

/* Onglet actif */
.tab.active {
  /* background-color: white; */
  background-color: #F97D3E ;
  font-weight: bold;
  color: #101010;
  color: white;
  font-size: 1.1em;
  /* border-bottom: 2px solid white; */
      /* background-color: lightgray; */
                                /* border-bottom: 4px solid green; */
  /* border: 3px solid #FFAB2F  ; */
  /* border-bottom: 0; */
   /* border-top: 4px solid #FFAB2F  ; */
}

/* Contenu de chaque onglet */
.tab-content {
  border: 1px solid #ccc;
  border-top: none;
  padding: 1em;
/*   background-color: green; */
                              /* opacity: 0; */
                              /* transform: translateY(10px); */
                              /* transition: opacity 0.3s ease, transform 0.3s ease; */
  display: none;
}

/* Affichage de l’onglet actif */
.tab-content.active {
  display: flex;
  justify-content: center;
                              /* opacity: 1; */
                              /* transform: translateY(0); */
  /* width: 75%; */
  gap: 10px;
}

/* .tab-content.search-mode { */
  /* display: flex; */
  /* opacity: 1; */
  /* transform: translateY(0); */
  /* gap: 20px; */
/* } */

.tab-content.search-mode {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  flex-direction: column;
  align-items: center; /* Centrer horizontalement */
  gap: 20px;
}

.tab-content.search-mode fieldset {
  display: flex;
  flex-direction: column;
  width: 55%;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  /* gap: 1em; */
}

.tab-content.active h3{
  margin-left: 3em;
}

.tab-content input {
  background-color: transparent;
  border-radius: 0px;
  outline: none;
  border: none;
  border-bottom: 1px dashed #aaa;
}

.tab-content input:focus {
  border: none;
  outline: none;
  border-bottom: 1px solid #aaa;
}

.tab-content fieldset {
    width: 45%;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 1em;
}

#tab-finances.tab-content.active div.label-input {
    margin-bottom: 0.2em;
}

#tab-autres.tab-content.active div.label-input {
    flex-wrap: wrap;
    /* margin: 0; */
}

#tab-autres.tab-content.active div.label-input textarea {
  width: calc( 100% - 0em );
}

#tab-sites.tab-content.active fieldset{
  width: 75%;
}

/* Le conteneur scrolle, pas la page */
#tab-sites .table-scroll{
  max-height: 50vh;          /* ajuste à ton goût */
  overflow: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}

/* En-tête qui reste visible quand on scrolle */
#sites-table thead th{
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}

.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  column-gap: 20px;
  align-items: center;
  margin-top: 0.5em;
}

.form-row label {
  text-align: right;
  margin-right: 1rem;
  font-weight: bold;
  white-space: nowrap;
  margin-top: 0.7rem;
}

.form-row input {
  width: 100%;
  padding: 6px 10px;
  box-sizing: border-box;
}
.form-actions {
  display: flex;                /* Active flexbox */
  justify-content: center;     /* Centre horizontalement */
  padding: 6px 10px;
  gap: 30px;
}

a.listing {
  width: 12rem;
  margin: auto;
  margin-top: 1rem;
}

.form-actions a,
a.listing  {
  display: flex;
  align-items: flex-end; /* Aligne le contenu en bas */
  justify-content: center; /* Centré horizontalement */
  text-decoration: none;
  cursor: pointer;
  /* background-color: #eee; */
  font-size: .75em;
  border: 1px solid #666;
  border-radius: 2.5px;
  padding: 0.23em 1.6em;
  color: black;
}
.form-actions a:hover,
a.listing:hover {
  color: gray;
  transition: color 1.8s ease;
  background-color: #5AED9E;
  color: #eee;
}

.form-actions button {
  /* color: gray; */
  border: 1px solid #666;
  border-radius: 2.5px;
  width: 8rem;
}

.form-actions button:hover {
  transition: color 1.8s ease;
  background-color: #5AED9E;
  color: #eee;
}


.label-input {
  display: flex;
  align-items: center;
  margin-bottom: 0.8em;
}

.label-input label {
  margin-right: 0.5rem;       /* espace entre le label et le champ */
  font-weight: bold;
  white-space: nowrap;     /* évite les sauts de ligne intempestifs */
  margin-top: 0.7rem;
  text-align: right;
}

.label-input input {
  flex: 1;
  font-size: 1.0em;
  font-family: Arial, sans-serif;
  /* font-weight: normal; */
  font-weight: bold;
  /* padding: 0.4em; */
  /* border: 1px solid #ccc; */
  /* border-radius: 4px; */
  width: 33%;
}

.label-input button {
  height: 56px;
  width: 54px;
  cursor: pointer;
  font-size: 0.75rem;
}

#create-dossier-form .label-input button {
  margin: 0 10px;
}


.label-input button#btnPickInvoiceTo,
.label-input button#btnResetInvoiceTo{
    height: unset;
    width: 33px;
    cursor: pointer;
}

#tab-base fieldset.identite .label-input label {
    min-width: 9.5em;
}

#tab-base fieldset.adresse .label-input label {
    min-width: 7em;
}

#tab-base fieldset.contact .label-input label {
    min-width: 6.5em;
}

#tab-contacts fieldset.contact .label-input label {
    min-width: 11em;
}

#tab-finances fieldset.administration .label-input label {
    /* min-width: 6.5em; */
	 min-width: 6.5em;
}

#tab-finances fieldset.finance .label-input label {
    min-width: 13.5em;
}

#tab-finances fieldset.comptabilite .label-input label {
    min-width: 14.5em;
}
#tab-finances.tab-content.active {
    display: flex;
    gap: 10px;
}
#tab-finances fieldset {
  flex: 1;          /* chaque fieldset prend la même largeur */
  min-width: 0;     /* évite que le contenu force l’élargissement */
}

#tab-finances select,
#tab-finances input {
  max-width: 100%;   /* ne déborde pas du fieldset */
  width: 100%;       /* occupe la colonne prévue */
  box-sizing: border-box;
  height: 25px;
}




.checkbox-row {
  display: flex;
  justify-content: center;
  gap: 2.5em;
  margin-bottom: 1em;
  align-items: flex-start; /* aligne le haut des colonnes */
}

.checkbox-cell,
.image-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
}
.checkbox-cell input[type="checkbox"] {
  transform: scale(1.2);       /* agrandir un peu la case */
  margin-top: 0.4em;
}

.checkbox-inline {
  display: flex;
  gap: 4em;
  gap: 3%;
  align-items: center;
  justify-content: center;
}

.checkbox-group {
  display: flex;
  gap: 2em; /* facultatif : espace entre les checkbox */
  margin-right: 0.2em; /* au cas où tu veux régler les checkbox en plus finement */
}

.image-cell img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.4em;
}

.inline-block label {
  margin-bottom: 0.2em; /* Réduit l'espace sous le label */
  margin-bottom: 0.4em; /* espace entre "Actif" et l’image */
}

.inline-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
  /* line-height: 1.1; */ /* resserre la hauteur entre éléments */
}

.inline-block input[type="checkbox"] {
  margin-top: -0.5em;
}

.active-image {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 8px;
  /* margin-top: 0.4em; */
  margin-top: -1rem; /* Supprime l'espace au-dessus de l'image */
  margin-bottom: 0.6em; /* espace entre l’image et les checkbox */
}

.status-line {
  display: flex;
  justify-content: center;   /* Centrage horizontal */
  align-items: flex-start;   /* Aligné en haut */
  gap: 3em;
  margin-bottom: 0;          /* Supprime la marge basse */
  margin-top: 1em;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.status-group {
  display: flex;
  gap: 2em;
}

.status-block {
  text-align: center;
  font-weight: bold;
}
.status-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.status-image {
  text-align: center;
}

.status-image img {
  margin-top: 0.4em;
}

.status-indicator {
  font-size: 1.3em;
}

.status-label {
  font-weight: bold;
   margin-top: 0.5em;
  margin-bottom: 0.8em; /* espace entre le texte et le check */
}

/* Positionnement des flèches */
.customer-navigation-arrows {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Aligner à droite */
    gap: 0px;/* gap: 10px; */ /* Espace entre les éléments */
}

.customer-navigation-arrows .nav-info {
    font-size: 0.9em;
    margin-right: 0.3em;
    font-weight: bold;
    color: #555;
    white-space: nowrap; /* Empêche le retour à la ligne */
}

.nav-arrow-button {
  display: inline-block;
  cursor: pointer;
  padding: 0.4em 0.65em;
  background-color: #F97D3E;
  margin: 0 0.5em;
  font-size: 1.2em;
  color: #eee;
  text-align: center;
  text-decoration: none;
  border-radius: 5px;
  transition-property: background-color, color;
  transition-duration: 2s;
  transition-delay: 0.5s;
  font-weight: bold;
  border: none;
}

.nav-arrow-button:hover {
    color: #aaa;
}

/* Styles pour la bannière de mode */
.mode-banner {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}

.mode-banner.edition {
    background-color: #fff3cd; /* Jaune clair */
    color: #856404;
    border: 1px solid #ffeeba;
}

.mode-banner.creation {
    background-color: #FFAB2F; /* Orange clair  */
    color: #565656;
    border: 1px solid #c3e6cb;
}

.mode-banner.recherche {
    background-color: #96F3A3; /* Vert clair */
    color: #737373;
    border: 1px solid #c3e6cb;
}

.mode-banner.visualisation {
    background-color: #d4edda; /* Vert clair */
    color: #565656;
    border: 1px solid #c3e6cb;
}

.scrollable-table-container {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #ccc;
  position: relative;
  padding: 0; /* important */
  margin: 0;  /* important */
}

.styled-customer-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.styled-customer-table th,
.styled-customer-table td {
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;

  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  /* vertical-align: top; */
  cursor: pointer;
}

.styled-customer-table th {
  background-color: #c7e9c0; /* vert plus soutenu pour les en-têtes */
  font-weight: bold;
}

.styled-customer-table tbody tr:nth-child(odd) {
  background-color: #eafbe8; /* vert très clair */
  cursor: pointer;
}

.styled-customer-table tbody tr:nth-child(even) {
  background-color: #ffffff;
  cursor: pointer;
}

/* Fixe l'en-tête du tableau */
.styled-customer-table thead th {
  position: sticky;
  top: 0;
 /*  background-color: #f5f5f5;  */ /* Choisis un fond bien visible, pas transparent */
  z-index: 10;                /* Plus haut que les lignes */
  border-bottom: 2px solid #ccc;
}
/* Fixer l’en-tête en haut du conteneur sans espace */
.styled-customer-table thead tr th {
  /* position: sticky; */
  /* top: 0; */
  /* background-color: #f5f5f5; */
  /* z-index: 10; */
  /* border-bottom: 2px solid #ccc; */
  /* margin: 0; */
  cursor: pointer;
}



/* Assure une ligne qui occupe toute la largeur */
.contact-input-row,
.term-input-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

/* L’input prend la place, les boutons seront poussés par margin-left:auto */
.contact-input-row input,
.term-input-row input {
  flex: 1 1 auto;
  min-width: 0; /* évite les débordements si très long */
}

.contact-input-row input {
  font-weight: bold;
}


/*  .search-container {
/*    position: relative;
/*    display: inline-block;
/*  }
/*
/*  .search-container input {
/*    padding-right: 40px; /* espace pour la loupe */
/*    height: 36px;
/*    font-size: 16px;
/*  }
/*
/*  .search-button {
/*    position: absolute;
/*    right: 5px;
/*    top: 50%;
/*    transform: translateY(-50%);
/*    background: none;
/*    border: none;
/*    cursor: pointer;
/*    font-size: 18px;
/*  }



/*   .input-wrapper {
/*     position: relative;
/*     display: inline-block;
/*   }
/*
/*   .input-wrapper input {
/*     padding-right: 30px; /* espace pour l'icône */
/*     height: 36px;
/*     font-size: 16px;
/*     box-sizing: border-box;
/*   }
/*
/*   .input-wrapper .icon {
/*     position: absolute;
/*     right: 8px;
/*     top: 50%;
/*     transform: translateY(-50%);
/*     pointer-events: none; /* empêche le clic si tu veux que ce soit décoratif */
/*     font-size: 18px;
/*     color: #888;
/*   }
/*
/*
/*   .icon-button {
/*     position: absolute;
/*     right: 8px;
/*     top: 50%;
/*     transform: translateY(-50%);
/*     background: none;
/*     border: none;
/*     cursor: pointer;
/*     font-size: 18px;
/*     color: #555;
/*   }  */



.input-wrapper {
  position: relative;
  display: inline-block;
}


.input-wrapper {
  position: relative;
  display: inline-block;
}

.input-wrapper input {
  padding-right: 40px; /* espace pour le bouton */
  height: 36px;
  font-size: 16px;
  box-sizing: border-box;
}

.search-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #555;
  padding: 0;
  height: 100%;
  width: 30px;
}
















/* Le secret pour coller à droite */
.contact-actions {
  display: inline-flex;
  gap: .25rem;
  margin-left: auto;             /* <- pousse le bloc à l’extrémité droite */
}

/* Hover : corrige la faute de frappe */
.contact-actions .icon-btn {
  font-size: .75em;
  border: none;
  background: #fff;
  padding: 0;
  cursor: pointer;
  height: 2em;
  width: 2em;
}
.contact-actions .icon-btn:hover { /* (et pas .conatct-action) */
  background: #f3f3f3;
}

/* .contact-input-row { */
  /* display: flex; */
  /* align-items: center; */
  /* justify-content: space-between; /* espace entre input et boutons */
  /* gap: .5rem; */
/* } */

/* .contact-input-row input { */
  /* flex: 1; /* prend tout l’espace dispo à gauche */
/* } */

/* .contact-actions { */
  /* display: inline-flex; */
  /* gap: .25rem; */
/* } */

/* .contact-actions .icon-btn { */
  /* font-size: .75em; */
  /* border: none; */
  /* background: #fff; */
  /* padding: 0; */
  /* cursor: pointer; */
  /* height: 2em; */
  /* width: 2em; */
/* } */

/* .contact-actions .icon-btn:hover { */
  /* background: #f3f3f3; */
/* } */

/* .contact-input-row { display: flex; align-items: center; gap: .5rem; } */
/* .contact-input-row input { flex: 1; } */
/* .contact-badge { font-size:.9em; color:#666; } */
/* .contact-actions { display: inline-flex; gap: .25rem; } */
/* .contact-actions .icon-btn { font-size:.75em; border: none; background: #fff; padding:0; cursor: pointer; height: 2em; width: 2em;} */
/* .conatct-action .icon-btn:hover { background: #f3f3f3; } */


/* .contact-input-row { display:flex; align-items:center; gap:.5rem; } */
/* .contact-input-row input { flex:1; } */
/* .contact-badge { font-size:.9em; color:#666; } */
/* .contact-actions { display:inline-flex; gap:.25rem; } */
/* .icon-btn { border:1px solid #ccc; background:#fff; padding:.2rem .4rem; cursor:pointer; } */
/* .icon-btn:hover { background:#f3f3f3; } */




/* Badges de statut (optionnel, visuel) */
.chip { display:inline-block; padding:2px 8px; border-radius:12px; font-size:.85em; line-height:1.6; }
.chip--ok { background:#e9f7ef; }
.chip--danger { background:#fdecea; }


.site-editor{margin-top:12px;padding:12px;border:1px solid #eee;border-radius:12px; overflow: auto;max-height: clamp(280px, 50vh, 520px);}
.site-editor .row{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}
.site-editor label{display:flex;flex-direction:column;gap:6px}
.site-editor input,.site-editor select{padding:8px;border:1px solid #ddd;border-radius:8px}
.site-editor .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}

.label-group {
  display: grid;
  grid-template-columns: 20% 80%;
  gap: 1em;
}

/* ============================================================================================ */
/* PAGE ORDERS   PAGE ORDERS   PAGE ORDERS   PAGE ORDERS   PAGE ORDERS   PAGE ORDERS            */
/* ============================================================================================ */


  .row input.date-std { width: 246px; font-variant-numeric: tabular-nums; }

  .mr8 { text-align: right;}

  .grid-top3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;align-items:stretch}
  fieldset.fs{border:1px solid #c9c9c9;border-radius:8px;padding:10px;/* min-height:180px; */margin-bottom:15px;display:flex;flex-direction:column}
  fieldset.fs legend{font-weight:600}
  .fs .row{display:flex;align-items:center;gap:8px;margin-bottom:8px}
  .fs .row label{min-width:180px}
  .fs input[type=text],
  .fs input[type=email],
  .fs input[type=date],
  .fs input[type=number],
  .fs select,
  .fs textarea,
  .badge {flex:1;padding:6px; border: 1px solid #727272; border-radius: 3px; width:60%; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 0.8em;}
  .fs textarea{min-height:60px;}
  .fs textarea#CustomerDisplay {min-height:40px;}
  .fs input#totAfterTTC {border: 2px solid #444; font-weight: bold;}
  .grid-bottom{display:grid;grid-template-columns:2fr 1fr;gap:12px;margin-top:12px}
  .lines-display table{width:100%;border-collapse:collapse}
  .lines-display th, .lines-display td{border:1px solid #ddd;padding:6px;text-align:left}
  .totals-inline{display:flex;gap:16px;justify-content:flex-end;margin-top:8px}
  .right{text-align:right}
  .center{text-align:center}
  fieldset.fs.ops .buttons {
    display:flex;
    flex-direction:column;
    gap: 8px;
    width: 50%;
    text-align: center;
    margin: 0 auto;
    padding: 20px;
  }
  fieldset.fs.ops .buttons  button {
    cursor: pointer;
    height: 40px;
  }
  fieldset.fs.ops .dropdown  button {
    width: 100%;
  }
  fieldset.fs.ops .buttons a.button {
    display: flex;                /* Active Flexbox */
    align-items: center;         /* Centre verticalement */
    justify-content: center;     /* Centre horizontalement (optionnel) */

    text-decoration: none;
    background-color: #eee;
    font-size: .85em;
    border: 1px solid #727272;
    border-radius: 2px;
    height: 40px;
    color: black;
  }

  fieldset.fs.ops .buttons  a.button:hover {
    background-color: #dcdcdc;
  }
  
  
  /* 🔧 Largeur des boutons dans "Opérations" malgré le wrapper tooltip */
  fieldset.fs.ops .buttons .tooltip-container > *:first-child {
    /* display: block; */
    width: 100%;
    box-sizing: border-box;    text-align: center;
  }
  
  
  
  .second > div {
    background-color: yellow;
  }

  .row input.is-locked { background:#f7f7f7; cursor:pointer; }

  .date-field { display:inline-flex; align-items:center; gap:.4rem; }
  .date-field .dp-open { padding:.35rem .5rem; border:1px solid #ddd; border-radius:8px; background:#fafafa; cursor:pointer; }
  .date-field .dp-open:hover { background:#f2f2f2; }

  .dp {
    position: absolute; z-index: 9999; background:#fff; border:1px solid #ddd; border-radius:10px;
    box-shadow:0 10px 25px rgba(0,0,0,.08); width: 280px; font: 14px system-ui, sans-serif;
  }
  .dp[hidden]{ display:none; }
  .dp header{ display:flex; align-items:center; justify-content:space-between; padding:.5rem .75rem; border-bottom:1px solid #eee; }
  .dp header .nav{ display:flex; gap:.25rem; }
  .dp header button{ border:1px solid #ddd; background:#fafafa; border-radius:8px; padding:.25rem .45rem; cursor:pointer; }
  .dp header button:hover{ background:#f2f2f2; }
  .dp header .title{ font-weight:600; }

  .dp table{ width:100%; border-collapse:collapse; table-layout:fixed; }
  .dp th, .dp td{ text-align:center; padding:.4rem 0; }
  .dp thead th{ font-weight:600; color:#444; }
  .dp tbody td button{
    width: 2.1rem; height: 2.1rem; border:none; background:transparent; border-radius:999px; cursor:pointer;
  }
  .dp tbody td button:hover{ background:#f3f6ff; }
  .dp tbody td button.is-today{ outline: 2px solid #d9e6ff; }
  .dp tbody td button.is-selected{ background:#2156f7; color:#fff; }
  .dp .weekend{ color:#999; }


  #btnHistory {
      margin-left: 1.5rem;
  }
  #historyModal h2{
      color: #666;
  }
  #histClose {
      width: 15%;
      margin: auto;
  }

  /* ===== Modal Historique ===== */
  #historyModal .history-modal{
    max-width: 980px;
    width: calc(100vw - 48px);
    margin: 8vh auto 4vh;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    max-height: 85vh;                 /* <-- limite la hauteur à l’écran */
    display: flex;                    /* pour séparer header/body/actions */
    flex-direction: column;
  }

  #historyModal .history-header{
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .5rem;
    flex: 0 0 auto;                   /* parties fixes */
    background: #fff;                 /* évite l'effet "translucide" au scroll */
  }


  #historyModal .history-actions{
    display:flex; justify-content:flex-end; gap:.5rem;
    margin-top: .75rem; padding-top:.5rem; border-top:1px solid #e9e9e9;
    flex: 0 0 auto;                   /* parties fixes */
    background: #fff;                 /* évite l'effet "translucide" au scroll */

  }

  #historyModal .history-body{
    flex: 1 1 auto;                   /* prend l’espace restant */
    min-height: 0;                    /* indispensable pour que le overflow marche en flex */
    overflow: auto;                   /* défilement interne si beaucoup de lignes */
    -webkit-overflow-scrolling: touch;/* scroll fluide iOS */
    overscroll-behavior: contain;     /* bloque l’overscroll qui fait bouger la page derrière */
    padding-right: 4px;               /* un peu d’air pour la scrollbar */
  }

  #historyModal .history-body  {
    /* text-align:center; */
  }



  /* Carte d’un document */
  #historyModal .doc-card{
    border:1px solid #e5e7eb; border-radius:10px;
    padding: .6rem .75rem; margin: .75rem 0;
    background:#fff;
  }
  #historyModal .doc-head{
    display:flex; gap:.75rem; align-items: baseline; justify-content: space-between;
    margin-bottom: .4rem;
  }
  #historyModal .doc-head .meta{
    color:#555; font-size:.9rem;
  }

  /* grille lignes */
  #historyModal .lines-grid{
    display:grid;
    /* grid-template-columns: 56px minmax(120px, 1.2fr) 2.2fr 110px 130px 130px; */
    /* grid-template-columns: 50px minmax(120px, 1.2fr) 0.8fr 110px 100px 150px; */
    grid-template-columns: 5% 16% 35% 10% 20% 9%;
    gap: 6px 8px;
    align-items:center;
  }
  #historyModal .lines-grid.header{
    display:grid;
    /* grid-template-columns: 50px minmax(80px, 0.8fr) 2.2fr 100px 150px 100px; */
    grid-template-columns: 5% 16% 35% 10% 23% 6%;
    font-weight:600; border-bottom:1px solid #ccc; padding-bottom:4px; margin-bottom:6px;
  }
  #historyModal .cell-num{ text-align:center; color:#555; }
  #historyModal .cell-qty,
  #historyModal .cell-deliv,
  #historyModal .cell-rem{ text-align:right; }
  #historyModal .cell-deliv { text-align:center; }

  /* Masquer colonnes selon type (ex: OFFER: pas de Livré/Reste) */
  #historyModal .doc-card[data-type="OFFER"] .col-deliv,
  #historyModal .doc-card[data-type="OFFER"] .col-rem {
    display:none;
  }
  #historyModal .doc-card[data-type="OFFER"] .lines-grid{
    grid-template-columns: 56px minmax(120px, 1.2fr) 2.2fr 110px; /* 4 colonnes */
  }


 /* En-tête d’un document dans le modal Historique */
#historyModal .doc-head{
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* gauche | centre | droite */
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
#historyModal .doc-head .head-left{
  justify-self: start;
  display: flex;
  align-items: center;
  gap: .5rem;
}
#historyModal .doc-head .head-date{
  justify-self: center;
  opacity: .8;
  white-space: nowrap;
  font-weight: 700;
}
#historyModal .doc-head .head-status{
  justify-self: end;
  color: #f0ad4e;
}
#historyModal .doc-head .head-status strong{
  font-weight: 700; /* statut en gras */
}

#historyBody .hist-fold-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 2.05em;
    line-height: 1;
    padding: .15rem .2rem;
    margin-right: .35rem;
    width: auto;
 }


#peppolCheckModal .history-body{
    flex: 1 1 auto;                   /* prend l’espace restant */
    min-height: 0;                    /* indispensable pour que le overflow marche en flex */
    overflow: auto;                   /* défilement interne si beaucoup de lignes */
    -webkit-overflow-scrolling: touch;/* scroll fluide iOS */
    overscroll-behavior: contain;     /* bloque l’overscroll qui fait bouger la page derrière */
    padding-right: 4px;               /* un peu d’air pour la scrollbar */
    max-height: 450px;
}




  .doc-wrap.clickable { cursor: pointer; transition: background .15s ease; border: 2px solid #fff; border-bottom: 2px solid #ccc; }
  .doc-wrap.clickable:hover { background: #f7f9ff; border: 2px solid lightblue;}
  .doc-wrap.clickable:focus { outline: 2px solid #8ab4ff; outline-offset: 2px; }





  /* Petit badge type */
  .badge-type{
    display:inline-block; padding:.15rem .4rem; border-radius:.4rem;
    font-weight:600; font-size:.75rem;
    background:#e5e7eb; color:#374151;
  }
  .badge-type.OFFER   { background:#e9d5ff; color:#3d1f5e; }
  .badge-type.ORDER   { background:#bfdbfe; color:#1f2937; }
  .badge-type.DELIVERY{ background:#d1e7dd; color:#0f5132; }

  /* Toggle HTVA / TVAC */
  .toggle {
    --h: 24px; --w: 48px;
    display:inline-flex; align-items:center; gap:.5rem; cursor:pointer; user-select:none;
  }
  .toggle .track{
    position:relative; width:var(--w); height:var(--h); border-radius:999px; background:#e6e8ee; box-shadow:inset 0 0 0 1px #d0d4de;
    transition:background .2s ease;
  }
  .toggle .thumb{
    position:absolute; top:2px; left:2px; width:calc(var(--h) - 4px); height:calc(var(--h) - 4px);
    border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.15);
    transition:left .2s ease, transform .2s ease;
  }
  .toggle .label{ font-size:.9rem; color:#455; display:inline-flex; gap:.35rem; }
  .toggle .label .on{ opacity:.5; }
  .toggle .label .off{ opacity:1; }

  /* état ON (TVAC) — on utilise une classe ajoutée par JS */
  .toggle.on .track{ background:#d9ecff; box-shadow:inset 0 0 0 1px #a8d4ff; }
  .toggle.on .thumb{ left:calc(var(--w) - var(--h) + 2px); }
  .toggle.on .label .on{ opacity:1; }
  .toggle.on .label .off{ opacity:.5; }





/* 12 colonnes (OFFRE) : on masque “Livré” et “Reste” */
fieldset.fs.lines-display.cols-12 #linesHeader,
fieldset.fs.lines-display.cols-12 #linesGridBody > .container {
  display: grid !important;
  grid-template-columns:
  4%     /* # */
  4%     /* Type */
  12%    /* Réf */
  36%    /* Description */
  6%     /* Qté */
  5%     /* Unité */
  6%     /* PU */
  5%     /* Rem.% */
  4%     /* TVA% */
  6%     /* TVA */
  6%     /* TVAC */
  6%     /* Actions */;
  border-right: 1px solid rgb(118,118,118);
}

/* --- GARANTIE 14 colonnes (spec + !important pour écraser tout override) --- */
fieldset.fs.lines-display.cols-14 #linesHeader,
fieldset.fs.lines-display.cols-14 #linesGridBody > .container {
  display: grid !important;
  grid-template-columns:
    /* 4%  3% 12% 31% 5% 5% 5% 4% 6% 4% 4% 5% 5% 7%; */
  4%   /* # */
  3%   /* Type */
  12%  /* Réf */
  31%  /* Description */
  5%   /* Qté */
  5%   /* Livré */
  5%   /* Reste */
  4%   /* Unité */
  6%   /* PU */
  5%   /* Rem.% */
  4%   /* TVA% */
  5%   /* TVA */
  5%   /* TVAC */
  6%   /* Actions */;
  border-right: 1px solid rgb(118,118,118);
}



/* --- BASELINE : toujours en grid (évite tout "empilement vertical") --- */
.lines-display #linesHeader,
.lines-display #linesGridBody .container {
  display: grid !important;
}


/* En 14 colonnes, on (re)montre explicitement les cellules Livré/Reste */
.lines-display.cols-14 #linesHeader [data-col="delivered"],
.lines-display.cols-14 #linesHeader [data-col="remaining"],
.lines-display.cols-14 #linesGridBody .c-delivered,
.lines-display.cols-14 #linesGridBody .c-remaining {
  display: initial !important;
}




/* Masquage ciblé des colonnes Livré/Reste en mode 12 colonnes */
.lines-display.cols-12 #linesHeader [data-col="delivered"],
.lines-display.cols-12 #linesHeader [data-col="remaining"],
.lines-display.cols-12 #linesGridBody .c-delivered,
.lines-display.cols-12 #linesGridBody .c-remaining{
  display: none !important;
}




  #linesHeader > div,
  #linesGridBody .container > div {
    border: 1px solid rgb(118,118,118);
    border-right: none;
    padding: 3px 6px;       /* plus compact */
    font-size: 12px;        /* plus petit */
    line-height: 1.2;       /* resserré */
    background: #fff;
    overflow: hidden;       /* évite débordements */
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }
  /* Alternance lignes (le header n'a pas .line-row) */
  #linesGridBody .line-row:nth-child(odd) > div {
    background: #fafafa;
  }
  .c-actions { white-space: nowrap;     text-align: center; }           /* empêche le retour à la ligne */
  .c-actions button { font-size: 12px; padding: 2px 6px; }

  #linesGridBody .line-row .c-desc {text-align: left;}
  #linesGridBody .line-row .c-ref {text-align: left;}

/* Ligne "Adresse de livraison" fusionnée (picker + textarea) */
.delivery-wrap{
  display:grid;
  grid-template-columns: minmax(220px, 32%) 1fr;
  gap:12px;
}


/* Cache proprement le picker s'il est vide ou s'il n'y a qu'un seul site */
#SitePicker:is(:empty,[data-hidden="true"]){ display:none; }

#SitePicker {
  height: 67px;
  width: 100%;
}


/* Mise en page: liste au-dessus, textarea en dessous */
.delivery-col{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Liste des sites (scroll si contenu long) */
.site-picker{
  max-height: 220px;
  overflow: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 6px;
}

/* Un item = exactement 3 lignes: nom / adresse / ville+pays */
.site-item{
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}
.site-item:hover{ background: #f7f7f7; }
.site-item.selected{
  background: #eef6ff;
  outline: 2px solid #cfe8ff;
}

/* Typo des 3 lignes */
.site-item .line1{ font-weight: 600; }
.site-item .line2, .site-item .line3{ font-size: .92em; opacity: .95; }


/* Mise en page: fieldset (select) au-dessus, textarea en dessous */

/* --- Modal “Recherche document” --- */
/* Modal 650px */
#documentSearchModal .modal-content { width: 650px; margin-top: 20vh;  }

.form-rows-2col .row {
  display: grid;
  grid-template-columns: 100px 1fr; /* label | champ */
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.form-rows-2col label { font-weight: 600; }

.radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

/* Conteneur pour input avec bouton clear */
.clearable {
  position: relative;
}
.clearable input[type="text"] {
  /* width: 100%; */
  padding-right: 2rem; /* place pour la croix */
}

.clear-btn {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
  opacity: .6;
}
.clear-btn:hover { opacity: 1; }
.clear-btn[hidden] { display: none; }


/* .modal-content.modal-650 { width: 650px; } */

/* 2 colonnes : label | champ */
/* .form-rows-2col .row { */
  /* display: grid; */
  /* grid-template-columns: 180px 1fr; */
  /* gap: 10px; */
  /* align-items: center; */
  /* margin-bottom: 10px; */
/* } */
/* .form-rows-2col label { font-weight: 600; } */

/* Hint sous l'input client */

.hint{
  font-size: 12px;
  color: #666;
  margin-left: 200px;
  width: 450px;
}

/* Résultats */
.search-results {
  margin-top: 12px;
  border-top: 1px solid #e5e5e5;
  max-height: 320px;
  overflow: auto;
}
.search-results .doc-item {
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 160px 1fr 140px;
  gap: 10px;
}
.search-results .doc-item:hover { background: #f6f9ff; }
.search-results .doc-ref { font-weight: 600; }
.search-results .doc-meta { font-size: 12px; opacity: .85; }
.search-results .doc-total { text-align: right; white-space: nowrap; }







/* largeur spécifique au modal de recherche doc */
/* .modal-650 { width: 650px !important; } */

.form-rows-1col .row {
  display: grid;
  grid-template-columns: 180px 1fr; /* ← ajuste 180px si besoin */
  align-items: center;
  gap: 10px;
}

.form-rows-1col .row > label {
  text-align: right;
  font-weight: bold;
  white-space: nowrap;
}

/* grille 2 colonnes pour les 3 lignes (label à gauche, champ à droite) */
.form-rows-2col .row {
  display: grid;
  grid-template-columns: 180px 1fr; /* ← ajuste 180px si besoin */
  align-items: center;
  gap: 10px;
}

.form-rows-2col .row > label {
  text-align: right;
  font-weight: bold;
  white-space: nowrap;
}

/* zone input avec bouton '×' intégré */
.clearable {
  position: relative;
}
.clearable input {
  width: 100%;
  padding-right: 2rem;     /* espace pour le bouton '×' */
  box-sizing: border-box;
}

/* neutraliser la règle globale sur les boutons dans le modal */
.modal-content .clear-btn {
  width: auto !important;  /* ← écrase le 97% */
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #888;
  cursor: pointer;
}

/* placer le '×' dans le champ */
.clearable .clear-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 22px;
  width: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 28px;
}

/* affichage conditionnel si l'input a une valeur */
.clear-btn { visibility: hidden; }
.clearable.has-value .clear-btn { visibility: visible; }

/* un petit style pour le groupe radio */
.radio-group {
  display: flex;
  gap: 14px;
  align-items: center;
}



/* ===== Recherche products ====================== */

#productSearchModal .modal-content {
    width: 400px;
}

#psResults {
    margin-top: .7rem;
    border-top: 1px solid #eee;
    overflow-y: auto;
    max-height: calc(60vh - 140px);
    width: 400px;
}

/* ===== Recherche document (version cartes) ===== */
#documentSearchModal .results {
  margin-top: .75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 300px;
  overflow: auto;
  background: #fff;
}

#documentSearchModal .doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

#documentSearchModal .doc-item {
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
#documentSearchModal .doc-item:hover {
  background: #f8f9fa;
  border-color: #ddd;
}

#documentSearchModal .doc-line1 {
  display: grid;
  /* gap: 10px; */
  align-items: center;
  grid-template-columns:  42% 17% 41%;
}

#documentSearchModal .doc-line2,
#documentSearchModal .doc-line3 {
  display: grid;
  /* gap: 10px; */
  align-items: center;
  grid-template-columns: 1fr 160px;       /* client | total */
  margin-top: 6px;
}

#documentSearchModal .doc-ref {
  font-weight: 600;
}
#documentSearchModal .doc-date {
  text-align: left;
  white-space: nowrap;
}
#documentSearchModal .doc-status {
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  color: #555;
}
#documentSearchModal .doc-client {
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#documentSearchModal .doc-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#documentSearchModal .doc-line3 {
  margin-top: 4px;
  font-size: 12px;
  color: #666;
  /* display: grid; */
  /* gap: 10px; */
  /* align-items: center; */
 /*  grid-template-columns: 1fr 160px;   */     /* client | total */
  /* margin-top: 6px; */
}



/* Marque d'édition en cours */
.dirty-mark {
  margin-left: .4rem;
  color: #c00;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;

}

#dirtyMark {
  padding-top: 0.5em;
}


/* .badge {
  display: inline-block;
  padding: .2rem .5rem;
  font-size: .9rem;
  line-height: 1;
  border-radius: .4rem;
  font-weight: 600;
  border: 1px solid transparent;
} */

.badge-muted   { color: #374151; background: #e5e7eb; /* border-color: #d1d5db;  */}  /* gris */
.badge-info    { color: #1f2937; background: #bfdbfe; /* border-color: #93c5fd;  */}  /* bleu clair */
.badge-success { color: #0f5132; background: #d1e7dd; /* border-color: #badbcc;  */}  /* vert */
.badge-warning { color: #664d03; background: #fff3cd; /* border-color: #ffecb5;  */}  /* jaune */
.badge-danger  { color: #842029; background: #f8d7da; /* border-color: #f5c2c7;  */}  /* rouge */
.badge-purple  { color: #3d1f5e; background: #e9d5ff; /* border-color: #d8b4fe;  */}  /* violet */

  .blurred {
    filter: grayscale(0.8) blur(1px);
    opacity: .6;
    pointer-events: none;
  }

  .blurred { opacity:.5; pointer-events:none; filter:grayscale(0.4); }

/* ========== Livraison Modal ========== */

/* #partialDeliveryModal.modal.show .modal-content { */
    /* width: 600px; */
    /* margin-top: 10vh; */
/* } */



/* ==================== MODAL Livraison partielle (table-like) ==================== */

/* largeur & aspect de la modale */
#partialDeliveryModal .modal-content{
  max-width: 980px;             /* + large pour un tableau lisible */
  width: calc(100vw - 48px);
  margin: 8vh auto 4vh;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}

/* titre de la modale (optionnel si tu as un header) */
#partialDeliveryModal .modal-title{
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 0 10px;
}

/* barre d’actions en bas */
#partialDeliveryModal .pdeliv-actions{
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding-top: 0.6em;
  border-top: 1px solid #e9e9e9;
  margin: 0 auto;
  max-width: 45%;
}

#partialDeliveryModal .pdeliv-actions button {
    background-color: #67E78A;
    cursor: pointer;
}


#partialDeliveryModal .pdeliv-actions .muted{ color:#666; }

/* Griser l’arrière-plan (ta JS ajoute .blurred sur la grille) */
.blurred{ filter: blur(1px) opacity(.85); pointer-events: none; }

/* ===== Table “DIVs” (thead + body) ===== */

#partialDeliveryModal .pdeliv-grid{
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;                 /* masque la bordure interne sticky */
}

/* en-tête */
#partialDeliveryModal .pdeliv-grid .thead{
  position: sticky; top: 0; z-index: 2;
  display: grid;
  grid-template-columns: 5rem 10rem 1fr 7rem 7rem 8rem 9rem; /* N°, Réf., Désignation, Q. cmd, Livré, Reste, À livrer */
  background: #f5f7ff;
  color:#222;
  border-bottom: 1px solid #dcdcdc;
  font-weight: 600;
}
#partialDeliveryModal .pdeliv-grid .thead > div{
  padding: 8px 10px;
  white-space: nowrap;
}

/* corps */
#partialDeliveryModal #pdelivBody{
  max-height: 56vh;                /* scroll si long */
  overflow: auto;
}
#partialDeliveryModal #pdelivBody .tr{
  display: grid;
  grid-template-columns: 5rem 10rem 1fr 7rem 7rem 8rem 9rem;
  align-items: center;
  border-bottom: 1px solid #eee;
  background: #fff;
}
#partialDeliveryModal #pdelivBody .tr:nth-child(odd){ background:#fafafa; }
#partialDeliveryModal #pdelivBody .td{
  padding: 8px 10px;
  min-width: 0;                    /* pour l’ellipsis */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* helpers d’alignement (ta JS met .tc/.tr sur certaines cellules) */
#partialDeliveryModal #pdelivBody .td.tc{ text-align: center; }
#partialDeliveryModal #pdelivBody .td.tr{ text-align: right; }

/* champ de saisie “à livrer” */
#partialDeliveryModal #pdelivBody input.qty-to-ship{
  width: 7rem;
  padding: 6px 8px;
  border: 1px solid #cfd6e0;
  border-radius: 8px;
  background:#fff;
  text-align: right;
}
#partialDeliveryModal #pdelivBody input.qty-to-ship:focus{
  outline: 2px solid #bcd3ff;
  border-color: #89a9ff;
}

/* ===== Variante si tu utilises un <table> ===== */
/* #partialDeliveryModal table.pdeliv-table{ */
  /* width: 100%; */
  /* border-collapse: collapse; */
  /* table-layout: fixed; */
  /* border: 1px solid #ddd; */
  /* border-radius: 10px; */
  /* overflow: hidden; */
/* } */
/* #partialDeliveryModal table.pdeliv-table thead th{ */
  /* position: sticky; top: 0; z-index: 2; */
  /* background: #f5f7ff; */
  /* text-align: left; */
  /* font-weight: 600; */
  /* padding: 8px 10px; */
  /* border-bottom: 1px solid #dcdcdc; */
/* } */
/* #partialDeliveryModal table.pdeliv-table td{ */
  /* padding: 8px 10px; */
  /* border-bottom: 1px solid #eee; */
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
  /* white-space: nowrap; */
/* } */
/* #partialDeliveryModal table.pdeliv-table tbody tr:nth-child(odd){ background:#fafafa; } */
/* #partialDeliveryModal table.pdeliv-table input.qty-to-ship{ */
  /* width: 7rem; */
  /* padding: 6px 8px; */
  /* border: 1px solid #cfd6e0; */
  /* border-radius: 8px; */
  /* background:#fff; */
  /* text-align: right; */
/* } */

/* ===== Responsive ===== */
@media (max-width: 760px){
  #partialDeliveryModal .pdeliv-grid .thead,
  #partialDeliveryModal #pdelivBody .tr{
    /* on compacte: on fusionne Réf. + Désignation, et on réduit les colonnes chiffrées */
    grid-template-columns: 3.8rem 1fr 5.5rem 5.5rem 6rem 7rem; /* N°, Ref+Desc, Cmd, Liv., Reste, À livrer */
  }
  /* masquer la colonne Réf. si tu as une cellule combinée Réf.+Desc ;
     si tu veux conserver la colonne Réf. distincte, commente cette règle. */
  #partialDeliveryModal #pdelivBody .td.col-ref,
  #partialDeliveryModal .pdeliv-grid .thead .col-ref{ display:none; }

  #partialDeliveryModal .modal-content{ margin: 5vh auto; }
}

/* petits boutons “secondaires” */
#partialDeliveryModal .btn-ghost{
  background: transparent; border: 1px solid #d7d7d7; border-radius: 8px;
  padding: .45rem .7rem; cursor: pointer;
}
#partialDeliveryModal .btn-ghost:hover{ background:#f6f6f6; }

/* bouton action principal */
#partialDeliveryModal .btn-primary{
  /* background:#2156f7; color:#fff; border:1px solid #2156f7; border-radius: 8px; */
  padding:.55rem .9rem; cursor:pointer; font-weight:600;
}
#partialDeliveryModal .btn-primary:disabled{ opacity:.6; cursor:not-allowed; }






/*.modal-content.modal-narrow { max-width: 720px; }                                  */

/* .form-rows .row {                                                                 */
/*   display: grid;                                                                  */
/*   grid-template-columns: 180px 1fr; /* label | champ */                           */
/*   gap: 10px;                                                                      */
/*   align-items: center;                                                            */
/*   margin-bottom: 10px;                                                            */
/* }                                                                                 */
/*                                                                                   */
/* .form-rows .row > label { font-weight: 600; }                                     */
/*                                                                                   */
/* .field-with-button { display: flex; align-items: center; gap: 8px; }              */
/*                                                                                   */
/* .modal-actions {                                                                  */
/*   display: flex;                                                                  */
/*   justify-content: flex-end;                                                      */
/*   gap: 8px;                                                                       */
/*   margin-top: 8px;                                                                */
/* }                                                                                 */
/*                                                                                   */
/* .search-results {                                                                 */
/*   margin-top: 12px;                                                               */
/*   border-top: 1px solid #e5e5e5;                                                  */
/*   max-height: 320px;                                                              */
/*   overflow: auto;                                                                 */
/* }                                                                                 */
/* .search-results .item {                                                           */
/*   padding: 8px 6px;                                                               */
/*   border-bottom: 1px solid #f0f0f0;                                               */
/*   cursor: pointer;                                                                */
/* }                                                                                 */
/* .search-results .item:hover { background: #f6f9ff; }                              */



/* ==================== MODAL invoices_manager & deliveries_manager ==================== */


  /* Description sur 2 lignes max par défaut dans le modal Lignes du document */
  #docLinesModal .doc-desc-cell {
    max-width: 420px;
    vertical-align: top;
  }
  #docLinesModal .doc-desc-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
  }
  #docLinesModal .doc-desc-cell.expanded .doc-desc-text {
    -webkit-line-clamp: unset; /* on laisse tout s’afficher */
  }
  #docLinesModal .doc-desc-toggle {
    border: none;
    background: none;
    padding-left: .25rem;
    cursor: pointer;
    font-size: .8rem;
  }





/* ============================================================================================ */
/* PAGE UTILS      PAGE UTILS      PAGE UTILS      PAGE UTILS      PAGE UTILS      PAGE UTILS   */
/* ============================================================================================ */


.scrollable-config-table-container {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #ccc;
  position: relative;
  padding: 0; /* important */
  margin: 0;  /* important */
  width: 90%;
  margin: auto;
}

.styled-config-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.styled-config-table th,
.styled-config-table td {
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  /* vertical-align: top; */
  cursor: pointer;
  min-width: 80px;
}

.styled-config-table th {
  background-color: #c7e9c0; /* vert plus soutenu pour les en-têtes */
  font-weight: bold;
}

.styled-config-table tbody tr:nth-child(odd) {
  background-color: #eafbe8; /* vert très clair */
  cursor: pointer;
}

.styled-config-table tbody tr:nth-child(even) {
  background-color: #ffffff;
  cursor: pointer;
}

/* Fixe l'en-tête du tableau */
.styled-config-table thead th {
  position: sticky;
  top: 0;
 /*  background-color: #f5f5f5;  */ /* Choisis un fond bien visible, pas transparent */
  z-index: 10;                /* Plus haut que les lignes */
  border-bottom: 2px solid #ccc;
}
/* Fixer l’en-tête en haut du conteneur sans espace */
.styled-config-table thead tr th {
  /* position: sticky; */
  /* top: 0; */
  /* background-color: #f5f5f5; */
  /* z-index: 10; */
  /* border-bottom: 2px solid #ccc; */
  /* margin: 0; */
  cursor: pointer;
}

/* ============================================================================================ */
/* PAGE  deliveries manager      PAGE  deliveries manager      PAGE  deliveries manager         */
/* ============================================================================================ */

/* Table générique pour la liste manager */
.tbl{ width:100%; border-collapse: collapse; }
.tbl th, .tbl td{ border:1px solid #ddd; padding:6px 8px; }
.tbl thead th{ background:#f4f6f8; text-align:left; }



.btn-ready{
  background:#2156f7; color:#fff; border:1px solid #2156f7;
  padding:.35rem .6rem; border-radius:8px; /* font-weight:600; */ cursor:pointer;
}
.btn-ready[disabled]{ opacity:.6; cursor:not-allowed; }


.scrollable-grid-container {
  max-height: 650px;
  overflow-y: auto;
  /* border: 3px solid #ccc; */
  position: relative;
  padding: 0; /* important */
  margin: 0;  /* important */
  width: 100%;
  margin: auto;
}


.scrollable-grid-container .header-flex-container {
  margin-top: 1rem;
}

.grid-container {
  display: grid;
  grid-template-columns: 15% 12% 20% 20% 28%;
  /* grid-gap: 10px; */
  /* background-color: #2196F3; */
  /* border: 1px solid #444; */
  /* padding: 0.2em 0.5em; */
  font-weight: bold;
  width: 85%;
}

.grid-container > div {
  /* background-color: rgba(255, 255, 255, 0.8); */
  /* text-align: center; */
  padding: 0.25em 0.5em;

  background: #f4f6f8;
  /* font-size: 30px; */
  border: 1px solid #ccc;
  /* border-right: 0; */
}

.grid-deliveries{
  display: grid;
  grid-template-columns: 12% 12% 18% 22% 1fr;
  padding: 0 10px;
}

.grid-deliveries div.cell, div.head {
    border-bottom: 1px solid #ccc;
    padding: 5px;

}

.grid-deliveries .head{
  font-weight: 600;
}

.grid-deliveries .actions{ display:flex; gap:.35rem; flex-wrap:wrap; }


.btn-picking, .btn-lines, .btn-pdf, .btn-ship, .btn-hold, .btn-cancel, .btn-ready, .btn-unhold, #dlgFooter button, #dlgActions .btn, .btn-peppol-export {

  cursor: pointer;
  text-decoration: none;
  background-color: #eee;
  font-size: .85em;
  border: 1px solid #888;
  border-radius: 2px;
  padding: .15em .64em;
  color: black;
  font-size: small;
}

#docLinesModal.modal.show .modal-content.history-modal .history-actions .btn {

    padding: 0.6em 5%;
    background-color: #67E78A;
    color: #333;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
/*     font-family: sans-serif; */
	text-decoration: none;
	font-size: 13px;
}
#docLinesModal.modal.show .modal-content.history-modal .history-actions .btn:hover {
	background-color: #58D87A;
}

#docLinesModal.modal.show .modal-content.history-modal {
    max-width: 980px;
    width: calc(100vw - 48px);
    margin: 25h auto 4vh;
}

#docLinesModal.modal.show .modal-content.history-modal .history-actions .btns-inline,
#peppolCheckModal.modal.show .modal-content.history-modal .history-actions {
    text-align: center;
    margin-top: 2em;
}

#docLinesModal.modal.show .modal-content.history-modal .history-actions {
    display: inline;
}

#docLinesModal.modal.show .modal-content.history-modal .history-actions button{
    width: 15%;
    margin-bottom: 0;
}

#docLinesModal.modal.show .modal-content.history-modal tbody tr td:first-child {
    text-align: center;
}

.modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}




#peppolCheckModal.modal.show .modal-content.history-modal .history-actions button {
    width: 30%;
    margin-bottom: 0;
}

@media (max-width: 1100px){
  .grid-deliveries { grid-template-columns: 120px 100px 1fr 160px 280px; }
}
@media (max-width: 780px){
  .grid-deliveries { grid-template-columns: 100px 90px 1fr 140px 220px; }
}



/* ============================================================================================ */
/* PAGE products  PAGE products  PAGE products  PAGE products  PAGE products  PAGE products     */
/* ============================================================================================ */

fieldset.fs.search {
    min-height:80px;
    margin-top: 12px;
}

fieldset.fs.result {
    min-height:220px;
    margin-top: 12px;
}
fieldset.fs.result .container {
    display:grid;
    grid-template-columns: 120px 210px 1fr 100px 80px 90px 80px 90px 50px;
    gap:6px;
    align-items:center;
    border-bottom: 1px dashed #ccc;
}
fieldset.fs.result .row-item {
    display: grid;
    /* grid-template-columns: 110px 110px 1fr 100px 80px 90px 80px 90px 50px; */
    grid-template-columns: 110px 200px 1fr 100px 60px 70px 60px 0px 90px 50px;
    gap: 15px;
    align-items: center;
    border-bottom: 1px dashed #ccc;
}
fieldset.fs.result .container {
    border-bottom: none;
    /* border-bottom: 1px dashed #ccc; */
}
#listBody {
    border-top: 1px solid #ccc;
}
fieldset.fs.edit {
    margin-top: 12px;
}

#pager {
    margin-top:8px;
    display:flex;
    gap:8px;
    justify-content:flex-end;
}

#pager button {
    cursor: pointer;
}

.btnEdit {
    cursor: pointer;
}

#dlgLines {
    max-width:900px;
    width:90%;
}

.th { cursor: pointer; user-select: none; display:flex; align-items:center; gap:.35rem; }
.th .arrow { font-size:.85em; opacity:.65; }
.th.active { text-decoration: underline; }

.th .right{text-align:right}


/* Description d'article (liste produits) */
.prod-desc-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.prod-desc {
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 2 lignes visibles */
}

/* Quand on a cliqué sur l’icône => tout afficher */
.prod-desc-wrapper.expanded .prod-desc {
  -webkit-line-clamp: unset;
  max-height: none;
}

/* Bouton toggle (petite icône) */
.prod-desc-toggle {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 2px;
  line-height: 1;
}

/* Caché si la description ne dépasse pas 2 lignes */
.prod-desc-toggle.is-hidden {
  display: none;
}

/* ============================================================================================ */
/* PAGE WELCOME    PAGE WELCOME    PAGE WELCOME    PAGE WELCOME    PAGE WELCOME    PAGE WELCOME */
/* ============================================================================================ */

.welcome-wrapper {
    height: 100vh;
    background-image: url("../static/images/illustration.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-content {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 2em 3em;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
}

.welcome-content h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    color: #2a2a2a;
}

.welcome-content p {
    font-size: 1.2em;
    margin-bottom: 1.5em;
    color: #444;
}

.btn-start {
    background-color: #007bff;
    color: white;
    padding: 0.8em 1.5em;
    font-size: 1.1em;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn-start:hover {
    background-color: #0056b3;
}


/* ==================================================================================================== */
/* @MEDIA 1460px    @MEDIA 1460px     @MEDIA 1460px    @MEDIA 1460px    @MEDIA 1460px    @MEDIA 1460px  */
/* ==================================================================================================== */

/* @media screen and (max-width: 1460px) { */
  @media all and (max-width: 1460px) {
    html {
      font-size: 0.95em;
    }
    .c-actions button { font-size: 12px; padding: 1px 1px; }
    .fs .row label{ font-size: 11px; min-width:125px}
    .fs input[type=text], .fs input[type=date], .fs input[type=number]{max-width: 70%;}
  }
  .first-line-table-row {
    display: grid;
    grid-template-columns: 80px 350px 100px 490px 1fr 400px;
    gap: 5px;
    justify-items: center;
  
  }

/* ==================================================================================================== */
/* @MEDIA 1350px    @MEDIA 1350px     @MEDIA 1350px    @MEDIA 1350px    @MEDIA 1350px    @MEDIA 1350px  */
/* ==================================================================================================== */

/* @media screen and (max-width: 1350px) { */
@media all and (max-width: 1350px) {

  html {
    font-size: 0.75em;
  }
  #verifier-bce,
  #verifier-vat{
    height: 40px;
    width: 40px;
    font-size: 9px;
    padding: 1px 4px;
  }
    .label-input input {
    font-size: 1.1em;
  }
  
  .first-line-table-row {
    display: grid;
    grid-template-columns: 80px 350px 100px 490px 1fr 400px;
    gap: 5px;
    justify-items: center;
  
  }

}
/* ==================================================================================================== */
/* @MEDIA 1200px    @MEDIA 1200px    @MEDIA 1200px    @MEDIA 1200px    @MEDIA 1200px    @MEDIA 1200px   */
/* ==================================================================================================== */

/* @media screen and (max-width: 1200px) { */
@media all and (max-width: 1200px) {

  html {
    font-size: 0.6em;
  }
}
/* ==================================================================================================== */
/* @MEDIA 1000pxpx    @MEDIA 1000pxpx    @MEDIA 1000pxpx    @MEDIA 1000pxpx    @MEDIA 1000pxpx          */
/* ==================================================================================================== */

/* @media screen and (max-width: 1000px) { */
@media all and (max-width: 1000px) {

  html {
    font-size: 0.5em;
  }
}

/* ==================================================================================================== */
/* @MEDIA 900px     @MEDIA 900px     @MEDIA 900px     @MEDIA 900px     @MEDIA 900px     @MEDIA 900px    */
/* ==================================================================================================== */

/* @media screen and (max-width: 900px) { */
@media all and  (max-width: 900px){
  .delivery-wrap{ grid-template-columns: 1fr; }
}


/* ==================================================================================================== */
/* @MEDIA 820px     @MEDIA 820px     @MEDIA 820px     @MEDIA 820px     @MEDIA 820px     @MEDIA 820px    */
/* ==================================================================================================== */

/* @media screen and (max-width: 820px) { */
  @media all and (max-width: 820px) {
    .c-actions button { font-size: 10px; padding: 0px 1px; }
    .fs .row label{display: none;}
    .fs input[type=text], .fs input[type=date], .fs input[type=number]{max-width: 80%;}
  }

/* ==================================================================================================== */
/* @MEDIA 800px     @MEDIA 800px     @MEDIA 800px     @MEDIA 800px     @MEDIA 800px     @MEDIA 800px    */
/* ==================================================================================================== */

/* @media screen and (max-width: 800px) { */
@media all and (max-width: 800px) {

  body {
    margin: 0.5em;
  }
  .debug-context {
    display: none;
  }

  html {
    font-size: small;
  }

  .illustration img {
    max-width: 95%;
  }

  .image-wrapper img {
    max-width: 300px;
  }

  .first-line h1 {
    font-size: 1.3em;
    margin: 0;
    flex-grow: 0;
  }

  .first-line img {
    height: 25px;
    width: 25px;
  }

  .first-line .right-text button {
    /* display:none; */
  }

  .first-line .right-text {
    white-space: normal;
  }

  .first-line .right-text img {
    height: 25px;
    width: 25px;
  }

  .first-line .right-text .welcome div{
    display: flex;
    gap: 0.8em;
    margin: 0.5rem 3.5rem;
  }

  .status-line {
    flex-direction: column;
    align-items: center;
  }

  .status-image {
    margin-top: 1em;
  }

  .tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .tab {
    width: 7rem;
    font-size: 0.9rem;
    padding: 0.5em;
  }
  .tab.active {
    font-weight: bold;
    font-size: 1em;
  }

  .tab-content {
    display: none;
    border: 1px solid #ccc;
    border-top: none;
    padding: 0;
  }

  .tab-content.active {
    flex-direction: column;
    align-items: center;
    display: flex;
    justify-content: center;
    gap: 2em;
    flex-wrap: wrap;
  }

  .tab-content fieldset {
    width: 70%;
    margin-bottom: 1.5em;
  }

  .tab-content.search-mode fieldset {
    grid-template-columns: 1fr;
  }

  .tab-content.search-mode fieldset label {
    text-align: left;
    padding-bottom: 4px;
  }

  .modal.show .modal-content {
    margin-top: 10vh;          /* Fait glisser vers le bas */
    border: 4px solid green;
  }

  .mode-label {
    display: none;
  }
  .form-row {
    grid-template-columns: 100px 1fr;
  }


}

/* ==================================================================================================== */
/* @MEDIA 680px     @MEDIA 680px     @MEDIA 680px     @MEDIA 680px     @MEDIA 680px     @MEDIA 680px    */
/* ==================================================================================================== */

/* Responsive petit écran du modal */
/* @media screen and (max-width: 680px) { */
@media all and (max-width: 680px) {

  #documentSearchModal .doc-line1 {
    grid-template-columns: 1fr 100px; /* ref | date ; statut passe en dessous */
  }
  #documentSearchModal .doc-status {
    grid-column: 1 / -1;
    text-align: left;
  }
  #documentSearchModal .doc-line2 {
    grid-template-columns: 1fr 120px; /* client | total */
  }
}
/* ==================================================================================================== */
/* @MEDIA 450px     @MEDIA 450px     @MEDIA 450px     @MEDIA 450px     @MEDIA 450px     @MEDIA 450px    */
/* ==================================================================================================== */

/* @media screen and (max-width: 450px) { */
@media all and (max-width: 450px) {
  body {
    margin: 0px;
    /* border: 2px solid red; */
  }

  .debug-context,
  #session-timer,
  #horloge-fluide {
    display: none;
  }

  .form-row {
    display: block;
    grid-template-columns: none;
  }

  html {
    font-size: small;
  }

  .illustration img {
    max-width: 95%;
  }

  .first-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .first-line h1 {
    font-size: 1.3em;
    margin: 0;
    flex-grow: 0;
    width: 25%
  }

  .first-line img {
    height: 25px;
    width: 25px;
  }

  .first-line .right-text {
    white-space: normal;
  }
  .first-line .right-text button {
    display:none;
  }

  .first-line .right-text img {
    display: none;
  }
  .first-line .right-text .welcome {
      text-align: right;
  }
  .first-line .right-text .user-line {
    margin: 0 calc(28vw) 0 0;
  }

  .tooltip-container {
    margin-top: 1em;
  }

  .btn-logout {
    position: absolute;
    top: 20px;
  }

  .btn-home {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1em;
  }

  .btn-home button {
    padding: 0.4em 1.2em;
    font-size: 1em;
    cursor: pointer;
  }

  #create-modal-content {
    width: 300px;
  }

  .modal {
    left: 10%;
    top: 10%;
    width: 80%;
    height: 90%;
  }

  .modal-content {
    /* background-color: rgba(255, 255, 255, 0.65); */
  }

  .modal-content button[type="submit"] {
    display: flex;
    justify-content: center;
    width: 60%;
    margin: 2em auto 0 auto;
  }

  .modal.show .modal-content {
    margin-top: 10vh;
  }

  #registerModal.modal.show .modal-content {
    margin-top: 5vh;
  }

  .tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .tab {
    width: 4.5rem;
    font-size: 0.6rem;
    padding: 0;
  }
  .tab.active {
    font-weight: bold;
    font-size: 1em;
  }

  .tab-content {
    display: none;
    border: 1px solid #ccc;
    border-top: none;
    padding: 0;
  }

  .tab-content.active {
    display: list-item;
    align-content: stretch;
    justify-items: center;
  }

  .tab-content fieldset {
    width: 85%;
  }
  .grid-top3{display:block;}
}

