/* === STYLE GLOBAL === */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  min-height: 100vh;
}
.dashboard-container {
    max-width: 70%;
    margin: 40px auto;
    text-align: center;
}
.module-btn {
    display: inline-block;
    padding: 20px 30px;
    margin: 15px;
    background: #d9e4ff;
    border-radius: 10px;
    font-size: 20px;
    text-decoration: none;
    color: #003;
    transition: 0.2s;
}
.module-btn:hover {
    background: #bcd0ff;
}

/* === LOGIN PAGE === */
.login-box {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  text-align: center;
  margin: 100px auto;
}

.login-box .logo {
  width: 70px;
  margin-bottom: 15px;
}

.login-box h2 {
  color: #0077cc;
  margin-bottom: 25px;
  font-size: 20px;
}

.login-box label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  text-align: left;
  color: #333;
  font-size: 14px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 14px;
}

.login-box input[type="submit"] {
  width: 100%;
  background-color: #0077cc;
  color: white;
  border: none;
  padding: 10px;
  font-size: 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.login-box input[type="submit"]:hover {
  background-color: #005fa3;
}

.login-box .error {
  color: #dc3545;
  margin-top: 10px;
  font-size: 14px;
}

/* === NAVBAR === */
.navbar {
  background-color: #0077cc;
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 20px;
  margin: 0;
}

.navbar a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-weight: bold;
}

.navbar a:hover {
  text-decoration: underline;
}
/* ===== HEADER BLEU UNIFIÉ (COULEUR #0077cc) ===== */

.header-4j {
  background: #0077cc; /* ton bleu historique */
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);

  /* Collé en haut */
  position: fixed;
  top: 0;
  left: 0;
  width: 97%;

  /* Toujours au-dessus du contenu */
  z-index: 9999;
}

/* Pour éviter que le contenu passe sous le header */
body {
  margin: 0;
  padding-top: 70px; /* hauteur du header */
}

/* Zone gauche : icône + titre */
.header-left {
  display: flex;
  align-items: center;
}

.header-left i {
  margin-right: 10px;
  font-size: 22px;
}

/* Zone droite : menu */
.header-right {
  display: flex;
  align-items: center;
}

.header-right a {
  color: white;
  margin-left: 25px;
  text-decoration: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: 0.2s ease;
}

.header-right a i {
  margin-right: 6px;
  font-size: 16px;
}

/* Hover */
.header-right a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* Déconnexion */
.header-right a.logout {
  font-weight: bold;
}

.header-right a.logout i {
  font-size: 17px;
}

/* === CONTENU PRINCIPAL === */
.main-content {
  max-width: 90%;
  margin: 30px auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* === FICHE SAV EN-TÊTE === */
.fiche-sav {
  margin-bottom: 30px;
}

.fiche-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.fiche-col {
  flex: 1;
  background-color: #ffffff;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.fiche-col h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
  color: #333;
}

.fiche-col p {
  margin: 8px 0;
  font-size: 0.95em;
  color: #444;
}

[contenteditable="true"] {
  padding: 2px 4px;
  border: 1px dashed transparent;
  cursor: text;
}

[contenteditable="true"]:focus {
  border-color: #007bff;
  outline: none;
  background-color: #eef6ff;
}

.encarts { display: flex; gap: 20px; align-items: stretch;margin-bottom:20px; }
.encart-resultat, .encart-pieces-selection, .encart-pieces-ajout {
  flex: 1; background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 1px solid #e0e0e0;
  display: flex; flex-direction: column;
}
.btn-delete { background: none; border: none; color: red; cursor: pointer; }

.row-red {
  background-color: #ff9999; /* rouge clair */
}
/* ====== CADRES COMMENTAIRES & HISTORIQUE ====== */

.bloc-flex {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.bloc-cadre {
  flex: 1;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
}

/* ====== TIMELINE HISTORIQUE DES STATUTS ====== */

.timeline {
  border-left: 3px solid #ccc;
  padding-left: 15px;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: #3498db;
  border-radius: 50%;
  position: absolute;
  left: -21px;
  top: 3px;
}

.timeline-content {
  background: #f8f8f8;
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.old-status {
  margin-top: 5px;
  font-size: 12px;
  color: #555;
}

/* ====== COMMENTAIRES ====== */

.cadre-commentaires .commentaire {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cadre-commentaires .meta {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.cadre-commentaires .message {
  margin: 5px 0 0;
}


/* === FORMULAIRES === */
label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  text-align: left;
  color: #333;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === BOUTONS === */
button,
input[type="submit"],
.btn {
  background-color: #0077cc;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 15px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s ease;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
  background-color: #005fa3;
}

/* === TABLEAUX === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 14px;
}

th, td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: left;
}

/* === ACTIONS CENTRÉES === */
.actions {
  text-align: center;
  margin-top: 30px;
}

.actions form {
  display: inline-block;
  margin: 0 10px;
}

textarea[name="commentaire"] {
  height: 100px;
}

/* === IMPRESSION PDF === */
@media print {
  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .navbar,
  .actions,
  form {
    display: none;
  }

  .main-content {
    box-shadow: none;
    border: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  h2 {
    color: black;
    font-size: 22px;
    margin-bottom: 20px;
  }

  p {
    font-size: 14px;
    margin: 8px 0;
  }

  label {
    font-weight: bold;
  }

  textarea,
  select,
  input {
    display: none;
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .main-content {
    margin: 15px;
    padding: 20px;
  }

  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar a {
    margin: 10px 0 0 0;
  }
}

/* === STATUTS === */
.statut {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  color: white;
  font-size: 14px;
}

.statut.a-traiter {
  background-color: #f5930b;
}
.statut.en-attente-de-reception-du-materiel-dans-nos-locaux {
  background-color: #0d82f0; /* jaune foncé */
}
.statut.materiel-receptionne {
  background-color: #5cb85c; /* jaune foncé */
}
.statut.en-cours-d-expertise {
  background-color: #0d82f0; /* jaune foncé */
}
.statut.devis-reparation-envoye {
  background-color: #0d82f0; /* jaune foncé */
}
.statut.devis-pieces-detachees-envoye {
  background-color: #0d82f0; /* jaune foncé */
}
.statut.devis-accepte-en-cours-de-reparation {
  background-color: #5cb85c; /* jaune foncé */
}
.statut.devis-accepte-en-cours-de-commande {
  background-color: #5cb85c; /* jaune foncé */
}
.statut.pieces-recues-en-cours-de-reparation {
  background-color: #5cb85c; /* jaune foncé */
}
.statut.envoi-sav-fournisseur {
  background-color: #0d82f0; /* jaune foncé */
}
.statut.retour-sav-fournisseur {
  background-color: #5cb85c; /* jaune foncé */
}
.statut.materiel-repare {
  background-color: #5cb85c;
}
.statut.traite {
  background-color: #5cb85c;
}
.statut.refuse {
  background-color: #d9534f;
}
.statut.archive {
  background-color: #8b8787;
}



.cadre-commentaires {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  background-color: #f9f9f9;
  max-width: 700px;

  /* Limiter la hauteur à environ 2 commentaires */
  max-height: 200px;   /* ajuste selon la taille de tes commentaires */
  overflow-y: auto;    /* ajoute une barre de défilement verticale */
}

.commentaire {
  padding: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
}

.commentaire:last-child {
  border-bottom: none;
}

.meta {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 5px;
}

.message {
  font-size: 1em;
  color: #222;
}


/* === FORMULAIRE SAV === */

.sav-form {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sav-form label {
  font-weight: bold;
  font-size: 14px;
  color: #333;
}

.sav-form input[type="text"],
.sav-form input[type="email"],
.sav-form select,
.sav-form textarea {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

.sav-form textarea {
  height: 80px;
  resize: vertical;
}

.sav-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.sav-form input[type="submit"],
.sav-form .btn {
  background-color: #0077cc;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 15px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease;
}

.sav-form input[type="submit"]:hover,
.sav-form .btn:hover {
  background-color: #005fa3;
}

@media screen and (max-width: 600px) {
  .sav-form {
    padding: 20px;
  }

  .sav-form .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sav-form input[type="submit"],
  .sav-form .btn {
    width: 100%;
    text-align: center;
  }
}

/* === GALERIE PHOTOS === */

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.photo-gallery a {
  display: block;
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.photo-gallery a:hover {
  transform: scale(1.05);
}

.photo-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === DOCUMENTS INTERNES === */

.documents-internes {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1em;
  margin-top: 2em;
  padding: 1em;
  border: 2px solid #ccc;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.documents-internes li {
  margin-bottom: 0.5em;
}

.documents-internes a {
  color: #2980b9;
  text-decoration: none;
}

.documents-internes input[type="file"] {
  margin-top: 0.5em;
  margin-bottom: 1em;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  cursor: pointer;
}
.fiche-sav {
  margin-bottom: 30px;
}

.fiche-header {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.fiche-col {
  flex: 1;
  background-color: #ffffff;
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.fiche-col h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
  color: #333;
}

.fiche-col p {
  margin: 8px 0;
  font-size: 0.95em;
  color: #444;
}
.bloc-documents {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.bloc {
  flex: 1;
  min-width: 280px;
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 8px;
  background: #f9f9f9;
}

.button.danger {
  background-color: #d32f2f; /* rouge foncé */
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

button.danger:hover {
  background-color: #b71c1c; /* rouge encore plus foncé au survol */
}
button.valider {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 12px;
  margin-left: 8px;
  border-radius: 4px;
  cursor: pointer;
}

button.valider:hover {
  background-color: #388E3C;
}
form.champ-ligne {
  display: inline-flex;
  align-items: baseline; /* ✅ corrige l'alignement vertical */
  gap: 8px;
}

form.champ-ligne input[type="text"] {
  padding: 6px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  line-height: 1.4;
}

button.valider {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1.4;
}

button.valider:hover {
  background-color: #388E3C;
}
.modif-alert {
  color: #d32f2f;
  font-size: 13px;
  margin-left: 10px;
  font-style: italic;
}
/* Masquer la fiche à l'écran */
.impression-seule {
  display: none;
}

/* Afficher uniquement à l'impression */
@media print {
  @page {
    margin: 1cm;
  }

  body * {
    visibility: hidden;
  }
  html, body {
    height: auto;
    overflow: visible;
  }

  #fiche-imprimable {
    page-break-after: avoid;
    page-break-before: avoid;
  }

  #fiche-imprimable {
    display: block;
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 5px;
    font-family: Arial, sans-serif;
    min-height: 800px; /* environ une page A4 */

  }

  #fiche-imprimable * {
    visibility: visible;
  }
  .fiche-entete {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 30px;
  }
  
  .fiche-entete .client,
  .fiche-entete .infos {
    flex: 1;
    min-width: 250px;
  }
  .zone-annotation {
    height: 200px;
    width: 90%;
    border: 1px solid #333;
    padding: 10px;
    margin: 0 auto;
    border-radius: 6px;
    font-style: italic;
    color: #555;
  }
  .dossier h1 {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin: 40px 0 20px;
  }
  
  
  
}
/* pièces détachées */

.stock-red { 
  background-color: #ffcccc; 
}
.stock-orange { 
  background-color: #ffe5b4; 
}
.action-links a { 
  margin-right: 10px; 
  text-decoration: none; font-weight: bold; 
}
.action-links a:hover { 
  text-decoration: underline; 
}
.action-links a {
  margin-right: 10px;
  color: #0077cc;
  font-weight: bold;
  text-decoration: none;
}

.action-links a:hover {
  text-decoration: underline;
}

.home-choice {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}

.card-choice {
  background: #fff;
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  width: 250px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card-choice:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.card-choice img {
  max-width: 100px;
  margin-bottom: 15px;
}
.popup {
  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: 9999;
}

.popup-content {
  background: white;
  padding: 20px;
  width: 500px;
  border-radius: 8px;
}

.popup-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
}

.previewMail {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background: #f8f8f8;
  border: 1px solid #ccc;
}

/* projets liste */

.page-container {
  padding: 20px;
}
.titre-page {
  font-size: 22px;
  margin-bottom: 15px;
  color: #1f3c88;
}
.filters {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.filters label {
  font-weight: bold;
}
.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tableau th {
  background: #1f3c88;
  color: white;
  padding: 8px;
  text-align: left;
}
.tableau td {
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
}
.tableau tr:nth-child(even) {
  background: #f7f9fc;
}
.btn {
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-size: 15px;
}
.btn-blue {
  background: #1f3c88;
  color: white;
}
.btn-green {
  background: #2e8b57;
  color: white;
}
.btn-blue:hover,
.btn-green:hover {
  opacity: 0.9;
}
.statut {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  display: inline-block;
}
.statut-enlevement-par-nos-soins-chez-le-client { background:orange; }
.statut-prospect { background:#7f8c8d; }
.statut-en-cours { background:#2980b9; }
.statut-gagné,
.statut-gagne { background:#27ae60; }
.statut-perdu { background:#c0392b; }
.statut-facturé,
.statut-facture { background:#8e44ad; }

.formulaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: white;
  padding: 20px;
  border-radius: 6px;
}

.formulaire textarea {
  grid-column: span 2;
  height: 120px;
}

.bloc {
  background: white;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
}

.commentaires {
  background: #f7f7f7;
  padding: 10px;
  white-space: pre-wrap;
  border-radius: 4px;
}
.objectif-box {
  background: #f0f4ff;
  padding: 12px;
  border-left: 4px solid #1f3c88;
  border-radius: 4px;
  margin-top: 5px;
}

.objectif-ok {
  color: #2e8b57; /* vert */
  font-weight: bold;
}

.objectif-ko {
  color: #c0392b; /* rouge */
  font-weight: bold;
}
.objectif-box {
  background: #f0f4ff;
  padding: 12px;
  border-left: 4px solid #1f3c88;
  border-radius: 4px;
  margin-top: 10px;
}
.alert-success {
  background: #d4edda;
  padding: 10px;
  border-left: 4px solid #2e8b57;
  margin-bottom: 15px;
  border-radius: 4px;
}

/* Carte upload BL */
.card-bl {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 25px;
  text-align: center;
}

.card-bl h3 {
  margin-bottom: 15px;
}

.card-bl input[type="file"] {
  margin-bottom: 15px;
}

/* Bouton mobile uniquement */
.btn-mobile-only {
  display: none;
}

/* VERSION MOBILE */
@media (max-width: 768px) {

  .dashboard-container {
      width: 100% !important;
      max-width: 100% !important;
      padding: 0 15px !important;
      text-align: center !important;
      box-sizing: border-box !important;
  }

  .card-bl {
      padding: 15px;
  }

  .btn-mobile-only {
      display: block !important;
      width: 100%;
      margin-top: 20px;
  }
}

/* VERSION DESKTOP */
@media (min-width: 769px) {
  .btn-mobile-only {
      display: none !important;
  }
}
/* ------------------------------
   STYLE SPÉCIFIQUE LISTE BL
--------------------------------*/

.bl-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.bl-item {
  width: 150px;
  text-align: center;
}

.bl-miniature {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.bl-actions a {
  display: block;
  margin-top: 8px;
  color: #0077cc;
  font-weight: 600;
}

/* ------------------------------
 VERSION MOBILE
--------------------------------*/
@media (max-width: 768px) {

  .dashboard-container {
      width: 100% !important;
      max-width: 100% !important;
      padding: 0 15px !important;
      text-align: center !important;
      box-sizing: border-box !important;
  }

  .bl-item {
      width: 45%;
  }
}

/* ============================
   DASHBOARD — VERSION MOBILE
   ============================ */

   @media (max-width: 500px) {

    body {
        margin: 0 !important;
        padding-top: 110px !important; /* pour compenser ton header fixe */
    }

    .dashboard-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 15px !important;
        text-align: center !important;
    }

    .dashboard-container h2 {
        font-size: 20px !important;
        margin-bottom: 25px !important;
    }

    .module-btn {
        display: block !important;
        width: 100% !important;
        padding: 18px 20px !important;
        margin: 12px 0 !important;
        font-size: 18px !important;
        border-radius: 12px !important;
        background: #d9e4ff !important;
        text-align: center !important;
    }
  
      /* Empêche tout scroll horizontal */
      html, body {
          overflow-x: hidden !important;
      }
  
      /* Header en colonne */
      .header-4j {
          display: flex;
          flex-direction: column;
          align-items: center; /* <-- CENTRAGE GLOBAL */
          width: 100% !important;
          padding: 12px 15px !important;
          box-sizing: border-box !important;
          text-align: center;
      }
  

        /* Conteneur du titre */
        .header-left {
            width: 100% !important;
            display: flex !important;
            flex-direction: row !important;
            justify-content: center !important;
            align-items: center !important;
            text-align: center !important;
            float: none !important;
            margin: 0 auto !important;
        }
    
        /* Icône du module */
        .header-left i {
            margin-right: 8px !important;
        }
  
      .header-right {
          width: 100%;
          display: flex;
          flex-wrap: wrap;
          gap: 10px;
          justify-content: center !important; /* <-- CENTRAGE DES BOUTONS */
          max-width: 100% !important;
          overflow-x: hidden !important;
      }
  
      .header-right a {
          padding: 8px 12px !important;
          font-size: 14px !important;
          margin: 0 !important;
          border-radius: 6px;
          background: rgba(255,255,255,0.15);
          white-space: nowrap;
      }
  
      /* Masquer le logout du header */
      .logout-desktop {
          display: none !important;
      }
  
      /* Bouton déconnexion mobile */
      .logout-mobile {
          display: block;
          width: 100%;
          text-align: center;
          margin-top: 10px;
      }
  
      .logout-mobile a {
          display: inline-block;
          padding: 12px 20px;
          background: #ff4d4d;
          color: white;
          border-radius: 8px;
          text-decoration: none;
          font-size: 16px;
      }
      /* Conteneur dashboard parfaitement centré */
    .dashboard-container {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 auto !important;
      padding: 0 15px !important;
      text-align: center !important;
      box-sizing: border-box !important;
  }

  /* Boutons en pleine largeur et centrés */
  .module-btn {
      display: block !important;
      width: 100% !important;   /* pas 82% */
      margin: 12px auto !important;
      text-align: center !important;
      box-sizing: border-box !important;
  }
  .btn-photo-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: linear-gradient(135deg, #0077cc, #0099ff);
    color: white;
    padding: 14px 22px;
    border-radius: 14px;

    font-size: 18px;
    font-weight: 600;
    cursor: pointer;

    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.35);
    transition: 0.25s ease;
}

.btn-photo-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 204, 0.45);
}

.btn-photo-premium i {
    font-size: 22px;
    animation: pulseCam 1.6s infinite ease-in-out;
}

@keyframes pulseCam {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.btn-photo-premium input {
    display: none;
}



  }
  
  /* Version desktop : masquer le logout mobile */
  @media (min-width: 769px) {
      .logout-mobile {
          display: none;
      }
  }
  /* Masquer header desktop sur mobile */
@media (max-width: 768px) {
  .header-4j {
      display: none !important;
  }
}

/* Header mobile général */
.header-mobile-general {
  display: none;
}

@media (max-width: 768px) {

  .header-mobile-general {
      display: block;
      width: 100%;
      background: #0077cc;
      color: white;
      padding: 15px 0;
      text-align: center;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 9999;
  }

  .header-mobile-title {
      font-size: 20px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
  }

  .header-mobile-title i {
      font-size: 22px;
  }

  .header-mobile-menu {
      margin-top: 10px;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 10px;
      padding: 0 10px;
  }

  .header-mobile-menu a {
      color: white;
      font-size: 14px;
      text-decoration: none;
      padding: 6px 10px;
      background: rgba(255,255,255,0.15);
      border-radius: 8px;
      white-space: nowrap;
  }

  /* Décalage du contenu */
  .dashboard-container {
      padding-top: 0px !important;
  }
}
/* Masquer header desktop sur mobile */
@media (max-width: 768px) {
  .header-4j {
      display: none !important;
  }
}

/* Header mobile BL */
.header-mobile-bl {
  display: none;
}

@media (max-width: 768px) {

  .header-mobile-bl {
      display: block;
      width: 100%;
      background: #0077cc;
      color: white;
      padding: 15px 0;
      text-align: center;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 9999;
  }

  .header-mobile-title {
      font-size: 20px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
  }

  .header-mobile-title i {
      font-size: 22px;
  }

  .header-mobile-menu {
      margin-top: 10px;
      display: flex;
      justify-content: center;
      gap: 15px;
  }

  .header-mobile-menu a {
      color: white;
      font-size: 15px;
      text-decoration: none;
      padding: 6px 10px;
      background: rgba(255,255,255,0.15);
      border-radius: 8px;
  }

  /* Décalage du contenu */
  .main-content {
      padding-top: 110px !important;
  }
}
/* Header mobile liste BL */
.header-mobile-liste-bl {
  display: none;
}

@media (max-width: 768px) {

  .header-mobile-liste-bl {
      display: block;
      width: 100%;
      background: #0077cc;
      color: white;
      padding: 15px 0;
      text-align: center;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 9999;
  }

  .header-mobile-title {
      font-size: 20px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
  }

  .header-mobile-title i {
      font-size: 22px;
  }

  .header-mobile-menu {
      margin-top: 10px;
      display: flex;
      justify-content: center;
      gap: 15px;
  }

  .header-mobile-menu a {
      color: white;
      font-size: 15px;
      text-decoration: none;
      padding: 6px 10px;
      background: rgba(255,255,255,0.15);
      border-radius: 8px;
  }
  #photo_bl {
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    opacity: 0;
}
.select-bl {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
}
.btn-delete {
  color: #d9534f;
  font-weight: 600;
}

  /* Décalage du contenu */
  .main-content {
      padding-top: 20px !important;
  }
}

/* ---------------- PAGE CRM ---------------- */

/* Masquer le header mobile CRM en desktop */

.crm-box {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.crm-box h3 {
  margin-top: 0;
  font-size: 20px;
  color: #333;
}

.crm-stats {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}

.crm-stat {
  background: #f4f4f4;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 16px;
}

.crm-row {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.crm-card {
  flex: 1;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.crm-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .crm-stats {
      flex-direction: column;
      gap: 10px;
  }

  .crm-row {
      flex-direction: column;
  }
}
 /* ajout client */

 .crm-box {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.crm-box h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
  color: #1f6feb;
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-box label {
  font-weight: 600;
  margin-top: 10px;
}

.crm-box input,
.crm-box select,
.crm-box textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  margin-top: 5px;
}

.btn-submit {
  background: #1f6feb;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 17px;
  border: none;
  cursor: pointer;
  margin-top: 20px;
}

.btn-submit i {
  margin-right: 8px;
}
/* Conteneur pour mettre les cadres côte à côte */
.crm-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

/* Chaque cadre prend 1/3 */
.crm-row .crm-box {
  flex: 1;
}

.crm-box h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 17px;
  color: #444;
  font-weight: 600;
}
.search-item {
  display: block;
  padding: 10px;
  background: #f7f7f7;
  border-radius: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #333;
}
.search-item:hover {
  background: #e9e9e9;
}
/* ============================
  FICHE CLIENT CRM
   ============================ */
   .crm-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.crm-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.crm-card h3 {
    margin-top: 0;
}
.contact-item {
    padding: 10px;
    background: #f7f7f7;
    border-radius: 8px;
    margin-bottom: 10px;
}
.btn-action {
    display: inline-block;
    padding: 10px 15px;
    background: #1f6feb;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
}
.btn-action i {
    margin-right: 6px;
}
.suggestions-box {
  background: #fff;
  border: 1px solid #ccc;
  position: absolute;
  width: 100%;
  z-index: 9999;
  display: none;
}

.suggestions-box div {
  padding: 8px;
  cursor: pointer;
}

.suggestions-box div:hover {
  background: #f0f0f0;
}
.contact-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px 50px 15px 15px;
  margin-bottom: 15px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.contact-header {
  font-weight: bold;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.contact-line {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.contact-line label {
  width: 90px;
  font-weight: 600;
  margin-right: 5px;
}

.contact-edit {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 3px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.contact-edit:focus {
  outline: none;
  border-bottom: 1px solid #007bff;
}

.contact-footer {
  position: absolute;
  right: 15px;
  top: 10%;
  transform: translateY(-50%);
}

.btn-delete-contact {
  background: #d9534f;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}





   @media (max-width: 768px) {

    /* Décalage du contenu à cause du header mobile */
    .main-content {
        padding-top: 120px !important;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Les cadres deviennent full-width */
    .crm-row {
        display: block !important;
    }

    .crm-card {
        width: 100% !important;
        margin-bottom: 20px;
    }

    /* Titres */
    .crm-card h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* Champs inline-edit */
    .autoedit {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border: 1px solid #d0d0d0;
        border-radius: 8px;
        margin-bottom: 10px;
        box-sizing: border-box;
    }

    textarea.autoedit {
        min-height: 90px;
    }

    /* Boutons d’action */
    .btn-action {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 16px;
        margin-top: 15px;
        border-radius: 10px;
    }

    /* Contacts */
    .contact-item {
        padding: 12px;
        font-size: 15px;
    }
    .contact-footer {
      position: absolute;
      right: 15px;
      top: 10%;
      transform: translateY(-50%);
    }
    

    /* Feedback ✓ */
    .oksave {
        font-size: 18px;
        margin-left: 8px;
    }

    /* Header mobile CRM */
    .header-mobile-crm {
        display: block;
        width: 100%;
        background: #1f6feb;
        color: white;
        padding: 15px 0;
        text-align: center;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9999;
    }

    .header-mobile-title {
        font-size: 20px;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .header-mobile-menu {
        margin-top: 10px;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0 10px;
    }

    .header-mobile-menu a {
        color: white;
        font-size: 15px;
        text-decoration: none;
        padding: 6px 10px;
        background: rgba(255,255,255,0.15);
        border-radius: 8px;
        white-space: nowrap;
    }
}


/* En mobile : les cadres passent en colonne */
@media (max-width: 768px) {
  .crm-row {
      flex-direction: column;
  }
}

.erp-test-marker{display:block!important;position:relative;z-index:300;background:#fff2ce;color:#704d00;border-bottom:1px solid #e9cf82;padding:9px 16px;text-align:center;font:600 12px/1.4 Arial,sans-serif;letter-spacing:.4px}
