/* ════════════════════════════════════════════════════════════════════════════════
   ORGANIGRAMME — wwwroot/css/ecran-organigramme.css

   Le CSS ne fait que PEINDRE : les positions viennent de Disposer(), qui attribue une
   abscisse par profondeur et une ordonnée par empilement des feuilles. Ne remplacez pas
   ce calcul par une grille — un arbre dont chaque parent se centre sur ses enfants ne se
   décrit pas en flux CSS.

   Trois mesures, et elles sont solidaires du composant : nœud 232 × 100, gouttières
   40 × 14 (refonte du 2026-09-27). Les changer ici sans les changer dans LARGEUR/HAUTEUR/ESPACE_X/ESPACE_Y
   décale les coudes des nœuds qu'ils relient.
   ════════════════════════════════════════════════════════════════════════════════ */

.org-scroll   { overflow: auto; padding: 22px 24px; }
.org-canevas  { position: relative; min-width: 100%; }
.org-filet    { position: absolute; background: var(--et-filet-fort); }

/* ── LE NŒUD ──────────────────────────────────────────────────────────────────
   Filet de 4 px à gauche : bleu pour un service, ardoise pour une équipe — elle n'a pas
   de hiérarchie propre, et l'arbre doit le dire d'un coup d'œil. */
.org-noeud            { position: absolute; width: 232px; height: 100px; display: flex;
                        background: var(--et-surface); border: 1px solid var(--et-form-border);
                        cursor: pointer; overflow: hidden; }
.org-noeud-filet      { flex: none; width: 4px; background: var(--et-form-blue); }
/* L'ardoise EN MARQUE, et non en aplat : --et-table-head-encre, pas --et-table-head.
   Les deux valent #354A5F en clair, mais seul le premier bascule en sombre (#C3D0E4) —
   l'aplat, lui, reste ardoise dans les deux thèmes parce qu'il porte de l'encre claire.
   Un filet de 4 px en #354A5F sur la surface sombre (#111A2B) rend 1,90:1, sous le seuil
   de 3:1 d'une marque graphique : l'équipe cesserait de se distinguer du service la nuit.
   C'est ce que l'ancienne feuille corrigeait avec un hexadécimal écrit à la main. */
.org-noeud.est-equipe   .org-noeud-filet { background: var(--et-table-head-encre); }
.org-noeud.est-inactif  { background: var(--et-surface-3); }
.org-noeud.est-inactif  .org-noeud-filet { background: var(--et-filet-fort); }
.org-noeud.est-inactif  .org-noeud-nom   { color: var(--et-faint); }
.org-noeud.est-alerte   { border-color: var(--et-avertissement-bord); }
.org-noeud.est-choisi   { border-color: var(--et-form-blue); box-shadow: 0 0 0 2px var(--et-info-bg); }

.org-noeud-corps      { flex: 1; min-width: 0; padding: 8px 10px; display: flex;
                        flex-direction: column; justify-content: center; gap: 3px; }
.org-noeud-tete       { display: flex; align-items: center; gap: 7px; }
.org-noeud-code       { flex: none; font-family: var(--et-font-mono); font-size: 12px;
                        letter-spacing: .04em; color: var(--et-muted); }
.org-noeud-nom        { flex: 1; min-width: 0; font-size: 13px; font-weight: 700;
                        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                        color: var(--et-ink); }
.org-noeud-alerte     { flex: none; display: grid; color: var(--et-avertissement-ink); }
.org-noeud-pastille   { flex: none; width: 7px; height: 7px; border-radius: var(--et-r-pill);
                        background: var(--et-ok); }
.org-noeud.est-inactif .org-noeud-pastille { background: var(--et-inerte); }

/* La donnée manquante se lit en ambre — SAUF sur un nœud inactif, où elle passe au gris :
   la couleur suit le verdict de la carte, sinon elle le contredit. Un nœud désactivé
   n'appelle aucune action. */
.org-noeud-sous               { font-size: 12px; overflow: hidden; text-overflow: ellipsis;
                                white-space: nowrap; color: var(--et-muted); }
.org-noeud-sous.est-manquant  { color: var(--et-avertissement-ink); }
.org-noeud.est-inactif .org-noeud-sous.est-manquant { color: var(--et-faint); }

/* Le nombre porte sa BASE à côté : « 21 · 21 » ne se lit pas sans son dénominateur. */
.org-noeud-pied       { display: flex; align-items: baseline; gap: 6px; }
.org-noeud-nombre     { font-family: var(--et-font-mono); font-size: 12px; font-weight: 500;
                        color: var(--et-ink); }
.org-noeud-base       { flex: 1; min-width: 0; font-size: 12px; color: var(--et-faint);
                        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org-noeud-pli        { flex: none; display: flex; flex-direction: column; align-items: center;
                        justify-content: center; gap: 2px; width: 30px; padding: 0; border: 0;
                        border-left: 1px solid var(--et-rang); background: transparent;
                        color: var(--et-muted); font-size: 12px; cursor: pointer; }
.org-noeud-pli:hover  { background: var(--et-tint); }
.org-noeud-pli .bi          { transform: rotate(90deg); }
.org-noeud-pli.est-plie .bi { transform: none; }

/* ── LA BARRE, LE BANDEAU, LA LÉGENDE ─────────────────────────────────────────
   L'entrée « Équipe » de la légende n'est rendue que sur l'axe mixte : une légende qui
   nomme une couleur absente de l'arbre fait chercher ce qui n'y est pas. */
.org-aide              { font-size: 13px; color: var(--et-faint); min-width: 0; }
.org-bascule.est-attention { border-color: var(--et-avertissement-bord);
                             background: var(--et-avertissement-bg); color: var(--et-avertissement-ink); }
.org-bascule.est-allume    { border-color: var(--et-filet-fort); background: var(--et-surface-3);
                             color: var(--et-muted); }
.org-bandeau           { display: flex; align-items: flex-start; gap: 8px; padding: 9px 14px;
                         background: var(--et-avertissement-bg);
                         border-bottom: 1px solid var(--et-avertissement-bord);
                         font-size: 13px; line-height: 1.5; color: var(--et-avertissement-ink); }
.org-legende           { display: flex; align-items: center; gap: var(--et-legende-gap);
                         flex-wrap: wrap; padding: var(--et-graphe-p) 18px; background: var(--et-surface-2);
                         border-top: 1px solid var(--et-hairline); }
.org-legende-titre     { font-family: var(--et-font-mono); font-size: 12px; text-transform: uppercase;
                         letter-spacing: .12em; color: var(--et-muted); }
.org-legende-item      { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
                         color: var(--et-muted); }
.org-legende-pt        { width: 8px; height: 8px; border-radius: var(--et-r-pill); }
.org-legende-pt.est-actif    { background: var(--et-ok); }
.org-legende-pt.est-inactif  { background: var(--et-inerte); }
.org-legende-pt.est-alerte   { background: var(--et-avertissement); }
.org-legende-pt.est-choisi   { background: var(--et-form-blue); }
.org-legende-pt.est-equipe   { background: var(--et-table-head-encre); }  /* cf. le filet du nœud */
.org-legende-methode   { flex: 1; min-width: 200px; font-size: 12px; color: var(--et-faint);
                         text-wrap: pretty; }

/* La PROVENANCE ne sort qu'à l'impression : sur papier, l'arbre ne dit plus de lui-même
   quel axe ni quels filtres l'ont produit, et deux axes pliés se ressemblent. À l'écran,
   elle redoublerait le résumé posé juste au-dessus. */
.org-provenance { display: none; }

/* ════════════════════════════════════════════════════════════════════════════════
   REFONTE DU 2026-09-27 — maquette « Organigramme — EasyTime »
   (docs/modeles/design_handoff_organigramme). Mesurée par le banc :
   node tools/banc-ecran/mesurer.mjs organigramme (et -mixte, -personnel).
   ════════════════════════════════════════════════════════════════════════════════ */

/* Les nœuds : 232 × 100 (LARGEUR / HAUTEUR du composant), le nombre de branches masquées
   sous le chevron quand la branche est repliée. */
/* Le nom, le responsable (ou la fonction) et la base du nombre passent à la ligne plutôt
   que d'être coupés par « … » : « Ressources humaines » à côté de son alerte, « Directeur ·
   Direction générale », « propre · cumulé — 4 hors équipe » ne tiennent pas sur une. */
.org-noeud .org-noeud-nom,
.org-noeud .org-noeud-sous,
.org-noeud .org-noeud-base { white-space: normal; text-overflow: clip; overflow: visible; line-height: 1.3; }
.org-noeud .org-noeud-pied { align-items: flex-start; }
.org-noeud .org-noeud-tete { align-items: flex-start; }
.org-noeud-pli-nb      { font-family: var(--et-font-mono); font-size: 12px; font-weight: 600; color: var(--et-ink); }
.org-noeud.est-alerte .org-noeud-filet { background: var(--et-avertissement-mark); }

/* Onglets à chiffre, à la place du segmenté. */
.org-onglets          { display: flex; min-width: 0; overflow-x: auto; align-self: stretch; }
.org-onglet           { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
                        min-height: 44px; padding: var(--et-onglet-chiffre-py) var(--et-onglet-px); background: transparent; border: 0;
                        border-bottom: 3px solid transparent; font-family: inherit; text-align: left;
                        color: var(--et-muted); cursor: pointer; }
.org-onglet:hover     { background: var(--et-survol); color: var(--et-ink); }
.org-onglet:focus-visible { outline: 2px solid var(--et-form-blue); outline-offset: -2px; }
.org-onglet.est-actif { color: var(--et-ink); border-bottom-color: var(--et-form-blue); }
.org-onglet-lib       { font-size: 14px; font-weight: 600; white-space: nowrap; }
.org-onglet-chiffre   { font-family: var(--et-font-mono); font-size: 12px; font-weight: 600;
                        color: var(--et-muted); font-variant-numeric: tabular-nums; }
.org-onglet.est-actif .org-onglet-chiffre { color: var(--et-form-blue-d); }

/* Le bandeau : chaque nom ouvre la fiche de son nœud. */
.org-bandeau-nom      { padding: 0; margin: 0 1px 0 4px; border: 0; background: none; font: inherit;
                        font-weight: 600; color: var(--et-lien); text-decoration: underline;
                        text-underline-offset: 2px; cursor: pointer; }
.org-bandeau-nom:hover { color: var(--et-lien-survol); }
.org-bandeau-nom:focus-visible { outline: 2px solid var(--et-form-blue); outline-offset: 2px; }

/* L'arbre et sa fiche côte à côte QUAND LA PLACE Y EST, dessous sinon. Pas de palier de
   largeur d'écran : ce qui décide, c'est la place laissée par la coquille (rail déplié ou
   non), que seule la mise en page connaît. L'arbre demande 820 px — trois niveaux de nœuds
   et leurs marges — ; s'il ne les a pas à côté des 340 de la fiche, la fiche passe dessous,
   en pleine largeur, et l'arbre garde toute la sienne. */
.org-corps            { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.org-corps > .org-arbre { flex: 1 1 820px; min-width: 0; margin: 0; }
.org-corps > .org-fiche { flex: 1 0 340px; min-width: 0; margin: 0; }

/* L'en-tête : la barre est BORNÉE à sa ligne (.est-bornee du gabarit, posée par l'écran),
   ses outils passent donc à la ligne ; le bouton d'engagement prend toute la largeur sur
   téléphone — à 390 px il sortait de l'écran par la droite, à 768 il dépassait de 16 px. */
@media (max-width: 720px) {
    .org-tete .mx-outils { width: 100%; }
    .org-tete .mx-outils .mx-btn-cta { flex: 1 1 100%; justify-content: center; min-height: 44px; }
}

/* La fiche. */
.org-fiche-tete       { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 16px;
                        border-bottom: 1px solid var(--et-hairline); }
.org-fiche-tete h2    { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; font-weight: 700; color: var(--et-ink); }
.org-fiche-code       { flex: none; padding: 2px 6px; font-family: var(--et-font-mono); font-size: 12px; font-weight: 600;
                        background: var(--et-info-bg); border: 1px solid var(--et-info-bord); color: var(--et-form-blue-d); }
.org-fiche-code.est-alerte { background: var(--et-avertissement-bg); border-color: var(--et-avertissement-bord);
                             color: var(--et-avertissement-ink); }
.org-fiche-etat       { flex: none; padding: var(--et-badge-py) var(--et-badge-px); border-radius: var(--et-r-pill); font-size: 12px; font-weight: 600;
                        white-space: nowrap; background: var(--et-surface-3); color: var(--et-muted); }
.org-fiche-etat.est-actif { background: var(--et-succes-bg); color: var(--et-succes-ink); }
.org-fiche-fermer     { flex: none; width: 44px; height: 44px; display: grid; place-items: center;
                        padding: 0; border: 0; background: transparent; color: var(--et-muted); cursor: pointer; }
.org-fiche-fermer:hover { background: var(--et-survol); color: var(--et-ink); }
.org-fiche-alerte     { display: flex; gap: 10px; margin: 14px 16px 0; padding: 12px;
                        background: var(--et-avertissement-bg); border: 1px solid var(--et-avertissement-bord);
                        font-size: 13px; line-height: 1.5; color: var(--et-ink); }
.org-fiche-alerte > .bi { flex: none; font-size: 16px; color: var(--et-avertissement-ink); }
.org-fiche-alerte strong { display: block; color: var(--et-avertissement-ink); }
.org-fiche-champs     { margin: 0; padding: 6px 16px 2px; }
.org-fiche-champs > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px;
                          padding: 9px 0; border-bottom: 1px solid var(--et-rang); font-size: 13px; }
.org-fiche-champs dt  { font-weight: 400; color: var(--et-muted); }
.org-fiche-champs dd  { margin: 0; font-weight: 600; color: var(--et-ink); overflow-wrap: anywhere; }
.org-fiche-champs dd.est-alerte { color: var(--et-avertissement-ink); }
.org-fiche-lien       { display: flex; align-items: center; min-height: 44px; margin: 4px 16px 10px;
                        font-size: 13px; font-weight: 600; color: var(--et-lien); text-decoration: none; }
.org-fiche-lien > span { flex: 1 1 auto; }
.org-fiche-lien:hover { color: var(--et-lien-survol); }

/* La liste indentée : cachée tant que l'arbre tient, elle le remplace sous 1024 px. */
.org-liste            { display: none; }
@media (max-width: 1024px) {
    .org-scroll       { display: none; }
    /* Les noms du bandeau sont des cibles : 44 px de haut, mesurés à 20 au banc. */
    .org-bandeau-nom  { display: inline-flex; align-items: center; min-height: 44px; }
    .org-liste        { display: block; }
    .org-legende      { padding: var(--et-graphe-p) 16px; }
}
.org-ligne            { display: flex; align-items: center; min-height: 56px;
                        border-bottom: 1px solid var(--et-rang); border-left: 4px solid var(--et-form-blue);
                        background: var(--et-surface); }
.org-ligne.est-equipe { border-left-color: var(--et-table-head-encre); }
.org-ligne.est-alerte { border-left-color: var(--et-avertissement-mark); }
.org-ligne.est-inactif { border-left-color: var(--et-filet-fort); background: var(--et-surface-3); }
.org-ligne.est-choisi { background: var(--et-tint); box-shadow: inset 0 0 0 1px var(--et-form-blue); }
.org-ligne-retrait    { flex: none; width: calc(var(--org-prof, 0) * 20px); }
.org-ligne-pli,
.org-ligne-pli-vide   { flex: none; width: 44px; height: 44px; }
.org-ligne-pli        { display: grid; place-items: center; padding: 0; border: 0; background: transparent;
                        color: var(--et-ink); cursor: pointer; }
.org-ligne-pli .bi    { transition: transform .15s; transform: rotate(90deg); }
.org-ligne-pli.est-plie .bi { transform: none; }
.org-ligne-pli:focus-visible,
.org-ligne-corps:focus-visible { outline: 2px solid var(--et-form-blue); outline-offset: -2px; }
.org-ligne-corps      { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px;
                        min-height: 44px; justify-content: center; padding: 6px 8px 6px 0; border: 0;
                        background: transparent; font: inherit; text-align: left; cursor: pointer; }
.org-ligne-tete       { display: flex; align-items: center; gap: 6px; min-width: 0; }
.org-ligne-nom        { min-width: 0; font-size: 14px; font-weight: 600; color: var(--et-ink); }
.org-ligne.est-inactif .org-ligne-nom { color: var(--et-muted); }
.org-ligne .org-noeud-sous { white-space: normal; }
.org-ligne-nombre     { flex: none; padding-right: 12px; font-family: var(--et-font-mono); font-size: 13px;
                        font-weight: 600; color: var(--et-ink); white-space: nowrap; }
@media (max-width: 640px) {
    .org-ligne-retrait { width: calc(var(--org-prof, 0) * 12px); }
}

/* ── IMPRESSION ───────────────────────────────────────────────────────────────
   Le FORMAT (A3 paysage) n'est PAS ici : il est posé par l'écran à l'entrée et retiré à
   la sortie — voir Organigramme.razor, FORMAT_IMPRESSION. Une règle de page écrite dans
   cette feuille, servie à tous les écrans, imposerait l'A3 à l'impression de n'importe
   quelle liste.

   Ce que la feuille fait : ouvrir la CHAÎNE de conteneurs. Lever le seul défilement de
   l'arbre ne suffit pas — la coquille, sa zone de contenu, son défileur et la carte de
   l'écran referment chacun leur boîte, et la page recevrait une fenêtre d'application
   au lieu d'un arbre. */
@media print {
  .org-cache-impression, .mx-outils { display: none !important; }
  .org-provenance { display: block !important; }

  /* LA CHAÎNE, ÉCRITE AVEC LES SÉLECTEURS DE CETTE COQUILLE-CI. La passation la
     désignait par des attributs `[data-coquille]` / `[data-zone]` / `[data-scroll]`
     qui n'existent nulle part ici : la coquille de ce dépôt est `.appgrid` >
     `.et-content` > `.et-scroll` (ShellModule.razor). Ses trois maillons sont déjà
     ouverts par le bloc @media print d'easytime-shell.css, posé une fois pour les
     quinze gabarits — les recopier ici les figerait sur cet écran le jour où la
     coquille bougera. Reste le dernier maillon, qui est à l'écran et non à la
     coquille : `.md-card` porte `overflow: hidden` (easytime-shell.css), et la carte
     couperait l'arbre à sa propre hauteur.

     ELLE EST DÉSIGNÉE PAR CE QU'ELLE CONTIENT, et non par sa classe : cette feuille est
     servie à TOUS les écrans, comme celle de la passation, et un `.md-card` nu aurait
     rouvert à l'impression les cartes de n'importe quelle liste — la raison même pour
     laquelle le format de page, lui, n'est pas ici. */
  .md-card:has(.org-scroll) { height: auto !important; min-height: 0 !important;
             max-height: none !important; overflow: visible !important; flex: none !important; }

  /* L'arbre imprimé est l'arbre AFFICHÉ, replis compris : on lève son défilement, et l'on
     empêche un nœud d'être coupé en deux par un saut de page. */
  .org-scroll  { overflow: visible !important; height: auto !important; max-height: none !important;
                 padding: 0 !important; }
  .org-noeud   { break-inside: avoid; }
  .org-liste   { display: none !important; }
  .org-scroll  { display: block !important; }
  .org-corps   { display: block !important; }
}
