:root {
  --bleu-principal: #145da0;
  --bleu-fonce: #0b3d66;
  --bleu-clair: #e8f2fb;
  --bleu-accent: #2b8fd6;
  --or: #d9a441;
  --vert: #2e8b57;
  --rouge: #c0392b;
  --gris-texte: #33404d;
  --gris-clair: #f4f7fa;
  --gris-bordure: #dbe4ec;
  --blanc: #ffffff;
  --rayon: 10px;
  --ombre: 0 2px 10px rgba(11, 61, 102, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--gris-clair);
  color: var(--gris-texte);
}

a { color: var(--bleu-principal); }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------------- ECRAN DE CONNEXION ---------------- */
#ecran-connexion {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu-principal));
  padding: 20px;
}

.carte-connexion {
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 400px;
  padding: 32px;
  text-align: center;
}

.carte-connexion img.logo { width: 240px; max-width: 100%; height: auto; margin-bottom: 8px; }
.carte-connexion h1 { font-size: 20px; color: var(--bleu-fonce); margin: 4px 0; }
.carte-connexion p.sous-titre { color: #6b7a89; font-size: 13px; margin-bottom: 24px; }

.champ { text-align: left; margin-bottom: 16px; }
.champ label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--gris-texte); }
.champ input, .champ select, .champ textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gris-bordure);
  border-radius: 6px;
  font-size: 14px;
  background: var(--blanc);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none;
  border-color: var(--bleu-accent);
  box-shadow: 0 0 0 3px rgba(43,143,214,0.15);
}

.bouton {
  display: inline-block;
  background: var(--bleu-principal);
  color: var(--blanc);
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.bouton:hover { background: var(--bleu-fonce); }
.bouton.large { width: 100%; padding: 12px; font-size: 15px; }
.bouton.secondaire { background: var(--blanc); color: var(--bleu-principal); border: 1px solid var(--bleu-principal); }
.bouton.secondaire:hover { background: var(--bleu-clair); }
.bouton.danger { background: var(--rouge); }
.bouton.danger:hover { background: #96261a; }
.bouton.petit { padding: 6px 10px; font-size: 12px; }
.bouton:disabled { opacity: 0.6; cursor: not-allowed; }

.erreur { color: var(--rouge); font-size: 13px; margin-top: 10px; min-height: 18px; }
.comptes-demo { margin-top: 20px; font-size: 11px; color: #8394a3; text-align: left; background: var(--gris-clair); border-radius: 6px; padding: 10px 12px; }
.comptes-demo b { color: var(--bleu-fonce); }

/* ---------------- STRUCTURE APPLICATION ---------------- */
#app {
  display: none;
  min-height: 100vh;
  grid-template-columns: 240px 1fr;
  display: grid;
}

.barre-laterale {
  background: var(--bleu-fonce);
  color: #cfe3f5;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

/* Barre superieure + bouton hamburger : caches par defaut (desktop), affiches uniquement en
   dessous de 860px (voir media query plus bas), ou la barre laterale devient un tiroir escamotable. */
.barre-mobile {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--bleu-fonce);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 1001;
}
.btn-menu-mobile {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  line-height: 1;
  padding: 4px 6px;
}
.logo-mobile { height: 32px; width: auto; border-radius: 4px; background: white; padding: 2px 4px; }

.fond-menu-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 61, 102, 0.45);
  z-index: 999;
}
.fond-menu-mobile.visible { display: block; }
.barre-laterale .entete-logo { padding: 0 18px 18px; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 12px; }
.barre-laterale .entete-logo img { width: 100%; max-width: 190px; height: auto; border-radius: 6px; background: white; padding: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: 14px;
  color: #cfe3f5;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.actif { background: rgba(255,255,255,0.12); border-left-color: var(--or); color: white; font-weight: 600; }
.nav-item .icone { font-size: 16px; width: 20px; text-align: center; }
.nav-item .chevron { margin-left: auto; font-size: 10px; color: #9fc1e0; transition: transform 0.15s; }
.nav-item.avec-sousmenu.actif .chevron { transform: rotate(180deg); }

.nav-sousmenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  background: rgba(0,0,0,0.14);
}
.nav-sousmenu.ouvert { max-height: 260px; }
.nav-sous-item {
  padding: 9px 20px 9px 50px;
  font-size: 13px;
  color: #a8c4dc;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-sous-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-sous-item.actif { color: white; font-weight: 600; border-left-color: var(--or); background: rgba(255,255,255,0.08); }

.bas-barre { margin-top: auto; padding: 14px 18px 0; border-top: 1px solid rgba(255,255,255,0.12); font-size: 12px; }
.bas-barre .utilisateur { font-weight: 600; color: white; margin-bottom: 2px; }
.bas-barre .role { color: #9fc1e0; text-transform: capitalize; margin-bottom: 10px; }

.zone-contenu { padding: 24px 32px; overflow-x: auto; }
/* Barre du haut : utilisateur connecte + deconnexion (2026-10-18). */
.colonne-principale { min-width: 0; display: flex; flex-direction: column; }
.barre-haut { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 10px 32px; background: white; border-bottom: 1px solid #e2e6ea; box-shadow: 0 1px 4px rgba(15, 40, 70, 0.05); }
.barre-haut-utilisateur { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-width: 0; }
.barre-haut .avatar-utilisateur { width: 30px; height: 30px; border-radius: 50%; background: #e8eef6; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.barre-haut .utilisateur { font-weight: 700; color: var(--bleu-fonce); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-haut .role { color: #3d5a78; background: #eef2f7; border-radius: 10px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.barre-haut #bouton-deconnexion { white-space: nowrap; }

.entete-page { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.entete-page h2 { margin: 0 0 4px; color: var(--bleu-fonce); }
.entete-page p.desc { margin: 0; color: #6b7a89; font-size: 13px; }

/* ---------------- CARTES / STATS ---------------- */
.grille-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.carte-stat { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; border-left: 4px solid var(--bleu-accent); }
.carte-stat.alerte { border-left-color: var(--rouge); }
.carte-stat.ok { border-left-color: var(--vert); }
.carte-stat .valeur { font-size: 26px; font-weight: 700; color: var(--bleu-fonce); }
.carte-stat .libelle { font-size: 12.5px; color: #6b7a89; margin-top: 4px; }
.carte-stat .lien-detail-carte { display: inline-block; margin-top: 12px; text-decoration: none; }

.panneau {
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 20px;
  margin-bottom: 20px;
}
.panneau h3 { margin-top: 0; color: var(--bleu-fonce); font-size: 16px; }

/* ---------------- TABLEAUX ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; padding: 10px 12px; background: var(--bleu-clair); color: var(--bleu-fonce); font-weight: 600; border-bottom: 2px solid var(--gris-bordure); white-space: nowrap; }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--gris-bordure); vertical-align: middle; }
tbody tr:hover { background: #fbfdff; }
/* En-tetes de colonne cliquables pour trier (ex: page Comptes utilisateurs) */
thead th.th-triable:hover { background: #dceafd; }
thead th.th-triable.actif { color: var(--bleu-principal, #145da0); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.badge.vert { background: #e5f5ea; color: var(--vert); }
.badge.rouge { background: #fbeae8; color: var(--rouge); }
.badge.bleu { background: var(--bleu-clair); color: var(--bleu-principal); }
.badge.gris { background: #eef1f4; color: #6b7a89; }
.badge.or { background: #fbf1de; color: #93701f; }

.cellule-obligation { text-align: center; }
.cellule-obligation .badge { padding: 3px 8px; font-size: 12px; }
/* Obligations mensuelles : couleurs foncees (2026-10-08, demande utilisateur "foncer les couleurs") --
   pastilles pleines vert / rouge fonce avec coche blanche, cases teintees, en-tete bleu fonce. */
.table-obligations thead th { background: #0f3d63; color: #fff; }
.table-obligations td.cellule-obligation.ok { background: #d3eedb; }
.table-obligations td.cellule-obligation.manque { background: #f8d7d3; }
.table-obligations .cellule-obligation .badge { padding: 4px 10px; font-size: 13px; min-width: 30px; }
.table-obligations .cellule-obligation .badge.vert { background: #146c34; color: #fff; }
.table-obligations .cellule-obligation .badge.rouge { background: #b3261e; color: #fff; }

.barre-outils { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.barre-outils input[type=text], .barre-outils select { padding: 9px 12px; border: 1px solid var(--gris-bordure); border-radius: 6px; font-size: 13.5px; min-width: 200px; }

.onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--gris-bordure); margin-bottom: 18px; }
.onglet { padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: #6b7a89; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglet.actif { color: var(--bleu-principal); border-bottom-color: var(--bleu-principal); }

/* ---------------- MODALES ---------------- */
.fond-modale {
  display: none;
  position: fixed; inset: 0; background: rgba(11,61,102,0.45);
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.fond-modale.visible { display: flex; }
.modale {
  background: var(--blanc); border-radius: var(--rayon); width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modale h3 { margin-top: 0; color: var(--bleu-fonce); }
/* Modale large (pharmacie : servir un patient) -- s'elargit avec son contenu, tableau defilant */
.modale.modale-large { max-width: 820px; }
.table-servir td, .table-servir th { padding: 6px 8px; font-size: 12.5px; vertical-align: middle; }
.table-servir input[type=text] { width: 100%; min-width: 160px; }
.table-servir input[type=number] { width: 64px; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.notif-encart {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
.notif-encart.info { background: var(--bleu-clair); color: var(--bleu-fonce); }
.notif-encart.attention { background: #fdf3e3; color: #93701f; }
.notif-encart.danger { background: #fbeae8; color: var(--rouge); }

.toast-conteneur { position: fixed; top: 62px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bleu-fonce); color: white; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 18px rgba(0,0,0,0.25); min-width: 240px; }
.toast.succes { background: var(--vert); }
.toast.erreur-t { background: var(--rouge); }

.legal-note { font-size: 11.5px; color: #8394a3; margin-top: 6px; line-height: 1.5; }

.dossier-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.dossier-entete .fiche-id { background: var(--bleu-clair); border-radius: 8px; padding: 14px 18px; }
.dossier-entete .fiche-id .num { font-size: 18px; font-weight: 700; color: var(--bleu-fonce); }

.ligne-consult { border-left: 3px solid var(--bleu-accent); padding: 10px 14px; margin-bottom: 10px; background: #fbfdff; border-radius: 6px; }
.ligne-consult .date { font-size: 12px; color: #6b7a89; font-weight: 600; }

/* ---------------- ACCUEIL / NOUVEAU PATIENT (poste de reception) ---------------- */
.grille-accueil {
  display: grid;
  grid-template-columns: minmax(320px, 1.3fr) minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
.grille-accueil .panneau { margin-bottom: 18px; }

/* Grille generique a 3 colonnes egales (ex: les 3 blocs du Portail Medecin -- session 9 suite,
   2026-10-06) -- meme principe de degradation progressive que .grille-accueil ci-dessus : passe a
   2 colonnes puis 1 colonne sur petit ecran (voir les media queries plus bas). */
.grille-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.grille-3 .panneau { margin-bottom: 0; }

/* Portail Medecin pendant une consultation (2026-10-06) : le bloc 2 (formulaire de consultation a
   onglets, reprenant la grille de constantes de l'ancien systeme HFSQL) s'elargit sur 2 colonnes,
   les blocs 1 et 3 se partagent la colonne de gauche, l'un sous l'autre. */
.grille-portail-consultation {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}
.grille-portail-consultation .panneau { margin-bottom: 0; }
.colonne-portail { display: flex; flex-direction: column; gap: 16px; }
/* Portail Medecin, consultation ouverte : les 3 blocs restent sur la meme ligne (demande
   utilisateur 2026-10-06), le bloc 2 (formulaire) plus large que les files d'attente. */
.grille-portail-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.grille-portail-3 .panneau { margin-bottom: 0; }
.grille-portail-3 table { font-size: 12.5px; }
.grille-portail-3 th, .grille-portail-3 td { padding-left: 8px; padding-right: 8px; }
/* Le bloc 2 est plus etroit qu'avant (3 colonnes) : constantes sur 3 colonnes, l'unite peut passer
   sous le champ sans chevaucher la colonne voisine. */
.grille-portail-3 .grille-constantes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille-portail-3 .constante { flex-wrap: wrap; }
@media (max-width: 1500px) { .grille-portail-3 .grille-constantes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Formulaire de consultation a onglets (bloc 2) */
.onglets-consultation { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--gris-bordure); margin: 0 16px 12px; }
.onglets-consultation .onglet { padding: 8px 12px; font-size: 12.5px; }
.volet-consultation { padding: 0 16px; }
.volet-consultation.masque { display: none; }
.cadre-consultation { border: 1px solid var(--gris-bordure); border-radius: 8px; padding: 10px 12px 6px; margin-bottom: 12px; position: relative; }
.cadre-consultation > legend, .cadre-consultation .legende { position: absolute; top: -8px; left: 10px; background: white; padding: 0 6px; font-size: 11.5px; font-weight: 700; color: var(--bleu-principal); text-transform: uppercase; letter-spacing: .4px; }
/* Grille dense de constantes : libelle + champ + unite sur une meme ligne, 4 par rangee. */
.grille-constantes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; }
.constante { display: flex; align-items: center; gap: 6px; min-width: 0; }
.constante label { font-size: 12px; color: var(--gris-texte); white-space: nowrap; flex: 0 0 auto; }
.constante input[type=number], .constante input[type=text], .constante select { flex: 1 1 50px; min-width: 0; padding: 6px 7px; font-size: 13px; border: 1px solid var(--gris-bordure); border-radius: 6px; }
.constante input[type=number]:focus, .constante input[type=text]:focus, .constante select:focus { outline: none; border-color: var(--bleu-accent); }
.constante .unite { font-size: 11.5px; color: #8394a3; white-space: nowrap; flex: 0 0 auto; }
.constante.large { grid-column: span 2; }
.constante.case { gap: 8px; }
.constante.case input[type=checkbox] { width: 16px; height: 16px; }
.table-generalite { font-size: 11.5px; }
/* Caisse par categorie (poste d'accueil, 2026-10-06) : un bloc remise/encaissement par recu. */
.caisse-groupe { border: 1px solid var(--gris-bordure); border-left: 4px solid var(--bleu-principal); border-radius: 8px; padding: 10px 12px 6px; margin-bottom: 10px; background: #fbfcfd; }
.caisse-groupe-titre { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; color: var(--bleu-principal); margin-bottom: 8px; }
.caisse-groupe .grille-2 { gap: 8px 12px; }
.caisse-groupe .champ { margin-bottom: 8px; }
.caisse-groupe .recap-caisse { margin-top: 2px; }
.table-generalite th, .table-generalite td { padding: 5px 6px; white-space: nowrap; }
@media (max-width: 1380px) { .grille-constantes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .grille-constantes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Chaque grande partie de saisie (identite, assurance, services) est regroupee dans une carte
   distincte -- plus lisible qu'un simple rectangle continu avec de simples separateurs. */
.sous-panneau {
  background: var(--gris-clair);
  border: 1px solid var(--gris-bordure);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}
.sous-panneau:last-child { margin-bottom: 0; }
.sous-panneau .section-titre { margin-top: 0; padding-top: 0; border-top: none; }
.sous-panneau .repli-contenu { background: #fff; border-radius: 8px; padding: 10px 12px 2px; margin-top: -2px; }

.section-icone { margin-right: 4px; }

/* Champs de recherche : forme en pastille avec icone loupe, pour se distinguer des champs de
   saisie classiques (rectangles simples). */
.champ-recherche-wrap { position: relative; }
.champ-recherche-wrap input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border-radius: 20px;
  border: 1px solid var(--gris-bordure);
  background: #fff;
  font-size: 13px;
}
.champ-recherche-wrap::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238394a3' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}

.section-titre {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--bleu-fonce);
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--gris-bordure);
}
.section-titre:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.section-titre .note { text-transform: none; font-weight: 400; color: #8394a3; font-size: 11.5px; letter-spacing: 0; }

.repli-toggle {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bleu-principal);
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
}
.repli-toggle:hover { text-decoration: underline; }
.repli-contenu { display: none; }
.repli-contenu.ouvert { display: block; }

.onglets-services { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.onglet-service {
  padding: 7px 13px;
  border: 1px solid var(--gris-bordure);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #6b7a89;
  cursor: pointer;
  background: var(--blanc);
}
.onglet-service:hover { border-color: var(--bleu-accent); }
.onglet-service.actif { background: var(--bleu-principal); color: white; border-color: var(--bleu-principal); }

.liste-services { max-height: 220px; overflow-y: auto; border: 1px solid var(--gris-bordure); border-radius: 8px; margin-bottom: 12px; }
.item-service {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--gris-bordure); cursor: pointer;
}
.item-service:last-child { border-bottom: none; }
.item-service:hover { background: var(--gris-clair); }
.item-service .prix { color: var(--bleu-principal); font-weight: 700; font-size: 12.5px; white-space: nowrap; margin-left: 10px; }
.item-service.selectionne { background: var(--bleu-clair); }

.ligne-selection {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 8px;
  padding: 9px 0; border-bottom: 1px solid var(--gris-bordure); font-size: 13px;
}
.ligne-selection:last-child { border-bottom: none; }
/* min-width: 0 est necessaire pour qu'un flex item puisse retrecir en dessous de la largeur de son
   contenu (ex: le select "Prestataire") -- sans ca, la ligne entiere deborde du panneau au lieu de
   s'adapter, ce qui coupait visuellement le prix/total sur la droite (signale par l'utilisateur). */
.ligne-selection .details { flex: 1 1 160px; min-width: 0; }
.ligne-selection .details .libelle { font-weight: 600; color: var(--gris-texte); }
.ligne-selection .details .meta { font-size: 11.5px; color: #8394a3; }
.ligne-selection .details .meta select,
.ligne-selection .details .meta input { max-width: 100%; }
.ligne-selection .prix { font-weight: 700; color: var(--bleu-fonce); white-space: nowrap; }
.ligne-selection .retirer { color: var(--rouge); cursor: pointer; font-size: 16px; padding: 0 4px; font-weight: 700; }

.recap-caisse { font-size: 13.5px; }
.recap-caisse .ligne-recap { display: flex; justify-content: space-between; padding: 5px 0; }
.recap-caisse .ligne-recap.total { border-top: 1px solid var(--gris-bordure); margin-top: 6px; padding-top: 10px; font-weight: 700; color: var(--bleu-fonce); }
.recap-caisse .ligne-recap.restant.du { color: var(--rouge); font-weight: 700; }

.liste-compacte { max-height: 340px; overflow-y: auto; }
.item-compact { padding: 10px 0; border-bottom: 1px solid var(--gris-bordure); font-size: 13px; }
.item-compact:last-child { border-bottom: none; }
.item-compact .titre-item { font-weight: 600; color: var(--gris-texte); }
.item-compact .sous-titre-item { font-size: 11.5px; color: #8394a3; margin: 2px 0 6px; }
.item-compact .actions-item { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1180px) {
  .grille-accueil { grid-template-columns: 1fr 1fr; }
  .grille-3 { grid-template-columns: 1fr 1fr; }
  .grille-portail-consultation { grid-template-columns: 1fr 1.4fr; }
  .grille-portail-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .barre-mobile { display: flex; }
  /* La barre laterale devient un tiroir qui glisse depuis la gauche par-dessus le contenu,
     plutot que d'etre completement masquee sans aucun moyen de l'ouvrir. */
  .barre-laterale {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 250px;
    max-width: 82vw;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 3px 0 16px rgba(0,0,0,0.3);
    /* Le tiroir est plus haut que l'ecran du telephone : il doit pouvoir defiler pour atteindre le
       bas du menu (Specialistes, Comptes, Mon compte, Se deconnecter...) -- correctif 2026-10-06. */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .barre-laterale.ouverte { transform: translateX(0); }
  .barre-laterale .bas-barre { margin-top: 12px; padding-bottom: 16px; }
  .zone-contenu { padding: 16px; }
  .barre-haut { position: static; padding: 8px 16px; gap: 10px; }
  .barre-haut .role { display: none; }
  .grille-2 { grid-template-columns: 1fr; }
  .grille-accueil { grid-template-columns: 1fr; }
  .grille-3 { grid-template-columns: 1fr; }
  .grille-portail-consultation { grid-template-columns: 1fr; }
  .grille-portail-3 { grid-template-columns: 1fr; }
  .grille-constantes { grid-template-columns: minmax(0, 1fr); }
  .constante.large { grid-column: auto; }
}

/* Encart des taux de prise en charge appliques (accueil, sous le choix de l'assureur) */
.encart-taux-assurance { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: #eef5fc; border: 1px solid #cfe0f3; border-radius: 8px; padding: 8px 12px; margin: 2px 0 10px; }
.encart-taux-assurance .taux-applique { display: flex; align-items: baseline; gap: 6px; }
.encart-taux-assurance .taux-libelle { font-size: 12px; color: #4a5b6b; }
.encart-taux-assurance .taux-valeur { font-size: 17px; font-weight: 700; color: #1b4f8a; }
.encart-taux-assurance .taux-source { font-size: 11px; color: #8394a3; }
.encart-taux-assurance .taux-source-globale { flex-basis: 100%; }

/* Champs en lecture seule (ex: unite / valeurs usuelles a la saisie des resultats labo) */
input.champ-lecture-seule, input.champ-lecture-seule:focus { background: #f1f4f7; color: #4a5b6b; border-color: #e1e7ee; cursor: default; box-shadow: none; }

/* Case "Agent de la clinique / famille -- 50 % a payer" (caisse de l'accueil, modale admin des recus) */
.case-agent-clinique { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gris-texte); cursor: pointer; padding: 8px 10px; border: 1px dashed var(--gris-bordure); border-radius: 6px; margin-bottom: 14px; background: #fbfcfe; }
.case-agent-clinique input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 auto; }
.case-agent-clinique:has(input:checked) { border-color: var(--bleu-accent); background: #eef5fc; }

/* Portail Medecin : colonnes d'actions des blocs 1 et 3 -- boutons empiles plutot que debordants */
.actions-portail { white-space: normal; }
.actions-portail .bouton { display: block; width: 100%; margin: 0 0 4px; text-align: center; box-sizing: border-box; }
.actions-portail .bouton:last-child { margin-bottom: 0; }
.sous-ligne-portail { font-size: 11px; color: #8394a3; margin-top: 2px; }
.grille-portail-3 .actions-portail { width: 1%; }

/* Barre de recherche des blocs 1 et 3 du Portail Medecin (texte + date + bouton) */
.barre-recherche-portail { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.barre-recherche-portail input[type=text] { flex: 1 1 120px; min-width: 0; padding: 7px 10px; border: 1px solid var(--gris-bordure); border-radius: 6px; font-size: 13px; }
.barre-recherche-portail input[type=date] { flex: 0 1 140px; min-width: 0; padding: 6px 8px; border: 1px solid var(--gris-bordure); border-radius: 6px; font-size: 12.5px; }

/* Onglet "General" du portail medecin : 3 cadres d'antecedents cote a cote (1 colonne sur ecran etroit) */
.grille-antecedents { gap: 10px; margin-bottom: 12px; }
.grille-antecedents .cadre-consultation { margin-bottom: 0; padding-top: 16px; }
.grille-antecedents .champ { margin: 4px 0 6px; }
.grille-antecedents .champ label { font-size: 11.5px; margin-bottom: 2px; }
.grille-antecedents .champ input { padding: 5px 7px; font-size: 12.5px; }
.volet-consultation textarea { border: 1px solid var(--gris-bordure); border-radius: 6px; padding: 7px 9px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.volet-consultation textarea:focus { outline: none; border-color: var(--bleu-accent); }
@media (max-width: 1500px) { .grille-portail-3 .grille-antecedents { grid-template-columns: 1fr; } }

/* Composition d'une ordonnance (onglet Diagnostic et traitement du portail medecin) */
.grille-posologie { display: grid; grid-template-columns: 80px 1.2fr 1.1fr 1.1fr 1.4fr; gap: 6px 10px; align-items: end; }
.grille-posologie .champ { margin: 0 0 6px; }
.grille-posologie.grille-dosage-soins { grid-template-columns: 80px 0.8fr 0.9fr 1.1fr 1.1fr 1fr; }
@media (max-width: 860px) { .grille-posologie.grille-dosage-soins { grid-template-columns: 1fr 1fr; } }
.grille-posologie .champ label { font-size: 11.5px; margin-bottom: 2px; }
.grille-posologie input, .grille-posologie select { padding: 6px 7px; font-size: 12.5px; }
@media (max-width: 1500px) { .grille-portail-3 .grille-posologie { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .grille-posologie { grid-template-columns: 1fr 1fr; } }

/* Apercu a l'ecran de la facture assurance mensuelle (Assurances & Facturation > Facturation) */
.table-facture-assurance.ecran { width: 100%; border-collapse: collapse; font-size: 12px; }
.table-facture-assurance.ecran th, .table-facture-assurance.ecran td { border: 1px solid var(--gris-bordure); padding: 4px 6px; text-align: center; }
.table-facture-assurance.ecran td.libelle { text-align: left; }
.table-facture-assurance.ecran tr.ligne-patient td { background: #e8eef5; font-weight: 700; }
.table-facture-assurance.ecran tr.sous-total td { background: #f3f5f7; font-weight: 700; }

/* Tuile "Consultations ce mois-ci" : deux chiffres cote a cote (perception a la caisse / traitees par les medecins) */
.carte-stat .valeur-duo { display: flex; align-items: stretch; gap: 14px; }
.carte-stat .valeur-duo > span { display: flex; flex-direction: column; line-height: 1.05; }
.carte-stat .valeur-duo small { font-size: 10.5px; font-weight: 600; color: #8394a3; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.carte-stat .valeur-duo .valeur-sep { width: 1px; background: #dbe1e6; align-self: stretch; }

/* Journal de tresorerie (Tresorerie > Tresorerie, admin) -- 2026-10-08 */
.panneau-tresorerie-filtres { padding: 12px 16px; }
.ligne-filtres-tresorerie { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.ligne-filtres-tresorerie label { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 600; color: #4a5a68; gap: 3px; }
.ligne-filtres-tresorerie label.libre { flex: 1 1 220px; }
.ligne-filtres-tresorerie input, .ligne-filtres-tresorerie select { padding: 6px 8px; border: 1px solid var(--gris-bordure); border-radius: 6px; font-size: 12.5px; }
.types-tresorerie { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0 6px; font-size: 12.5px; }
.types-tresorerie .titre-types { font-weight: 600; color: #4a5a68; }
.types-tresorerie .case-type { display: flex; align-items: center; gap: 4px; font-weight: 400; }
.types-tresorerie .case-type input { width: auto; }
.actions-tresorerie { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.actions-tresorerie .info-session { font-size: 12px; color: #4a5a68; }
.grille-tresorerie { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1500px) { .grille-tresorerie { grid-template-columns: 1fr; } }
.table-tresorerie { font-size: 12px; } .table-tresorerie th, .table-tresorerie td { padding: 5px 7px; }
.table-tresorerie td.montant { text-align: right; white-space: nowrap; font-weight: 600; }
.table-tresorerie tr.sens-depense td.montant { color: #b03a2e; } .table-tresorerie tr.sens-info td { color: #8394a3; }
.detail-tresorerie { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; font-size: 12.5px; }
@media (max-width: 900px) { .detail-tresorerie { grid-template-columns: 1fr; } }
.detail-tresorerie h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; color: #8394a3; letter-spacing: .4px; }
.detail-tresorerie .colonne-detail div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted #dbe1e6; padding: 3px 0; }
.detail-tresorerie .colonne-detail small { color: #8394a3; min-width: 24px; text-align: right; }
.totaux-tresorerie { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.totaux-tresorerie .total { border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #fff; }
.totaux-tresorerie .total.credit { background: #e3a21a; } .totaux-tresorerie .total.depense { background: #c0392b; }
.totaux-tresorerie .total.recette { background: #1b9aaa; } .totaux-tresorerie .total.solde { background: #2e9e4f; }
/* Sessions de caisse du journal de tresorerie : ligne selectionnee (filtre actif) en vert clair, sessions a valider en orange pale */
.table-tresorerie tr.session-selectionnee td { background: #dff3e6 !important; }
.table-tresorerie tr.session-a-valider td { background: #fff7f0; }
/* Ligne de filtres dans l'en-tete des tableaux du journal de tresorerie */
.table-tresorerie thead tr.filtres-colonnes th { padding: 3px 4px; background: #f3f6f9; }
.table-tresorerie thead tr.filtres-colonnes input { width: 100%; min-width: 60px; padding: 4px 6px; border: 1px solid var(--gris-bordure); border-radius: 5px; font-size: 11.5px; font-weight: 400; }
.table-tresorerie td.actions-op .bouton { margin-bottom: 2px; }
/* Tableaux des sessions (2026-10-10) : 4 colonnes compactes, sans ascenseur horizontal ni vertical. */
.conteneur-table-sessions { overflow: visible; }
.table-sessions-compacte { width: 100%; table-layout: fixed; }
.table-sessions-compacte th, .table-sessions-compacte td { white-space: normal; word-break: break-word; vertical-align: top; }
.table-sessions-compacte th:nth-child(1) { width: 29%; } .table-sessions-compacte th:nth-child(2) { width: 27%; }
.table-sessions-compacte th:nth-child(3) { width: 24%; } .table-sessions-compacte th:nth-child(4) { width: 20%; }
.table-sessions-compacte td.montant { font-size: 12px; white-space: normal; }
.table-sessions-compacte thead tr.filtres-colonnes input { min-width: 0; }
.table-sessions-compacte td.montants-session div { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; }
.table-sessions-compacte td.montants-session span { color: #6b7a89; }
.table-sessions-compacte .actions-session { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.table-sessions-compacte .actions-session .bouton { padding: 2px 6px; font-size: 11px; }
.bouton.danger-texte { color: #b03a2e; border-color: #e8b4ae; }
/* Tresorerie : colonne de droite = sessions a valider + sessions validees (2026-10-08). */
.colonne-sessions-tresorerie { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.table-tresorerie th[data-tri-validee]:hover { background: #e3edf7; }

/* Catalogue : elements realises d'un acte (2026-10-08). */
.totaux-elements-acte { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.totaux-elements-acte div { background: #f2f6fa; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; }
.totaux-elements-acte span { font-size: 11px; text-transform: uppercase; color: #6b7a89; letter-spacing: .3px; }
.totaux-elements-acte b { font-size: 15px; color: #0f3d63; }
@media (max-width: 900px) { .totaux-elements-acte { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.totaux-elements-acte.totaux-assureur { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .totaux-elements-acte.totaux-assureur { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table-patients-assures input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.table-elements-acte { font-size: 12.5px; } .table-elements-acte th, .table-elements-acte td { padding: 6px 8px; }

/* Accueil : historique des patients enregistres -- signe des patients assures (2026-10-08). */
.item-compact.item-assure { border-left: 4px solid #1f6fb2; background: #f1f7fd; }
.signe-assure { display: inline-block; background: #1f6fb2; color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: middle; text-transform: uppercase; letter-spacing: .3px; }
.signe-garant { display: inline-block; background: #8a5a00; color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: middle; text-transform: uppercase; letter-spacing: .3px; }
.assurance-item { color: #1f6fb2 !important; font-weight: 600; }

/* Laboratoire : saisie du groupage sanguin par listes (2026-10-08). */
.table-groupage { width: 100%; margin: 6px 0 4px; font-size: 13px; }
/* Ionogramme / transaminases (2026-10-19) : parametres saisis sur une seule ligne (sans retour a la ligne). */
.labo-en-ligne { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; margin: 8px 0 2px; }
.labo-en-ligne label { display: flex; align-items: center; gap: 5px; font-size: 13px; margin: 0; flex: 1 1 0; min-width: 0; }
.labo-en-ligne .labo-param { font-weight: 700; white-space: nowrap; }
.labo-en-ligne input { width: 100%; min-width: 42px; max-width: 110px; padding: 6px 8px; }
.labo-en-ligne .labo-unite { color: #6b7a89; font-size: 12px; white-space: nowrap; }
.labo-usuelles { margin: 2px 0 4px; font-size: 11px; color: #8394a3; }
.table-groupage th { background: #e3edf7; text-align: left; padding: 5px 8px; }
.table-groupage td { padding: 4px 8px; }
.table-groupage td:first-child { width: 45%; font-weight: 600; color: #3b4b5b; }
.table-groupage select, .table-groupage input[type=text] { width: 100%; font-size: 14px; font-weight: 700; }
.tout-boutons-labo { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.table-antibiogramme th:not(:first-child), .table-antibiogramme td:not(:first-child) { text-align: center; width: 18%; }
.table-antibiogramme tbody tr:nth-child(odd) { background: #f6f9fc; }
.table-antibiogramme input[type=radio] { width: 18px; height: 18px; cursor: pointer; }
.legende-antibiogramme { margin: 0 0 6px; font-size: 11px; color: #6b7a89; }
.champ-identification-labo { display: block; font-weight: 600; color: #3b4b5b; font-size: 13px; margin: 4px 0; }
.champ-identification-labo textarea { width: 100%; margin-top: 3px; font-weight: 700; font-size: 14px; font-family: inherit; }

/* ---------------- IMPOT ET CNSS (2026-10-16) ---------------- */
.barre-impots { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 14px; }
.barre-impots label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; color: var(--gris-texte); gap: 4px; }
.barre-impots label.libre { flex: 1; min-width: 180px; }
.barre-impots label.case-impots { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.barre-impots input, .barre-impots select { padding: 7px 9px; border: 1px solid var(--gris-bordure); border-radius: 6px; font-size: 13px; }
.signature-impots { display: flex; align-items: center; gap: 10px; font-size: 13px; padding-bottom: 6px; margin-left: auto; }
.signature-impots label { flex-direction: row !important; align-items: center; gap: 4px !important; font-weight: 400 !important; }
.cartes-impots { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.carte-impots { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 12px 14px; border-left: 4px solid var(--bleu-accent); }
.carte-impots .libelle { font-size: 12px; color: #6b7a89; } .carte-impots .valeur { font-size: 19px; font-weight: 700; color: var(--bleu-fonce); margin-top: 4px; }
.carte-impots.principal { border-left-color: var(--rouge); } .carte-impots.principal .valeur { color: var(--rouge); font-size: 22px; }
.barre-actions-impots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--gris-bordure); }
.barre-actions-impots label { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.conteneur-table-impots { overflow: auto; max-height: 68vh; }
.table-impots { font-size: 12.5px; }
.table-impots thead th { position: sticky; top: 0; z-index: 1; padding: 8px; }
.table-impots td { padding: 6px 8px; border-bottom: 1px solid var(--gris-bordure); }
.table-impots .montant { text-align: right; white-space: nowrap; }
.table-impots tfoot td { font-weight: 700; background: var(--bleu-clair); position: sticky; bottom: 0; }
.table-impots.compacte td { padding: 4px 8px; }
.deductions-impots { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; font-size: 13px; }
.deductions-impots label { display: flex; align-items: center; gap: 6px; }
.deductions-impots input { width: 120px; padding: 6px 8px; border: 1px solid var(--gris-bordure); border-radius: 6px; }
.grille-3-impots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.grille-3-impots .champ { margin-bottom: 10px; }
.encart-calcul-impots { background: #f6f8fb; border: 1px solid var(--gris-bordure); border-radius: 8px; padding: 10px 12px; }
.grille-bareme-impots { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.ligne-cible-impots td { background: #fff6dd; } .cellule-cible-impots { background: #fbd38d !important; font-weight: 700; }
@media (max-width: 900px) { .grille-bareme-impots, .grille-3-impots { grid-template-columns: 1fr; } .signature-impots { margin-left: 0; } }

/* Accueil : montant recu a 0 pour un patient assure (2026-10-17) */
.aide-recu-assure { margin-top: 5px; font-size: 11.5px; color: #93701f; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Journal de tresorerie : validation ligne par ligne (2026-10-17) */
.resume-validation-journal { padding: 0 16px 8px; font-size: 12.5px; color: #4a5a68; }
.table-tresorerie tr.ligne-validee td { background: #eef9f1; }
.table-tresorerie tr.ligne-validee-modifiee td { background: #fff6e5; }
.bouton-valider-ligne { background: #1e8e4f; }
.bouton-valider-ligne:hover { background: #166c3c; }
.bouton-annuler-validation { border: 0; background: none; color: #b03a2e; font-size: 15px; font-weight: 700; cursor: pointer; padding: 0 4px; vertical-align: middle; }

/* Stock de l'article lie a un acte de soins (2026-10-17) */
.badge-stock-article { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 700; background: #e5f5ea; color: #1e7b45; white-space: nowrap; }
.badge-stock-article.rupture { background: #fbeae8; color: #b03a2e; }

/* Portail medecin : consultations prescrites avec un referencement (2026-10-17) */
.liste-ref-consult { display: none; max-height: 150px; overflow: auto; border: 1px solid #e2e6ea; border-radius: 6px; margin-top: 4px; }

/* Acte de soins gere a la pharmacie (2026-10-17) */
.case-gere-pharmacie { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; background: #f3f8f4; border: 1px solid #cfe6d6; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; cursor: pointer; }
.case-gere-pharmacie input { width: auto; margin-top: 2px; }
.badge-gere-pharmacie, .badge-article-acte { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 700; background: #ede7f6; color: #5b3a9a; white-space: nowrap; }

/* Sessions de caisse : recette par mode de paiement (2026-10-17) */
.montants-session .mode-session span { color: #6b7a89; font-size: 10.5px; padding-left: 8px; }
.montants-session .mode-session b { font-weight: 600; font-size: 11px; color: #2b5d8a; }

/* Journal : changement du mode de paiement (2026-10-17) */
.badge-mode-paiement { border: 0; cursor: pointer; font-size: 10px; }
.badge-mode-paiement:hover { outline: 1px solid #2b8fd6; }
.choix-mode-paiement { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

/* Composition d'un serum (portail medecin, 2026-10-18) */
.ligne-composition-serum td { padding-top: 0; }
.bloc-composition-serum { border: 1px dashed #8fb5dd; background: #f4f8fd; border-radius: 8px; padding: 8px 10px; margin: 2px 0 6px 18px; }
.bloc-composition-serum .titre-composition { font-weight: 700; font-size: 12.5px; color: var(--bleu-fonce); margin-bottom: 4px; }
.bloc-composition-serum .titre-composition span { font-weight: 400; color: #6b7a89; font-size: 11.5px; }
.bloc-composition-serum .table-composition td { padding: 3px 6px; border-bottom: 1px solid #e2eaf3; font-size: 12.5px; }
.bloc-composition-serum .vide-composition { font-size: 12px; color: #8394a3; margin: 2px 0 4px; }
.bloc-composition-serum .ajout-composition { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.bloc-composition-serum .ajout-composition input[type=text] { flex: 1 1 220px; min-width: 0; }
.sous-ligne-portail.serum-composition { color: #1f5f9e; }

/* Etat des factures assureurs / reglements (2026-10-18) */
.grille-cartes-etat-fa { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.carte-etat-fa, .grille-resume-reglement-fa > div { background: #f4f7fb; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; }
.carte-etat-fa span, .grille-resume-reglement-fa span { display: block; font-size: 11.5px; color: #6b7a89; margin-bottom: 2px; }
.carte-etat-fa b { font-size: 16px; }
.grille-resume-reglement-fa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 700px) { .grille-resume-reglement-fa { grid-template-columns: 1fr 1fr; } }

/* Laboratoire : noms des examens dans les listes de patients (2026-10-18) */
.liste-examens-labo { display: flex; flex-wrap: wrap; gap: 3px; }
.liste-examens-labo .examen-labo { display: inline-block; background: #eef3f9; color: #1f3b57; border-radius: 4px; padding: 1px 6px; font-size: 11.5px; line-height: 1.45; }
.liste-examens-labo .examen-labo.fait { background: #e5f5ea; color: #1e6b34; }
/* Choix d'impression de la facture assurance (2026-10-20) : complete / un souscripteur / tous. */
.choix-impression-fa { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--gris-bordure); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 13.5px; }
.choix-impression-fa input[type=radio] { width: auto; margin-top: 3px; }
.choix-impression-fa small { color: #6b7a89; }
.choix-impression-fa select { width: 100%; }
.choix-impression-fa:has(input:checked) { border-color: var(--bleu-principal); background: var(--bleu-clair); }

/* Patients > Certificats medicaux (2026-10-20) : liste de choix du patient sous le champ de recherche. */
.resultats-recherche-certificat { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid #d6dee6; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.resultats-recherche-certificat:empty { display: none; }
.resultats-recherche-certificat > div { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid #eef2f5; }
.resultats-recherche-certificat > div:hover { background: #eef6fb; }
.resultats-recherche-certificat small { color: #6b7c8c; }

/* Factures assurance > Ajouter des elements (2026-10-22) : liste a cocher + elements choisis. */
.fa-liste-elements { border: 1px solid #d6dee6; border-radius: 6px; max-height: 230px; overflow-y: auto; background: #fff; }
.fa-liste-elements .fa-element { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #eef2f5; cursor: pointer; font-weight: 400; margin: 0; }
.fa-liste-elements .fa-element:hover { background: #f3f8fc; }
.fa-liste-elements .fa-element.choisi { background: #e8f3ec; }
.fa-liste-elements .fa-element span { flex: 1; }
.fa-liste-elements .fa-element small { color: #6b7c8c; white-space: nowrap; }
.fa-liste-elements .fa-element input { width: auto; margin: 0; }
.table-fa-selection { width: 100%; font-size: 13px; margin-top: 8px; }
.table-fa-selection td, .table-fa-selection th { padding: 4px 6px; }
.table-fa-selection input { padding: 4px 6px; }

/* Actualisation automatique des listes d'attente (2026-10-22). */
.bandeau-maj-auto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff7e6; border: 1px solid #f3c56b; color: #6b4a00; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.bandeau-maj-auto .bouton { margin-left: auto; }

/* Salle de soins (2026-10-22). */
.carte-soins { border: 1px solid #d6e4ee; border-left: 4px solid #1f6fae; border-radius: 8px; margin: 0 16px 12px; padding: 10px 12px; background: #fbfdff; }
.table-soins-detail { width: 100%; margin-top: 8px; font-size: 13px; }
.table-soins-detail th, .table-soins-detail td { padding: 5px 6px; vertical-align: top; }

/* Acces par type de compte (2026-10-22). */
.table-acces-roles { font-size: 13px; }
.table-acces-roles th.c, .table-acces-roles td.c { text-align: center; white-space: nowrap; }
.table-acces-roles tr.menu-parent td { background: #f5f8fa; }
.liste-acces-role { margin: 0; padding-left: 18px; line-height: 1.8; font-size: 13.5px; }
.liste-acces-role ul { padding-left: 22px; font-size: 12.5px; color: #4a5a68; line-height: 1.6; }
.table-acces-roles td:first-child, .table-acces-roles th:first-child { min-width: 200px; }

/* Tresorerie en consultation (comptable, 2026-10-24) : actions reservees a l'administrateur masquees. */
.tresorerie-lecture-seule [data-valider-ligne], .tresorerie-lecture-seule [data-annuler-validation], .tresorerie-lecture-seule [data-op-modifier],
.tresorerie-lecture-seule [data-op-supprimer], .tresorerie-lecture-seule [data-session-valider], .tresorerie-lecture-seule [data-session-versement],
.tresorerie-lecture-seule [data-validee-versement] { display: none !important; }
.tresorerie-lecture-seule button[data-changer-mode] { pointer-events: none; cursor: default; }
