/* zone de modification */
.div-commande,
.div-avis,
.div-modification {
  color: black;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 80px auto;
  gap: 10px;
  border: none;
  background-color: inherit;
}
.div-commande:hover,
.div-avis:hover,
.div-modification:hover {
  opacity: 0.5;
  cursor: pointer;
}
.hidden {
  display: none;
}
/* mode edition */
.mode-edition {
  position: absolute;
  left: 0;
  top: 0;
  height: 59px;
  width: 100%;
  background-color: black;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
/* modal */
/* ══ Overlay ══ */
.modal-content-avis {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow: auto;
}
.modal-content {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow: auto;
}

/* ══ Modale (= inner box) ══ */
.modal-avis,
.modal {
  background: #fff;
  width: 90vw;
  height: 90vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.modal-avis h1,
.modal h2 {
  color: #3a5151;
  text-align: center;
  padding-bottom: 15px;
  font-size: 25px;
}

/* ══ Formulaire en colonnes flexibles ══ */
.modal form {
  font-family: Geist;
  color: #3a5151;
  display: flex;
  flex: 1;
  gap: 20px;
  overflow: hidden;
}
/* Chaque colonne prend un tiers et scroll si besoin */
.modal form > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.btn-validate,
.btn-delete {
  background-color: #3a5151;
  border: 1px solid white;
  border-radius: 10px;
  width: 50px;
  color: white;
  transition: 0.3s;
}
#cropper-cancel,
#cropper-apply,
#btn-submit {
  font-family: Geist;
  background-color: #3a5151;
  border: 1px solid white;
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  margin-top: 20px;
  color: white;
  transition: 0.3s;
}

.btn-delete:hover {
  background-color: red;
  border: 1px solid red;
  cursor: pointer;
  transition: 0.3s;
}
.btn-validate:hover,
#cropper-cancel:hover,
#cropper-apply:hover,
#btn-submit:hover {
  background-color: white;
  border: 1px solid #3a5151;
  color: #3a5151;
  cursor: pointer;
  transition: 0.3s;
}
.formulaire-modification-primaire label {
  margin-top: 20px;
}

/* ══ Quill – conteneurs fixes + scroll interne ══ */
.quill-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quill-editor .ql-container {
  flex: 1;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.quill-editor .ql-editor {
  height: 100%;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  box-sizing: border-box;
  padding: 10px;
}
.image-wrapper {
  position: relative;
  display: inline-block;
}

.btn-delete-img {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 0, 0, 0.7);
  color: white;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}
.image-preview {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.image-preview-gallery {
  display: inline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  overflow-y: auto;
}
#preview-couverture {
  width: 100%;
  height: 20%;
  object-fit: cover;
  margin-bottom: 20px;
}
/* modale ajout photo projet */
.ajout-projet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.btnp,
.btnp-line {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-top: 1px solid #b3b3b3;
  width: 420px;
  padding: 25px 0px 30px 0px;
}
.ajout-projet form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.ajout-projet .formulaire-photo {
  margin-bottom: 50px;
}
.ajout-projet form #title,
.ajout-projet form #category {
  margin: 10px auto;
  display: flex;
  justify-content: center;
  width: 420px;
  height: 51px;
  box-shadow: 0px 4px 14px 0px rgba(0, 0, 0, 0.09);
  border: none;
}
.custom-file-upload input[type='file'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  z-index: -1;
}
.custom-file-upload {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 4px;
  background-color: white;
  margin-bottom: 10px;
}
#preview {
  height: 100%;
  width: 30%;
  margin: 0px;
}
.custom-file-upload .btn-text {
  font-family: Geist;
  background-color: #3a5151;
  border: 1px solid white;
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 0.25em;
  color: white;
  transition: 0.3s;
}
.picture-file {
  color: #cbd6dc;
  font-size: 50px;
}
.custom-file-upload .btn-text:hover {
  background-color: white;
  border: 1px solid #3a5151;
  color: #3a5151;
}
.custom-file-upload:focus-within .btn-text {
  border: 1px solid black;
}
.file-info {
  font-size: 0.85em;
  color: #555;
}
/* ==== modal cropperjs ==== */

#cropper-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 10001;
}
.cropper-modal {
  opacity: 1;
  z-index: -1;
}

#cropper-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.cropper-modal-inner {
  width: 650px;
  height: 90vh;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 16px; /* padding global */
  box-sizing: border-box; /* important pour que ça n'agrandisse pas */
}

.cropper-container-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#cropper-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.cropper-buttons {
  margin-top: 12px; /* espace entre image et boutons */
  display: flex;
  justify-content: space-around;
}

#table-container {
  width: 100%;
  overflow-x: auto;
}

/* Table responsive */
.avis-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* facultatif pour conserver lisibilité */
}

.avis-table th,
.avis-table td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-align: left;
  white-space: nowrap; /* empêche le contenu de se casser */
}
/* Hauteur des lignes */
.avis-table tr {
  height: 60px;
}

.comment-cell {
  max-height: 50px; /* hauteur max de la cellule */
  overflow-y: auto; /* scroll vertical si contenu trop long */
  white-space: normal; /* autorise le retour à la ligne */
  word-wrap: break-word; /* coupe les mots si nécessaire */
  padding: 4px 8px;
}

/* === modal gestion des revenus === */
.modal-content-export,
.modal-content-ajout-commande,
.modal-content-gestion {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow: auto;
}
.modal-export,
.modal-ajout-commande {
  background: #fff;
  max-width: 90vw;
  width: 1300px;
  max-height: 85vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  margin: 80px auto !important;
  gap: 10px;
  color: #3a5151;
}
.modal-ajout-commande button {
  background-color: #3a5151;
  border: 1px solid white;
  border-radius: 8px;
  color: white;
  margin-top: 10px;
}
.modal-ajout-commande button:hover {
  background-color: white;
  border: 1px solid #3a5151;
  color: #3a5151;
  cursor: pointer;
}
.modal-ajout-commande label {
  display: flex;
  flex-direction: column;
  font-family: Geist;
  margin-top: 10px;
}
.modal-gestion {
  background: #fff;
  width: 90vw;
  height: 90vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.modal-gestion-periode {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  width: 100%;
  margin: 0 auto;
}
.modal-gestion-periode select {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  width: 110px;
  margin: 0 auto;
  border-radius: 8px;
  padding: 3px 15px;
}
.modal-gestion-centrale {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  height: 100%;
}
.modal-gestion-filtres {
  width: 100%;
  height: 85%;
  overflow: auto;
}
.modal-gestion-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.modal-gestion-table th,
.modal-gestion-table td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-align: left;
  white-space: nowrap;
}
.modal-gestion-table tr {
  height: 50px;
}
.modal-gestion-ajout-article {
  position: absolute;
  bottom: 20px;
  left: 20px;
  border-radius: 8px;
  background-color: white;
}
.modal-gestion-export {
  position: absolute;
  bottom: 20px;
  right: 20px;
  border-radius: 8px;
  background-color: white;
}
.modal-gestion-charges {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.modal-gestion-charges-secondaire {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.modal-gestion-charges-secondaire ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 0;
  padding: 0;
  border: 1px solid;
  border-radius: 8px;
}
.modal-gestion-charges-secondaire li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 5px 15px;
}
.modal-gestion-charges-mensuel {
  display: flex;
  justify-content: center;
  align-items: start;
  margin: auto;
  width: 100%;
  gap: 10px;
}
.modal-gestion-qte-total-ventes {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.modal-gestion-qte-total-ventes-annuel {
  display: flex;
  gap: 10px;
}
.modal-gestion-charges-mensuel-table-qte,
.modal-gestion-charges-mensuel-table-trimestre {
  width: 50%;
  border-collapse: collapse;
  height: 50%;
}
.modal-gestion-charges-mensuel-table {
  width: 50%;
  border-collapse: collapse;
}
.modal-gestion-charges-mensuel-table-qte th,
.modal-gestion-charges-mensuel-table-qte td,
.modal-gestion-charges-mensuel-table-trimestre th,
.modal-gestion-charges-mensuel-table-trimestre td,
.modal-gestion-charges-mensuel-table th,
.modal-gestion-charges-mensuel-table td {
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-align: left;
  white-space: nowrap;
}
.modal-gestion-charges-mensuel-table tr {
  height: 30px;
}
#liste-articles-selectionnes {
  height: 60px;
  overflow: auto;
  border: 1px solid black;
}
.modal-ajout-commande h4 {
  margin: 0;
}
.modal-ajout-commande-enfant {
  display: flex;
  justify-content: space-around;
  width: 100%;
  gap: 80px;
}
@media (max-width: 1498px) {
  .modal-gestion-centrale {
    flex-direction: column;
  }
  .modal-gestion-filtres {
    height: 35%;
    border: 1px solid black;
  }
  .modal-gestion-centrale {
    height: 86%;
    gap: 20px;
  }
  .modal-gestion-charges-secondaire {
    position: absolute;
    bottom: 20px;
    right: 230px;
  }
}
@media (max-width: 768px) {
  .modal,
  .modal-avis,
  .modal-gestion {
    width: 100vw;
    height: 100vh;
    border-radius: 0px;
  }
  .modal-gestion-centrale {
    gap: 0px;
  }
  .modal-gestion-charges-secondaire li {
    gap: 0px;
    padding: 0px 13px;
  }
  .modal form {
    flex-direction: column-reverse;
    overflow: auto;
  }
  .modal form > div {
    overflow: initial;
  }
  #editor-descriptionComplete p {
    height: 200px;
  }
  .formulaire-modification-primaire {
    height: auto;
  }
  .formulaire-modification-secondaire {
    height: 200px;
  }
}
@media (max-width: 690px) {
  .modal-gestion-charges {
    overflow-y: auto;
  }
  .modal-gestion-charges-mensuel {
    flex-direction: column;
  }
  .modal-gestion-charges-mensuel-table {
    width: 100%;
    margin-top: 10px;
  }
  .modal-gestion-filtres {
    height: 100%;
  }
  .modal-gestion-charges-mensuel-table-trimestre,
  .modal-gestion-qte-total-ventes-annuel,
  .modal-gestion-qte-total-ventes {
    width: 100%;
  }
  .modal-gestion-charges-secondaire {
    position: initial;
  }
}
@media (max-width: 590px) {
  .modal-gestion-periode {
    width: 45%;
    justify-content: start;
    margin: 0;
  }
  .modal-ajout-commande h3 {
    font-size: 24px;
  }
  .modal-ajout-commande h4 {
    font-size: 18px;
  }
  .modal-ajout-commande-enfant {
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    width: 100%;
    margin: auto;
    overflow: auto;
    border: 1px solid black;
  }
  .modal-ajout-commande-enfant > div {
    width: 90% !important;
    margin: 0 auto;
  }
  .modal-ajout-commande {
    background: #fff;
    max-width: none;
    max-height: none;
    width: 100vw;
    height: 100vh;
    border-radius: 1px;
    margin: 0px auto !important;
    gap: 10px;
    color: #3a5151;
  }
}
@media (max-width: 375px) {
  .modal-gestion-qte-total-ventes {
    font-size: 11px;
  }
  .btn-close {
    top: 10px;
    right: 10px;
  }
}
@media (max-width: 320px) {
  .modal-gestion-qte-total-ventes {
    font-size: 8px;
  }
}
