@font-face { font-family: "Onest"; src: url("fonts/onest-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Onest"; src: url("fonts/onest-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F; }

:root {
  --z-collant: 10; --z-haut: 20; --z-voile: 25; --z-barre: 30; --z-toast: 40; --ease: cubic-bezier(.22, 1, .36, 1);
  --police: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ombre-carte: 0 0 0 1px var(--trait), 0 1px 2px rgb(11 26 19 / 4%), 0 12px 28px -18px rgb(11 26 19 / 16%);
  --ombre-bouton: 0 1px 2px rgb(11 26 19 / 18%), inset 0 1px 0 rgb(255 255 255 / 12%);
  --ombre-discrete: 0 1px 2px rgb(11 26 19 / 6%);
  --ombre-active: 0 6px 14px -8px color-mix(in srgb, var(--primaire) 60%, transparent);
  --ombre-haute: 0 1px 3px rgb(11 26 19 / 10%), 0 20px 48px -12px rgb(11 26 19 / 24%);
  --haut-hauteur: 66px;
  --texte-tableau: .9375rem;
  --texte-mini: .8125rem;
  --barre-largeur: 259px;
  --titre-encre: var(--encre);
}
/* Dense à la souris, 48 px au doigt : le comptoir reste sur tablette. */
@media (pointer: fine) and (min-width: 1200px) { :root { --cible: 40px; } }

/* Backoffice et Pharmacie restent en clair, même si le système est en mode sombre. */
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--haut-hauteur) + var(--esp-4)); }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 var(--texte-corps)/1.55 var(--police); font-kerning: normal; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; color: var(--titre-encre); text-wrap: balance; letter-spacing: -.02em; }
strong, b { font-weight: 600; }
small { font-size: var(--texte-mini); }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
a { color: var(--primaire); text-underline-offset: 2px; }
p { max-width: 72ch; text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--marque) 30%, transparent); }
kbd { font: 600 var(--texte-mini)/1 var(--police); }
img { max-width: 100%; height: auto; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .95em; overflow-wrap: anywhere; }
.petit { font-size: var(--texte-petit); color: var(--encre-2); }
.muet { color: var(--encre-2); }
.montant { font-weight: 600; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus, h1:focus { outline: none; }

.icone { width: 1.25em; height: 1.25em; flex: none; }
.logo-sur-sombre { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-sur-sombre { display: block; }
  :root:not([data-theme="light"]) .logo-sur-clair { display: none; }
}

.evitement { position: absolute; left: var(--esp-2); top: -4rem; background: var(--surface); padding: var(--esp-3) var(--esp-4); z-index: var(--z-toast); border-radius: var(--rayon-moyen); }
.evitement:focus { top: var(--esp-2); }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--cible); padding: 0 var(--esp-4); border: 1px solid transparent; border-radius: var(--rayon-petit); font: 600 .9375rem/1.2 var(--police); letter-spacing: -.005em; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--duree-rapide) var(--ease), border-color var(--duree-rapide) var(--ease), color var(--duree-rapide) var(--ease), box-shadow var(--duree-rapide) var(--ease), transform var(--duree-rapide) var(--ease); }
.btn .icone { width: 1.125rem; height: 1.125rem; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
.btn-primaire { background: var(--primaire); color: var(--sur-primaire); box-shadow: var(--ombre-bouton); }
.btn-primaire:hover:not(:disabled) { background: var(--primaire-survol); }
.btn-secondaire { background: var(--surface); border-color: var(--trait); color: var(--encre); box-shadow: var(--ombre-discrete); }
.btn-secondaire:hover:not(:disabled) { background: var(--surface-2); border-color: var(--trait-fort); }
.btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 35%, var(--surface)); color: var(--danger); box-shadow: var(--ombre-discrete); }
.btn-danger:hover:not(:disabled) { background: var(--danger-fond); border-color: var(--danger); }
.btn-fantome { background: none; color: var(--encre-2); box-shadow: none; }
.btn-fantome:hover:not(:disabled) { background: var(--surface-2); color: var(--encre); }
.btn-icone { width: var(--cible); padding: 0; flex: none; }
.en-cours { pointer-events: none; opacity: .8; }
.en-cours::before { content: ""; width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tourner .8s linear infinite; }
.roue { width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: tourner .8s linear infinite; }
@keyframes tourner { to { transform: rotate(1turn); } }

.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label, .label { font-size: var(--texte-petit); font-weight: 500; color: var(--encre); }
input:not([type=checkbox]):not([type=hidden]), select, textarea { width: 100%; min-height: var(--cible); padding: var(--esp-2) var(--esp-3); background: var(--surface); color: var(--encre); border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit); box-shadow: var(--ombre-discrete); font: inherit; transition: border-color var(--duree-rapide) var(--ease), box-shadow var(--duree-rapide) var(--ease); }
input:not([type=checkbox]):focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--primaire); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primaire) 22%, transparent); border-radius: var(--rayon-petit); }
input:not([type=checkbox]):not(:focus-visible):hover, select:not(:focus-visible):hover, textarea:not(:focus-visible):hover { border-color: var(--encre-2); }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233B4C43' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; cursor: pointer; }
::placeholder { color: var(--trait-fort); opacity: 1; }
.haut-recherche ::placeholder { color: var(--encre-2); }
input[type=date] { height: var(--cible); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primaire); }
input[readonly] { background: var(--surface-2); }
[aria-invalid=true] { border-color: var(--danger) !important; }
.aide-erreur { color: var(--danger); font-size: var(--texte-petit); font-weight: 500; }
.pile { display: flex; flex-direction: column; gap: var(--esp-4); }
.rangee { display: flex; align-items: center; gap: var(--esp-3); flex-wrap: wrap; }
.espace { justify-content: space-between; }

.message { display: flex; gap: var(--esp-2); padding: var(--esp-3) var(--esp-4); border-radius: var(--rayon-petit); font-weight: 500; }
.message-erreur { background: var(--danger-fond); color: var(--danger); }
.message-attention { background: var(--avertissement-fond); color: var(--avertissement); }
.message-succes { background: var(--primaire-fond); color: var(--encre); }

/* Badges et tons de statut : même code dans les trois interfaces */
.ton-attente { --ton-f: var(--ton-attente-fond); --ton-e: var(--ton-attente-encre); --ton-c: var(--ton-attente-contour); }
.ton-disponible { --ton-f: var(--ton-disponible-fond); --ton-e: var(--ton-disponible-encre); --ton-c: var(--ton-disponible-contour); }
.ton-partiel { --ton-f: var(--ton-partiel-fond); --ton-e: var(--ton-partiel-encre); --ton-c: var(--ton-partiel-contour); }
.ton-indisponible { --ton-f: var(--ton-indisponible-fond); --ton-e: var(--ton-indisponible-encre); --ton-c: var(--ton-indisponible-contour); }
.ton-action { --ton-f: var(--ton-action-fond); --ton-e: var(--ton-action-encre); --ton-c: var(--ton-action-contour); }
.ton-clos { --ton-f: var(--ton-clos-fond); --ton-e: var(--ton-clos-encre); --ton-c: var(--ton-clos-contour); }
.badge { display: inline-flex; align-items: center; gap: var(--esp-1); padding: 2px 10px 2px var(--esp-2); background: var(--ton-f); color: var(--ton-e); border: 1px solid color-mix(in srgb, var(--ton-c) 40%, var(--ton-f)); border-radius: var(--rayon-pilule); font-size: var(--texte-mini); font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge .icone { width: 14px; height: 14px; }

/* États */
.etat { display: flex; flex-direction: column; align-items: center; gap: var(--esp-2); padding: var(--esp-7) var(--esp-4); text-align: center; color: var(--encre-2); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.etat-icone { width: 40px; height: 40px; color: var(--marque); }
.etat-titre { color: var(--encre); font-weight: 600; }
.etat-erreur .etat-icone { color: var(--danger); }
.squelettes { display: flex; flex-direction: column; gap: var(--esp-2); }
.squelette { height: 72px; border-radius: var(--rayon-moyen); background: var(--surface); box-shadow: var(--ombre-carte); animation: pulser 1.4s ease-in-out infinite; }
@keyframes pulser { 50% { opacity: .55; } }

/* Coquille */
.coquille { min-height: 100dvh; }
.barre { position: fixed; inset: 0 auto 0 0; z-index: var(--z-barre); display: flex; flex-direction: column; width: var(--barre-largeur); background: var(--surface); border-right: 1px solid var(--trait); transition: width var(--duree-normal) var(--ease), transform var(--duree-normal) var(--ease); }
.barre-marque { position: relative; display: flex; align-items: center; flex: none; height: var(--haut-hauteur); padding: 0 var(--esp-4); border-bottom: 1px solid var(--trait); }
.barre-logo { display: flex; align-items: center; min-height: var(--cible); overflow: hidden; }
.barre-logo .logo { max-width: none; height: 30px; width: auto; }
.barre-bascule { position: absolute; right: -14px; top: 19px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--primaire); color: var(--sur-primaire); box-shadow: var(--ombre-active); cursor: pointer; transition: transform var(--duree-normal) var(--ease); }
.barre-bascule .icone { width: 16px; height: 16px; }
.barre nav { flex: 1; min-height: 0; overflow-y: auto; padding: var(--esp-2) var(--esp-4) var(--esp-4) 0; scrollbar-width: thin; scrollbar-color: var(--trait) transparent; }
.nav-defilante { display: contents; }
.nav-titre { display: flex; align-items: center; min-height: 32px; margin-top: var(--esp-1); padding: 0 var(--esp-4); font-size: var(--texte-mini); font-weight: 600; color: var(--encre-2); white-space: nowrap; overflow: hidden; }
.nav-titre:not(:first-child) { margin-top: var(--esp-2); }
.nav-lien { display: flex; align-items: center; gap: var(--esp-3); width: calc(100% - var(--esp-2)); min-height: var(--cible); margin: 0 0 2px var(--esp-2); padding: 0 var(--esp-3); border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre); font: 500 .9375rem/1.2 var(--police); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--duree-rapide) var(--ease), color var(--duree-rapide) var(--ease), box-shadow var(--duree-rapide) var(--ease); }
.nav-lien .icone { width: 1.125rem; height: 1.125rem; color: var(--encre-2); fill: currentColor; fill-opacity: .12; }
.nav-lien:hover .icone, .nav-lien.actif .icone { color: inherit; }
.nav-lien span:not(.compteur) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-lien:hover { background: var(--primaire-fond); color: var(--primaire-survol); }
.nav-lien.actif { background: var(--primaire); color: var(--sur-primaire); box-shadow: var(--ombre-bouton); }
.nav-lien.actif .icone { fill-opacity: .3; }
.compteur { margin-left: auto; min-width: 22px; padding: 0 var(--esp-2); border-radius: var(--rayon-pilule); background: var(--primaire); color: var(--sur-primaire); font-size: var(--texte-mini); font-weight: 600; line-height: 20px; text-align: center; }
.nav-lien.actif .compteur { background: var(--surface); color: var(--primaire-survol); }

.page { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 100dvh; margin-left: var(--barre-largeur); transition: margin-left var(--duree-normal) var(--ease); }
/* L'en-tête reste accessible sur les longues listes. */
.haut { position: sticky; top: 0; z-index: var(--z-haut); display: flex; align-items: center; gap: var(--esp-4); height: var(--haut-hauteur); padding: 0 var(--esp-5) 0 var(--esp-6); background: var(--surface); box-shadow: 0 1px 0 var(--trait); }
.haut-droite { display: flex; align-items: center; gap: var(--esp-3); margin-left: auto; min-width: 0; }
.haut-recherche { position: relative; display: flex; align-items: center; width: min(340px, 36vw); color: var(--encre-2); }
.haut-recherche .icone { position: absolute; left: var(--esp-3); width: 18px; height: 18px; pointer-events: none; }
.haut-recherche input:not([type=checkbox]) { min-height: var(--cible); padding: 0 40px; border-color: var(--trait); background: var(--surface-2); box-shadow: none; }
.haut-recherche input:not([type=checkbox]):focus-visible { background: var(--surface); }
.haut-raccourci { position: absolute; right: var(--esp-2); display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--trait); border-radius: 6px; background: var(--surface); color: var(--encre-2); pointer-events: none; }
.haut-recherche:focus-within .haut-raccourci { display: none; }
@media (pointer: coarse) { .haut-raccourci { display: none; } }
.haut-bouton { display: none; place-items: center; width: var(--cible); height: var(--cible); padding: 0; border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre); cursor: pointer; }
.haut-compte { display: flex; align-items: center; gap: var(--esp-3); min-height: var(--cible); max-width: 320px; padding: 0 var(--esp-2); border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre-2); font: inherit; text-align: left; cursor: pointer; }
.haut-compte:hover { background: var(--surface-2); }
.avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--primaire-fond); color: var(--primaire-survol); font-weight: 600; font-size: 1rem; }
.haut-identite { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.haut-identite strong { font-size: .9375rem; font-weight: 600; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.haut-identite small { font-size: var(--texte-mini); }
.banniere { position: absolute; inset: 0 0 auto 0; z-index: -1; height: var(--banniere-hauteur, 216px); border-radius: 0 0 var(--rayon-grand) var(--rayon-grand); background: #14573A url("img/banniere.svg") center / cover no-repeat; }
main { flex: 1; min-width: 0; padding: 0 var(--esp-6) var(--esp-6); }
.pied { display: flex; justify-content: space-between; gap: var(--esp-3); padding: var(--esp-2) var(--esp-6); background: var(--surface); border-top: 1px solid var(--trait); color: var(--encre-2); font-size: var(--texte-petit); }

/* En-tête de page : posé sur le bandeau, les cartes suivantes le chevauchent de 31 px.
   Il reste compact sur les écrans de travail, seul l'accueil prend le grand format. */
.page:has(.entete-large) { --banniere-hauteur: 264px; }
.entete.entete-large { min-height: 167px; }
.entete { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3) var(--esp-5); flex-wrap: wrap; min-height: 119px; padding: var(--esp-4) var(--esp-3) var(--esp-5); --titre-encre: #FFFFFF; color: #FFFFFF; --encre-2: #E6F2EC; }
.entete a:not(.btn) { color: #FFFFFF; }
.entete-texte { display: flex; flex-direction: column; gap: var(--esp-1); min-width: 0; max-width: 720px; }
.entete .btn-secondaire, .entete .btn-danger { background: rgb(255 255 255 / 12%); color: #FFFFFF; border-color: rgb(255 255 255 / 32%); box-shadow: none; }
.entete .btn-secondaire:hover:not(:disabled), .entete .btn-danger:hover:not(:disabled) { background: rgb(255 255 255 / 22%); border-color: rgb(255 255 255 / 55%); }
.entete .btn-primaire { background: #FFFFFF; color: var(--primaire-survol); box-shadow: 0 1px 2px rgb(11 26 19 / 24%); }
.entete .btn-primaire:hover:not(:disabled) { background: var(--primaire-fond); }
.entete .champ label { color: #FFFFFF; }
.entete input:not([type=checkbox]) { background: rgb(255 255 255 / 94%); color: #0F2118; color-scheme: light; border-color: transparent; }
.entete .badge { background: var(--ton-f); }

/* File de commandes */
.colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--esp-4); align-items: start; }
.colonne { padding: var(--esp-4); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.colonne h2 { display: flex; align-items: center; gap: var(--esp-2); margin-bottom: var(--esp-3); font-size: 1.25rem; }
.colonne-nombre { min-width: 24px; padding: 0 var(--esp-2); border-radius: var(--rayon-pilule); background: var(--primaire-fond); color: var(--primaire-survol); font-size: var(--texte-petit); font-weight: 600; line-height: 22px; text-align: center; }
.file { display: flex; flex-direction: column; gap: var(--esp-2); }
.ticket { display: flex; flex-direction: column; gap: var(--esp-1); min-height: var(--cible); padding: var(--esp-3) var(--esp-4); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--rayon-moyen); color: inherit; text-decoration: none; transition: border-color var(--duree-rapide) var(--ease), background-color var(--duree-rapide) var(--ease); }
a.ticket:hover { border-color: var(--primaire); background: var(--surface); }
.ticket-haut { display: flex; justify-content: space-between; gap: var(--esp-2); font-weight: 600; }
.ticket-bas { display: flex; justify-content: space-between; align-items: center; gap: var(--esp-2); flex-wrap: wrap; font-size: var(--texte-petit); color: var(--encre-2); }
.ticket-nouveau { animation: arriver var(--duree-normal) var(--ease); }
@keyframes arriver { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.bandeau { display: flex; align-items: center; gap: var(--esp-2); margin-bottom: var(--esp-4); padding: var(--esp-3) var(--esp-4); border-radius: var(--rayon-moyen); background: var(--avertissement-fond); color: var(--avertissement); font-weight: 500; }

/* Écran de vérification */
.controle { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--esp-5); align-items: start; }
/* Pendant la vérification d'une ordonnance lue, le formulaire prend autant de place que l'image. */
@media (min-width: 961px) { .controle:has(.numerisation-med) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.document { position: sticky; top: calc(var(--haut-hauteur) + var(--esp-4)); display: flex; flex-direction: column; gap: var(--esp-2); }
.document-outils { display: flex; gap: var(--esp-2); flex-wrap: wrap; align-items: center; }
.document-vue { height: calc(100dvh - 12rem); min-height: 320px; overflow: auto; background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.controle > .pile > section, .controle > .pile > form { display: flex; flex-direction: column; gap: var(--esp-3); padding: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.colonne-carte { padding: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.controle section .table-cadre, .colonne-carte .table-cadre { box-shadow: none; }
.controle .synthese { box-shadow: none; background: var(--surface-2); }
.controle > .pile > .synthese { padding: var(--esp-5); box-shadow: var(--ombre-carte); }
.document-outils { padding: var(--esp-2) var(--esp-3); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.document-calque { position: relative; transition: width var(--duree-rapide) var(--ease); }
.document-vue img { display: block; width: 100%; max-width: none; }
/* Zone lue par le moteur : contour épais et voile léger, lisibles sur une photo claire ou sombre. */
/* Double anneau blanc et vert : visible sur une photo claire comme sur une photo sombre. */
.document-zone { position: absolute; border: 3px solid var(--focus); border-radius: 4px; background: color-mix(in srgb, #FFD84D 22%, transparent); box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--focus); pointer-events: none; animation: zone-apparaitre var(--duree-normal) var(--ease); }
@keyframes zone-apparaitre { from { opacity: 0; } }

/* Ordonnance numérique : lecture, vérification, validation. */
.numerisation { display: flex; flex-direction: column; gap: var(--esp-4); min-width: 0; padding: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.numerisation > * { min-width: 0; }
/* Dans la colonne de contrôle, déjà une carte : pas de carte dans la carte, un simple séparateur. */
.controle .colonne-carte > .numerisation { padding: 0 0 var(--esp-5); background: none; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--trait); }
.numerisation-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--esp-3); }
.numerisation-entete p { margin-top: 2px; }
.numerisation-vide { display: flex; flex-direction: column; gap: var(--esp-3); }
.numerisation-attente { display: flex; gap: var(--esp-3); align-items: center; padding: var(--esp-4); background: var(--surface-2); border-radius: var(--rayon-petit); }
.numerisation-attente .roue { flex: none; color: var(--primaire); }
.numerisation-legende { display: flex; flex-wrap: wrap; gap: var(--esp-2); align-items: center; }
.numerisation fieldset { min-width: 0; margin: 0; padding: var(--esp-4); border: 1px solid var(--trait); border-radius: var(--rayon-petit); }
.numerisation fieldset[disabled] { background: var(--surface-2); }
.numerisation legend { padding: 0 var(--esp-1); font-weight: 600; color: var(--encre); }
.numerisation-entetes, .numerisation-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: var(--esp-3) var(--esp-4); }
.message-bloc { flex-direction: column; gap: var(--esp-1); }
.message-bloc ul { margin: 0; padding-left: var(--esp-5); font-weight: 400; }
.numerisation-meds { display: flex; flex-direction: column; gap: var(--esp-3); }
.numerisation-med { display: flex; flex-direction: column; gap: var(--esp-3); }
.numerisation .champ-large { grid-column: 1 / -1; }
.champ-titre { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-1) var(--esp-2); min-height: 32px; }
.champ-titre label { margin-right: auto; min-width: 0; }
.champ-titre .badge { font-size: var(--texte-mini); }
.champ-voir { min-height: 32px; width: 32px; }
.numerisation-lu { display: flex; flex-direction: column; gap: 2px; padding: var(--esp-2) var(--esp-3); background: var(--surface-2); border-radius: var(--rayon-petit); white-space: pre-line; font-variant-numeric: tabular-nums; }
.numerisation-alertes { display: flex; flex-direction: column; gap: var(--esp-1); margin: 0; padding: 0; list-style: none; color: var(--avertissement); font-size: var(--texte-petit); font-weight: 500; }
.numerisation-alertes li { display: flex; gap: var(--esp-2); align-items: flex-start; }
.numerisation-alertes .icone { flex: none; margin-top: 2px; }
.numerisation-catalogue { display: flex; flex-direction: column; gap: var(--esp-2); }
.puce { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: var(--cible); padding: var(--esp-2) var(--esp-3); border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit); background: var(--surface); color: var(--encre); font: 500 .9375rem/1.3 var(--police); text-align: left; cursor: pointer; transition: border-color var(--duree-rapide) var(--ease), background-color var(--duree-rapide) var(--ease); }
.puce:hover { border-color: var(--primaire); }
.puce-active { border-color: var(--primaire); background: var(--primaire-fond); box-shadow: inset 0 0 0 1px var(--primaire); }
.puce > .icone { position: absolute; }
.puce-active { position: relative; padding-left: calc(var(--esp-3) + 22px); }
.puce-active > .icone { left: var(--esp-3); top: 50%; translate: 0 -50%; color: var(--primaire); }
.numerisation-validation { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; justify-content: space-between; padding: var(--esp-4); background: var(--primaire-fond); border-radius: var(--rayon-petit); }
.numerisation-report { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; justify-content: space-between; }
.numerisation-details summary { cursor: pointer; font-weight: 600; min-height: var(--cible); display: flex; align-items: center; }
.numerisation-details ol { display: flex; flex-direction: column; gap: var(--esp-2); padding-left: var(--esp-5); }
.numerisation-details .table-cadre { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .document-zone { animation: none; } .document-calque { transition: none; } }
.lignes { display: flex; flex-direction: column; gap: var(--esp-3); }
.ligne { display: grid; grid-template-columns: minmax(0, 1fr) 72px 112px; gap: var(--esp-2); align-items: end; padding-bottom: var(--esp-3); border-bottom: 1px solid var(--trait); }
.ligne-options { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.bascule { display: inline-flex; align-items: center; gap: var(--esp-2); min-height: var(--cible); cursor: pointer; font-weight: 500; }
.synthese { display: flex; flex-direction: column; gap: var(--esp-3); padding: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--texte-fort); }
.onglets { display: flex; gap: var(--esp-1); flex-wrap: wrap; padding: var(--esp-2); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.onglet { min-height: var(--cible); padding: 0 var(--esp-4); border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre-2); font: 600 .9375rem var(--police); cursor: pointer; transition: background-color var(--duree-rapide) var(--ease), color var(--duree-rapide) var(--ease); }
.onglet:hover { background: var(--primaire-fond); color: var(--primaire-survol); }
.onglet[aria-selected=true] { background: var(--primaire); color: var(--sur-primaire); box-shadow: var(--ombre-bouton); }

/* Tableaux et données */
.table-cadre { position: relative; overflow-x: auto; background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
table { width: 100%; border-collapse: collapse; font-size: var(--texte-tableau); line-height: 1.45; }
th { text-align: left; font-size: var(--texte-mini); font-weight: 600; color: var(--encre-2); background: var(--surface-2); white-space: nowrap; }
td strong { font-weight: 600; }
td { padding: var(--esp-3) var(--esp-4); border-bottom: 1px solid var(--trait); vertical-align: middle; }
th { padding: 10px var(--esp-4); border-bottom: 1px solid var(--trait); }
tr > :first-child { padding-left: var(--esp-5); }
tr > :last-child { padding-right: var(--esp-5); }
tr > .td-actions:last-child { padding-right: var(--esp-3); }
tbody tr { transition: background-color var(--duree-rapide) var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--primaire-fond) 45%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td.nombre, th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--esp-4) var(--esp-5); padding: var(--esp-4) 0; }
.chiffres dt { font-size: var(--texte-petit); color: var(--encre-2); }
.chiffres dd { margin: 0; font-size: var(--texte-titre3); font-weight: 600; }
.barres { display: flex; flex-direction: column; gap: var(--esp-2); }
.barres li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 3rem; align-items: center; gap: var(--esp-3); }
.barres-piste { height: 8px; background: var(--primaire-fond); border-radius: var(--rayon-pilule); overflow: hidden; }
.barres-piste span { display: block; height: 100%; border-radius: var(--rayon-pilule); background: var(--marque); }

/* Timeline et étapes (motifs absents de Magic UI, écrits pour Massa+) */
.timeline { display: flex; flex-direction: column; }
.timeline li { position: relative; display: flex; gap: var(--esp-3); padding-bottom: var(--esp-4); }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--trait); }
.timeline-point { display: grid; place-items: center; width: 32px; height: 32px; flex: none; background: var(--ton-f); color: var(--ton-e); border: 1px solid var(--ton-c); border-radius: 50%; }
.timeline-point .icone { width: 16px; height: 16px; }
.timeline time { display: block; font-size: var(--texte-petit); color: var(--encre-2); font-variant-numeric: tabular-nums; }
.etapes { display: flex; gap: var(--esp-3); flex-wrap: wrap; }
.etapes li { display: flex; align-items: center; gap: var(--esp-2); color: var(--encre-2); font-size: var(--texte-petit); font-weight: 500; }
.etape-numero { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--trait-fort); border-radius: 50%; font-weight: 600; }
.etapes .courant { color: var(--encre); }
.etapes .courant .etape-numero, .etapes .fait .etape-numero { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire); }

/* Connexion */
.connexion { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; padding: 0; background: var(--surface); }
.connexion-boite { display: flex; flex-direction: column; gap: var(--esp-5); width: 100%; max-width: 420px; min-height: 100dvh; margin: 0 auto; padding: var(--esp-6) var(--esp-4); }
.connexion-boite > .logo { align-self: flex-start; }
.connexion-boite-large { max-width: 600px; }
.connexion-boite-large .bascule { align-items: flex-start; }
.connexion-contenu { display: flex; flex-direction: column; gap: var(--esp-4); margin: auto 0; }
.connexion-contenu .pile { gap: var(--esp-4); }
.connexion-contenu .btn { width: 100%; min-height: 46px; margin-top: var(--esp-1); font-size: 1rem; }
.connexion-espace { display: flex; align-items: center; gap: 6px; font-size: var(--texte-petit); font-weight: 600; color: var(--primaire); }
.connexion-espace .icone { width: 1.125rem; height: 1.125rem; }
.connexion-contenu h1 { margin-top: calc(-1 * var(--esp-3)); font-size: 2rem; }
.connexion-note { display: flex; align-items: center; gap: var(--esp-2); font-size: var(--texte-mini); color: var(--encre-2); }
.connexion-note .icone { width: 1rem; height: 1rem; }
.connexion-art { position: relative; display: flex; overflow: hidden; background: #0C3F2A; color: #FFFFFF; }
.connexion-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.connexion-art figcaption { position: relative; display: flex; flex-direction: column; gap: var(--esp-2); align-self: flex-end; max-width: 34rem; padding: var(--esp-7); }
.connexion-art strong { font-size: 1.75rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.connexion-art span { font-size: 1.0625rem; color: #E6F2EC; }
.champ-mdp { position: relative; display: flex; align-items: center; }
.champ-mdp input:not([type=checkbox]) { padding-right: 48px; }
.mdp-bascule { position: absolute; right: 2px; display: grid; place-items: center; width: 44px; height: 42px; padding: 0; border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre-2); cursor: pointer; }
.mdp-bascule:hover { color: var(--encre); }
.mdp-bascule .icone-masquer { display: none; }
.mdp-bascule[aria-pressed=true] .icone-masquer { display: block; }
.mdp-bascule[aria-pressed=true] .icone-voir { display: none; }
.majuscules { display: flex; align-items: center; gap: var(--esp-1); font-size: var(--texte-mini); font-weight: 500; color: var(--avertissement); }
.majuscules[hidden] { display: none; }
.majuscules .icone { width: 1rem; height: 1rem; }
.qr { align-self: center; width: 208px; padding: var(--esp-2); background: #FFFFFF; border-radius: var(--rayon-petit); }
.qr svg { display: block; width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--esp-2); }

/* Modales, menus et notifications */
.modale { width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: var(--rayon-grand); background: var(--surface); color: var(--encre); box-shadow: var(--ombre-haute); }
.modale-large { width: min(860px, calc(100vw - 2rem)); }
.modale[open] { display: flex; flex-direction: column; animation: arriver var(--duree-normal) var(--ease); }
.modale::backdrop { background: rgb(11 26 19 / 55%); }
.modale-entete { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); padding: var(--esp-4) var(--esp-5); border-bottom: 1px solid var(--trait); }
.modale-entete h2 { font-size: 1.125rem; }
.modale-corps { display: flex; flex-direction: column; gap: var(--esp-4); padding: var(--esp-5); overflow-y: auto; }
.modale-pied { display: flex; justify-content: flex-end; gap: var(--esp-2); flex-wrap: wrap; padding: var(--esp-4) var(--esp-5); border-top: 1px solid var(--trait); }
.menu { position: fixed; inset: auto; margin: 0; min-width: 232px; padding: 6px; background: var(--surface); color: var(--encre); border: 0; border-radius: var(--rayon-moyen); box-shadow: var(--ombre-haute); }
.menu-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 var(--esp-3); border: 0; border-radius: var(--rayon-petit); background: none; color: var(--encre); font: 500 .9375rem/1.2 var(--police); text-align: left; text-decoration: none; cursor: pointer; }
.menu-action .icone { width: 1.125rem; height: 1.125rem; color: var(--encre-2); }
.menu-action:hover, .menu-action:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.menu-danger .icone { color: inherit; }
@media (pointer: coarse) { .menu-action { min-height: var(--cible); } }
.menu-danger { color: var(--danger); }
.menu-danger:hover, .menu-danger:focus-visible { background: var(--danger-fond); color: var(--danger); }
.menu-separateur { height: 1px; margin: var(--esp-1) 0; background: var(--trait); }
.toasts { position: fixed; right: var(--esp-4); bottom: var(--esp-4); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--esp-2); width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--esp-2); padding: var(--esp-2) var(--esp-2) var(--esp-2) var(--esp-4); background: var(--surface); color: var(--encre); border: 1px solid var(--trait); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-haute); pointer-events: auto; animation: arriver var(--duree-normal) var(--ease); }
.toast span { flex: 1; }
.toast-erreur { border-color: var(--danger); background: var(--danger-fond); color: var(--danger); }
.toast-fermer { display: grid; place-items: center; width: var(--cible); height: var(--cible); border: 0; background: none; color: inherit; cursor: pointer; }
.filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--esp-3) var(--esp-4); margin-bottom: var(--esp-5); padding: var(--esp-4) var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.filtres .champ { min-width: 170px; }
.filtres .champ-large { flex: 1 1 260px; }
.compte-ligne { display: flex; flex-direction: column; }
.compte-ligne small { color: var(--encre-2); font-size: var(--texte-mini); }
.etats { display: flex; flex-wrap: wrap; gap: var(--esp-1); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); margin-top: var(--esp-3); }
.total-liste { margin-bottom: var(--esp-3); font-size: var(--texte-petit); color: var(--encre-2); }
.td-actions { width: 1%; white-space: nowrap; text-align: right; }
.td-actions .btn-icone { width: 36px; min-height: 36px; }
@media (pointer: coarse) { .td-actions .btn-icone { width: var(--cible); min-height: var(--cible); } }

/* Tableau de bord */
.taches { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--esp-5); margin-bottom: var(--esp-5); }
.tache { display: flex; align-items: center; gap: var(--esp-3); min-height: 104px; padding: var(--esp-4); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); color: var(--encre-2); text-decoration: none; transition: box-shadow var(--duree-normal) var(--ease), transform var(--duree-normal) var(--ease); }
a.tache:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--trait), 0 14px 34px 0 rgb(20 80 52 / 12%); }
.tache-icone { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--rayon-moyen); background: var(--primaire-fond); color: var(--primaire-survol); }
.tache-icone .icone { width: 24px; height: 24px; fill: currentColor; fill-opacity: .16; }
.tache-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; font-size: var(--texte-petit); }
.tache strong { color: var(--encre); font-size: 1.625rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.tache-danger .tache-icone { background: var(--danger-fond); color: var(--danger); }
.tache-danger strong { color: var(--danger); }
.tableau { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--esp-5); margin-bottom: var(--esp-5); align-items: stretch; }
.tableau-trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tableau-demi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panneau-corps { padding: var(--esp-5); }
.panneau { display: flex; flex-direction: column; gap: var(--esp-3); min-width: 0; padding: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.panneau-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--esp-3); }
.panneau-entete > p { color: var(--encre-2); }
.panneau-chiffre { font-size: 2rem; font-weight: 600; line-height: 1.2; color: var(--encre); letter-spacing: -.02em; }
.petit-titre { font-size: var(--texte-corps); font-weight: 400; color: var(--encre-2); letter-spacing: 0; }
.panneau-marque { padding: 0; overflow: hidden; }
.valeurs.valeurs-pile { grid-template-columns: 1fr; gap: 0; flex: 1; min-width: 0; }
.valeurs-pile dd { margin-bottom: var(--esp-3); font-weight: 600; color: var(--encre); }
.marque-carte { padding: var(--esp-5); background: #14573A url("img/banniere.svg") 70% center / cover no-repeat; color: #FFFFFF; }
.marque-carte p { color: #E6F2EC; }
.marque-carte .panneau-chiffre { color: #FFFFFF; margin-top: var(--esp-1); }
.marque-liste { display: flex; flex-direction: column; gap: var(--esp-3); padding: var(--esp-5); }
.marque-liste li { display: flex; align-items: center; gap: var(--esp-3); }
.marque-liste .tache-icone { width: 44px; height: 44px; }
.marque-liste .tache-icone .icone { width: 20px; height: 20px; }
.marque-liste strong { display: block; color: var(--encre); font-weight: 600; }
.marque-liste small { color: var(--encre-2); font-size: var(--texte-petit); }
.anneau-bloc { display: flex; align-items: center; gap: var(--esp-5); }
.anneau-bloc > p { flex: 1; }
.anneau { position: relative; display: grid; place-items: center; flex: none; width: 120px; height: 120px; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau-piste { fill: none; stroke: var(--primaire-fond); stroke-width: 4; }
.anneau-valeur { fill: none; stroke: var(--marque); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset var(--duree-normal) var(--ease); }
.anneau-texte { position: absolute; font-size: 1.25rem; font-weight: 600; color: var(--encre); }
.statuts-barres { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--esp-4) var(--esp-6); }
.statuts-barres li { display: flex; flex-direction: column; gap: var(--esp-1); }
.statuts-barres .rangee { justify-content: space-between; flex-wrap: nowrap; }
.statuts-barres strong { font-weight: 600; color: var(--encre); }

/* Graphiques SVG, calculés côté serveur */
.graphique { display: block; width: 100%; height: auto; overflow: visible; }
.g-grille { stroke: var(--trait); stroke-width: 1; }
.g-axe { fill: var(--encre-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.g-ligne { fill: none; stroke: var(--marque); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-aire-debut { stop-color: var(--marque); stop-opacity: .24; }
.g-aire-fin { stop-color: var(--marque); stop-opacity: 0; }
.g-barre { fill: var(--marque); transition: fill var(--duree-rapide) var(--ease); }
.g-point { fill: var(--marque); stroke: var(--surface); stroke-width: 2; }
.g-zone { fill: transparent; }
.g-curseur { stroke: var(--trait-fort); stroke-width: 1; stroke-dasharray: 3 3; }
.g-survol { visibility: hidden; pointer-events: none; }
.g-pt:hover .g-survol { visibility: visible; }
.g-pt:hover .g-barre { fill: var(--primaire); }
.g-bulle { fill: var(--encre); }
.g-bulle-texte { fill: var(--surface); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Écrans de gestion */
.section { margin-top: var(--esp-6); }
.section > h2 { margin-bottom: var(--esp-3); }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--esp-3) var(--esp-4); }
.formulaire { display: flex; flex-direction: column; gap: var(--esp-4); max-width: 960px; padding: var(--esp-5); margin-bottom: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.recto-verso { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--esp-3); }
.recto-verso figure { display: flex; flex-direction: column; gap: var(--esp-1); }
.recto-verso figcaption { font-size: var(--texte-petit); font-weight: 600; }
.recto-verso img { width: 100%; border: 1px solid var(--trait); border-radius: var(--rayon-petit); background: var(--surface-2); }
.dossier { padding: var(--esp-5); margin-bottom: var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); display: flex; flex-direction: column; gap: var(--esp-3); }
.valeurs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--esp-1) var(--esp-4); }
.valeurs dt { color: var(--encre-2); }
.valeurs dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
.chip { display: inline-flex; align-items: center; gap: var(--esp-2); min-height: var(--cible); padding: 0 var(--esp-3); border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit); cursor: pointer; }
.ident { font-family: ui-monospace, Menlo, monospace; font-size: var(--texte-petit); overflow-wrap: anywhere; }
.ligne-erreur td { background: var(--danger-fond); }
.ligne-erreur a { color: var(--danger); }
.secret { display: block; padding: var(--esp-3); background: var(--surface-2); border-radius: var(--rayon-petit); font-size: var(--texte-fort); user-select: all; }

/* Reconnexion Blazor */
#components-reconnect-modal { display: none; position: fixed; inset: auto var(--esp-4) var(--esp-4) auto; z-index: var(--z-toast); padding: var(--esp-3) var(--esp-4); background: var(--surface); border: 1px solid var(--trait-fort); border-radius: var(--rayon-moyen); }
#components-reconnect-modal.components-reconnect-show, #components-reconnect-modal.components-reconnect-failed, #components-reconnect-modal.components-reconnect-rejected { display: block; }

/* Menu réduit aux icônes, choisi par la personne et retenu sur ce poste */
@media (min-width: 1200px) {
  [data-barre="mini"] { --barre-largeur: 84px; }
  [data-barre="mini"] .barre-logo { width: 30px; }
  [data-barre="mini"] .barre-bascule { transform: rotate(180deg); }
  [data-barre="mini"] .nav-lien { justify-content: center; padding: 0; margin-left: var(--esp-3); width: calc(100% - var(--esp-1)); }
  [data-barre="mini"] .nav-lien .icone { width: 1.25rem; height: 1.25rem; }
  [data-barre="mini"] .nav-lien span { display: none; }
  [data-barre="mini"] .nav-titre { height: 1px; min-height: 0; margin: var(--esp-3) 0 var(--esp-3) var(--esp-3); padding: 0; border-top: 1px solid var(--trait); font-size: 0; }
}

/* L'illustration passe au-dessus du formulaire dès que les deux colonnes seraient à l'étroit. */
/* Paramètres : navigation par catégories, état des intégrations, formulaires groupés. */
.visuellement-cache { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.entete-sous-titre { margin-top: var(--esp-1); max-width: 70ch; color: inherit; opacity: .92; }
.parametres { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: var(--esp-5); align-items: start; }
.parametres-nav { position: sticky; top: calc(var(--haut-hauteur) + var(--esp-4)); padding: var(--esp-3) var(--esp-2); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.parametres-nav ul { margin: 0 0 var(--esp-2); padding: 0; list-style: none; }
.parametres-groupe { margin: var(--esp-2) var(--esp-3) var(--esp-1); font-size: var(--texte-mini); font-weight: 600; color: var(--encre-2); }
.parametres-lien { position: relative; display: flex; align-items: center; gap: var(--esp-2); min-height: var(--cible); padding: var(--esp-1) var(--esp-3); border-radius: var(--rayon-petit); color: var(--encre); font-weight: 500; font-size: .9375rem; line-height: 1.3; text-decoration: none; transition: background-color var(--duree-rapide) var(--ease); }
.parametres-lien:hover { background: var(--surface-2); }
.parametres-lien[aria-current=page] { background: var(--primaire-fond); color: var(--primaire); font-weight: 600; }
.parametres-lien > span:first-of-type { flex: 1; min-width: 0; }
.pastille { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ton-clos-contour); }
.pastille-disponible { background: var(--ton-disponible-contour); }
.pastille-partiel { background: var(--ton-partiel-contour); }
.pastille-indisponible { background: var(--ton-indisponible-contour); box-shadow: 0 0 0 3px var(--ton-indisponible-fond); }
.parametres-contenu { display: flex; flex-direction: column; gap: var(--esp-4); min-width: 0; }
.parametres-contenu .formulaire { max-width: none; margin-bottom: 0; }
.section-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--esp-3); padding: var(--esp-4) var(--esp-5); background: var(--surface); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-carte); }
.section-entete h2 { font-size: 1.375rem; }
.section-entete p { max-width: 65ch; margin-top: 2px; }
.section-etat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-1) var(--esp-2); max-width: 100%; }
.integrations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--esp-3); margin: 0; padding: 0; list-style: none; }
.integration { display: flex; flex-direction: column; gap: var(--esp-2); padding: var(--esp-4); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-discrete); }
.integration-indisponible { border-color: var(--ton-indisponible-contour); }
.integration-partiel { border-color: color-mix(in srgb, var(--ton-partiel-contour) 55%, var(--trait)); }
.integration-titre { display: flex; align-items: center; gap: var(--esp-2); flex-wrap: wrap; }
.integration-titre strong { flex: 1; min-width: 0; }
.integration p { flex: 1; }
.integration .btn { align-self: flex-start; }
.groupe-champs { display: flex; flex-direction: column; gap: var(--esp-3); min-width: 0; margin: 0; padding: var(--esp-4); border: 1px solid var(--trait); border-radius: var(--rayon-petit); }
.groupe-champs legend { padding: 0 var(--esp-1); font-weight: 600; color: var(--encre); }
.formulaire-actions { display: flex; flex-wrap: wrap; gap: var(--esp-3); align-items: center; }
.rangee-bas { align-items: flex-end; }
.palier-retirer { display: flex; align-items: flex-end; }
.paliers { display: flex; flex-direction: column; gap: var(--esp-3); }
.paliers .grille-form { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--esp-3); }
.choix-option { display: flex; gap: var(--esp-3); align-items: flex-start; min-height: var(--cible); padding: var(--esp-3) var(--esp-4); border: 1px solid var(--trait-fort); border-radius: var(--rayon-petit); cursor: pointer; }
.choix-option:has(input:checked) { border-color: var(--primaire); background: var(--primaire-fond); box-shadow: inset 0 0 0 1px var(--primaire); }
.choix-option input { margin-top: 4px; accent-color: var(--primaire); }
.choix-option span { display: flex; flex-direction: column; }
.code-copiable { padding: var(--esp-2) var(--esp-3); background: var(--surface-2); border-radius: var(--rayon-petit); }
.modele-email { border: 1px solid var(--trait); border-radius: var(--rayon-petit); }
.modele-email summary { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-3); min-height: var(--cible); padding: 0 var(--esp-4); font-weight: 500; cursor: pointer; }
.modele-email-corps { display: flex; flex-direction: column; gap: var(--esp-3); padding: 0 var(--esp-4) var(--esp-4); }
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--esp-3) var(--esp-4); margin: 0; }
.fiche dt { font-size: var(--texte-petit); color: var(--encre-2); }
.fiche dd { margin: 2px 0 0; font-weight: 500; }

@media (max-width: 960px) {
  .parametres { grid-template-columns: minmax(0, 1fr); }
  .parametres-nav { position: relative; top: auto; display: flex; gap: var(--esp-1); overflow-x: auto; padding: var(--esp-2); scrollbar-width: thin; }
  .parametres-nav ul { display: contents; }
  .parametres-groupe { display: none; }
  .parametres-lien { white-space: nowrap; }
  .paliers .grille-form { grid-template-columns: 1fr 1fr auto; }
  .connexion { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .connexion-art { order: -1; height: clamp(150px, 26dvh, 240px); }
  .connexion-art img { object-position: center 62%; }
  .connexion-art figcaption { display: none; }
  .connexion-boite { min-height: 0; padding-top: var(--esp-5); }
}

@media (max-width: 1199.98px) {
  .barre { transform: translateX(-100%); box-shadow: none; }
  [data-barre="ouverte"] .barre { transform: none; box-shadow: var(--ombre-haute); }
  .barre-bascule { display: none; }
  .voile { position: fixed; inset: 0; z-index: var(--z-voile); background: rgb(15 33 24 / 50%); opacity: 0; visibility: hidden; transition: opacity var(--duree-normal) var(--ease), visibility var(--duree-normal); }
  [data-barre="ouverte"] .voile { opacity: 1; visibility: visible; }
  .page { margin-left: 0; }
  .haut-bouton { display: grid; }
  .tableau, .tableau-trois, .tableau-demi { grid-template-columns: 1fr; }
  .colonnes { grid-template-columns: 1fr; }
  .controle, .controle:has(.numerisation-med) { grid-template-columns: minmax(0, 1fr); }
  .document { position: static; }
  .document-vue { height: 60dvh; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.625rem; }
  .haut { gap: var(--esp-2); padding: 0 var(--esp-3); }
  .haut-identite, .haut-compte > .icone { display: none; }
  .haut-recherche { flex: 1; width: auto; }
  main { padding: 0 var(--esp-4) var(--esp-5); }
  .banniere { height: 248px; }
  .page:has(.entete-large) { --banniere-hauteur: 296px; }
  .entete > .rangee { flex-wrap: nowrap; width: 100%; }
  /* Une rangée de boutons défile dans la bannière plutôt que de passer à la ligne sous le fond vert, où le texte blanc disparaîtrait. */
  .entete > .rangee:not(:has(.champ, h1)) { overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
  .entete > .rangee:not(:has(.champ, h1)) > .btn { flex-shrink: 0; }
  /* L'action principale passe en tête : elle reste visible sans faire défiler la rangée. */
  .entete > .rangee:not(:has(.champ, h1)) > .btn-primaire { order: -1; }
  /* Rangée de titre (retour, référence, statut) : le statut passe dessous plutôt que d'être rogné. */
  .entete > .rangee:has(h1) { flex-wrap: wrap; }
  .entete > .rangee .champ { flex: 1; min-width: 0; }
  .entete input[type=date] { padding: var(--esp-2); }
  .entete { padding: var(--esp-5) var(--esp-1); }
  .pied { padding: var(--esp-2) var(--esp-4); }
  .taches { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--esp-3); }
  .tache { flex-direction: column; align-items: flex-start; }
  .recto-verso { grid-template-columns: 1fr; }
  .ligne { grid-template-columns: minmax(0, 1fr) 72px; }
  .ligne .champ-designation { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

.sr-annonce { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
