
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333333;
  background-color: #f4f4f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: #FF7900;
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover {
  color: #cc6000;
}


/* ---------------------------------------------------------
   2. VARIABLES DE COULEUR
   On centralise les couleurs ici. Si un jour on veut changer
   la teinte d'orange, on ne modifie qu'une seule ligne.
--------------------------------------------------------- */
:root {
  --couleur-orange: #FF7900;
  --couleur-orange-fonce: #cc6000;
  --couleur-noir: #1a1a1a;
  --couleur-texte: #333333;
  --couleur-texte-clair: #888888;
  --couleur-fond: #f4f4f5;
  --couleur-blanc: #ffffff;
  --rayon-bordure: 10px;

  /* Teintes derivees de l'orange (memes couleurs, variantes translucides) */
  --orange-voile: rgba(255, 121, 0, 0.12);
  --orange-halo: rgba(255, 121, 0, 0.16);
  --orange-tint-fond: #fff6ec;

  /* Bordures neutres */
  --bordure-neutre: #e6e6e8;
  --bordure-neutre-active: #d2d2d6;

  /* Echelle d'ombres (meme noir translucide, plus nuance) */
  --ombre-carte: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --ombre-douce: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --ombre-relief: 0 4px 10px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.09);
  --ombre-orange: 0 4px 14px rgba(255, 121, 0, 0.35);
}

.page {
  display: flex;
  min-height: 100vh;
}


/* ---------------------------------------------------------
   4. SIDEBAR (menu de gauche)
--------------------------------------------------------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background-color: var(--couleur-noir);
  padding: 20px 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
  z-index: 5;
}

/* Logo + nom du site en haut de la sidebar */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: transform 0.25s ease;
}
.sidebar-logo a:hover img {
  transform: scale(1.06) rotate(-3deg);
}
.sidebar-logo span {
  color: var(--couleur-blanc);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Liste des liens du menu */
.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin: 2px 0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #aaaaaa;
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease,
              padding-left 0.2s ease, border-color 0.2s ease;
}

.sidebar-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--couleur-blanc);
  padding-left: 24px;
}

/* Lien actif = page actuellement affichee */
.sidebar-menu li.actif a {
  background-color: rgba(255, 121, 0, 0.15);
  color: var(--couleur-blanc);
  border-left: 3px solid var(--couleur-orange);
}

/* Petit badge rond orange avec une lettre (e / b) */
.badge-lettre {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--couleur-orange);
  color: var(--couleur-blanc);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(255, 121, 0, 0.4);
  transition: transform 0.2s ease;
}
.sidebar-menu li a:hover .badge-lettre {
  transform: scale(1.08);
}


/* ---------------------------------------------------------
   5. ZONE DE CONTENU (a droite de la sidebar)
--------------------------------------------------------- */
.contenu {
  flex: 1;
  padding: 18px;
  min-width: 0;
}

.contenu-large {
  max-width: 1000px;
  margin: 0 auto;
  animation: apparition-contenu 0.35s ease both;
}

@keyframes apparition-contenu {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ---------------------------------------------------------
   6. EN-TETE DE PAGE
   (bandeau blanc avec une icone + un titre de page)
--------------------------------------------------------- */
.entete-page {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--couleur-blanc);
  border-radius: var(--rayon-bordure);
  box-shadow: var(--ombre-carte);
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
/* Fin accent orange a gauche de l'en-tete */
.entete-page::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--couleur-orange);
}

.entete-page .icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--couleur-orange);
  color: var(--couleur-blanc);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--ombre-orange);
}

.entete-page h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--couleur-texte);
  letter-spacing: -0.01em;
}
.entete-page h1 span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--couleur-texte-clair);
  margin-top: 2px;
  letter-spacing: 0.02em;
}


/* ---------------------------------------------------------
   7. CARTES (remplacent les anciens "panel" Bootstrap)
--------------------------------------------------------- */
.carte {
  background-color: var(--couleur-blanc);
  border-radius: var(--rayon-bordure);
  box-shadow: var(--ombre-carte);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.25s ease;
}
.carte:hover {
  box-shadow: var(--ombre-relief);
}
.carte-recherche {
  overflow: visible;
}

.carte-titre {
  background-color: var(--couleur-orange);
  color: var(--couleur-blanc);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 20px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.carte-contenu {
  padding: 20px;
}

.carte-contenu ul {
  list-style: none;
}

.carte-contenu ul li {
  padding: 12px 0;
  border-bottom: 1px solid #eeeeee;
}
.carte-contenu ul li:last-child {
  border-bottom: none;
}

.carte-contenu ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--couleur-texte);
  font-weight: 500;
}
.carte-contenu ul li a:hover {
  color: var(--couleur-orange);
}
.carte-contenu ul li a::before {
  content: "\2192";
  color: var(--couleur-orange);
  font-weight: 700;
  transition: transform 0.18s ease;
}
.carte-contenu ul li a:hover::before {
  transform: translateX(3px);
}


/* ---------------------------------------------------------
   8. PAGE D'ACCUEIL
--------------------------------------------------------- */

/* Bandeau de bienvenue avec le logo */
.accueil-bandeau {
  display: flex;
  align-items: center;
  gap: 20px;
  background-color: var(--couleur-blanc);
  border-radius: var(--rayon-bordure);
  box-shadow: var(--ombre-carte);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.accueil-bandeau::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--couleur-orange);
}

.accueil-bandeau img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: var(--ombre-douce);
}

.accueil-bandeau h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--couleur-texte);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.accueil-bandeau h2 span {
  font-size: 15px;
  font-weight: 400;
  color: var(--couleur-texte-clair);
  margin-left: 8px;
}
.accueil-bandeau p {
  font-size: 13px;
  color: var(--couleur-texte-clair);
}

/* Bandeau "Vous souhaitez creer un scenario..." */
.accueil-intro {
  background-color: var(--couleur-noir);
  color: var(--couleur-blanc);
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  padding: 22px;
  border-radius: var(--rayon-bordure);
  margin-bottom: 24px;
  box-shadow: var(--ombre-douce);
  border-top: 3px solid var(--couleur-orange);
}

.accueil-etapes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.etape {
  background-color: var(--couleur-blanc);
  border-radius: var(--rayon-bordure);
  box-shadow: var(--ombre-carte);
  padding: 28px 24px;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.etape:hover {
  transform: translateY(-4px);
  box-shadow: var(--ombre-relief);
}

.etape-icone {
  font-size: 32px;
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--couleur-orange);
  width: 64px;
  height: 64px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 50%;
  background-color: var(--orange-tint-fond);
}

.etape h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--couleur-texte);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eeeeee;
  text-align: center;
}

.etape ul {
  list-style: none;
}

.etape ul li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 14px;
  color: var(--couleur-texte);
}

.etape ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--couleur-orange);
  font-weight: 700;
}


/* ---------------------------------------------------------
   9. RESPONSIVE (ecrans plus petits)
--------------------------------------------------------- */
@media (max-width: 900px) {
  .accueil-etapes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    position: static;
    height: auto;
  }
  .contenu {
    padding: 20px;
  }
  .accueil-bandeau {
    flex-direction: column;
    text-align: center;
  }
  .accueil-bandeau::before {
    display: none;
  }
}


/* ---------------------------------------------------------
   10. FORMULAIRES (pages Fiche entreprise / RIB)
--------------------------------------------------------- */
.formulaire-champ {
  margin-bottom: 16px;
  position: relative;
}

.formulaire-champ label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--couleur-texte);
  margin-bottom: 6px;
}

.formulaire-champ input[type="text"],
.formulaire-champ textarea,
.formulaire-champ select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--bordure-neutre);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--couleur-texte);
  background-color: var(--couleur-blanc);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
              background-color 0.2s ease;
}

.formulaire-champ input[type="text"]:hover,
.formulaire-champ textarea:hover,
.formulaire-champ select:hover {
  border-color: var(--bordure-neutre-active);
}

.formulaire-champ input:focus,
.formulaire-champ textarea:focus,
.formulaire-champ select:focus {
  outline: none;
  border-color: var(--couleur-orange);
  box-shadow: 0 0 0 3px var(--orange-halo);
}

/* Champs en lecture seule : leger fond grise pour les distinguer */
.formulaire-champ input[readonly],
.formulaire-champ textarea[readonly] {
  background-color: #fafafa;
  color: #555555;
  cursor: default;
}
.formulaire-champ input[readonly]:hover,
.formulaire-champ textarea[readonly]:hover {
  border-color: var(--bordure-neutre);
}
.formulaire-champ input[readonly]:focus,
.formulaire-champ textarea[readonly]:focus {
  box-shadow: none;
  border-color: var(--bordure-neutre);
}

.formulaire-deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.formulaire-trois-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 24px;
}

@media (max-width: 800px) {
  .formulaire-deux-colonnes,
  .formulaire-trois-colonnes {
    grid-template-columns: 1fr;
  }
}

/* Boutons d'action (Generer / Imprimer / Exporter) */
.barre-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease;
}
.bouton:active {
  transform: translateY(0);
}
.bouton i {
  font-size: 13px;
}

.bouton-principal {
  background-color: var(--couleur-orange);
  color: var(--couleur-blanc);
  box-shadow: 0 2px 6px rgba(255, 121, 0, 0.25);
}
.bouton-principal:hover {
  background-color: var(--couleur-orange-fonce);
  transform: translateY(-1px);
  box-shadow: var(--ombre-orange);
}
.bouton-principal:active {
  box-shadow: 0 1px 4px rgba(255, 121, 0, 0.3);
}

.bouton-secondaire {
  background-color: var(--couleur-blanc);
  color: var(--couleur-texte);
  border: 1.5px solid var(--bordure-neutre);
}
.bouton-secondaire:hover {
  border-color: var(--couleur-orange);
  color: var(--couleur-orange);
  background-color: var(--orange-tint-fond);
  transform: translateY(-1px);
}

/* Liste de suggestions (autocompletion NAF / banques) */
.suggestions {
  display: none;
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--couleur-blanc);
  border: 1px solid var(--bordure-neutre);
  border-radius: 8px;
  box-shadow: var(--ombre-relief);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
}

.suggestion-naf {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.12s ease, color 0.12s ease,
              padding-left 0.12s ease;
}
.suggestion-naf:last-child {
  border-bottom: none;
}
.suggestion-naf:hover {
  background-color: var(--orange-tint-fond);
  color: var(--couleur-orange);
  padding-left: 18px;
}

/* Sous-titre de section a l'interieur d'une carte */
.sous-titre {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--couleur-texte-clair);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}


/* ---------------------------------------------------------
   11. APERCU IMPRIMABLE (carte d'identite / RIB)
   C'est ce bloc qui s'affiche a l'ecran ET qui sort
   a l'impression (bouton "Imprimer").
--------------------------------------------------------- */
.apercu {
  border: 1.5px solid var(--bordure-neutre);
  border-radius: var(--rayon-bordure);
  overflow: hidden;
}

.apercu-entete {
  background-color: var(--couleur-noir);
  color: var(--couleur-blanc);
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.apercu-corps {
  padding: 20px;
  background-color: var(--couleur-blanc);
}

.apercu-ligne {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
.apercu-ligne:last-child {
  border-bottom: none;
}
.apercu-ligne span:first-child {
  color: var(--couleur-texte-clair);
}
.apercu-ligne span:last-child {
  font-weight: 600;
  color: var(--couleur-texte);
}

/* Au moment de l'impression : on cache la sidebar et les boutons */
@media print {
  .sidebar,
  .barre-actions,
  .entete-page {
    display: none;
  }
  .contenu {
    padding: 0;
  }
}

.formulaire-champ input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--bordure-neutre);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--couleur-texte);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.formulaire-champ input[type="date"]:hover {
  border-color: var(--bordure-neutre-active);
}
.formulaire-champ input[type="date"]:focus {
  outline: none;
  border-color: var(--couleur-orange);
  box-shadow: 0 0 0 3px var(--orange-halo);
}

/* ---------------------------------------------------------
   12. POPUP PERSONNALISE (remplace les alert() natifs)
--------------------------------------------------------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(2px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.popup-boite {
  background: var(--couleur-blanc);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  padding: 36px 32px 28px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.popup-icone {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--couleur-orange), #ff9a3c);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(255,121,0,0.35);
}

.popup-titre {
  font-size: 18px;
  font-weight: 700;
  color: var(--couleur-texte);
  margin-bottom: 10px;
}

.popup-message {
  font-size: 14px;
  color: var(--couleur-texte-clair);
  line-height: 1.6;
  margin-bottom: 24px;
}

.popup-fermer {
  min-width: 130px;
  justify-content: center;
}


/* ---------------------------------------------------------
   13. APERCU RIB IMPRIMABLE (style document bancaire officiel)
--------------------------------------------------------- */
.rib-document {
  position: relative;
  font-family: "Segoe UI", Arial, sans-serif;
  max-width: 700px;
  margin: 0 auto;
  color: #1a1a1a;
}

.rib-entete-banque {
  margin-bottom: 10px;
}

.rib-nom-banque {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}

.rib-date {
  font-size: 13px;
  color: var(--couleur-orange);
  font-weight: 600;
  margin-top: 6px;
}

.rib-separateur {
  border: none;
  border-top: 2px solid #1a1a1a;
  margin: 12px 0 20px;
}

.rib-section-titre {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  margin-top: 22px;
}

.rib-tableau {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}

.rib-tableau th,
.rib-tableau td {
  border: 1px solid #c0c0c0;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
}

.rib-tableau th {
  background-color: #f0f4ff;
  color: #2255aa;
  font-weight: 600;
  font-size: 13px;
}

.rib-tableau td {
  font-weight: 600;
  background: #fff;
}

.rib-tableau-iban td {
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.05em;
}

.rib-titulaire {
  margin-top: 22px;
  padding: 14px 16px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.rib-titulaire-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--couleur-texte-clair);
  margin-bottom: 4px;
}

.rib-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 42px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.06);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}


/* ---------------------------------------------------------
   14. IMPRESSION : n'afficher que l'apercu RIB
--------------------------------------------------------- */
@media print {
  .sidebar,
  .barre-actions,
  .entete-page,
  .carte:not(#apercu-rib),
  .carte-recherche {
    display: none !important;
  }

  #apercu-rib {
    display: block !important;
    box-shadow: none !important;
    border: none !important;
  }

  .carte-titre {
    display: none !important;
  }

  .contenu {
    padding: 10mm !important;
  }

  .rib-watermark {
    color: rgba(0, 0, 0, 0.08) !important;
    font-size: 52px !important;
  }

  body {
    background: white !important;
  }

  .popup-overlay {
    display: none !important;
  }
}


/* ---------------------------------------------------------
   15. PAGE RESSOURCES HUMAINES
--------------------------------------------------------- */
.disposition-formulaire-tableau {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .disposition-formulaire-tableau {
    grid-template-columns: 1fr;
  }
}

.tableau-donnees-conteneur {
  overflow-x: auto;
  border-radius: 8px;
}

table.tableau-donnees {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.tableau-donnees th {
  text-align: left;
  padding: 10px 14px;
  background-color: #fafafa;
  color: var(--couleur-texte-clair);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #eeeeee;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.tableau-donnees td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--couleur-texte);
}

table.tableau-donnees tbody tr {
  transition: background-color 0.12s ease;
}

table.tableau-donnees tr:hover td {
  background-color: var(--orange-tint-fond);
}

/* Colonne "N° securite sociale" (3e colonne) : plus large, sans retour a la ligne */
table.tableau-donnees th:nth-child(3),
table.tableau-donnees td:nth-child(3) {
  min-width: 180px;
  white-space: nowrap;
}

/* Colonne "Ville" (6e colonne) : plus large, sans retour a la ligne */
table.tableau-donnees th:nth-child(6),
table.tableau-donnees td:nth-child(6) {
  min-width: 160px;
  white-space: nowrap;
}

/* Colonne "Adresse" (4e colonne) : plus large, sans retour a la ligne */
table.tableau-donnees th:nth-child(4),
table.tableau-donnees td:nth-child(4) {
  min-width: 220px;
  white-space: nowrap;
}

.compteur-info {
  margin-top: 14px;
  font-size: 13px;
  color: var(--couleur-texte-clair);
}

.compteur-info strong {
  color: var(--couleur-orange);
}

.separateur {
  border: none;
  border-top: 1px solid #eeeeee;
  margin: 18px 0;
}

.aide-bloc {
  font-size: 12px;
  color: var(--couleur-texte-clair);
  margin-bottom: 10px;
}


/* ---------------------------------------------------------
   16. BARRE DE DEFILEMENT (touche discrete, teinte orange)
--------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #d8d8db transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: #d0d0d4;
  border-radius: 8px;
  border: 2px solid var(--couleur-fond);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--couleur-orange);
}

/* ---------------------------------------------------------
   17. RH — AMELIORATIONS VISUELLES DU TABLEAU
   (additif, scope au tableau des salaries)
--------------------------------------------------------- */

/* Le tableau se lit comme un bloc contenu, avec une fine bordure */
.tableau-donnees-conteneur {
  border: 1px solid var(--bordure-neutre);
  background-color: var(--couleur-blanc);
}

/* Zebrage leger : une ligne sur deux, pour suivre les lignes du regard */
table.tableau-donnees tbody tr:nth-child(even) td {
  background-color: #fafafa;
}

/* Colonne "Nom" (1re) : mise en avant comme ancre de lecture */
table.tableau-donnees td:nth-child(1) {
  font-weight: 600;
  color: var(--couleur-noir);
}

/* N° de securite sociale : chiffres a chasse fixe, bien alignes */
table.tableau-donnees td:nth-child(3) {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

/* Survol : reste prioritaire sur le zebrage */
table.tableau-donnees tbody tr:hover td {
  background-color: var(--orange-tint-fond);
}

/* Compteur : la valeur ressort dans une petite pastille orange */
.compteur-info strong {
  display: inline-block;
  background-color: var(--orange-voile);
  color: var(--couleur-orange-fonce);
  padding: 1px 9px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---------------------------------------------------------
   18. RH — AFFICHAGE INTEGRAL DU TABLEAU DES SALARIES
   (additif, scope au tableau des salaries ; le tableau tient
    dans la largeur disponible, sans barre de defilement)
--------------------------------------------------------- */

/* Plus de defilement horizontal : le tableau s'affiche en entier */
.tableau-donnees-conteneur {
  overflow-x: visible;
}

/* Padding un peu plus compact pour gagner de la place en largeur */
table.tableau-donnees th,
table.tableau-donnees td {
  padding: 9px 10px;
}

/* Repartition maitrisee des colonnes dans 100 % de la largeur */
table.tableau-donnees {
  table-layout: fixed;
  width: 100%;
}
table.tableau-donnees th:nth-child(1),
table.tableau-donnees td:nth-child(1) { width: 13%; }   /* Nom */
table.tableau-donnees th:nth-child(2),
table.tableau-donnees td:nth-child(2) { width: 11%; }   /* Prenom */
table.tableau-donnees th:nth-child(3),
table.tableau-donnees td:nth-child(3) { width: 28%; }   /* N° securite sociale (elargie) */
table.tableau-donnees th:nth-child(4),
table.tableau-donnees td:nth-child(4) { width: 24%; }   /* Adresse */
table.tableau-donnees th:nth-child(5),
table.tableau-donnees td:nth-child(5) { width: 7%;  }   /* C.P. */
table.tableau-donnees th:nth-child(6),
table.tableau-donnees td:nth-child(6) { width: 17%; }   /* Ville */

/* N° securite sociale : colonne large, numero garde sur une seule ligne */
table.tableau-donnees th:nth-child(3),
table.tableau-donnees td:nth-child(3) {
  min-width: 0;
  white-space: nowrap;
}

/* Adresse et Ville : reviennent a la ligne au lieu de deborder */
table.tableau-donnees th:nth-child(4),
table.tableau-donnees td:nth-child(4),
table.tableau-donnees th:nth-child(6),
table.tableau-donnees td:nth-child(6) {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   19. RH — CARTE(S) VITALE(S) (vraie-fausse, facsimile pedagogique)
   (additif ; liste de selection + fenetre modale 1 a N cartes)
--------------------------------------------------------- */

/* --- Liste de selection des salaries (cases a cocher) --- */
.liste-cases {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--bordure-neutre, #e2e2e5);
  border-radius: 8px;
  background: var(--couleur-blanc);
  padding: 4px;
}
.liste-cases-vide {
  padding: 10px 8px;
  font-size: 13px;
  color: var(--couleur-texte-clair);
}
.case-salarie {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.case-salarie:hover {
  background-color: var(--orange-tint-fond, #fff3e8);
}
.case-salarie span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-salarie input,
.case-tout input {
  accent-color: var(--couleur-orange);
  flex: 0 0 auto;
  cursor: pointer;
}
.case-tout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--couleur-texte-clair);
  cursor: pointer;
}

/* --- Fenetre modale --- */
.carte-vitale-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  overflow: auto;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(2px);
}
.carte-vitale-boite {
  background: var(--couleur-blanc);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  padding: 22px 24px 24px;
  max-width: 860px;
  width: auto;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}
.cv-modale-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eeeeee;
}
.cv-modale-titre {
  font-size: 16px;
  font-weight: 700;
  color: var(--couleur-texte);
}
.cv-modale-fermer {
  border: none;
  background: transparent;
  color: var(--couleur-texte-clair);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cv-modale-fermer:hover {
  background-color: #f2f2f2;
  color: var(--couleur-noir);
}

/* --- Grille des cartes (1 a N) --- */
.cv-grille {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}
.cv-carte-bloc {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cv-carte-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

/* Cadre qui reserve la place de la carte (permet la mise a l'echelle mobile) */
.cv-cadre {
  width: 380px;
  height: 240px;
  max-width: 100%;
}

/* La carte elle-meme : ratio carte bancaire ID-1 (85.6 x 54 mm) */
.carte-vitale {
  position: relative;
  width: 380px;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background-color: #3c9d7c;            /* vert assurance maladie, aplat */
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.cv-vagues {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cv-vague-1 { fill: #46ab88; }          /* aplats verts, sans degrade */
.cv-vague-2 { fill: #329070; }

.cv-embleme {
  position: absolute;
  top: 16px;
  left: 18px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #ffffff;
  color: #3c9d7c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.cv-titre {
  position: absolute;
  top: 20px;
  left: 58px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.cv-puce {
  position: absolute;
  top: 74px;
  left: 22px;
  width: 46px;
  height: 34px;
}
.cv-puce svg {
  display: block;
  width: 100%;
  height: 100%;
}
.cv-photo {
  position: absolute;
  top: 58px;
  right: 22px;
  width: 74px;
  height: 92px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.cv-photo-vide {
  color: #9bbbb0;
  font-size: 40px;
}
.cv-identite {
  position: absolute;
  left: 22px;
  bottom: 36px;
  right: 110px;
  text-align: left;
}
.cv-nom {
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-numero-label {
  margin-top: 8px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.cv-numero {
  margin-top: 1px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.cv-mention {
  position: absolute;
  left: 22px;
  bottom: 14px;
  font-size: 8px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.cv-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 40px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.carte-vitale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

/* Mise a l'echelle sur petits ecrans : la carte garde ses proportions */
@media (max-width: 440px) {
  .cv-cadre {
    width: 300px;
    height: 190px;
  }
  .cv-cadre .carte-vitale {
    transform: scale(0.789);        /* 300 / 380 */
    transform-origin: top left;
  }
  .carte-vitale-boite {
    padding: 16px;
  }
}

/* ---------------------------------------------------------
   20. IMPRESSION : n'afficher que la ou les cartes vitales
--------------------------------------------------------- */
@media print {
  body.impression-carte-vitale .page {
    display: none !important;
  }
  body.impression-carte-vitale .carte-vitale-overlay {
    position: static !important;
    display: block !important;
    padding: 0 !important;
    background: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }
  body.impression-carte-vitale .carte-vitale-boite {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.impression-carte-vitale .cv-modale-entete,
  body.impression-carte-vitale .cv-carte-actions,
  body.impression-carte-vitale .carte-vitale-actions {
    display: none !important;
  }
  body.impression-carte-vitale .cv-grille {
    gap: 14px !important;
  }
  body.impression-carte-vitale .cv-carte-bloc {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.impression-carte-vitale .carte-vitale {
    transform: none !important;
    box-shadow: none !important;
  }
  body.impression-carte-vitale {
    background: #ffffff !important;
  }
}
