/* ===================== Polices =====================
 * Arabe : Amiri ou Noto Naskh Arabic. Pour un rendu identique sur tous les postes et HORS LIGNE,
 * déposez les fichiers dans web/fonts/ (voir README) ; à défaut, les polices arabes du système sont utilisées. */
@font-face { font-family: "Amiri"; src: local("Amiri"), local("Amiri Regular"), url("../fonts/Amiri-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: "Amiri"; src: local("Amiri Bold"), url("../fonts/Amiri-Bold.ttf") format("truetype"); font-weight: 700; }
/* Polices intégrées au site (web/fonts, licence OFL) : rendu identique sur tous les postes, hors ligne */
@font-face { font-family: "Noto Naskh Arabic"; src: url("../fonts/NotoNaskhArabic.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --p: #1F4E79; --p2: #2E75B6; --fond: #F3F5F8; --bord: #D9E0E8; --txt: #1d2733; --doux: #5f6b7a;
  --rouge: #C0392B; --orange: #B9770E; --vert: #1E8449;
  --arabe: "Noto Naskh Arabic", "Amiri", "Sakkal Majalla", "Geeza Pro", "Traditional Arabic", "Arabic Typesetting", "Segoe UI", Tahoma, serif;
  /* Identité visuelle : bleu marine + vert médical doux en accent */
  --accent: #0E8A7B; --accent-doux: #E3F4F1; --p-fonce: #153A5B; --p-doux: #E6EEF7;
  --ombre: 0 1px 2px #1d27330f, 0 2px 8px #1d27330a; --ombre-forte: 0 10px 30px #1d273324;
  --rayon: 10px;
  --police: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--police); background: var(--fond); color: var(--txt); -webkit-font-smoothing: antialiased; }
.ar, [lang="ar"] { font-family: var(--arabe); font-size: 1.12em; }
h1 { font-size: 24px; color: var(--p); margin: 0; }
h2 { font-size: 17px; margin: 4px 0 10px; color: var(--p); }
h3 { font-size: 15px; margin: 14px 0 6px; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.aide { color: var(--doux); font-size: 13px; }

/* ---------- Boutons (gros, lisibles) ---------- */
.btn { font: inherit; font-size: 15px; padding: 9px 16px; border: 1px solid #b6c2cf; background: #fff; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--txt); }
.btn:hover { background: #eef4fa; }
.btn.principal { background: var(--p); color: #fff; border-color: var(--p); font-weight: 600; }
.btn.principal:hover { background: #163a5b; }
.btn.danger { color: var(--rouge); border-color: #e3b2ac; }
.btn.petit { padding: 4px 10px; font-size: 13px; }
.btn.grand { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.btn.clair { background: transparent; color: #fff; border-color: #ffffff70; }
.btn.alerte { background: #FEF5E7; border-color: var(--orange); color: #7d5100; padding: 5px 10px; }
.btn[disabled] { opacity: .4; cursor: default; }
summary.btn { list-style: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grille-form .actions .btn { white-space: normal; }
.actions.fin { justify-content: flex-end; margin-top: 14px; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #b6c2cf; border-radius: 6px; background: #fff; width: 100%; color: inherit; }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 40px; }
input[type=range] { padding: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e8; border-color: var(--p2); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--doux); }
label.case { flex-direction: row; align-items: center; gap: 8px; color: var(--txt); font-size: 14px; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grille-form .pleine, label.pleine { grid-column: 1 / -1; }
.recherche-grande { font-size: 18px; padding: 12px 14px; margin: 8px 0 12px; }

/* ---------- Coquille ---------- */
.barre { position: fixed; inset: 0 0 auto 0; height: 58px; background: var(--p); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 18px; z-index: 10; }
.logo-app { font-size: 20px; font-weight: 700; }
.medecin-actif { flex-direction: row; align-items: center; color: #dfe9f3; font-size: 14px; }
.medecin-actif select { width: auto; min-width: 240px; font-weight: 600; color: var(--txt); }
.barre-droite { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.menu { position: fixed; top: 58px; bottom: 0; inset-inline-start: 0; width: 220px; background: #fff; border-inline-end: 1px solid var(--bord); padding-top: 10px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 16px; cursor: pointer; color: var(--txt); border-inline-start: 4px solid transparent; }
.menu a:hover { background: #f0f5fa; }
.menu a.actif { background: #e3edf7; color: var(--p); font-weight: 600; border-inline-start-color: var(--p); }
.menu a.bientot { color: #98a3b0; }
.menu a small { margin-inline-start: auto; font-size: 10px; background: #eef1f5; padding: 1px 6px; border-radius: 8px; }
.menu .ico { width: 24px; text-align: center; font-size: 18px; }
#contenu { margin: 58px 0 0 220px; padding: 20px 24px 60px; }
.titre-page { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.compteur { font-size: 14px; background: #e3edf7; padding: 2px 10px; border-radius: 12px; vertical-align: middle; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.titre-carte { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ordo.deux-colonnes { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.colonne-apercu { position: sticky; top: 72px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; background: #eef1f5; }
.badge.vert { background: #e9f7ef; color: var(--vert); font-weight: 600; }
.onglets-simples { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.onglet { font: inherit; padding: 8px 14px; border: 1px solid var(--bord); background: #fff; border-radius: 6px; cursor: pointer; }
.onglet.actif { background: var(--p); color: #fff; border-color: var(--p); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2733; color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 100; max-width: 90vw; }
.alerte-rouge { background: #FDEDEC; border: 1px solid var(--rouge); color: var(--rouge); padding: 8px 12px; border-radius: 6px; margin: 6px 0; font-weight: 700; }
.alerte-orange { background: #FEF5E7; border: 1px solid #E0B25C; color: #7d5100; padding: 6px 10px; border-radius: 6px; margin: 6px 0; font-size: 13px; }
.bientot-carte { max-width: 640px; }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--bord); }
.tableau th, .tableau td { padding: 8px 10px; border-bottom: 1px solid #edf0f4; text-align: start; vertical-align: top; }
.tableau th { background: #f2f5f9; font-size: 12px; color: var(--doux); position: sticky; top: 58px; }
.tableau.compact td { font-size: 13px; padding: 5px 8px; }
.nowrap { white-space: nowrap; }
.pagination { margin-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: center; }

/* ---------- Dialogue ---------- */
.dialogue { border: none; border-radius: 10px; padding: 22px; width: min(900px, 94vw); max-height: 90vh; overflow: auto; }
.dialogue::backdrop { background: #0006; }
.liste-poso { list-style: none; padding: 0; margin: 0 0 10px; }
.liste-poso li { display: flex; justify-content: space-between; gap: 10px; padding: 8px; border: 1px solid var(--bord); border-radius: 6px; margin-bottom: 6px; }

/* ---------- Médecins ---------- */
.champ-image { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--doux); }
.champ-image img { max-height: 90px; max-width: 220px; object-fit: contain; border: 1px dashed var(--bord); padding: 4px; background: #fafafa; }
.apercu-cadre { background: #8a96a3; padding: 16px; border-radius: 8px; overflow: auto; max-height: calc(100vh - 160px); }
.apercu-page .page { margin: 0 auto; box-shadow: 0 4px 16px #0004; }
.apercu-page .page-A5 { transform-origin: top center; }

/* ---------- Ordonnance ---------- */
.autocomplete { position: relative; }
.autocomplete input { font-size: 17px; padding: 11px 14px; }
.suggestions { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--bord); border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px #0002; z-index: 20; max-height: 360px; overflow: auto; }
.suggestion { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.suggestion.active, .suggestion:hover { background: #e3edf7; }
.lignes-ordo { padding-inline-start: 20px; }
.ligne-ordo { border: 1px solid var(--bord); border-radius: 8px; padding: 10px; margin: 10px 0; background: #fbfcfd; }
.ligne-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ligne-tete input { width: auto; padding: 4px 8px; }
.ligne-ordo select[data-role=poso-type] { margin-bottom: 6px; }
.editeur-poso { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.editeur-poso label { font-size: 12px; }
.editeur-poso input, .editeur-poso select { padding: 5px 7px; width: auto; }
.editeur-poso .pleine { flex-basis: 100%; }
.editeur-poso .pleine input { width: 100%; }
.apercu-poso { margin-top: 8px; padding: 8px 10px; background: #eef4fa; border-radius: 6px; font-size: 14px; }
.apercu-poso [contenteditable] { outline: none; border-bottom: 1px dashed #8fb3d6; margin-top: 3px; }
.patient-choisi { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.patient-choisi .aide { display: block; }
.patient-choisi .poids { flex-direction: row; align-items: center; }
.patient-choisi .poids input { width: 70px; }
.liste-choix .choix { padding: 8px 10px; border-bottom: 1px solid #eef1f4; cursor: pointer; }
.liste-choix .choix:hover { background: #e3edf7; }
.modeles { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.modeles select { width: auto; max-width: 260px; }
.options-ordo { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.options-ordo label { flex-direction: row; align-items: center; gap: 8px; }
.options-ordo select { width: auto; }

/* ---------- Verrouillage ---------- */
body.verrouille { background: var(--p); }
.ecran-verrou { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.verrou { width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; }
.erreur { color: var(--rouge); font-weight: 600; min-height: 1.2em; }

/* ---------- Écrans étroits / tablette ---------- */
@media (max-width: 1100px) { .deux-colonnes, .ordo.deux-colonnes { grid-template-columns: 1fr; } .colonne-apercu { position: static; } }
@media (max-width: 760px) {
  .menu { position: static; width: auto; display: flex; overflow-x: auto; margin-top: 58px; padding: 0; }
  .menu a { padding: 10px 12px; white-space: nowrap; } .menu a small { display: none; }
  #contenu { margin: 0; padding: 12px; }
  .medecin-actif { display: none; }
}

/* ---------- Patients ---------- */
.deux-colonnes.patients { grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); }
.liste-choix .choix.actif, .choix.actif { background: #e3edf7; font-weight: 600; }
.liste-choix { max-height: 70vh; overflow: auto; }
.choix { padding: 8px 10px; border-bottom: 1px solid #eef1f4; cursor: pointer; }
.choix:hover { background: #f0f5fa; }
.badge.rouge { background: #FDEDEC; color: var(--rouge); font-size: 11px; margin-inline-start: 6px; }
.grand-select { font-size: 16px; padding: 10px; }

/* ---------- Couverture : saisie, calibrage ---------- */
.actes-saisie input, .actes-saisie select { padding: 4px 6px; font-size: 13px; }
.apercu-page.petite { zoom: .55; }
.calage { position: relative; background: #fff no-repeat 0 0 / 100% 100%; border: 1px solid #999; margin: 0 auto;
  background-image: repeating-linear-gradient(0deg, #0000 0 29px, #e6ecf2 29px 30px), repeating-linear-gradient(90deg, #0000 0 29px, #e6ecf2 29px 30px); }
.repere { position: absolute; transform: translateY(-50%); background: #1F4E79e0; color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 3px;
  cursor: grab; white-space: nowrap; user-select: none; touch-action: none; }
.repere::before { content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; background: #C0392B; border-radius: 50%; }
.repere:active { cursor: grabbing; }

/* ---------- Bilans ---------- */
.bilans-types { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.catalogue-examens { max-height: 55vh; overflow: auto; columns: 2 320px; column-gap: 14px; }
.catalogue-examens fieldset { break-inside: avoid; border: 1px solid var(--bord); border-radius: 6px; margin: 0 0 10px; padding: 6px 10px; }
.catalogue-examens legend { font-weight: 700; color: var(--p); font-size: 13px; }
.examen { padding: 2px 0; }
.examen.coche { background: #eef6ee; border-radius: 4px; }
.examen .precision { padding: 3px 6px; font-size: 13px; margin: 2px 0 4px 24px; width: calc(100% - 24px); }

/* ---------- Saisie de date au clavier ---------- */
.date-saisie { display: flex; flex-direction: column; gap: 2px; }
.date-saisie small { color: var(--doux); min-height: 1.1em; font-size: 12px; }
input.invalide { border-color: var(--rouge); background: #fff6f5; }
input.invalide + small { color: var(--rouge); }

/* ---------- Traduction automatique ---------- */
.trad { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; padding: 6px 8px; background: #f3f8f3; border-radius: 6px; }
.trad input { font-size: 15px; }
.trad-alerte { color: #7d5100; font-size: 12px; }
.trad-note { color: #1E8449; font-size: 12px; min-height: 1em; }

/* ---------- Import d'ordonnances types ---------- */
.liste-import { max-height: 45vh; overflow: auto; border: 1px solid var(--bord); border-radius: 6px; padding: 6px; }
.import-item { align-items: flex-start !important; padding: 6px; border-bottom: 1px solid #eef1f4; }
.import-item input { margin-top: 4px; }

/* ---------- Bilans : aide-mémoire et éditeur de bilans types ---------- */
.examen-ligne { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.btn-info { border: 1px solid #b6c2cf; background: #fff; border-radius: 50%; width: 22px; height: 22px; padding: 0; font-size: 12px; cursor: pointer; color: var(--p); flex: none; }
.btn-info.actif, .btn-info:hover { background: var(--p); color: #fff; }
.ref-bio { margin: 4px 0 8px 24px; padding: 8px 10px; background: #eef4fa; border-left: 3px solid var(--p); border-radius: 4px; font-size: 13px; line-height: 1.45; }
.ref-bio div { margin-bottom: 3px; }
.conversions { margin: 6px 0; font-size: 13px; }
.conversions summary { cursor: pointer; color: var(--p); font-weight: 600; }
.editeur-bilan { border: 2px solid var(--p); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fbfdff; }
.catalogue-examens.petit { max-height: 40vh; }
.ligne-active { background: #e3edf7; }

/* ---------- Fiches molécules ---------- */
.fiche-molecule th { width: 30%; background: #f2f5f9; font-size: 12.5px; color: var(--txt); position: static; }
.fiche-molecule td { font-size: 13.5px; line-height: 1.45; }

/* Aide-mémoire d'une ordonnance du guide (écran seulement) */
.memo-guide { margin: 8px 0; padding: 8px 12px; border: 1px solid #e6c76a; background: #fff9e6; border-radius: 6px; font-size: 13px; }
.memo-guide summary { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.memo-guide summary .btn { margin-left: auto; }
.memo-guide ul { margin: 6px 0 0 18px; padding: 0; }


/* =====================================================================
 * Identité visuelle (v2) : logo, barre, menu, cartes, boutons
 * ===================================================================== */
:root { --fond: #F4F6F9; --bord: #E1E6EE; }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.marque-logo { width: 34px; height: 34px; flex: none; }
.marque-texte { display: flex; flex-direction: column; line-height: 1.1; }
.marque-nom { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.marque-sous { font-family: var(--arabe); font-size: 13px; opacity: .85; }
.barre { background: linear-gradient(90deg, var(--p-fonce), var(--p)); box-shadow: 0 2px 10px #0b223a33; }
.barre .btn.clair:hover { background: #ffffff1f; }
.menu { background: #fff; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.menu a { border-radius: 8px; border-inline-start: 0; padding: 11px 14px; font-size: 15px; transition: background .15s, color .15s; }
.menu a:hover { background: var(--p-doux); }
.menu a.actif { background: var(--p-doux); color: var(--p); box-shadow: inset 3px 0 0 var(--accent); }
.menu .ico { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; background: #F1F4F8; font-size: 16px; }
.menu a.actif .ico { background: #fff; box-shadow: var(--ombre); }
.carte { border-radius: var(--rayon); box-shadow: var(--ombre); border-color: var(--bord); padding: 18px; }
h1 { font-size: 25px; letter-spacing: -.2px; color: var(--p-fonce); }
h2 { color: var(--p-fonce); }
.titre-carte h2::before, .carte > h2:first-child::before { content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 2px; background: var(--accent); margin-inline-end: 8px; vertical-align: -2px; }
.btn { border-radius: 8px; border-color: #C9D3DE; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.principal { background: var(--p); border-color: var(--p); box-shadow: 0 1px 2px #1F4E7940; }
.btn.principal:hover { background: var(--p-fonce); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
input, select, textarea { border-radius: 8px; border-color: #C9D3DE; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p2); box-shadow: 0 0 0 3px #2E75B633; }
.badge.vert { background: var(--accent-doux); color: var(--accent); }
.compteur { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.onglet.actif { background: var(--p); }
.tableau { border-radius: var(--rayon); }
.tableau tbody tr:hover { background: #F7FAFD; }
.toast { border-radius: 10px; box-shadow: var(--ombre-forte); animation: toast-entree .2s ease-out; }
@keyframes toast-entree { from { opacity: 0; transform: translate(-50%, 8px); } }
.dialogue { border-radius: 14px; box-shadow: var(--ombre-forte); }
.apercu-cadre { background: linear-gradient(180deg, #DDE3EA, #CBD3DD); }
.apercu-page .page { box-shadow: 0 2px 4px #0002, 0 12px 28px #0003; border-radius: 2px; }

/* Écran de verrouillage */
body.verrouille { background: radial-gradient(1200px 600px at 20% 10%, #2E75B6 0%, transparent 60%), linear-gradient(160deg, var(--p-fonce), var(--p) 60%, #0E6E73); }
.verrou { padding: 30px 28px; border: none; box-shadow: var(--ombre-forte); border-radius: 16px; }
.verrou-marque { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 6px; text-align: center; }
.verrou-marque svg { width: 64px; height: 64px; }
.verrou-marque h1 { margin: 4px 0 0; }
.verrou-marque .ar { color: var(--doux); }
.marque-nom { white-space: nowrap; }
@media (max-width: 1000px) { .marque-sous { display: none; } .medecin-actif select { min-width: 160px; } }
@media (max-width: 760px) {
  .menu { flex-direction: row; padding: 6px; gap: 4px; }
  .menu a.actif { box-shadow: inset 0 -3px 0 var(--accent); }
  .marque-texte { display: none; }
}

/* ---------- Icônes et éléments communs (v2) ---------- */
.icone { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.menu .ico .icone { width: 18px; height: 18px; color: var(--p); }
.menu a.actif .ico .icone { color: var(--accent); }
.btn .icone { width: 17px; height: 17px; }
.btn.petit .icone { width: 14px; height: 14px; }
.btn.danger .icone { color: var(--rouge); }
.btn-info { display: inline-grid; place-items: center; }
.btn-info .icone { width: 14px; height: 14px; }
.alerte-rouge, .alerte-orange { display: flex; align-items: center; gap: 8px; border-radius: 8px; }
.alerte-rouge .icone { width: 18px; height: 18px; }
.btn.alerte { border-radius: 20px; }
.etat-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--doux); padding: 34px 16px; }
.etat-vide .icone { width: 40px; height: 40px; color: #B8C4D2; }
.etat-vide p { margin: 0; }
/* Liste des patients : avatar à initiales, badges d'organisme */
.liste-choix .choix[data-action=ouvrir] { display: flex; gap: 10px; align-items: center; border-radius: 8px; border-bottom: 1px solid #F0F2F5; }
.choix-texte { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--p-doux); color: var(--p); }
.avatar.f { background: #FBEAF0; color: #A3386A; }
.badge.org { font-size: 11px; font-weight: 600; padding: 1px 8px; background: #EEF1F5; color: var(--doux); }
.badge.org-cnssamo { background: #E6F0FA; color: #1F5F9E; }
.badge.org-cnopsamo { background: #E8F6EE; color: #1E7A47; }
.badge.org-amotadamon { background: #FFF4E0; color: #9A6200; }
.badge.org-mutuellefar, .badge.org-mgpap, .badge.org-omfam, .badge.org-modep { background: #F1ECFA; color: #6B45A8; }
.badge.rouge { font-weight: 600; }
/* Titres de page */
.titre-page h1 { display: flex; align-items: center; gap: 10px; }
/* Onglets */
.onglets-simples { background: #EAEFF5; padding: 4px; border-radius: 10px; display: inline-flex; }
.onglet { border: none; background: transparent; border-radius: 7px; color: var(--doux); font-weight: 500; }
.onglet:hover { background: #ffffffa0; }
.onglet.actif { background: #fff; color: var(--p); box-shadow: var(--ombre); }
/* Tableaux */
.tableau th { background: #F5F7FA; text-transform: uppercase; letter-spacing: .3px; font-size: 11px; }
/* Détails / blocs repliables */
details > summary { cursor: pointer; }
.tableau-defile { overflow-x: auto; border-radius: var(--rayon); }
.tableau-defile .tableau th { top: 0; }
#contenu { min-width: 0; }

/* ---------- Barres de défilement toujours visibles ----------
 * Sur Mac (et certains Windows), les barres sont masquées tant qu'on ne fait pas défiler :
 * on les dessine nous-mêmes pour que le médecin voie qu'une liste continue plus bas. */
.catalogue-examens, .liste-choix, .liste-import, .suggestions, .tableau-defile, .apercu-cadre, .dialogue { scrollbar-gutter: stable; }
/* Firefox (Chrome/Edge utilisent les règles ::-webkit-scrollbar ci-dessous, qui forcent l'affichage permanent) */
@supports (-moz-appearance: none) {
  .catalogue-examens, .liste-choix, .liste-import, .suggestions, .tableau-defile, .apercu-cadre, .dialogue { scrollbar-width: auto; scrollbar-color: #9AAABD #EDF1F5; }
}
.catalogue-examens::-webkit-scrollbar, .liste-choix::-webkit-scrollbar, .liste-import::-webkit-scrollbar, .suggestions::-webkit-scrollbar,
.tableau-defile::-webkit-scrollbar, .apercu-cadre::-webkit-scrollbar, .dialogue::-webkit-scrollbar { width: 12px; height: 12px; }
.catalogue-examens::-webkit-scrollbar-track, .liste-choix::-webkit-scrollbar-track, .liste-import::-webkit-scrollbar-track, .suggestions::-webkit-scrollbar-track,
.tableau-defile::-webkit-scrollbar-track, .apercu-cadre::-webkit-scrollbar-track, .dialogue::-webkit-scrollbar-track { background: #EDF1F5; border-radius: 6px; }
.catalogue-examens::-webkit-scrollbar-thumb, .liste-choix::-webkit-scrollbar-thumb, .liste-import::-webkit-scrollbar-thumb, .suggestions::-webkit-scrollbar-thumb,
.tableau-defile::-webkit-scrollbar-thumb, .apercu-cadre::-webkit-scrollbar-thumb, .dialogue::-webkit-scrollbar-thumb {
  background: #9AAABD; border-radius: 6px; border: 2px solid #EDF1F5; min-height: 40px;
}
.catalogue-examens::-webkit-scrollbar-thumb:hover, .liste-choix::-webkit-scrollbar-thumb:hover, .liste-import::-webkit-scrollbar-thumb:hover,
.suggestions::-webkit-scrollbar-thumb:hover, .tableau-defile::-webkit-scrollbar-thumb:hover, .apercu-cadre::-webkit-scrollbar-thumb:hover,
.dialogue::-webkit-scrollbar-thumb:hover { background: var(--p2); }
/* Catalogue des examens : cadre visible + ombre en bas tant qu'il reste des examens à voir */
.catalogue-examens { border: 1px solid var(--bord); border-radius: 8px; padding: 10px 6px 10px 10px;
  background: linear-gradient(#fff 30%, #fff0) top / 100% 30px no-repeat local, linear-gradient(#fff0, #fff 70%) bottom / 100% 30px no-repeat local,
    radial-gradient(farthest-side at 50% 0, #1d273326, #0000) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, #1d273326, #0000) bottom / 100% 10px no-repeat scroll;
  background-color: #fff; }
/* Catalogue des examens : défilement VERTICAL (plus de colonnes qui débordent sur le côté) */
.catalogue-examens { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; align-items: start;
  overflow-x: hidden; overflow-y: auto; }
.catalogue-examens fieldset { margin: 0; }

/* ---------- Abonnement ---------- */
.badge-licence { border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.badge-licence.essai { background: #E6F0FA; border-color: #9CC3E8; color: #1F5F9E; }
.badge-licence.orange { background: #FEF5E7; border-color: #E0B25C; color: #7d5100; }
.badge-licence.rouge { background: #FDEDEC; border-color: var(--rouge); color: var(--rouge); }
.licence-etat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; border-inline-start: 4px solid; }
.licence-etat.vert { background: var(--accent-doux); border-color: var(--accent); }
.licence-etat.bleu { background: #E6F0FA; border-color: var(--p2); }
.licence-etat.orange { background: #FEF5E7; border-color: var(--orange); }
.licence-etat.rouge { background: #FDEDEC; border-color: var(--rouge); }
#licence textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* Activation (clé d'essai / abonnement) au premier lancement */
.verrou textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; resize: vertical; }
.verrou .demande-essai { border-top: 1px solid var(--bord, #E1E6EE); margin-top: 6px; padding-top: 14px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.verrou .demande-essai p { margin: 0; color: var(--doux); }
.verrou .demande-essai .btn { text-decoration: none; justify-content: center; }
.verrou .cle-ok { background: #E3F4F1; color: #0b5f55; border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.verrou .cle-ok svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
