/* Memophone — Administration. Charte de l'espace famille (palette « 6c » de Homeshell, memophone-famille/public/style.css),
   depuis le 2026-10-08 (demande : « adapte la charte graphique et les couleurs de l'appli admin comme l'espace famille ») :
   mêmes jetons, mêmes valeurs, mêmes formes. Indigo pour les actions, vermillon pour les erreurs et suppressions, corail pour ce
   qui doit se remarquer sans alarmer ; contrastes AA. Aucune couleur en dur ailleurs que dans ces jetons. */
:root {
  --fond: #f1f3f7;        /* indigo 50 */
  --surface: #ffffff;
  --texte: #1c2436;       /* indigo 900 */
  --discret: #46566f;     /* indigo 600 */
  --indigo: #2f3e5c;      /* indigo 700 : actions */
  --aplat: #dadde4;       /* indigo 700 à 12 % */
  --filet: #8c9bb4;       /* indigo 400 */
  --bordure: #d3d8e1;
  --vermillon: #8f3020;
  --corail: #c8553d;
  --interrupteur-eteint: #c3cad6;
  --succes-fond: #e4efe6;
  --succes: #2f5f3a;
  --succes-bordure: #bcd6c1;
  --action-fond: #2f3e5c;
  --sur-action: #ffffff;
  --erreur-fond: #f6e6e2;
  --erreur-bordure: #e3bcb2;
  --attention-fond: #f8e5df;
  --attention-texte: #8a3a28;
  --attention-bordure: #ecc3b6;
  --pale: #6b7a90;
  --ombre: rgba(47, 62, 92, 0.22);
  /* Anciens noms de l'administration, reliés à la charte (les règles plus bas les utilisent encore). */
  --bg: var(--fond);
  --border: var(--bordure);
  --text: var(--texte);
  --muted: var(--discret);
  --primary: var(--indigo);
  --primary-dark: var(--indigo);
  --danger: var(--vermillon);
  --warn-bg: var(--attention-fond);
  --warn-text: var(--attention-texte);
  --error-bg: var(--erreur-fond);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  background: var(--fond);
  color: var(--texte);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
a { color: var(--indigo); }

/* Bandeau du haut fixe, comme l'espace famille : marque indigo et corail, surface blanche, filet en bas. */
.topbar {
  position: sticky; top: 0; z-index: 20; min-height: 4.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* Marque (2026-10-08) : le logo de l'app iPhone — cerveau en indigo 600, lettre A en corail —, deux calques teints par masque
   (public/logo-a-cerveau.png et logo-a-lettre.png, générés par memophone-commun/Charte/generer-animation.py --logo-web) ;
   « Memophone » en titre, « Administration » en sous-titre gris. */
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-logo { position: relative; width: 48px; height: 39px; flex-shrink: 0; }
.brand-logo::before, .brand-logo::after { content: ''; position: absolute; inset: 0; }
.brand-logo::before {
  background: var(--discret);
  -webkit-mask: url(/logo-a-cerveau.png) center / contain no-repeat; mask: url(/logo-a-cerveau.png) center / contain no-repeat;
}
.brand-logo::after {
  background: var(--corail);
  -webkit-mask: url(/logo-a-lettre.png) center / contain no-repeat; mask: url(/logo-a-lettre.png) center / contain no-repeat;
}
.brand-texte { display: flex; flex-direction: column; line-height: 1.15; }
.brand-titre { font-size: 1.25rem; font-weight: 800; color: var(--indigo); }
/* Sous-titre « Administration » en corail (2026-10-09, « affiche le sous titre en corail »), comme le A du logo. */
.brand-sous-titre { font-size: 0.85rem; font-weight: 500; color: var(--corail); }
.topnav { display: flex; align-items: center; gap: 0.6rem; }
/* L'utilisateur connecté et son rôle sur une même ligne. */
.topnav .user { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.topnav form { margin: 0; }
/* Déconnexion en icône (comme l'espace famille) : cible de 40 px. */
.bouton-icone {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: none; border-radius: 4px; background: none; color: var(--discret); cursor: pointer;
}
.bouton-icone:hover { background: var(--fond); color: var(--vermillon); }
/* Icônes d'action des tableaux (2026-11-13) : 32 px, côte à côte ; Supprimer en rouge au survol, Modifier en indigo. */
.actions .bouton-icone, .bouton-icone.bouton-danger { width: 32px; height: 32px; }
.bouton-icone:focus-visible { outline: 3px solid var(--corail); outline-offset: 1px; }
.bouton-icone.btn-edit-evt:hover { color: var(--action-fond); }
/* Ligne cliquable (cercle de confiance) : le nom est un lien, toute la ligne ouvre le volet. */
tr.ligne-cliquable { cursor: pointer; }
tr.ligne-cliquable:hover > td { background: var(--aplat); }
.lien-ligne { color: inherit; text-decoration: none; }
.lien-ligne:hover, .lien-ligne:focus-visible { text-decoration: underline; }
/* Libellé réservé aux lecteurs d'écran. */
.visuellement-cache { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.role-badge { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.05rem 0.45rem; border-radius: 99px; }
.role-admin { background: var(--aplat); color: var(--indigo); }
.role-aidant { background: var(--succes-fond); color: var(--succes); }

.container { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
.container-wide { max-width: 1160px; }
.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1rem; border-top: 1px solid var(--border); }

/* Mise en page avec menu latéral : menu COLLÉ AU BORD GAUCHE de la fenêtre, contenu à sa droite (2026-10-08, comme l'espace famille). */
main:has(> .layout) { max-width: none; margin: 0; padding: 1.5rem 1.5rem 3rem 0.75rem; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.layout-main { min-width: 0; max-width: 1160px; }
.container-journal .layout-main { max-width: 1400px; }
/* Sous le bandeau fixe (4,25 rem), comme le menu de l'espace famille. */
.sidebar { position: sticky; top: 5.5rem; }
.sidebar-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 0.6rem 0.5rem; }
.sidebar-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
/* Glisser-déposer (public/menu.js) : pas de sélection de texte ni de menu « lien » d'iOS pendant l'appui long ; rubrique tenue mise en évidence. */
.sidebar-menu { -webkit-user-select: none; user-select: none; }
.sidebar-link { -webkit-touch-callout: none; }
.sidebar-menu.tri-en-cours, .sidebar-menu.tri-en-cours .sidebar-link { cursor: grabbing; }
.sidebar-menu.tri-en-cours li:not(.deplace) .sidebar-link { opacity: 0.7; }
.sidebar-menu li.deplace .sidebar-link { background: var(--surface); color: var(--indigo); outline: 2px dashed var(--indigo); outline-offset: -2px; box-shadow: 0 4px 14px var(--ombre); }
/* Menu à icônes monochromes (teintées par currentColor), comme celui de l'espace famille. */
.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem; border-radius: 4px;
  color: var(--discret); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--surface); color: var(--indigo); }
.sidebar-link.active { background: var(--aplat); color: var(--indigo); border-left-color: var(--indigo); }
/* Première lettre de la rubrique survolée en corail, au passage de la souris seulement (demande du 2026-10-09, comme l'espace
   famille) : pas sur un écran tactile, où le toucher laisserait la lettre colorée. */
@media (hover: hover) {
  .sidebar-link:hover .sidebar-libelle::first-letter { color: var(--corail); }
}
.sidebar-ico { flex-shrink: 0; color: currentColor; }

@media (max-width: 760px) {
  main:has(> .layout) { padding: 1rem; }
  .layout { grid-template-columns: 1fr; gap: 1rem; }
  .sidebar { position: static; }
  .sidebar-menu { flex-direction: row; flex-wrap: wrap; }
}

h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.strong { font-weight: 600; color: var(--text); }
.breadcrumb { font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.empty { color: var(--muted); text-align: center; padding: 2.5rem; }

.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.inline-form { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
/* Barre du Catalogue (création d'une offre, d'un code promo) : sous les onglets, juste avant le tableau (2026-10-11). */
.barre-catalogue { margin-bottom: 1rem; }

.table { width: 100%; border-collapse: collapse; }
.table.card { padding: 0; overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--fond); }
.table tbody tr:last-child td { border-bottom: none; }
.table a { color: var(--primary); text-decoration: none; }
/* Tri des tableaux (2026-10-11, public/tri-tableau.js) : l'en-tête d'une colonne triable est un bouton à l'allure du titre ; flèche
   discrète tant que la colonne n'est pas triée, puis le sens du tri. */
.tri-entete {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer;
}
.tri-entete:hover, th[aria-sort] .tri-entete { color: var(--indigo); }
.tri-entete:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 2px; }
.tri-fleche::after { content: '↕'; font-size: 0.9em; opacity: 0.4; }
th[aria-sort="ascending"] .tri-fleche::after { content: '▲'; font-size: 0.7em; opacity: 1; }
th[aria-sort="descending"] .tri-fleche::after { content: '▼'; font-size: 0.7em; opacity: 1; }
.actions { display: flex; gap: 0.4rem; justify-content: flex-end; white-space: nowrap; }
.actions form { display: inline; }
/* Cellule d'actions d'un tableau (2026-11-13) : reste une cellule (en flex, elle sortait de la grille et décalait la ligne) ;
   icônes alignées à droite, au milieu de la ligne. */
td.actions { display: table-cell; text-align: right; vertical-align: middle; }
td.actions > *, td.actions form > * { vertical-align: middle; }
td.actions form { display: inline-block; margin-left: 0.25rem; }

/* Pastilles : celles de l'espace famille (aplat, texte, coins ronds) ; variantes plus bas. */
.badge { font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--aplat); color: var(--texte); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
/* Souscriptions en ligne à valider (2026-10-11) : rappel en tête de la liste des familles, bandeau de la fiche. */
.alerte-souscriptions { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--attention-bordure); border-radius: 4px; padding: 0.7rem 1rem; margin: 0 0 1rem; }
.alerte-souscriptions a { color: inherit; font-weight: 600; }
.souscription-attente { border-left: 4px solid var(--corail); }
.souscription-attente h2 { margin-bottom: 0.5rem; }
.actions-souscription { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.souscription-details { margin: 0.4rem 0 0.6rem 1.2rem; }
.souscription-details li { margin: 0.15rem 0; }
.badge-abo-actif { background: var(--succes-fond); color: var(--succes); }
.badge-abo-suspendu { background: var(--warn-bg); color: var(--warn-text); }
.badge-abo-resilie { background: var(--error-bg); color: var(--danger); }
.badge-moment { background: var(--aplat); color: var(--primary-dark); }
.badge-moi { background: var(--succes-fond); color: var(--succes); margin-left: 0.4rem; }
/* Type de compte (onglet « Compte » d'une aide à domicile, 2026-11-12). */
.badge-type-aide_domicile { background: var(--warn-bg); color: var(--warn-text); white-space: nowrap; }
.badge-facture { background: var(--aplat); color: var(--primary-dark); margin-left: 0.45rem; display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle; }
/* Membre facturé (2026-11-13, demande : « moins contraster la ligne du membre facturé ») : teinte et liseré adoucis. */
.row-facture { background: rgba(47, 62, 92, 0.025); }
.row-facture td:first-child { box-shadow: inset 2px 0 0 var(--filet); }
/* Aide à domicile dans l'onglet Cercle d'une famille (2026-11-13) : ligne teintée vert (succès), liseré, icône stéthoscope. */
.row-aide { background: var(--succes-fond); }
.row-aide td:first-child { box-shadow: inset 3px 0 0 var(--succes); }
.icone-aide { display: inline-flex; vertical-align: middle; margin-right: 0.35rem; color: var(--succes); }
.badge-past { background: var(--aplat); color: var(--muted); margin-left: 0.4rem; }

.hidden { display: none !important; }
.subhead { font-size: 1rem; font-weight: 600; color: var(--primary-dark); margin: 1.5rem 0 0.6rem; }
.rubrique-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rubrique-head .subhead { margin-bottom: 0.3rem; }

/* Suivi des prises (pilulier) */
.pillbox-wrap { overflow-x: auto; container-type: inline-size; }
.pillbox { min-width: 480px; }
.pillbox th, .pillbox td { text-align: center; }
/* Colonne Médicament élargie (2026-11-13 : « agrandis la zone d'affichage des médicaments ») : nom, durée, moments, puis dosage,
   posologie, période, fréquence, notes et icônes (partials/infos-medicament.ejs) ; elle passe à la ligne plutôt que d'élargir la
   grille au-delà de la carte. */
.pillbox .pillbox-med { text-align: left; white-space: normal; width: 42%; min-width: 15rem; vertical-align: top; }
.pillbox .med-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.35rem; }
.pillbox .med-details { margin-top: 0.2rem; font-size: 0.82rem; color: var(--discret); }
.pillbox .med-notes { margin-top: 0.15rem; font-size: 0.82rem; font-style: italic; color: var(--discret); }
.pillbox .med-actions { display: flex; gap: 0.25rem; margin-top: 0.25rem; }
.pillbox .med-actions form { margin: 0; display: inline; }
.pillbox .med-actions .bouton-icone { width: 28px; height: 28px; }
.pillbox-day { width: 46px; }
.pillbox th.col-today, .pillbox td.col-today { background: rgba(47, 62, 92, 0.10); }
.today-tag { font-size: 0.62rem; color: var(--primary); font-weight: 700; }
.pillbox td form { display: flex; justify-content: center; margin: 0; }
.prise-btn {
  width: 26px; height: 26px; border-radius: 4px; padding: 0; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--primary);
  font-size: 0.9rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.prise-btn:hover { border-color: var(--primary); }
.prise-btn.pris { background: var(--succes); border-color: var(--succes); color: var(--sur-action); }
.prise-mark { color: var(--border); font-size: 0.9rem; }
.prise-mark.pris { color: var(--succes); font-weight: 700; }
.prise-mark.hors-traitement { color: var(--discret); opacity: 0.6; }
.prise-mark.a-venir { color: var(--discret); opacity: 0.45; }
/* Une case par prise (2026-11-13) : petites cases côte à côte dans la cellule du jour ; verte quand la prise est faite. */
.prises-cases { display: inline-flex; gap: 0.2rem; margin: 0; flex-wrap: nowrap; justify-content: center; }
.prise-case { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.2rem;
  border: 1.5px solid var(--bordure); border-radius: 5px; background: var(--surface); color: var(--discret); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.prise-case:hover { border-color: var(--succes); color: var(--succes); }
.prise-case.pris { background: var(--succes); border-color: var(--succes); color: #fff; }
.prise-case:focus-visible { outline: 3px solid var(--corail); outline-offset: 1px; }
.prise-case.a-venir { cursor: default; opacity: 0.4; border-style: dashed; }
.prise-case.a-venir:hover { border-color: var(--bordure); color: var(--discret); }
/* Médicament passé (2026-11-13) : ligne grisée, cases figées. */
tr.ligne-terminee > td { color: var(--discret); background: var(--aplat); }
tr.ligne-terminee .badge-moment { opacity: 0.6; }
.badge-termine { background: var(--bordure); color: var(--texte); }
.prise-case.fige { cursor: default; opacity: 0.55; }
.prise-case.fige:hover { border-color: var(--bordure); color: var(--discret); }
.prise-case.fige.pris:hover { border-color: var(--succes); color: #fff; }
.legende-prises { font-size: 0.85rem; margin-top: 0; }
/* Défilement de la période des prises (2026-11-13). */
.prises-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0 0.75rem; }
.prises-nav a[aria-current="page"] { background: var(--action-fond); border-color: var(--action-fond); color: #fff; }
.prises-periode { margin-left: 0.4rem; color: var(--discret); font-size: 0.9rem; }
/* Volet d'un médicament (2026-11-13) : date de fin calculée, présentée comme un champ en lecture seule. */
.etiquette { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.8rem 0 0.25rem; }
.date-fin { display: inline-flex; align-items: center; min-height: 2.4rem; padding: 0 0.7rem; border: 1px dashed var(--bordure); border-radius: 4px; color: var(--texte); background: var(--aplat); }

/* Onglets de la fiche famille (2026-10-08) : pastilles sur UNE seule ligne (défilement horizontal si la fenêtre est étroite),
   l'onglet ouvert plein indigo comme les sous-onglets de l'espace famille. */
.tabs { display: flex; flex-wrap: nowrap; gap: 0.35rem; overflow-x: auto; margin-bottom: 1.25rem; padding: 2px 2px 4px; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 999px;
  padding: 0.38rem 0.8rem; width: auto;
  font-size: 0.86rem; font-weight: 600; font-family: inherit; color: var(--discret); cursor: pointer;
}
.tab:hover { color: var(--indigo); border-color: var(--filet); }
.tab.active { background: var(--action-fond); border-color: var(--action-fond); color: var(--sur-action); }
.tab-count { font-size: 0.72rem; background: var(--aplat); color: var(--texte); border-radius: 999px; padding: 0.02rem 0.45rem; }
.tab.active .tab-count, .tab.active .badge { background: rgba(255, 255, 255, 0.22); color: var(--sur-action); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.restants-info { font-size: 0.82rem; }
.btn-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.inline-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Calendrier visuel (onglet Calendrier) — calendrier à gauche, liste à droite */
.cal-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-events { flex: 1; min-width: 260px; }
.cal-widget { border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.1rem; margin-bottom: 1.5rem; background: var(--fond); }
/* Variante compacte utilisée dans la disposition côte à côte */
.cal-widget-sm { max-width: 270px; flex: 0 0 auto; margin-bottom: 0; padding: 0.7rem 0.8rem; }
.cal-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.cal-title { font-weight: 700; color: var(--primary-dark); letter-spacing: 0.5px; flex: 1; text-align: center; }
.cal-widget-sm .cal-title { font-size: 0.9rem; }
.cal-nav, .cal-today { background: none; border: none; width: auto; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 4px; }
.cal-today { font-size: 1rem; }
.cal-nav:hover, .cal-today:hover { background: var(--surface); color: var(--primary); }
.cal-days-header { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 0.2rem; }
.cal-day-name { text-align: center; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0.2rem 0; }
.cal-widget-sm .cal-day-name { font-size: 0.62rem; padding: 0.1rem 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-cell { min-height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0.25rem 0 0.15rem; border-radius: 4px; }
.cal-widget-sm .cal-cell { min-height: 28px; padding: 0.15rem 0 0.1rem; border-radius: 4px; }
.cal-cell.empty { background: none; }
.cal-cell:not(.empty):hover { background: var(--surface); }
.cal-num { font-size: 0.9rem; color: var(--text); line-height: 1.1; }
.cal-widget-sm .cal-num { font-size: 0.78rem; }
.cal-cell.weekend .cal-num { color: var(--muted); }
.cal-cell.today { background: rgba(47, 62, 92, 0.12); }
.cal-cell.today .cal-num { color: var(--primary-dark); font-weight: 700; }
.cal-cell.ferie .cal-num { color: var(--danger); font-weight: 600; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 3px; }
.cal-widget-sm .cal-dot { width: 5px; height: 5px; margin-top: 2px; }
.cal-legend { display: flex; gap: 1.2rem; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--muted); }
.cal-widget-sm .cal-legend { gap: 0.8rem; font-size: 0.68rem; margin-top: 0.5rem; padding-top: 0.45rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-legend-dot.evt { background: var(--primary); }
.cal-legend-dot.ferie { background: var(--danger); }

/* Statistiques du jour (onglet Stats) */
.stat-health { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.1rem; border-radius: 4px; font-size: 1rem; margin: 1rem 0 1.25rem; }
.stat-health-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.stat-health-vert { background: var(--succes-fond); color: var(--succes); border: 1px solid var(--succes-bordure); }
.stat-health-vert .stat-health-dot { background: var(--succes); }
.stat-health-orange { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--attention-bordure); }
.stat-health-orange .stat-health-dot { background: var(--corail); }
.stat-health-rouge { background: var(--error-bg); color: var(--danger); border: 1px solid var(--erreur-bordure); }
.stat-health-rouge .stat-health-dot { background: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.stat-card { border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.1rem; background: var(--fond); }
.stat-val { font-size: 1.7rem; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.stat-val-text { font-size: 1.2rem; }
.stat-unit { font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.stat-sep { height: 1px; background: var(--border); margin: 0.7rem 0; }
.stat-lbl { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.35rem; }
.stat-lbl-head { margin: 0 0 0.5rem; color: var(--primary-dark); font-weight: 700; }
.stat-pair { font-size: 0.9rem; color: var(--text); margin-top: 0.2rem; }
.stat-pair-val { display: inline-block; min-width: 1.4em; font-weight: 700; color: var(--primary-dark); }
.batt-bar { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; margin: 0.5rem 0 0.1rem; }
.batt-fill { height: 100%; background: var(--succes); border-radius: 99px; }
.batt-fill.low { background: var(--danger); }

/* Page Statistiques (graphe abonnements / CA) */
.chart-wrap { overflow-x: auto; }
.stats-chart { width: 100%; min-width: 600px; height: auto; display: block; }
.chart-legend { display: flex; gap: 1.5rem; margin-bottom: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-key { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-key-ca { background: var(--indigo); }
.chart-key-actifs { background: var(--corail); border-radius: 99px; height: 4px; }
/* Légende d'une courbe (Statistiques › Consommation IA, Visites, 2026-10-08) : un trait. */
.chart-key-ligne { border-radius: 99px; height: 4px; }
.chart-key-indigo { background: var(--indigo); }
.chart-key-corail { background: var(--corail); }
.chart-key-succes { background: var(--succes); }
a.tab { text-decoration: none; }

/* Filtre des événements par mois / année */
.cal-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.cal-filter label { margin: 0; font-size: 0.85rem; }
.cal-filter select { width: auto; }
tr.filter-hidden { display: none !important; }

@media (max-width: 720px) {
  .cal-layout { flex-direction: column; }
  .cal-widget-sm { max-width: 100%; width: 100%; }
}

/* Boutons de l'espace famille : plein indigo (action principale), contour indigo (secondaire), contour vermillon (danger). */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--action-fond);
  border-radius: 4px;
  background: var(--surface);
  color: var(--indigo);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--aplat); }
.btn-primary { background: var(--action-fond); border-color: var(--action-fond); color: var(--sur-action); }
.btn-primary:hover { background: var(--action-fond); filter: brightness(1.15); }
.btn-danger { color: var(--vermillon); border-color: var(--vermillon); }
.btn-danger:hover { background: var(--erreur-fond); }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-ghost { border: none; background: none; color: var(--discret); font-weight: 500; }
.btn-ghost:hover { background: var(--fond); color: var(--indigo); }
.btn-block { width: 100%; }

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.8rem 0 0.25rem; }
/* Champs ajustés à la largeur de la donnée saisie (fallback JS : autosize.js) */
input, select, textarea {
  width: auto;
  min-width: 14ch;
  max-width: 100%;
  field-sizing: content;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--filet);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--texte);
}
textarea { min-width: min(40ch, 100%); }
/* Cases et boutons radio : à leur taille, collés à leur libellé (la largeur minimale des champs les en écartait ; 2026-10-10). */
input[type="checkbox"], input[type="radio"] { min-width: 0; width: auto; padding: 0; }
/* Interrupteurs (2026-11-12, demande : « remplacer les cases à cocher binaires par des switchs ») : une case à cocher oui / non
   porte `class="switch" role="switch"` ; elle reste une vraie case (formulaire, clavier : Espace) dessinée en interrupteur,
   indigo quand elle est activée, comme les interrupteurs du catalogue. Les listes de choix (personnes, jours, offres,
   spécialisations) gardent leurs cases. */
input[type="checkbox"].switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 2.6rem; height: 1.5rem; min-width: 0; margin: 0;
  padding: 0; border: none; border-radius: 0.75rem; background: var(--interrupteur-eteint); cursor: pointer; vertical-align: middle;
  field-sizing: fixed; transition: background 0.15s;
}
input[type="checkbox"].switch::before {
  content: ''; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px var(--ombre); transition: transform 0.15s;
}
input[type="checkbox"].switch:checked { background: var(--action-fond); }
input[type="checkbox"].switch:checked::before { transform: translateX(1.1rem); }
input[type="checkbox"].switch:focus-visible { outline: 3px solid var(--corail); outline-offset: 2px; }
input[type="checkbox"].switch:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { input[type="checkbox"].switch, input[type="checkbox"].switch::before { transition: none; } }
/* Champ désactivé (conditions figées d'un code promo utilisé, 2026-10-10) : grisé, comme une liste désactivée. */
input:disabled, select:disabled, textarea:disabled { background: var(--fond); color: var(--muted); cursor: not-allowed; }
/* Mise au point visible au clavier, comme l'espace famille : contour corail. */
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--corail); outline-offset: 1px; }

fieldset { border: 1px solid var(--border); border-radius: 4px; margin: 0 0 1rem; padding: 0.5rem 1rem 1rem; }
legend { font-size: 0.85rem; font-weight: 700; color: var(--primary-dark); padding: 0 0.4rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }

.patient-body { display: flex; gap: 2rem; align-items: flex-start; }
.patient-body .patient-info { flex: 1; min-width: 0; }
.subhead-memophone { display: flex; align-items: center; gap: 0.4rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.subhead-memophone svg { color: var(--primary); }
.map-widget { margin: 0; width: 200px; flex-shrink: 0; margin-left: auto; }
.map-widget iframe { border: 1px solid var(--border); border-radius: 4px; display: block; }
.map-widget figcaption { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.35rem; text-align: center; }
.map-widget figcaption a { color: var(--muted); text-decoration: none; }
.map-widget figcaption a:hover { color: var(--primary); }

.fiche { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 2rem; margin: 0; }
.fiche-1col { grid-template-columns: 1fr; margin-top: 0.6rem; }
/* Abonnement (2026-11-13) : souscription / remise / code promo sur une ligne ; renouvellements sur la suivante. Téléphone : 1 colonne. */
.fiche-3col { grid-template-columns: repeat(3, 1fr); }
.fiche-suite { margin-top: 0.6rem; }
.pdf-icon { color: var(--danger); display: inline-flex; }
.pdf-icon:hover { color: var(--primary); }
.fiche dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.fiche dd { margin: 0.1rem 0 0; }

.alert { padding: 0.7rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: var(--error-bg); color: var(--danger); border: 1px solid var(--erreur-bordure); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--attention-bordure); }
.alert-success { background: var(--succes-fond); color: var(--succes); border: 1px solid var(--succes-bordure); }
.inline-pwd { display: flex; gap: 0.4rem; align-items: center; }
.addr-ok { display: inline-block; margin-top: 0.35rem; font-size: 0.8rem; color: var(--succes); font-weight: 600; }
/* Autocomplétion d'adresse (Base Adresse Nationale) */
.addr-autocomplete { position: relative; max-width: 480px; }
.addr-autocomplete > input { min-width: 30ch; }
.addr-suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; margin: 3px 0 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 6px 18px var(--ombre); max-height: 240px; overflow-y: auto; }
.addr-sugg { padding: 0.5rem 0.7rem; font-size: 0.9rem; cursor: pointer; }
.addr-sugg:hover, .addr-sugg.active { background: var(--aplat); color: var(--primary-dark); }
input[type="file"] { field-sizing: auto; width: auto; max-width: 100%; padding: 0.4rem; }
.checkbox-line { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.checkbox-line input { width: auto; }
.radio-line { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; margin: 0.2rem 1.2rem 0.4rem 0; }
.radio-line input { width: auto; }
.paiement-bloc { display: none; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border); }
.readonly-value { display: inline-block; padding: 0.55rem 0.7rem; border: 1px dashed var(--border); border-radius: 4px; background: var(--fond); color: var(--muted); font-size: 0.95rem; min-width: 14ch; }
.field-hint { font-size: 0.78rem; color: var(--muted); margin: 0.3rem 0 0; }

.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 380px; }
.login-card h1 { margin-top: 0; }
.login-card .btn { margin-top: 1.2rem; }
/* Formulaire dont les champs occupent toute la largeur (connexion), au lieu de
   s'ajuster à la donnée saisie ; autosize.js les laisse aussi tranquilles. */
.pleine-largeur input:not([type=checkbox]):not([type=radio]),
.pleine-largeur select,
.pleine-largeur textarea { width: 100%; min-width: 0; field-sizing: fixed; }

@media (max-width: 640px) {
  .row, .fiche { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .patient-body { flex-direction: column; }
  .map-widget { margin-left: 0; }
}

/* Aperçu / affichage des caractéristiques de l'offre liée à l'abonnement */
.offre-apercu, .offre-souscrite {
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.9rem 1.1rem; margin-top: 0.6rem; background: var(--fond);
}
.offre-apercu-head, .offre-souscrite-head {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.offre-apercu-nom, .offre-souscrite-nom { font-weight: 600; color: var(--primary-dark); font-size: 1.05rem; }
.offre-apercu-eng {
  font-size: 0.72rem; background: var(--aplat); color: var(--primary-dark);
  border-radius: 99px; padding: 0.1rem 0.55rem;
}
.offre-apercu-tarifs, .offre-souscrite-tarifs {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin: 0.6rem 0; padding: 0.5rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 0.9rem;
}
.offre-apercu-tarifs strong, .offre-souscrite-tarifs strong { color: var(--text); }
.offre-apercu-rub, .offre-souscrite-rub {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin: 0.7rem 0 0.25rem;
}
.offre-apercu-list, .offre-souscrite-list { list-style: none; margin: 0; padding: 0; }
.offre-apercu-list li, .offre-souscrite-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.25rem 0; border-bottom: 1px dashed var(--border); font-size: 0.9rem;
}
.offre-apercu-list li:last-child, .offre-souscrite-list li:last-child { border-bottom: none; }

/* Renommer une famille (depuis le titre) */
.title-row { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.title-row h1 { margin-bottom: 0; }
.rename-famille { position: relative; }
.rename-famille summary { display: inline-flex; cursor: pointer; list-style: none; }
.rename-famille summary::-webkit-details-marker { display: none; }
.rename-famille[open] summary { background: var(--surface); }
.rename-famille form { margin-top: 0.5rem; }

/* Statut de l'abonnement aligné sur le titre « Offre souscrite » */
.subhead-abo { display: flex; align-items: center; gap: 0.6rem; }

/* Espace famille : sécurité (2026-10-05) */
.alert-info { background: var(--aplat); color: var(--texte); border: 1px solid var(--bordure); }
.alert-info a { color: var(--indigo); font-weight: 600; }
.badge-bloque { background: var(--error-bg); color: var(--danger); font-size: 0.7rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 99px; }
.connexion-famille { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; }
.connexion-famille form { margin: 0; }
.choix-securite { display: flex; gap: 1.5rem; margin: 1rem 0; }
.choix-securite label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.liste-simple { margin: 0.5rem 0 0; padding-left: 1.2rem; line-height: 1.8; }
.champ-large { width: 100%; field-sizing: fixed; }

/* Journal d'activité (2026-10-07) */
.container-journal { max-width: 1400px; }
.filtres-journal { padding-top: 0.4rem; }
.filtres-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; }
.filtres-grille input, .filtres-grille select { width: 100%; min-width: 0; field-sizing: fixed; }
.filtres-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.8rem; }
/* Journal (2026-11-13) : filtres et bouton « Filtrer » sur une même ligne ; les champs se partagent la largeur (130 px au moins),
   les boutons gardent la leur, en bas de la ligne, alignés sur les champs. Fenêtre étroite : passage à la ligne. */
.filtres-journal .filtres-grille { display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: flex-end; }
.filtres-journal .filtres-grille > div { flex: 1 1 130px; min-width: 0; }
.filtres-journal .filtres-grille > .filtres-actions { flex: 0 0 auto; margin-top: 0; }
.filtres-grille .filtres-actions { align-self: end; margin-top: 0; }
.filtres-grille .filtres-actions .btn { min-height: 2.4rem; }
.journal-total { margin: 0 0 0.5rem; font-size: 0.88rem; }
.journal-wrap { padding: 0; overflow-x: auto; }
.table-journal { min-width: 900px; font-size: 0.86rem; }
.table-journal th, .table-journal td { padding: 0.55rem 0.7rem; }
.table-journal td { vertical-align: top; }
.table-journal .col-date { white-space: nowrap; }
.table-journal .col-action { min-width: 12.5rem; max-width: 18rem; overflow-wrap: anywhere; }
.table-journal .col-detail { min-width: 11rem; max-width: 24rem; overflow-wrap: anywhere; }
.table-journal .col-ip { white-space: nowrap; color: var(--muted); }
.action-journal { font-size: 0.82rem; background: var(--aplat); border-radius: 4px; padding: 0.05rem 0.35rem; }
.pagination-journal { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }

/* Interrupteur « Visible sur le site de présentation » des offres (2026-10-09), comme celui du mode sombre de l'espace famille :
   un bouton `role="switch"` sans script, indigo quand il est actif. */
.ligne-interrupteur { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.interrupteur {
  position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: none; border-radius: 15px;
  background: var(--interrupteur-eteint); cursor: pointer; transition: background 0.15s;
}
.interrupteur[aria-checked="true"] { background: var(--action-fond); }
.interrupteur-curseur {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px var(--ombre); transition: transform 0.15s;
}
.interrupteur[aria-checked="true"] .interrupteur-curseur { transform: translateX(22px); }
.interrupteur:focus-visible { outline: 3px solid var(--corail); outline-offset: 2px; }
.interrupteur-etat { font-size: 0.85rem; color: var(--discret); }
/* Ligne des onglets d'une aide à domicile (2026-11-12) : onglets à gauche, interrupteur « Compte actif » à droite. */
.barre-onglets { display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.barre-onglets .tabs { margin-bottom: 0; min-width: 0; }
.interrupteur-aide { margin-left: auto; }
.visibilite-offre { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bordure); }
/* Présentation d'une offre sur le site (2026-10-11) : aperçu de la pastille, comme sur la carte du site de présentation. */
.ligne-pastille { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.apercu-pastille { background: var(--vermillon); color: #fff; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.38rem 0.8rem; border-radius: 980px; white-space: nowrap; }
.apercu-pastille[hidden] { display: none; }
.form-presentation textarea { width: 100%; min-width: 0; field-sizing: fixed; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) {
  .interrupteur, .interrupteur-curseur { transition: none; }
}

/* Bascule de clientèle GP / PRO des offres (2026-10-09) : deux boutons accolés, celui de la clientèle actuelle plein indigo. */
.bascule-clientele { display: inline-flex; margin: 0; border: 1px solid var(--bordure); border-radius: 6px; overflow: hidden; }
.bascule-clientele .bascule {
  min-width: 3rem; padding: 0.35rem 0.7rem; border: none; background: var(--surface); color: var(--discret);
  font: inherit; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.03em; cursor: pointer;
}
.bascule-clientele .bascule + .bascule { border-left: 1px solid var(--bordure); }
.bascule-clientele .bascule:hover { color: var(--indigo); background: var(--fond); }
.bascule-clientele .bascule.active { background: var(--action-fond); color: var(--sur-action); cursor: default; }
.bascule-clientele .bascule:focus-visible { outline: 3px solid var(--corail); outline-offset: -3px; }

/* Codes promo (2026-10-10) : Catalogue › Codes promo, fiche d'un code, saisie dans l'abonnement de la famille. */
.field-error { font-size: 0.8rem; font-weight: 600; color: var(--danger); margin: 0.3rem 0 0; }
.code-promo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 0.04em; }
input.saisie-code { text-transform: uppercase; }
input.saisie-code::placeholder { text-transform: none; }
.liste-offres-code { display: flex; flex-wrap: wrap; gap: 0 1.4rem; margin-top: 0.3rem; }
.liste-offres-code .checkbox-line { margin: 0.35rem 0; font-weight: 500; }
.table-defilante { overflow-x: auto; margin-bottom: 1rem; }
.table-codes-promo { min-width: 860px; }
.table-codes-promo td { vertical-align: middle; }
.badge-promo-utilisable { background: var(--succes-fond); color: var(--succes); }
.badge-promo-a-venir { background: var(--aplat); color: var(--primary-dark); }
.badge-promo-expire, .badge-promo-epuise { background: var(--warn-bg); color: var(--warn-text); }
.badge-promo-desactive { background: var(--aplat); color: var(--muted); }
h1 .badge { vertical-align: middle; font-size: 0.8rem; }

/* Volet glissant de la droite (2026-11-12, fiche patient de la page Famille, public/volet.js) : la page et son menu de gauche
   restent en place derrière ; sur téléphone, le volet prend toute la largeur. */
dialog.volet {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0;
  width: min(36rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: var(--surface); color: var(--texte); box-shadow: -8px 0 32px var(--ombre);
  overflow: hidden;
}
dialog.volet[open] { display: flex; animation: volet-entree 0.22s ease-out; }
dialog.volet.volet-sortie { animation: volet-sortie 0.18s ease-in forwards; }
dialog.volet::backdrop { background: rgba(28, 36, 54, 0.35); }
@keyframes volet-entree { from { transform: translateX(100%); } to { transform: none; } }
@keyframes volet-sortie { from { transform: none; } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { dialog.volet[open], dialog.volet.volet-sortie { animation: none; } }
.volet-form { display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; }
.volet-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bordure); }
.volet-tete h2 { margin: 0; font-size: 1.15rem; }
.volet-corps { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.volet-pied { margin: 0; padding: 0.85rem 1.25rem; border-top: 1px solid var(--bordure); background: var(--surface); }
/* Champs du volet : ajustés à leur contenu, comme partout (2026-11-12) ; jamais plus larges que le volet. */
.volet-corps input, .volet-corps select, .volet-corps textarea { max-width: 100%; box-sizing: border-box; }
/* Petit écran : le volet couvre tout l'écran (la page de l'administration peut déborder en largeur sur téléphone). */
@media (max-width: 640px) { dialog.volet { inset: 0; width: auto; max-width: none; } }

/* Aides à domicile (2026-11-12) : liste et fiche. */
.onglets-filtre { display: flex; gap: 0.4rem; margin: 0.8rem 0; flex-wrap: wrap; }
.onglets-filtre a { padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--bordure); color: var(--texte); text-decoration: none; }
.onglets-filtre a[aria-current="page"] { background: var(--action-fond); color: var(--sur-action); border-color: var(--action-fond); }
.table-defilante { overflow-x: auto; }
.zone-cellule { max-width: 16rem; }
.fiche-aide .choix { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; margin: 0.25rem 0; }
/* Jours de visite à cocher (ajout d'une visite, 2026-11-12) : sept pastilles Lun … Dim, pleines quand elles sont cochées. */
.fiche-aide fieldset.jours-visite { border: none; padding: 0; margin: 0.5rem 0 0; }
.fiche-aide fieldset.jours-visite legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.jours-visite-cases { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.jour-visite { position: relative; margin: 0; cursor: pointer; }
.jour-visite input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jour-visite span { display: inline-block; min-width: 2.9rem; text-align: center; padding: 0.4rem 0.55rem; border: 1px solid var(--bordure);
  border-radius: 999px; font-weight: 500; font-size: 0.9rem; background: var(--surface); }
.jour-visite input:checked + span { background: var(--action-fond); border-color: var(--action-fond); color: #fff; }
.jour-visite input:focus-visible + span { outline: 3px solid var(--corail); outline-offset: 2px; }
.jours-visite[aria-invalid="true"] .jour-visite span { border-color: var(--vermillon); }
.choix-statut { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.cases-specialisations { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 1rem; margin-bottom: 0.6rem; }
.libelle-groupe { font-weight: 600; margin: 0.8rem 0 0.2rem; }
.aide-champ { font-size: 0.85rem; margin: 0.2rem 0 0; }
.erreur-champ { color: var(--vermillon); font-size: 0.88rem; margin: 0.25rem 0 0; }
.fiche-aide [aria-invalid="true"] { border-color: var(--vermillon); }
.liste-patients { list-style: none; margin: 0.6rem 0 0; padding: 0; max-height: 22rem; overflow-y: auto; border: 1px solid var(--bordure); border-radius: 6px; }
.liste-patients li { padding: 0.35rem 0.75rem; border-bottom: 1px solid var(--bordure); }
.liste-patients li:last-child { border-bottom: 0; }
.liste-patients li[hidden] { display: none; }
/* Onglet « Patients » avec carte (2026-11-12) : liste sur le quart gauche, carte sur les trois quarts droits ; sur un écran étroit,
   la carte passe au-dessus de la liste. Repères : domicile de l'aide (corail), personnes accompagnées par l'aide (indigo),
   autres (gris) ; pâlis hors de la zone d'intervention ; personne choisie sur la carte : surbrillance dans la liste. */
.patients-carte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1rem; align-items: start; }
.patients-carte > .card { margin: 0; min-width: 0; }
.patients-liste fieldset { min-width: 0; }
.liste-patients .choix input[type="checkbox"] { flex: none; width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; }
.liste-patients .choix { align-items: flex-start; }
.patients-liste .liste-patients { max-height: calc(70vh - 6rem); }
.liste-patients li.surbrillance { background: var(--attention-fond); box-shadow: inset 4px 0 0 var(--corail); }
.liste-patients li.hors-zone { opacity: 0.55; }
.distance-patient { display: block; font-size: 0.8rem; }
.carte-aide { display: flex; flex-direction: column; gap: 0.6rem; }
.carte-outils { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin: 0; }
.carte-outils label { font-weight: 600; margin: 0; }
.carte-outils input[type="range"] { flex: 1 1 12rem; max-width: 22rem; accent-color: var(--corail); }
.carte-outils output { min-width: 3.5rem; font-weight: 600; }
.carte-compte { flex-basis: 100%; }
.carte-aide-fond { height: 70vh; min-height: 420px; border-radius: 6px; border: 1px solid var(--bordure); z-index: 0; }
.carte-aide-fond[hidden] { display: none; }
.carte-etat:empty { display: none; }
.carte-etat { margin: 0; }
.repere-patient { fill: #98a2b3; stroke: #fff; fill-opacity: 0.95; cursor: pointer; }
.repere-patient.repere-affecte { fill: var(--action-fond); }
.repere-patient.repere-hors-zone { fill-opacity: 0.35; stroke-opacity: 0.6; }
.repere-patient.repere-selectionne { stroke: var(--corail); stroke-width: 4; }
.zone-aide { fill: var(--corail); fill-opacity: 0.08; stroke: var(--corail); stroke-width: 2; stroke-dasharray: 6 4; }
.repere-aide { display: flex !important; align-items: center; justify-content: center; border-radius: 50%; background: var(--corail);
  color: #fff; font-size: 18px; line-height: 1; border: 2px solid #fff; box-shadow: 0 1px 4px var(--ombre); }
.legende-carte { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.pastille-legende { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--bordure); }
.legende-aide { background: var(--corail); }
.legende-affectee { background: var(--action-fond); }
.legende-autre { background: #98a2b3; }
/* Fenêtre étroite (menu de gauche compris) : la carte passe au-dessus de la liste. */
@media (max-width: 1100px) {
  .patients-carte { grid-template-columns: minmax(0, 1fr); }
  .patients-carte .carte-aide { order: -1; }
  .carte-aide-fond { height: 55vh; min-height: 320px; }
}
#recherche-patients { width: 100%; box-sizing: border-box; }
.zone-suppression { margin-top: 1.5rem; }
/* Fiche d'une aide : champs ajustés à leur contenu, comme partout (2026-11-12). */
.fiche-aide input, .fiche-aide select, .fiche-aide textarea { max-width: 100%; box-sizing: border-box; }
.sans-coupure { white-space: nowrap; }

/* Planning des aides à domicile (2026-11-12) : semaine du lundi au dimanche, une carte par visite. */
.planning-barre { display: flex; align-items: center; gap: 0.8rem 1.2rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.planning-nav { display: flex; gap: 0.35rem; }
.planning-nav a[aria-current="page"] { background: var(--action-fond); color: var(--sur-action); border-color: var(--action-fond); }
.planning-titre { margin: 0; font-size: 1.1rem; }
.planning-total { margin: 0; flex: 1; }
.planning-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.5rem; }
.planning-jour { background: var(--surface); border: 1px solid var(--bordure); border-radius: 8px; padding: 0.5rem; min-height: 9rem; min-width: 0; }
.planning-jour h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--discret); margin: 0 0 0.5rem; display: flex; justify-content: space-between; }
.planning-numero { font-size: 1rem; color: var(--texte); }
.planning-aujourdhui { border-color: var(--action-fond); box-shadow: inset 0 3px 0 var(--action-fond); }
.planning-vide { text-align: center; margin: 1.5rem 0 0; }
.visite { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.55rem; margin-bottom: 0.4rem; border-radius: 6px; border-left: 3px solid var(--action-fond);
  background: var(--fond); color: var(--texte); text-decoration: none; font-size: 0.85rem; overflow-wrap: anywhere; }
.visite:hover { background: var(--aplat); }
.visite-heure { font-weight: 700; }
.visite-famille, .visite-objet { font-size: 0.78rem; }
.visite-annulee { opacity: 0.6; }
.visite-annulee .visite-heure, .visite-annulee .visite-personne { text-decoration: line-through; }
.visite-badge { align-self: flex-start; margin-top: 0.2rem; }
.pousse-gauche { margin-right: auto; }
/* Visite d'une série (2026-11-12) : section « Série » du volet, et choix « Cette visite seulement » / « Toute la série » à la
   validation, au-dessus des boutons du pied du volet. */
.fiche-aide fieldset.serie-visite { margin-top: 1rem; }
.volet-pied .form-actions { margin: 0; }
.choix-portee { margin-bottom: 0.75rem; padding: 0.75rem; border: 1px solid var(--bordure); border-radius: 6px; background: var(--aplat); }
.choix-portee[hidden], .volet-pied .btn[hidden] { display: none; }
.choix-portee-question { margin: 0 0 0.5rem; }
.choix-portee-boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
@media (max-width: 1100px) { .planning-semaine { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
@media (max-width: 640px) { .planning-semaine { grid-template-columns: 1fr; } .planning-jour { min-height: 0; } .planning-vide { margin: 0; } }

/* Vue « Mois » du planning (2026-11-12) : grille lundi → dimanche ; sur téléphone, la liste des jours qui ont des visites. */
.planning-vues { margin: 0; }
.mois-grille { border: 1px solid var(--bordure); border-radius: 8px; overflow: hidden; background: var(--surface); }
.mois-entete, .mois-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mois-entete span { padding: 0.4rem 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--discret); background: var(--fond); border-bottom: 1px solid var(--bordure); }
.mois-jour { min-height: 6.5rem; padding: 0.3rem; border-right: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); min-width: 0; }
.mois-semaine .mois-jour:last-child { border-right: 0; }
.mois-semaine:last-child .mois-jour { border-bottom: 0; }
.mois-hors { background: var(--fond); }
.mois-hors .mois-numero { color: var(--pale); }
.mois-numero { display: block; text-align: right; font-weight: 700; font-size: 0.85rem; color: var(--texte); text-decoration: none; padding: 0 0.2rem 0.2rem; }
.mois-numero:hover { text-decoration: underline; }
.mois-nom-jour { display: none; }
.mois-jour.planning-aujourdhui { box-shadow: inset 0 3px 0 var(--action-fond); }
.mois-jour.planning-aujourdhui .mois-numero { color: var(--action-fond); }
.visite-mini { flex-direction: row; gap: 0.3rem; padding: 0.15rem 0.35rem; margin-bottom: 0.2rem; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mois-plus { display: block; font-size: 0.75rem; color: var(--discret); padding: 0 0.35rem; }
@media (max-width: 640px) {
  .mois-entete { display: none; }
  .mois-semaine { display: block; }
  .mois-jour { min-height: 0; border-right: 0; }
  .mois-jour.mois-vide, .mois-jour.mois-hors { display: none; }
  .mois-numero { text-align: left; }
  .mois-nom-jour { display: inline; }
  .visite-mini { white-space: normal; }
}

/* Une couleur par personne dans le planning (2026-11-12, lib/planning-aides.js › couleursPatients) : liseré franc et fond teinté ;
   le texte reste celui de la charte (contraste AA sur ces fonds clairs). Le nom est toujours écrit : la couleur n'est qu'un repère. */
.patient-c0 { --c-bord: #2f3e5c; --c-fond: #e3e7f0; }
.patient-c1 { --c-bord: #c8553d; --c-fond: #f9e4df; }
.patient-c2 { --c-bord: #2f7d4f; --c-fond: #e1f1e6; }
.patient-c3 { --c-bord: #6b4fa3; --c-fond: #ece6f6; }
.patient-c4 { --c-bord: #1f7a8c; --c-fond: #dff0f3; }
.patient-c5 { --c-bord: #a86b00; --c-fond: #f8ecd6; }
.patient-c6 { --c-bord: #b03a6f; --c-fond: #f7e1eb; }
.patient-c7 { --c-bord: #5f7a1e; --c-fond: #ecf2dc; }
.patient-c8 { --c-bord: #7a4b2a; --c-fond: #f0e6dd; }
.patient-c9 { --c-bord: #4f5d6b; --c-fond: #e7eaee; }
.visite[class*="patient-c"] { border-left-color: var(--c-bord); background: var(--c-fond); }
.visite[class*="patient-c"]:hover { background: var(--c-fond); box-shadow: inset 0 0 0 1px var(--c-bord); }
.legende-patients { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: -0.3rem 0 0.9rem; padding: 0; font-size: 0.85rem; }
.legende-patients li { display: flex; align-items: center; gap: 0.35rem; }
.pastille-patient { width: 0.85rem; height: 0.85rem; border-radius: 3px; background: var(--c-fond); border: 2px solid var(--c-bord); flex-shrink: 0; }

/* Catalogue (2026-11-13, demande : « homogénéiser la hauteur des champs ») : champs d'une ligne, listes et boutons des
   formulaires à la même hauteur (2.5rem) sur les pages du catalogue (offres, articles, codes promo) ; les boutons d'action
   des tableaux gardent leur taille. */
.page-catalogue input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
.page-catalogue select { height: 2.5rem; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.page-catalogue form .btn { height: 2.5rem; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
.page-catalogue .actions form .btn, .page-catalogue td form .btn { height: auto; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.page-catalogue .inline-form { align-items: flex-end; }

/* Ordonnance analysée (2026-11-13) : bouton de chargement (le champ fichier est caché, le libellé fait bouton), état de l'analyse,
   fenêtre de relecture plus large, un cadre par médicament proposé, texte lu repliable. */
/* `position: relative` : le champ de fichier caché (position absolue) reste dans le bouton au lieu d'élargir la page. */
.ordonnance-charger { cursor: pointer; margin: 0; position: relative; overflow: hidden; }
.ordonnance-charger[hidden] { display: none; }
.ordonnance-charger:focus-within { outline: 3px solid var(--corail); outline-offset: 2px; }
.ordonnance-etat { margin-right: auto; }
.ordonnance-etat.ordonnance-erreur { color: var(--vermillon); font-weight: 600; }
dialog.volet.volet-large { width: min(760px, 100vw); max-width: 100vw; }
.medicament-propose { margin: 0.9rem 0; padding: 0.4rem 0.9rem 0.9rem; border: 1px solid var(--bordure); border-radius: 6px; }
.medicament-propose legend { padding: 0 0.3rem; }
.texte-ordonnance summary { cursor: pointer; font-weight: 600; margin: 0.6rem 0; }
.texte-ordonnance pre { white-space: pre-wrap; font-size: 0.85rem; background: var(--aplat); padding: 0.7rem; border-radius: 4px; max-height: 14rem; overflow: auto; }

/* Pilulier groupé par ordonnance (2026-11-13) : en-tête de groupe (date, prescripteur, lien vers le scan). */
/* Ligne de titre contrastée (2026-11-13, demande : « contraster la ligne de titre de l'ordonnance ») : fond indigo, texte clair. */
.groupe-ordonnance th { background: var(--action-fond); color: var(--sur-action); text-align: left; font-weight: 500; padding: 0.5rem 0.75rem;
  text-transform: none; letter-spacing: normal; font-size: 0.92rem; border-top: 2px solid var(--surface); }
/* Le contenu de l'en-tête reste dans la largeur VISIBLE du tableau qui défile (repère : le conteneur .pillbox-wrap) et à gauche
   pendant le défilement horizontal : la poubelle et le compteur ne sortent jamais de la vue. */
.groupe-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; position: sticky; left: 0.75rem;
  max-width: calc(100cqw - 1.5rem); }
.groupe-ordonnance .ordonnance-titre { font-weight: 700; }
.groupe-ordonnance .ordonnance-prescripteur, .groupe-ordonnance .ordonnance-renouvellement { opacity: 0.9; }
.groupe-ordonnance .ordonnance-scan { font-size: 0.85rem; white-space: nowrap; color: var(--sur-action); text-decoration: underline; }
/* Compteur et poubelle juste après le scan (jamais rejetés tout à droite d'un tableau plus large que l'écran). */
.groupe-ordonnance .groupe-nombre { font-size: 0.8rem; opacity: 0.8; }
.groupe-ordonnance .ordonnance-supprimer { margin: 0; }
.groupe-ordonnance .bouton-icone { color: var(--sur-action); }
.groupe-ordonnance .bouton-icone:hover { background: rgba(255, 255, 255, 0.15); }
/* Statut « Terminée » après la poubelle (2026-11-13) : pastille claire lisible sur l'en-tête indigo. */
.groupe-ordonnance .badge-ordonnance-terminee { background: rgba(255, 255, 255, 0.2); color: var(--sur-action); border: 1px solid rgba(255, 255, 255, 0.45); }
/* Plier / déplier un groupe (public/pilulier.js) : chevron tourné, lignes masquées sauf l'en-tête. */
.plier-groupe { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: var(--sur-action); cursor: pointer; }
.plier-groupe:hover, .plier-groupe:focus-visible { background: rgba(255, 255, 255, 0.25); }
.plier-groupe svg { transition: transform 0.15s ease; }
.plier-groupe[aria-expanded="false"] svg { transform: rotate(-90deg); }
.groupe-plie > tr:not(.groupe-ordonnance) { display: none; }
/* Lien vers la fiche du médicament : le nom (grille) et l'icône collée au nom (tableau). */
.lien-fiche { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.lien-fiche:hover, .lien-fiche:focus-visible { color: var(--indigo); text-decoration-style: solid; }
.lien-fiche-icone { display: inline-flex; vertical-align: middle; color: var(--indigo); margin-left: 0.15rem; }
.lien-fiche-icone svg { width: 16px; height: 16px; }
.ordonnance-entete { border: 1px solid var(--bordure); border-radius: 10px; padding: 0.6rem 0.9rem 0.3rem; }

/* Fiche d'un médicament (2026-11-13) : fenêtre modale centrée (public/fiche-medicament.js) et contenu « type Vidal ». */
dialog.modale { width: min(48rem, calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); padding: 0; border: 0; border-radius: 14px;
  background: var(--surface); color: var(--texte); box-shadow: 0 16px 48px var(--ombre); overflow: hidden; }
dialog.modale[open] { display: flex; flex-direction: column; }
dialog.modale::backdrop { background: rgba(28, 36, 54, 0.45); }
.modale-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--bordure); }
.modale-tete h2 { margin: 0; font-size: 1.1rem; }
.modale-corps { overflow-y: auto; padding: 1rem 1.25rem 1.25rem; }
.fiche-medicament h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.fiche-medicament h4 { margin: 1.1rem 0 0.35rem; font-size: 0.95rem; color: var(--discret); text-transform: uppercase; letter-spacing: 0.03em; }
.fiche-titre p { margin: 0 0 0.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fiche-liste { margin: 0; padding-left: 1.1rem; }
.fiche-liste li { margin: 0.15rem 0; }
.fiche-libelle { margin: 0.35rem 0 0; }
.fiche-liens { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fiche-source { margin-top: 1rem; }
.fiche-recherche { display: flex; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.fiche-candidats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
/* Déclinaisons d'un médicament (2026-11-14) : une ligne par spécialité, son bouton « Choisir » à droite. */
.fiche-candidat { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); color: var(--texte); }
.fiche-candidat:hover { border-color: var(--indigo); background: var(--aplat); }
.fiche-candidat.actuel { border-color: var(--succes); }
.fiche-candidat-texte { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.fiche-candidat form { flex-shrink: 0; margin: 0; }
.badge-ok { background: var(--succes-fond); color: var(--succes); }
/* Durée de prescription après le nom d'un médicament issu d'une ordonnance (2026-11-13). */
.duree-prescription { font-weight: 500; color: var(--discret); white-space: nowrap; }
/* Filtre « Masquer les ordonnances terminées » (2026-11-13) et alerte de durée manquante dans la fenêtre de relecture. */
.filtre-terminees { margin: 0.25rem 0 0.5rem; }
.groupe-masque { display: none; }
.alerte-duree { color: var(--attention-texte); background: var(--attention-fond); border: 1px solid var(--attention-bordure); border-radius: 8px; padding: 0.4rem 0.6rem; }
/* Grille et tableau du pilulier plus compacts (2026-11-13) : ils tiennent dans la carte aux largeurs courantes ; au-delà, ils
   défilent à l'intérieur (.pillbox-wrap). */
.pillbox-wrap .table th, .pillbox-wrap .table td { padding: 0.5rem 0.5rem; }
.pillbox-wrap .pillbox .pillbox-day { padding-left: 0.25rem; padding-right: 0.25rem; }
.pillbox-wrap .groupe-ordonnance th { padding: 0.5rem 0.6rem; }
/* Fréquence du médicament dans la grille (2026-11-13) : pastille à contour, distincte des moments. */
.badge-frequence { background: transparent; border: 1px solid var(--filet); color: var(--texte); }
/* Renouvellements prescrits (2026-11-14) : même pastille que la fréquence. */
.badge-renouvellement { background: transparent; border: 1px solid var(--filet); color: var(--texte); }

/* Calendrier = agenda partagé (2026-11-13) : une entrée retirée reste visible, pâlie ; date sur une ligne. */
.table-agenda .ligne-annulee td { color: var(--muted); }
.table-agenda .ligne-annulee .strong { text-decoration: line-through; }
.table-agenda .nowrap { white-space: nowrap; }
/* La liste ne déborde jamais de la page : elle défile dans sa colonne si l'écran est trop étroit. */
.cal-events { min-width: 0; flex: 1 1 34rem; } /* passe sous le mini-calendrier quand la place manque */
.table-agenda-wrap { overflow-x: auto; max-width: 100%; }
.table-agenda .agenda-date { width: 1%; }
.table-agenda td.muted { font-size: 0.85rem; }
/* « Chaque année » dans les formulaires du calendrier (2026-11-13) : case sur la même ligne que les champs. */
.inline-add .agenda-annuel { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 500; }
/* Pilulier : jour sans prise d'après la fréquence (2026-11-13) — distinct de « — » (hors du traitement). */
.prise-mark.sans-prise { color: var(--discret); font-weight: 700; }
/* Stats (2026-11-13) : moment de la mesure sous le libellé. */
.stat-quand { font-weight: 400; font-size: 0.78rem; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* Animation d'attente au centre de l'écran pendant l'envoi et l'analyse d'une ordonnance (2026-11-14, script commun
   /pilulier-commun/ordonnance.js) : voile, boîte centrée, roue qui tourne, étape en cours. Mouvement réduit : roue lente. */
.attente-ordonnance { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(28, 36, 54, 0.45); }
.attente-ordonnance[hidden] { display: none; }
.attente-boite { width: min(24rem, 100%); padding: 1.6rem 1.4rem; border-radius: 14px; background: var(--surface); color: var(--texte); text-align: center; box-shadow: 0 18px 50px rgba(28, 36, 54, 0.35); }
.attente-roue { display: inline-block; width: 52px; height: 52px; border-radius: 50%; border: 5px solid var(--bordure); border-top-color: var(--corail); animation: attente-tour 0.9s linear infinite; }
.attente-titre { margin: 0.9rem 0 0.2rem; font-weight: 700; font-size: 1.05rem; }
.attente-etape { margin: 0; min-height: 1.4em; }
.attente-aide { margin: 0.6rem 0 0; font-size: 0.85rem; opacity: 0.75; }
body.attente-en-cours { overflow: hidden; }
@keyframes attente-tour { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .attente-roue { animation-duration: 2.5s; } }

/* Pastille « RECETTE » (2026-11-16, MEMOPHONE_ENVIRONNEMENT=recette) : jamais confondre la recette avec la production. */
.pastille-recette { align-self: center; margin-left: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--attention-texte); background: var(--attention-fond); color: var(--attention-texte); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; }

/* Modèles d'e-mails (2026-11-15) : textes à gauche, aperçu à droite ; l'un sous l'autre sur un écran étroit. */
.modele-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.modele-colonnes textarea { width: 100%; resize: vertical; }
.modele-apercu iframe { width: 100%; height: 640px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--fond); }
.modele-apercu form { margin-top: 0.75rem; }
@media (max-width: 1100px) { .modele-colonnes { grid-template-columns: minmax(0, 1fr); } }

/* Statistiques › Envois e-mails (2026-11-15) : boutons de période Jour / Semaine / Mois. */
.filtres-periode { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
