/* =============================================================================
   LOGIMED Labo — charte de l'interface.
   Bleu nuit (navigation), bleu LOGIMED (actions), orange réservé aux anomalies
   et alertes, vert pour ce qui est terminé. Polices embarquées : l'interface
   fonctionne sans Internet. Les tubes gardent leurs vraies couleurs de bouchon.
   ============================================================================= */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
/* Ancienne police, encore utilisable par les documents imprimés qui la nomment */
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Les noms historiques sont gardés : toutes les pages suivent la nouvelle charte */
  --paillasse: #f4f6f9;          /* fond de page */
  --surface: #ffffff;
  --surface-2: #f8fafc;          /* en-têtes de tableaux, pieds de cartes */
  --encre: #0f1b2d;
  --doux: #5b6b80;
  --trait: #e3e8ef;
  --trait-fort: #d5dce6;
  --nuit: #0b1b2e;               /* menu */
  --nuit-texte: #c9d4e3;
  --nuit-doux: #8fa3bc;
  --methylene: #0b5fa5;          /* bleu LOGIMED : actions, liens */
  --methylene-fonce: #08487d;
  --methylene-pale: #eaf2fb;
  --eosine: #c2410c;             /* anomalies, alertes */
  --eosine-vif: #e8590c;
  --eosine-pale: #fdeee4;
  --eosine-trait: #f3c9b0;
  --ambre: #92580a;
  --ambre-pale: #fcf3e3;
  --vert: #0f7a5c;
  --vert-pale: #e6f6ef;
  --violet: #6d28d9;
  --violet-pale: #f1ebfd;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  /* bouchons */
  --t-violet: #6b3fa0; --t-bleu: #3a86c8; --t-jaune: #e2b521; --t-vert: #3f9b5a; --t-gris: #8c959a; --t-rouge: #c43b3b;
  --rayon: 10px;
  --rayon-carte: 14px;
  --ombre: 0 1px 2px rgba(15, 27, 45, .04);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--encre); background: var(--paillasse); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Chiffres alignés dans les tableaux et indicateurs (pas ailleurs : Inter élargit les tirets en mode tabulaire) */
td.num, th.num, .chiffres b, input, .flag, .ref-texte { font-variant-numeric: tabular-nums; }
a { color: var(--methylene); text-underline-offset: 2px; }
a:hover { color: var(--methylene-fonce); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.07rem; margin: 0 0 .75rem; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 1rem; margin: 0 0 .4rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
b, strong { font-weight: 600; }
:focus-visible { outline: 3px solid rgba(11, 95, 165, .35); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- Structure */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.nav {
  background: var(--nuit); color: var(--nuit-texte); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav .labo { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
.nav .marque { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: var(--methylene); display: flex; align-items: center; justify-content: center; }
.nav .labo-plateforme .marque { background: var(--violet); }
.nav .labo strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #fff; font-size: .9rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.nav .labo span { font-size: .78rem; color: var(--nuit-doux); }
.nav a {
  color: var(--nuit-texte); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: .93rem;
  display: flex; align-items: center; gap: 12px; min-height: 40px;
}
.nav a svg { flex: 0 0 18px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.actif { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.nav a.actif svg { opacity: 1; }
.nav .compteur { margin-left: auto; background: var(--eosine-vif); color: #fff; border-radius: 10px; padding: 0 8px; font-size: .76rem; font-weight: 700; line-height: 1.6; }
.nav .nav-titre { margin: 16px 12px 6px; font-size: .72rem; color: #6f86a3; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav .pied { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); display: flex; align-items: center; gap: 10px; }
.nav .avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #1e3a5c; color: #fff; font-weight: 600; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.nav .pied .qui { flex: 1; min-width: 0; font-size: .8rem; color: var(--nuit-doux); line-height: 1.35; }
.nav .pied a.moi { padding: 0; min-height: 0; color: #fff; font-weight: 600; font-size: .87rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .pied a.moi:hover { background: none; text-decoration: underline; }
.nav .pied button { flex: 0 0 auto; background: none; border: 0; color: var(--nuit-doux); padding: 6px; min-height: 0; border-radius: 8px; cursor: pointer; display: flex; }
.nav .pied button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.contenu { padding: 30px 34px 64px; max-width: 1280px; width: 100%; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.entete .sous { color: var(--doux); margin-top: 5px; font-size: .95rem; }
.barre-mobile { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .nav.ouverte { transform: none; box-shadow: 0 0 0 100vw rgba(11, 27, 46, .45); }
  .barre-mobile { display: flex; align-items: center; gap: 12px; background: var(--nuit); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
  .barre-mobile button { background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 8px; padding: 8px 12px; min-height: 40px; }
  .contenu { padding: 20px 16px 60px; }
}

/* ---------------------------------------------------------------- Cartes */
.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte); padding: 20px 22px; box-shadow: var(--ombre); }
.bloc + .bloc { margin-top: 18px; }
.grille > .bloc + .bloc, .grille > * > .bloc:first-child { margin-top: 0; }
.bloc.plat { box-shadow: none; }
.bloc > h2:first-child, .bloc > .ligne.entre:first-child h2 { margin-bottom: 14px; }
.grille { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g4 { grid-template-columns: 1fr; } }
.g-detail { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
@media (max-width: 1000px) { .g2, .g3, .g-detail { grid-template-columns: 1fr; } }
.ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ligne.entre { justify-content: space-between; }
.doux { color: var(--doux); }
.petit { font-size: .86rem; }
.droite { text-align: right; }
.mono { font-family: var(--mono); font-size: .92em; }
.vide { padding: 32px 12px; text-align: center; color: var(--doux); }
.sep { border: 0; border-top: 1px solid var(--trait); margin: 16px 0; }

/* Chiffres clés : une carte par indicateur */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.chiffres > div { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-carte); padding: 18px 20px; display: flex; flex-direction: column-reverse; gap: 6px; justify-content: flex-end; }
.chiffres b { display: block; font-size: 1.85rem; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.chiffres span { color: var(--doux); font-size: .88rem; font-weight: 500; }
.chiffres .alerte { border-color: var(--eosine-trait); }
.chiffres .alerte b { color: var(--eosine); }

/* ---------------------------------------------------------------- Tableaux */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: .74rem; color: var(--doux); padding: 10px 12px; border-bottom: 1px solid var(--trait);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
td { padding: 11px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.bloc > .table-defile, .bloc > table { margin: 0 -22px; width: calc(100% + 44px); }
.bloc > .table-defile > table th:first-child, .bloc > .table-defile > table td:first-child,
.bloc > table th:first-child, .bloc > table td:first-child { padding-left: 22px; }
.bloc > .table-defile > table th:last-child, .bloc > .table-defile > table td:last-child,
.bloc > table th:last-child, .bloc > table td:last-child { padding-right: 22px; }
.bloc > .table-defile:last-child, .bloc > table:last-child { margin-bottom: -20px; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: #f5f9fd; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-defile { overflow-x: auto; }

/* ---------------------------------------------------------------- Formulaires */
label { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 6px; color: #26354a; }
.champ { margin-bottom: 14px; }
.champ small { color: var(--doux); display: block; margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; padding: 9px 12px; min-height: 42px; background: #fff;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon); transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #8a97a8; }
input:hover, select:hover, textarea:hover { border-color: #bcc7d5; }
input:focus, select:focus, textarea:focus { border-color: var(--methylene); outline: 0; box-shadow: 0 0 0 3px rgba(11, 95, 165, .15); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--doux); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--methylene); }
.case { display: flex; gap: 8px; align-items: center; font-weight: 500; }
textarea { min-height: 80px; resize: vertical; }

button, .bouton {
  font: inherit; font-weight: 600; font-size: .93rem; border-radius: var(--rayon); padding: 9px 18px; min-height: 42px; cursor: pointer;
  border: 1px solid var(--methylene); background: var(--methylene); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s, border-color .12s;
}
button:hover, .bouton:hover { background: var(--methylene-fonce); border-color: var(--methylene-fonce); color: #fff; }
button.second, .bouton.second { background: #fff; color: var(--encre); border-color: var(--trait-fort); }
button.second:hover, .bouton.second:hover { background: var(--surface-2); border-color: #bcc7d5; color: var(--encre); }
button.danger { background: #fff; color: var(--eosine); border-color: var(--eosine-trait); }
button.danger:hover { background: var(--eosine-pale); color: var(--eosine); }
button.lien { background: none; border: 0; color: var(--methylene); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
button.lien:hover { background: none; color: var(--methylene-fonce); }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- Statuts : pastille + point de couleur */
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 1.5; }
.statut::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.s-ENREGISTREE, .s-BROUILLON { background: #eef1f5; color: #475569; }
.s-PRELEVEE { background: var(--violet-pale); color: var(--violet); }
.s-EN_COURS { background: var(--methylene-pale); color: var(--methylene); }
.s-VALIDEE_TECH { background: #e4f4f7; color: #0e7490; }
.s-VALIDEE_BIO { background: var(--vert-pale); color: var(--vert); }
.s-DIFFUSEE, .s-LU { background: var(--vert); color: #fff; }
.s-ANNULEE, .s-ANNULE { background: #fff; color: var(--doux); border-color: var(--trait-fort); text-decoration: line-through; }
.s-EMISE, .s-PARTIELLE { background: var(--ambre-pale); color: var(--ambre); }
.s-SOLDEE, .s-PAYE, .s-ACCORDEE, .s-ENVOYE, .s-DELIVRE, .s-VALIDE_BIO { background: var(--vert-pale); color: var(--vert); }
.s-DEMANDEE, .s-ATTENTE, .s-EN_ATTENTE { background: #eef1f5; color: #475569; }
.s-REFUSEE, .s-REJETE, .s-ECHEC { background: var(--eosine-pale); color: var(--eosine); }
.s-PAYE_PARTIEL, .s-SAISI, .s-CORRIGE { background: var(--ambre-pale); color: var(--ambre); }
.s-VALIDE_TECH { background: #e4f4f7; color: #0e7490; }
.urgent { color: var(--eosine); font-weight: 600; }

/* Bouchons de tubes */
.tube { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); background: #fff; }
.tube.Violet { background: var(--t-violet); } .tube.Bleu { background: var(--t-bleu); } .tube.Jaune { background: var(--t-jaune); }
.tube.Vert { background: var(--t-vert); } .tube.Gris { background: var(--t-gris); } .tube.Rouge { background: var(--t-rouge); }
.portoir { display: flex; gap: 6px; }
.portoir .tube { width: 16px; height: 16px; margin: 0; }

/* ---------------------------------------------------------------- Résultats */
.feuille td { padding: 7px 12px; }
.feuille tr.examen td { background: var(--surface-2); font-weight: 600; color: var(--methylene); border-bottom: 1px solid var(--trait); padding-top: 14px; font-size: .9rem; }
.feuille input { padding: 6px 10px; min-height: 36px; max-width: 120px; text-align: right; font-family: var(--mono); font-weight: 600; }
.feuille select { padding: 6px 10px; min-height: 36px; max-width: 200px; }
.feuille input.texte { max-width: 100%; text-align: left; font-family: inherit; font-weight: 500; }
.feuille input.anormal { color: var(--eosine); border-color: var(--eosine-trait); }
.flag { font-weight: 700; font-size: .82rem; white-space: nowrap; }
.f-H, .f-HH, .f-A, .f-B, .f-BB { color: var(--eosine); }
.f-HH, .f-BB { background: var(--eosine-pale); padding: 1px 6px; border-radius: 5px; }
td.v-H, td.v-HH, td.v-A, td.v-B, td.v-BB { color: var(--eosine); font-weight: 700; }
tr.critique td { background: #fff7f2; }
/* Position de la valeur dans l'intervalle de référence */
.ref-jauge { position: relative; display: block; width: 120px; height: 6px; border-radius: 3px; background: #eef1f5; margin: 3px 0 5px; }
.ref-jauge::before { content: ""; position: absolute; left: 25%; width: 50%; top: 0; bottom: 0; border-radius: 3px; background: #cde6d9; }
.ref-jauge i { position: absolute; top: -3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--encre); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--encre); }
.ref-jauge.anormal i { background: var(--eosine); box-shadow: 0 0 0 1px var(--eosine); }
.ref-texte { font-family: var(--mono); font-size: .8rem; color: var(--doux); white-space: nowrap; }

/* ---------------------------------------------------------------- Sélection d'examens */
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { display: inline-flex; align-items: center; gap: 6px; background: var(--methylene-pale); color: var(--methylene-fonce); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .88rem; font-weight: 500; }
.puce button { background: none; border: 0; color: inherit; padding: 0 6px; min-height: 0; font-weight: 700; }
.puce button:hover { background: rgba(11, 95, 165, .12); color: inherit; }
.suggestions { border: 1px solid var(--trait); border-radius: var(--rayon); max-height: 320px; overflow: auto; margin-top: 6px; background: #fff; box-shadow: 0 8px 24px rgba(15, 27, 45, .08); }
.suggestions button { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; background: #fff; color: var(--encre); border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; font-weight: 400; padding: 10px 14px; min-height: 0; }
.suggestions button:hover, .suggestions button:focus { background: var(--methylene-pale); color: var(--encre); }

/* ---------------------------------------------------------------- Messages, fenêtres */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 440px; box-shadow: 0 10px 30px rgba(15, 27, 45, .2); font-weight: 500; }
.toast.erreur { background: var(--eosine); }
.toast.ok { background: var(--vert); }
.encart { padding: 12px 16px; border-radius: 12px; border: 1px solid #cfe0f3; background: var(--methylene-pale); margin-bottom: 14px; }
.encart.attention { border-color: #f0d9ad; background: var(--ambre-pale); }
.encart.alerte { border-color: var(--eosine-trait); background: #fff7f2; }

dialog { border: 0; border-radius: 16px; padding: 0; width: min(540px, 94vw); box-shadow: 0 24px 60px rgba(11, 27, 46, .3); color: var(--encre); }
dialog::backdrop { background: rgba(11, 27, 46, .5); }
dialog form { padding: 24px 26px; }
dialog h2 { font-size: 1.2rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------------------------------------------------------- Connexion */
.connexion { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.connexion .gauche { background: var(--nuit); color: var(--nuit-texte); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.connexion .marque-ligne { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.connexion .marque { width: 40px; height: 40px; border-radius: 11px; background: var(--methylene); display: flex; align-items: center; justify-content: center; }
.connexion .gauche h1 { font-size: 2.6rem; line-height: 1.12; max-width: 15ch; color: #fff; letter-spacing: -.03em; margin-bottom: 18px; }
.connexion .gauche p { color: #a9bad0; max-width: 42ch; font-size: 1.05rem; line-height: 1.55; }
.connexion .atouts { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.connexion .atouts li { display: flex; align-items: center; gap: 12px; }
.connexion .atouts span { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.connexion .gauche .petit { color: #6f86a3; }
.connexion .cote-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: #f7f9fb; }
.connexion form { width: min(400px, 100%); background: #fff; border: 1px solid var(--trait); border-radius: 16px; padding: 32px; }
.connexion form h2 { font-size: 1.45rem; font-weight: 700; margin: 0 0 4px; }
.connexion form .sous { color: var(--doux); font-size: .93rem; margin-bottom: 22px; }
.connexion form button { min-height: 48px; font-size: 1rem; margin-top: 4px; }
@media (max-width: 860px) { .connexion { grid-template-columns: 1fr; } .connexion .gauche { padding: 28px; gap: 24px; } .connexion .gauche h1 { font-size: 2rem; } }

@media print {
  .nav, .barre-mobile, button, .pas-imprimer { display: none !important; }
  .app { display: block; } .contenu { padding: 0; } .bloc { border: 0; box-shadow: none; }
}
.plein { width: 100%; }
.espace { margin-top: 16px; }
.jauge-cell { width: 45%; }
.jauge { display: block; height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.jauge-val { display: block; height: 100%; border-radius: 4px; }
.jauge-val.s-ENREGISTREE { background: #94a3b8; }
.jauge-val.s-PRELEVEE { background: var(--violet); }
.jauge-val.s-EN_COURS { background: var(--methylene); }
.jauge-val.s-VALIDEE_TECH { background: #0e7490; }
.jauge-val.s-VALIDEE_BIO, .jauge-val.s-DIFFUSEE { background: var(--vert); }
.histo { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; }
.histo-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.histo-barre { display: block; width: 100%; max-width: 28px; background: var(--methylene); border-radius: 3px 3px 0 0; }
.histo-col:hover .histo-barre { background: var(--eosine); }
.histo-col small { color: var(--doux); font-size: .75rem; margin-top: 4px; }
.cache { display: none !important; }
.gros { font-size: 1.3rem; }
.puce.a-faire { background: #fff; border: 1px dashed var(--trait-fort); color: var(--doux); }
tfoot td { border-bottom: 0; border-top: 2px solid var(--trait); }
.imprimable { display: none; }
@media print {
  .pas-imprimer, .entete, .encart { display: none !important; }
  .imprimable { display: block; }
  .feuille tr.examen td { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.formulaire-etroit { max-width: 460px; }
tr.annule td { color: var(--doux); text-decoration: line-through; }
tr.annule td:last-child { text-decoration: none; }

.app > *, .grille > *, .contenu { min-width: 0; }
td.tarif { white-space: nowrap; }
@media (max-width: 600px) { .col-tarif { display: none; } }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--trait); margin-bottom: 0; flex-wrap: wrap; }
.onglets a { padding: 10px 16px; text-decoration: none; color: var(--doux); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.onglets a:hover { color: var(--methylene); }
.onglets a.actif { color: var(--methylene-fonce); border-bottom-color: var(--methylene); }
.onglets .compte { display: inline-block; min-width: 22px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--paillasse); color: var(--doux); font-size: .8rem; text-align: center; }
.onglets a.actif .compte { background: var(--methylene-pale); color: var(--methylene); }
.onglet-contenu { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
tr.inactif td { color: var(--doux); }
dialog { max-height: 92vh; overflow-y: auto; }

/* Choix de la période du tableau de bord */
.periode { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.periode .champ { margin: 0; min-width: 160px; }
.periode .raccourcis { display: flex; gap: 4px 14px; flex-wrap: wrap; margin-left: auto; align-self: center; }
.periode .raccourcis { background: #fff; border: 1px solid var(--trait); border-radius: 10px; padding: 4px; gap: 2px; }
.periode .lien { padding: 6px 12px; min-height: 0; border-radius: 7px; text-decoration: none; color: var(--doux); font-weight: 500; font-size: .87rem; }
.periode .lien:hover { background: var(--methylene-pale); color: var(--methylene); }
@media (max-width: 640px) { .periode .champ { flex: 1 1 140px; } .periode .raccourcis { margin-left: 0; } }

/* Choix des examens affichés sur la feuille de résultats */
.filtre-examens { margin-bottom: 16px; }
.filtre-examens .ligne.entre { margin-bottom: 10px; }
.puce-ex { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--encre); border: 1px solid var(--trait-fort); border-radius: 999px; padding: 6px 14px; font-weight: 500; font-size: .88rem; min-height: 36px; }
.puce-ex:hover { background: var(--methylene-pale); color: var(--methylene-fonce); }
.puce-ex[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.puce-ex .petit { opacity: .8; }
.pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--trait-fort); }
.pastille.s-SAISI, .pastille.s-CORRIGE { background: var(--t-jaune); }
.pastille.s-VALIDE_TECH { background: var(--t-bleu); }
.pastille.s-VALIDE_BIO { background: var(--t-vert); }
.puce-ex[aria-pressed="true"] .pastille { box-shadow: 0 0 0 2px #fff; }

/* Formulaire compact : tout le dossier patient visible sans défilement */
.entete.compacte { align-items: baseline; justify-content: flex-start; gap: 6px 14px; margin-bottom: 12px; }
.form-compact { padding: 14px 18px; }
.form-compact .grille { gap: 0 14px; }
.form-compact .champ { margin-bottom: 8px; }
.form-compact label { font-size: .82rem; margin-bottom: 2px; }
.form-compact input, .form-compact select { padding: 6px 9px; }
.form-compact input::placeholder { font-size: .85rem; }
.g4f { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.titre-section { font-weight: 700; margin: 6px 0 6px; padding-top: 8px; border-top: 1px solid var(--trait); }
.titre-section .doux { font-weight: 400; font-size: .85rem; }
.pied-form { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--trait); }
.pied-form .case { margin: 0; font-size: .92rem; }
@media (max-width: 1050px) { .g4f { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g4f { grid-template-columns: 1fr; } }

/* Fenêtre large sur deux colonnes */
dialog.large { width: min(760px, 96vw); }
dialog.large form { padding: 18px 22px; }
.deux-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.deux-col .champ { margin-bottom: 8px; }
.deux-col .pleine { grid-column: 1 / -1; }
dialog.large input, dialog.large select { padding: 6px 9px; }
dialog.large .actions { margin-top: 10px; }
@media (max-width: 560px) { .deux-col { grid-template-columns: 1fr; } }

/* États imprimables (menu Éditions) */
.etat { background: #fff; border: 1px solid var(--trait-fort); padding: 22px 26px; max-width: 900px; }
.etat-entete { border-bottom: 1px solid var(--trait-fort); padding-bottom: 14px; min-height: 70px; }
.etat-labo { font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.35; }
.etat-labo b { font-size: 1.15rem; text-transform: uppercase; }
.etat-titre { margin: 18px -26px 0; padding: 12px; text-align: center; background: var(--methylene-pale); border-top: 1px solid var(--trait-fort); border-bottom: 1px solid var(--trait-fort);
  color: #6b1f6b; font-weight: 700; letter-spacing: .06em; font-size: 1.15rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.etat-edition { text-align: right; font-size: .85rem; margin: 12px 0 18px; }
.etat-periode { text-align: center; font-style: italic; margin-bottom: 16px; }
.etat-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.etat-table th, .etat-table td { border: 1px solid var(--trait-fort); padding: 3px 6px; }
.etat-table thead th { background: var(--methylene-pale); color: var(--encre); font-size: .9rem; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.etat-table thead th:first-child { width: 40%; }
.etat-table tfoot td { font-weight: 700; }
.etat-table tfoot td:first-child { text-align: center; }
.etat-note { margin: 10px 0 0; }
@media print {
  body { background: #fff; }
  .etat { border: 0; padding: 0; max-width: none; }
  .etat-titre { margin: 18px 0 0; }
}

/* Logo du laboratoire */
.etat-entete { display: flex; align-items: center; gap: 18px; }
.etat-logo { max-height: 80px; max-width: 200px; object-fit: contain; }
.logo-zone { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.logo-apercu { width: 220px; height: 110px; border: 1px dashed var(--trait-fort); border-radius: var(--rayon); display: flex; align-items: center; justify-content: center; background: #fff; color: var(--doux); font-size: .9rem; }
.logo-apercu img { max-width: 200px; max-height: 96px; object-fit: contain; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; }
.titre-section.premier { border-top: 0; padding-top: 0; margin-top: 0; }

/* Bordereau global tiers payeurs */
.etat.bordereau + .etat.bordereau { margin-top: 24px; }
.etat-entete { position: relative; }
.etat-edition-haut { margin-left: auto; align-self: flex-start; font-size: .82rem; color: var(--doux); }
.etat-cadre-periode { width: fit-content; margin: 16px auto 18px; padding: 10px 26px; border: 1px solid var(--encre); font-weight: 700; font-size: .92rem; }
.etat-cadre-periode span { font-weight: 700; margin: 0 6px; }
.etat-cadre-periode b { color: var(--encre); margin: 0 10px; }
.bord-tiers { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.bord-lib { color: #b4232c; font-weight: 700; text-decoration: underline; }
.bord-nom { color: #b4232c; font-weight: 700; margin: 6px 0 0 60px; text-transform: uppercase; }
.bord-coord { display: grid; grid-template-columns: auto auto; gap: 6px 18px; margin: 0; font-weight: 700; }
.bord-coord dt { font-weight: 700; } .bord-coord dd { margin: 0; text-transform: uppercase; }
.bord-table td.centre { text-align: center; white-space: nowrap; }
.bord-table thead th:first-child { width: 12%; } .bord-table thead th:nth-child(2) { width: 12%; } .bord-table thead th:nth-child(3) { width: 40%; }
.bord-table tfoot td { color: #b4232c; }
.bord-table .bord-total { text-align: left !important; text-transform: uppercase; }
@media print {
  .saut-page { break-before: page; page-break-before: always; }
  .etat.bordereau + .etat.bordereau { margin-top: 0; }
  .bord-lib, .bord-nom, .bord-table tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* État récapitulatif par garant : TPA en en-tête, garants en retrait */
.etat-table tr.ligne-tpa td { background: var(--paillasse); font-weight: 700; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.etat-table tr.ligne-garant td:first-child { padding-left: 26px; }

/* Décompte TPA par garant */
.etat.decompte + .etat.decompte { margin-top: 24px; }
.dec-garant { margin-top: 16px; }
.dec-ligne { display: flex; gap: 14px; align-items: baseline; margin: 4px 0; }
.dec-ligne.entre { justify-content: space-between; }
.dec-lib { font-weight: 700; font-style: italic; text-decoration: underline; margin-right: 18px; }
.dec-lib.italique { text-decoration: none; }
.dec-table { margin-top: 6px; font-size: .85rem; }
.dec-table thead th { font-size: .8rem; }
.dec-table td.droite { text-align: right; }
.dec-table tfoot td { font-weight: 700; }
.dec-total-facture td { color: #b4232c; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dec-total-facture td:first-child { border: 0; }
.dec-nb { display: inline-block; min-width: 30px; padding: 0 6px; border: 1px solid var(--encre); text-align: right; color: var(--encre); }
.dec-total-garant td:first-child { text-align: right !important; }
.dec-general { margin-top: 18px; font-size: .95rem; }
.dec-general td { font-weight: 700; }
.dec-general td:first-child { width: 58%; }
.dec-nb-col { width: 6%; }
.dec-arrete { margin-top: 20px; line-height: 1.6; }
.dec-arrete b { display: block; margin-left: 40px; }
.dec-table { table-layout: fixed; }
.dec-table thead th:nth-child(1) { width: 12%; } .dec-table thead th:nth-child(2) { width: 22%; } .dec-table thead th:nth-child(3) { width: 10%; }
.dec-table thead th:nth-child(4) { width: 11%; } .dec-table thead th:nth-child(5) { width: 13%; } .dec-table thead th:nth-child(6) { width: 11%; }
.dec-table thead th:nth-child(7) { width: 8%; } .dec-table thead th:nth-child(8) { width: 13%; }
.dec-table td { overflow-wrap: anywhere; }
.dec-total-facture td.droite { white-space: nowrap; }
.dec-table td.centre { white-space: nowrap; }
.dec-table thead th { white-space: normal; line-height: 1.15; vertical-align: middle; }
.dec-table td { overflow-wrap: break-word; }
@media print { .dec-table { font-size: .74rem; } .dec-table thead th { font-size: .72rem; } }

/* Écran État des prestations */
.etats-ecran { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); gap: 18px 26px; align-items: start; }
.etats-liste { border: 1px solid var(--trait-fort); border-radius: var(--rayon); padding: 6px; margin: 0; max-height: 470px; overflow-y: auto; }
.etats-choix { display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; border-radius: 4px; font-weight: 400; font-size: .9rem; cursor: pointer; margin: 0; color: var(--methylene-fonce); }
.etats-choix:hover { background: var(--methylene-pale); }
.etats-choix.actif { background: var(--methylene-pale); outline: 1px dotted var(--methylene); }
.etats-choix input { width: auto; margin-top: 3px; }
.etats-choix b { margin-right: 2px; }
.etats-filtres .champ { margin-bottom: 9px; }
.etats-filtres .champ.inactif label { color: var(--trait-fort); }
.etats-filtres select:disabled, .etats-filtres input:disabled { background: var(--paillasse); color: var(--trait-fort); }
.etats-entete { border: 1px solid var(--trait-fort); border-radius: var(--rayon); padding: 6px 12px 8px; margin: 2px 0 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.etats-entete legend { font-weight: 700; font-size: .85rem; padding: 0 4px; }
.etats-entete .case { margin: 0; font-size: .9rem; }
.etats-boutons { gap: 8px; }
.cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#resultat { margin-top: 18px; }
.etat-generique { max-width: none; }
.etat-sous-titre { text-align: center; font-weight: 700; margin: 0 0 12px; }
.etat-normalisee { font-family: inherit; font-size: .85rem; margin-top: 4px; }
.etat-table.generique tr.sous-total td { font-weight: 700; background: #fafbfb; }
.etat-table.generique tr.total-general td { font-weight: 700; }
.etat-table.generique tfoot td:first-child, .etat-table.generique tr.sous-total td:first-child { text-align: left; }
.etat-table.generique td.centre { text-align: center; white-space: nowrap; }
.etat-table.generique thead th:first-child { width: auto; }
@media (max-width: 1000px) { .etats-ecran { grid-template-columns: 1fr; } }
@media print { .etat-generique.large .etat-table { font-size: .7rem; } .etat-generique .table-defile { overflow: visible; } }
.etats-entete .case { white-space: nowrap; }

/* ---------------------------------------------------------------- Console plateforme et utilisateurs */
.s-ACTIF { background: var(--vert-pale); color: var(--vert); }
.s-SUSPENDU { background: var(--eosine); color: #fff; }
.s-EXPIRE, .s-VERROUILLE { background: var(--eosine-pale); color: var(--eosine); }
.s-ECHEANCE, .s-A_CHANGER { background: var(--ambre-pale); color: var(--ambre); }
.s-INACTIF { background: #fff; color: var(--doux); border-color: var(--trait-fort); }
.labo-plateforme { border-left: 4px solid var(--ambre); padding-left: 10px; }
.plat-filtres { gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.plat-filtres input { flex: 1 1 260px; }
.plat-filtres select { flex: 0 0 210px; }
.plat-actions { gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.plat-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.plat-dl dt { color: var(--doux); }
.plat-dl dd { margin: 0; }
.plat-dl.deux { grid-template-columns: max-content 1fr max-content 1fr; }
.plat-recap { max-width: 640px; }
.plat-recap h2 { margin-top: 0; }
.plat-mdp { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .04em; }
.role-puce { display: inline-block; background: var(--methylene-pale); color: var(--methylene-fonce); border-radius: 10px; padding: 1px 8px; font-size: .82rem; margin: 1px 0; }
.actions-ligne { white-space: nowrap; }
.actions-ligne .lien + .lien { margin-left: 10px; }
@media (max-width: 760px) { .plat-dl.deux { grid-template-columns: max-content 1fr; } }
.champ-bouton { flex-wrap: nowrap; gap: 6px; }
.champ-bouton input { flex: 1 1 auto; min-width: 0; }
.champ-bouton button { flex: 0 0 auto; }
.plat-recap p { margin-top: 16px; }
.plat-fiche { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px 36px; }
.plat-fiche .titre-section { margin-top: 0; }
@media (max-width: 900px) { .plat-fiche { grid-template-columns: 1fr; } }
.deux-cases { grid-column: span 2; }
@media (max-width: 760px) { .deux-cases { grid-column: auto; } }
.espace-haut { margin-top: 16px; }
.grille-tarif input { width: 130px; text-align: right; }
.grille-tarif td { vertical-align: middle; }

/* Examens et valeurs de référence */
tr.debut-groupe td { border-top: 2px solid var(--trait-fort); }
.flag.provisoire { opacity: .7; }
.plat-filtres .case { flex: 0 0 auto; white-space: nowrap; }
.plat-filtres .case input { flex: none; }

/* ---------------------------------------------------------------- Compte rendu d'analyses (A4) */
.cr {
  --cr-encre: #16262c; --cr-doux: #5d6b70; --cr-trait: #d9e0e1; --cr-fond: #eef2f3;
  --cr-accent: #1f4f5c; --cr-alerte: #c2410c;
  max-width: 190mm; margin: 0 auto; color: var(--cr-encre); background: #fff;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-size: 10pt; line-height: 1.4;
}
.cr-mono, .cr-valeur, .cr-ref, .cr-ant, .cr-unite { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cr-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2.5px solid var(--cr-accent); }
.cr-labo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-logo { max-height: 62px; max-width: 150px; object-fit: contain; }
.cr-labo-nom { color: var(--cr-accent); font-weight: 700; font-size: 13pt; line-height: 1.2; }
.cr-labo-type, .cr-labo-coord { color: var(--cr-doux); font-size: 8.5pt; }
.cr-titre { text-align: right; font-size: 8.5pt; color: var(--cr-doux); white-space: nowrap; }
.cr-titre-doc { color: var(--cr-encre); font-weight: 700; font-size: 11pt; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.cr-identite { display: grid; grid-template-columns: 1fr 1fr; margin: 10px 0 8px; border: 1px solid var(--cr-trait); border-radius: 6px; font-size: 9pt; }
.cr-identite > div { padding: 9px 12px; }
.cr-identite > div + div { border-left: 1px solid var(--cr-trait); }
.cr-etiquette { color: var(--cr-doux); font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.cr-patient-nom { font-weight: 700; font-size: 11pt; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 8.8pt; line-height: 1.3; }
.cr-table col.c-analyse { width: 34%; } .cr-table col.c-valeur { width: 16%; } .cr-table col.c-unite { width: 10%; }
.cr-table col.c-ref { width: 22%; } .cr-table col.c-ant { width: 18%; }
.cr-table thead th { background: var(--cr-fond); color: var(--cr-doux); font-size: 7.5pt; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; text-align: left; padding: 6px 8px; vertical-align: top; }
.cr-ant-date { display: block; font-weight: 400; letter-spacing: 0; font-size: 7.5pt; color: var(--cr-doux); }
.cr-table td { padding: 2px 8px; border-bottom: 1px solid var(--cr-trait); vertical-align: top; }
.cr-titre-discipline th { text-align: left; padding: 10px 8px 3px; color: var(--cr-accent); font-size: 9pt; font-weight: 700;
  border-bottom: 1.5px solid var(--cr-encre); }
.cr-titre-discipline th > span:first-child { text-transform: uppercase; letter-spacing: .03em; }
.cr-titre-examen { text-transform: none; }
.cr-sous-titre td { font-weight: 700; padding-top: 6px; color: var(--cr-encre); border-bottom-color: var(--cr-trait); }
.cr-anormal { color: var(--cr-alerte); font-weight: 700; }
.cr-critique { text-decoration: underline; text-underline-offset: 2px; }
.cr-signe { font-size: 8pt; white-space: nowrap; }
.cr-unite, .cr-ref, .cr-ant { color: var(--cr-doux); }
.cr-note { color: var(--cr-doux); font-size: 8pt; }
.cr-vide { color: var(--cr-doux); margin: 16px 0; }
.cr-commentaire { margin-top: 14px; padding: 9px 12px; border: 1px solid var(--cr-trait); border-radius: 6px; font-size: 9pt; break-inside: avoid; }
.cr-pied { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 18px; padding-top: 10px;
  border-top: 1px solid var(--cr-trait); font-size: 8pt; color: var(--cr-doux); break-inside: avoid; }
.cr-signe-legende { color: var(--cr-alerte); font-weight: 700; }
.cr-signature { min-width: 62mm; color: var(--cr-doux); }
.cr-biologiste { color: var(--cr-encre); font-weight: 700; font-size: 9.5pt; margin-top: 2px; }
.cr-cachet { margin-top: 18px; padding-top: 3px; border-top: 1px solid var(--cr-trait); }
.cr tr { break-inside: avoid; }
.cr-titre-discipline, .cr-sous-titre { break-after: avoid; }
@media print {
  @page { size: A4 portrait; margin: 12mm 12mm 14mm;
    @bottom-right { content: "Page " counter(page) " / " counter(pages); font: 8pt "Segoe UI", sans-serif; color: #5d6b70; } }
  #cr.imprimable { display: block; }
  .cr { max-width: none; }
  .cr, .cr * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- Tableau de bord */
.colonne { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.colonne > .bloc + .bloc { margin-top: 0; }
.chiffres > div { position: relative; }
.chiffres > div::after { content: ""; position: absolute; top: 20px; right: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--trait-fort); }
.chiffres .kpi-bleu::after { background: var(--methylene); }
.chiffres .kpi-violet::after { background: var(--violet); }
.chiffres .kpi-cyan::after { background: #0e7490; }
.chiffres .kpi-orange::after { background: var(--eosine-vif); }
.circuit { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 14px; }
.circuit .etape { display: flex; flex-direction: column; gap: 6px; }
.circuit .jauge { height: 6px; }
.circuit b { font-size: 1.45rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.circuit span:last-child { font-size: .83rem; color: var(--doux); }
.carte-alerte { border-color: var(--eosine-trait); }
.titre-icone { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.titre-icone h2 { margin: 0; }
.icone-alerte { width: 30px; height: 30px; border-radius: 8px; background: var(--eosine-pale); color: var(--eosine); display: flex; align-items: center; justify-content: center; }
.liste-alertes { list-style: none; margin: 0 0 14px; padding: 0; }
.liste-alertes li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid #f1f3f6; }
.liste-alertes li div { display: flex; flex-direction: column; }
.liste-alertes .valeur { color: var(--eosine); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.resume { margin: 0; display: flex; flex-direction: column; }
.resume > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #f1f3f6; font-size: .93rem; }
.resume > div:first-child { border-top: 0; padding-top: 0; }
.resume dt { color: var(--doux); }
.resume dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.histo-barre { background: #9bc1e6; border-radius: 4px 4px 0 0; }
.histo-col:hover .histo-barre { background: var(--methylene); }
.bouton.plein { width: 100%; }
.feuille td[data-flag] { width: 70px; white-space: nowrap; }
.feuille td:nth-child(2) { width: 150px; }
.circuit { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
tr.cliquable td:first-child { white-space: nowrap; }

/* ---------------------------------------------------------------- Facture (A4) */
.fa {
  --fa-encre: #16262c; --fa-doux: #5d6b70; --fa-trait: #d9e0e1; --fa-fond: #eef2f3; --fa-accent: #144b57;
  position: relative; max-width: 190mm; margin: 0 auto; background: #fff; color: var(--fa-encre);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-size: 9.5pt; line-height: 1.45;
}
.fa-mono, .fa-code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.fa-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.fa-labo { display: flex; align-items: flex-start; gap: 14px; color: var(--fa-doux); font-size: 9pt; min-width: 0; }
.fa-logo { max-height: 64px; max-width: 150px; object-fit: contain; }
.fa-labo-nom { color: var(--fa-accent); font-weight: 700; font-size: 13.5pt; line-height: 1.2; margin-bottom: 3px; }
.fa-cartouche { background: var(--fa-accent); color: #e6f0f2; border-radius: 6px; padding: 12px 18px; min-width: 62mm; font-size: 9.5pt; line-height: 1.6; }
.fa-titre { color: #fff; font-weight: 700; font-size: 14pt; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; }
.fa-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--fa-trait); border-radius: 6px; margin-bottom: 14px; }
.fa-parties > div { padding: 10px 14px; }
.fa-parties > div + div { border-left: 1px solid var(--fa-trait); }
.fa-etiquette { color: var(--fa-doux); font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.fa-fort { font-weight: 700; }
.fa-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.fa-table thead th { background: var(--fa-fond); color: var(--fa-doux); font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 10px; text-align: left; border: 0; }
.fa-table td { padding: 6px 10px; border-bottom: 1px solid var(--fa-trait); vertical-align: top; }
.fa-table .d { text-align: right; white-space: nowrap; }
.fa-code { color: var(--fa-doux); font-size: 8.5pt; white-space: nowrap; }
.fa-bas { display: grid; grid-template-columns: minmax(0, 1fr) 80mm; gap: 18px; align-items: start; margin-top: 14px; }
.fa-mentions { color: var(--fa-doux); }
.fa-mentions b { color: var(--fa-encre); }
.fa-mentions > div + div { margin-top: 5px; }
.fa-totaux { border: 1px solid var(--fa-trait); border-radius: 6px; overflow: hidden; }
.fa-totaux > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 14px; border-top: 1px solid var(--fa-trait); }
.fa-totaux > div:first-child { border-top: 0; }
.fa-totaux .fa-net { background: var(--fa-accent); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; padding: 9px 14px; border-top: 0; }
.fa-cadres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.fa-cadres > div { border: 1px solid var(--fa-trait); border-radius: 6px; padding: 9px 12px; font-size: 9pt; }
.fa-reste { color: #c2410c; }
.fa-cachet { margin-top: 20px; padding-top: 3px; border-top: 1px solid var(--fa-trait); color: var(--fa-doux); font-size: 8pt; }
.fa-annulation { margin-top: 14px; color: #c2410c; font-weight: 700; }
.fa-annulee::before { content: "ANNULÉE"; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 64pt; font-weight: 700; color: rgba(194, 65, 12, .14); letter-spacing: .1em; pointer-events: none; }
.fa tr, .fa-bas, .fa-cadres { break-inside: avoid; }
@media print {
  #impression.imprimable { display: block; }
  .fa { max-width: none; }
  .fa, .fa * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- Ticket de caisse (80 mm) */
.tk { page: ticket; width: 72mm; margin: 0 auto; background: #fff; color: #000; font-family: var(--mono); font-size: 9pt; line-height: 1.45; font-variant-numeric: tabular-nums; }
.tk hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.tk-c { text-align: center; }
.tk-labo { font-weight: 600; font-size: 10.5pt; text-transform: uppercase; }
.tk-titre { font-weight: 600; text-transform: uppercase; margin-bottom: 2px; }
.tk-l { display: flex; justify-content: space-between; gap: 8px; }
.tk-l > span:last-child { text-align: right; white-space: nowrap; }
.tk-fort { font-weight: 600; font-size: 10pt; }
.tk-code { display: block; width: 58mm; max-width: 100%; margin: 10px auto 4px; image-rendering: pixelated; }
.tk-petit { font-size: 7.5pt; margin-top: 4px; }
.tk-annule .tk-titre { text-decoration: line-through; }
@media print {
  body.impression-ticket .tk, body.impression-ticket .tk * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
