/* Réconciliation du mois (reconciliation_mois.js) : écran de la Géologie, lu par l'Usine, la Mine et la direction.
   Jetons et classes de app.css seulement ; aucune couleur en dur. La page ne défile pas : le corps de l'onglet défile
   seul. Un état « à corriger » porte un texte en plus de sa couleur (jamais la couleur seule). Lot 7 : couleurs des flux
   et des ajustements de levé (jetons --ok, --warn, --bad, --ink-2), check-list par département, réglages du mois. */

.rmo-ecran { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--e2); padding: var(--e2); }
.rmo-barre { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e2); }
.rmo-mois { display: flex; align-items: center; gap: var(--e2); }
.rmo-mois .champ { width: 150px; }
/* Statut du mois, puis la bulle (i) des sources non disponibles (bulles.js). */
.rmo-statut { display: inline-flex; align-items: center; gap: var(--e2); }
.rmo-statut > .bl { margin-left: 0; }
.rmo-pastille { padding: 1px var(--e3); border: 1px solid var(--line-fort); border-radius: var(--r2); font-size: var(--fs-s); font-weight: 600; }
.rmo-st-clos { background: var(--ok-bg); border-color: var(--ok); }
.rmo-st-en_cloture { background: var(--info-bg); border-color: var(--info); }
.rmo-st-rouvert { background: var(--warn-bg); border-color: var(--warn); }
.rmo-onglets { display: flex; border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; }
.rmo-onglets [role="tab"] { padding: var(--e2) var(--e4); border: 0; border-right: 1px solid var(--line); background: var(--bg-1); color: var(--ink-2); font-size: var(--fs-m); }
.rmo-onglets [role="tab"]:last-child { border-right: 0; }
.rmo-onglets [role="tab"][aria-selected="true"] { background: var(--grid-bg); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.rmo-m { display: flex; flex-direction: column; gap: var(--e2); }
.rmo-m:empty { display: none; }
.rmo-corps { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--e2); scrollbar-width: thin; }
.rmo-corps:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rmo-v { font-variant-numeric: tabular-nums; }
/* Panneaux de l'onglet à leur hauteur ; un long tableau défile dans son panneau (les panneaux suivants restent lisibles). */
.rmo-corps > .panneau { flex: none; }
.rmo-corps > .panneau > .rmo-defile { max-height: 55vh; }
.rmo-inds { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rmo-fige-bascule { font-size: var(--fs-s); }

/* Flux de matière : cartes des nœuds en ligne, flèches entre elles ; repli en colonnes sur écran étroit. */
.rmo-flux { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--e2); padding: var(--e2); }
.rmo-noeud { flex: 1 1 210px; max-width: 260px; display: flex; flex-direction: column; gap: var(--e1); padding: var(--e2); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r1); }
/* Titre d'une carte et sa bulle (i) des raisons n.d. (bulles.js), sur la même ligne. */
.rmo-n-tete { display: flex; align-items: center; gap: var(--e1); min-width: 0; }
.rmo-noeud h3 { margin: 0; min-width: 0; font-size: var(--fs-m); }
.rmo-code { display: inline-block; min-width: 24px; color: var(--accent-texte); font-weight: 700; }
.rmo-n-tab { table-layout: auto; }
.rmo-n-tab th, .rmo-n-tab td { height: auto; padding: 1px var(--e2); }
.rmo-n-ecart { margin: 0; color: var(--ink-2); font-size: var(--fs-s); }
.rmo-n-ecart > span:not(.nd):not(.rmo-v) { margin-left: var(--e2); }
.rmo-noeud .btn { align-self: flex-start; }
/* Flèche d'un flux (S01, point 3) : trait et pointe dans la couleur du flux (currentColor), écart en % et symbole dessous
   (jamais la couleur seule). Les cartes des nœuds restent sans couleur. */
.rmo-fleche { flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; color: var(--line-fort); font-size: var(--fs-xs); }
.rmo-fl-trait { position: relative; width: 40px; height: 3px; background: currentColor; }
.rmo-fl-trait::after { content: ""; position: absolute; right: -4px; top: -4px; border: 5px solid transparent; border-left-color: currentColor; border-right: 0; }
.rmo-fl-txt { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rmo-fleche.rmo-c-aucune { color: var(--line-fort); }
.rmo-mesure { margin-left: auto; display: inline-flex; align-items: center; gap: var(--e2); color: var(--ink-2); }
.rmo-mesure .champ { height: 18px; padding: 0 var(--e2); font-size: var(--fs-s); }
.panneau-tete .rmo-mesure + .note, .panneau-tete .note + .rmo-mesure { margin-left: var(--e4); }
.rmo-flux-pied { padding: 0 var(--e3) var(--e2); }

/* Couleurs rendues par le serveur (flux et ajustements de levé) : symbole et libellé en plus de la couleur. */
.rmo-c-vert { color: var(--ok); }
.rmo-c-ambre, .rmo-c-jaune { color: var(--warn); }
.rmo-c-rouge { color: var(--bad); }
.rmo-c-gris { color: var(--ink-2); }
.rmo-coul { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; white-space: nowrap; }
.rmo-sym { display: inline-block; min-width: 1em; font-size: var(--fs-xs); line-height: 1; text-align: center; }
.rmo-legende { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2) var(--e5); margin-top: var(--e2); color: var(--ink-2); font-size: var(--fs-s); }
.rmo-leg-titre { font-weight: 600; color: var(--ink); }

/* Cascade des onces : moteur natif (type « cascade »), graphique de taille standard, 280 px sous la tête du panneau
   (spécification des tableaux de bord, 1.2) ; tableau équivalent pour les lecteurs d'écran. */
.rmo-corps > .rmo-p-cascade { height: calc(var(--h-tete) + 280px); }
.rmo-cas-graphe { flex: 1; min-height: 0; position: relative; }
.rmo-cas-graphe > .vide { margin: 0; padding: var(--e4); color: var(--ink-2); }

/* Clôture : étapes à gauche, contenu à droite. */
.rmo-assistant { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px 1fr; gap: var(--e2); }
.rmo-gauche { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--e3); scrollbar-width: thin; }
/* Résumé « ce qui manque, par département » (D-ANP-MNS M) sous les étapes. */
.rmo-pardep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e1); }
.rmo-pd { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--e2); padding: var(--e2); text-align: left; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r1); color: var(--ink); font-size: var(--fs-s); }
.rmo-pd:hover { border-color: var(--line-fort); }
.rmo-etapes ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--e1); }
.rmo-etape { width: 100%; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: var(--e2); padding: var(--e2); text-align: left; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r1); color: var(--ink); }
.rmo-etape[aria-current="step"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.rmo-e-num { grid-row: span 2; font-weight: 700; }
.rmo-e-etat { color: var(--ink-2); font-size: var(--fs-s); }
.rmo-e-ok .rmo-e-etat, .rmo-e-acquitte .rmo-e-etat, .rmo-e-pret .rmo-e-etat, .rmo-e-clos .rmo-e-etat { color: var(--ok); }
.rmo-e-bloquant .rmo-e-etat { color: var(--bad); font-weight: 600; }
.rmo-e-avertissement .rmo-e-etat { color: var(--warn); font-weight: 600; }
.rmo-etape-corps { min-height: 0; }
.rmo-actions { display: inline-flex; gap: var(--e2); }
.rmo-defile { flex: 1; min-height: 0; overflow: auto; padding: var(--e2) var(--e3); scrollbar-width: thin; }
.rmo-h3 { margin: var(--e3) 0 var(--e2); font-size: var(--fs-m); }
/* Titre d'un bloc d'étape et sa bulle (i) sur la même ligne (bulles.js : jamais de bulle dans un titre). */
.rmo-h3-tete { display: flex; align-items: center; gap: var(--e1); margin: var(--e3) 0 var(--e2); }
.rmo-h3-tete > .rmo-h3 { margin: 0; }
.rmo-ok { color: var(--ok); }
.rmo-ctl { list-style: none; margin: 0 0 var(--e2); padding: 0; display: flex; flex-direction: column; gap: var(--e1); }
.rmo-ctl li { padding: var(--e1) var(--e2); border-left: 3px solid var(--line-fort); background: var(--bg-1); }
.rmo-ctl-bloquant { border-left-color: var(--bad) !important; }
/* Lot 7, groupe N, partie N2 (P13) : état du contrôle en trois termes (symbole et texte, jamais la couleur seule). */
.rmo-tt { font-weight: 600; }
.rmo-tt-ok { color: var(--ok); }
.rmo-tt-ko { color: var(--bad); }
.rmo-tt-nd { color: var(--ink-2); }
.rmo-ctl-avertissement { border-left-color: var(--warn) !important; }
.rmo-ctl-niveau { font-weight: 600; }
/* Saisies responsables d'un manque : département, section, lien « Aller à la saisie ». */
.rmo-saisies { list-style: none; margin: var(--e1) 0 0; padding: 0; display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-s); }
.rmo-saisies li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2); padding: 0; border: 0; background: none; }
.rmo-dep { font-weight: 600; color: var(--ink); }
.rmo-section { color: var(--ink-2); }
.rmo-lien-off { font-style: italic; }
.rmo-h4 { margin: var(--e3) 0 var(--e1); font-size: var(--fs-m); }
.rmo-h4 small { margin-left: var(--e2); color: var(--ink-2); font-weight: 400; }
.rmo-dep-bloc + .rmo-dep-bloc { margin-top: var(--e3); }
/* Réglage du mois (source de la teneur du concassé réel) et fins du mois minier. */
.rmo-reglage { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e3); margin: var(--e2) 0; }
.rmo-reglage .champ-bloc { min-width: 220px; }
.rmo-poste { width: 90px; }
.rmo-sous td { color: var(--ink-2); }
.rmo-propose { color: var(--accent-texte); font-weight: 600; }
.rmo-rappel { margin: 0; }
.rmo-d-tab, .rmo-r-tab { table-layout: auto; }
.rmo-oz { width: 110px; text-align: right; }
.rmo-boutons { display: flex; flex-wrap: wrap; gap: var(--e2); }
.rmo-calc { display: grid; grid-template-columns: max-content 1fr; gap: var(--e1) var(--e4); margin: var(--e2) var(--e3); }
.rmo-calc dt { color: var(--ink-2); }
.rmo-calc dd { margin: 0; }
.rmo-change > * { background: var(--warn-bg); }
.rmo-alerte { color: var(--warn); font-weight: 700; }
.rmo-grille { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: var(--e2) var(--e3); }
.rmo-large { grid-column: 1 / -1; }
[data-si][hidden] { display: none; }

@media (max-width: 760px) {
  .rmo-assistant { grid-template-columns: 1fr; }
  .rmo-noeud { max-width: none; }
  /* Écran étroit : cartes en colonne, flèche du flux couchée en ligne entre deux cartes (couleur et écart gardés). */
  .rmo-fleche { flex-basis: 100%; flex-direction: row; justify-content: center; }
  .rmo-fl-trait { width: 3px; height: 14px; }
  .rmo-fl-trait::after { right: -4px; top: auto; bottom: -5px; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; }
  .rmo-grille { grid-template-columns: 1fr; }
}

/* Rapport de clôture imprimé (PDF du mois clos, lot R5) : feuille cachée à l'écran ; à l'impression, elle remplace
   l'écran. Couleurs de la charte G-CORE en dur pour le papier seulement (noir 0D0D0D, ambre F28A2E, DCL-011). */
.rmo-impression { display: none; }
@media print {
  [data-imp="oui"] .rmo-ecran > :not(.rmo-impression) { display: none !important; }
  [data-imp="oui"] .rmo-ecran { display: block; padding: 0; }
  [data-imp="oui"] .rmo-impression { display: block; color: #0D0D0D; background: #FFFFFF; font-size: 9.5pt; }
  .rmo-i-tete { margin-bottom: 10pt; padding-bottom: 6pt; border-bottom: 3px solid #F28A2E; }
  .rmo-i-marque { margin: 0 0 4pt; font-size: 15pt; letter-spacing: .02em; }
  .rmo-i-marque strong { color: #0D0D0D; font-weight: 800; }
  .rmo-i-marque i { color: #F28A2E; font-style: normal; }
  .rmo-i-marque small { color: #0D0D0D; font-size: 8pt; font-weight: 600; letter-spacing: .18em; }
  .rmo-i-tete h1 { margin: 0 0 6pt; font-size: 13pt; }
  .rmo-i-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2pt 12pt; margin: 0; }
  .rmo-i-meta div { display: flex; gap: 4pt; }
  .rmo-i-meta dt { color: #595959; }
  .rmo-i-meta dd { margin: 0; font-weight: 600; }
  .rmo-impression section { margin: 8pt 0; break-inside: avoid-page; }
  .rmo-impression h2 { margin: 0 0 4pt; padding-left: 5pt; border-left: 3px solid #F28A2E; font-size: 11pt; }
  .rmo-i-tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
  .rmo-i-tab th, .rmo-i-tab td { padding: 2pt 5pt; border-bottom: 1px solid #D9D9D9; text-align: left; }
  .rmo-i-tab thead th { background: #F28A2E; color: #0D0D0D; font-weight: 700; }
  .rmo-i-tab .n { text-align: right; }
  .rmo-i-tab small { color: #595959; }
  .rmo-i-f { color: #595959; font-size: 8pt; }
  .rmo-i-pied { margin-top: 10pt; padding-top: 4pt; border-top: 1px solid #0D0D0D; color: #595959; font-size: 8pt; }
}
