/* Réconciliation Géologie / Usine (reconciliation.js) : écran commun à la Géologie et à l'Usine. Jetons et classes de
   app.css seulement ; aucune couleur en dur. La page ne défile jamais : l'écran occupe l'hôte (en-tête d'indicateurs,
   graphe de taille standard, tableau qui défile seul dans son panneau). Fenêtre basse (1366 x 768) : le graphe cède sa
   hauteur jusqu'à son minimum avant le tableau (au moins 160 px) ; en dessous des deux minimums seulement, c'est la
   zone de l'écran qui défile, jamais la page. Un écart hors tolérance porte la couleur ET un
   « ! » (jamais la couleur seule). */

.rc-ecran { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--e2); padding: var(--e2); overflow: auto; scrollbar-width: thin; }
.rc-tete { flex: none; display: flex; flex-direction: column; gap: var(--e2); }
/* Zone des messages : pastilles compactes des bulles (« ⚠ Chiffres provisoires », « ⚠ N alertes ») sur une ligne,
   message d'erreur sur toute la largeur. Les explications vont dans les bulles (i) des blocs (bulles.js). */
.rc-m { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2); max-height: 96px; overflow: auto; scrollbar-width: thin; }
.rc-m > .bl { margin-left: 0; }
.rc-m > .message, .rc-m > .chargement { flex: 1 1 100%; }
.rc-m:empty { display: none; }
.rc-inds { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.rc-inds .indicateur { position: relative; }
.rc-ind-hors { box-shadow: inset 0 2px 0 var(--bad); }
.rc-ind-hors dd:not(.note) { color: var(--bad); }
/* Graphe de taille standard (spécification des tableaux de bord, 1.2) : 280 px sous la tête du panneau quand la
   place le permet ; il rétrécit (jusqu'à 140 px de tracé) avant le tableau, qui ne rétrécit pas sous 160 px. */
.rc-p-graphe { flex: 0 1 calc(var(--h-tete) + 280px); min-height: calc(var(--h-tete) + 140px); }
.rc-p-graphe[hidden] { display: none; }
.rc-graphe { flex: 1; min-height: 0; position: relative; }
.rc-p-tableau { flex: 1 0 160px; min-height: 160px; }
.rc-defile { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-fort) transparent; }
.rc-defile:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Tableau dense, colonnes groupées (Géologie, Usine, Écarts, Facteurs F) : largeur au contenu, défilement dans le panneau. */
.rc-tab { width: max-content; min-width: 100%; table-layout: auto; }
.rc-tab th, .rc-tab td { padding: 0 var(--e2); }
.rc-tab td.n { min-width: 60px; }
.rc-tab thead th { text-align: center; }
.rc-tab thead th.n { text-align: right; }
.rc-tab thead tr.rc-h2 th { top: var(--h-tete); font-weight: 400; color: var(--ink-2); }
/* En-têtes de colonnes sur deux lignes au plus : la largeur suit les valeurs, pas le libellé (« Concassé (concasseur fixe) »). */
.rc-tab thead tr.rc-h2 th { white-space: normal; line-height: 1.15; vertical-align: bottom; padding-bottom: 2px; }
.rc-lib { display: inline-block; max-width: 92px; white-space: normal; }
.rc-tab thead th small { display: inline; color: var(--ink-2); font-weight: 400; }
.rc-tab .rc-deb { border-left: 1px solid var(--line-fort); }
.rc-tab thead th.rc-b-geo { box-shadow: inset 0 2px 0 var(--serie-1); }
.rc-tab thead th.rc-b-usine { box-shadow: inset 0 2px 0 var(--serie-2); }
.rc-tab thead th.rc-b-ecarts, .rc-tab thead th.rc-b-facteurs { box-shadow: inset 0 2px 0 var(--line-fort); }
.rc-tab .rc-per { position: sticky; left: 0; z-index: 1; min-width: 120px; max-width: 200px; text-align: left; border-right: 1px solid var(--line-fort); }
.rc-tab thead .rc-per, .rc-tab tfoot .rc-per { z-index: 3; }
.rc-tab tbody tr { cursor: pointer; }
.rc-tab tbody tr:hover > * { background: var(--survol); }
.rc-tab tbody tr:focus-visible > * { background: var(--survol); }
.rc-tab tbody tr[aria-selected="true"] > * { background: var(--choisi); }
.rc-tab tbody tr.rc-alerte > .rc-per { box-shadow: inset 3px 0 0 var(--bad); }
.rc-tab tbody tr.rc-attention > .rc-per { box-shadow: inset 3px 0 0 var(--warn); }

/* Valeurs : écart hors tolérance (couleur et « ! »), absence « n.d. ». */
.rc-hors { color: var(--bad); font-weight: 600; }
.rc-nd { color: var(--ink-2); }
.rc-marque { display: inline-flex; align-items: center; justify-content: center; min-width: 12px; height: 12px; margin-right: var(--e1); padding: 0 2px;
  border: 1px solid var(--bad); border-radius: 6px; background: var(--bad-bg); color: var(--bad); font-size: var(--fs-xxs); font-weight: 700; line-height: 10px; vertical-align: 1px; }

/* Contrôle de la période : pastille texte (le libellé dit le verdict, la couleur le souligne). */
.rc-c-ctl { white-space: nowrap; }
.rc-ctl { display: inline-block; padding: 0 5px; border: 1px solid var(--line-fort); border-radius: var(--r1); font-size: var(--fs-xs); font-weight: 600; line-height: 14px; white-space: nowrap; }
.rc-ctl-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.rc-ctl-hors { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.rc-ctl-attention { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.rc-ctl-nd { color: var(--ink-2); }

/* Panneau Détail : périodes à contrôler (bouton lien vers la période). */
.rc-lien { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.rc-lien:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

@media (max-width: 900px) {
  .rc-p-graphe { flex-basis: calc(var(--h-tete) + 240px); }
  .rc-tab .rc-per { min-width: 96px; }
}
