/* Écran des rapports (rapports.js) : rapports du classeur de la Géologie (Daily, Feeding Monthly, Mined Monthly) et
   rapports de l'Espace de travail ; cadre (rp-ecran, rp-tete, rp-corps) repris par les Reconciliation Reports et les
   Dashboards. Jetons et classes d'app.css seulement ; la page ne défile jamais : seul le corps du rapport défile, chaque
   tableau large défile à l'horizontale dans son bloc, en-têtes et colonne des libellés collants. */

.rp-ecran { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; background: var(--bg-0); }
.rp-ecran [hidden] { display: none !important; }
.rp-tete { flex: none; display: flex; align-items: center; gap: var(--e4); height: var(--h-tete); padding: 0 var(--e4); border-bottom: 1px solid var(--line); background: var(--bg-1); overflow: hidden; }
.rp-titre { font-size: var(--fs-l); font-weight: 600; color: var(--ink); white-space: nowrap; }
.rp-info { min-width: 0; color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-info strong { color: var(--ink); }
/* Bulle (i) du titre du rapport (bulles.js, 04/11/2026) collée au titre, suivie de la pastille « ⚠ N brouillons non
   comptés » quand l'option des lignes non validées en exclut (guide et glossaire : menu Aide du cadre). */
.rp-tete-bulle { flex: none; display: inline-flex; margin-left: calc(-1 * var(--e4)); }
/* Fraîcheur du résultat affiché (2.32.0) : « Mis à jour il y a N min » (dernier résultat connu, gardé par ce navigateur) ou
   « Mise à jour en cours » (recalcul du serveur), discret, à droite de la tête, avec sa bulle (i). */
.rp-fraicheur { flex: none; display: inline-flex; align-items: center; gap: var(--e1); margin-left: auto; color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; }
.rp-fraicheur[data-nature="hors-ligne"] .rp-fraicheur-texte { color: var(--warn); }
.rp-m { flex: none; }
.rp-m:empty { display: none; }
.rp-m .message { margin: var(--e2) var(--e4); }
.rp-corps { flex: 1 1 0; min-height: 0; overflow: auto; padding: var(--e3) var(--e4) var(--e5); }
.rp-corps:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Sections et blocs */
.rp-section + .rp-section { margin-top: var(--e5); }
.rp-s-titre { margin: 0 0 var(--e3); padding-bottom: var(--e1); border-bottom: 1px solid var(--line-fort); color: var(--ink); font-size: var(--fs-m); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
/* Titre de section avec sa bulle (i) (onglet complémentaire) : bulle juste après le titre, hors du h2 ; la rangée porte
   le filet du titre. */
.rp-s-tete { display: flex; align-items: center; gap: var(--e1); margin: 0 0 var(--e3); padding-bottom: var(--e1); border-bottom: 1px solid var(--line-fort); }
.rp-s-tete > .rp-s-titre { margin: 0; padding: 0; border: 0; }
.rp-bloc + .rp-bloc { margin-top: var(--e4); }
.rp-bloc .panneau-tete { gap: var(--e4); }
.rp-bloc .panneau-tete h3 { margin: 0; font-size: var(--fs-m); font-weight: 600; color: var(--ink); white-space: nowrap; }
/* Bulle (i) d'un bloc (notes, différences avec Pitinfo ou corrections du classeur, disposition) collée à son titre. */
.rp-bloc .panneau-tete > .bl { flex: none; margin-left: calc(var(--e2) - var(--e4)); }
.rp-bloc-corps { padding: var(--e2) 0 0; }
.rp-bloc h3[tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.rp-note { margin: 0 var(--e3) var(--e2); padding-left: var(--e4); border-left: 2px solid var(--info); color: var(--ink-2); font-size: var(--fs-s); }
.rp-sous { margin: var(--e4) var(--e3) var(--e2); font-size: var(--fs-s); font-weight: 600; color: var(--ink); }
.rp-liste { margin: 0 var(--e3) var(--e3); padding-left: var(--e5); color: var(--ink); font-size: var(--fs-s); }
.rp-liste li + li { margin-top: var(--e1); }
.rp-structure { margin: 0 var(--e3) var(--e2); font-size: var(--fs-s); }
.rp-structure summary { cursor: pointer; color: var(--ink-2); }
.rp-structure summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rp-nd { margin: 0 var(--e3) var(--e2); }

/* Tableaux : défilement horizontal dans le bloc, hauteur bornée, en-têtes collants sur plusieurs rangées */
.rp-table { overflow: auto; max-height: 62vh; border-top: 1px solid var(--line); }
.rp-t { width: max-content; min-width: 100%; table-layout: auto; }
.rp-t th, .rp-t td { padding: 0 var(--e3); }
.rp-t td.n { min-width: 64px; }
.rp-t thead tr.rp-r2 th { top: var(--h-tete); }
.rp-t thead tr.rp-r3 th { top: calc(var(--h-tete) * 2); }
.rp-t thead th.rp-parent, .rp-t thead th.rp-groupe { text-align: center; border-left: 1px solid var(--line-fort); }
.rp-t thead th.rp-g-total { background: var(--bg-3); }
.rp-t .rp-debut { border-left: 1px solid var(--line-fort); }
.rp-t th.rp-lib { position: sticky; left: 0; z-index: 3; min-width: 150px; border-right: 1px solid var(--line-fort); text-align: left; }
.rp-t thead th.rp-lib { z-index: 4; vertical-align: bottom; }
.rp-t tbody th.rp-lib { background: var(--bg-1); color: var(--ink); font-family: var(--mono); font-size: var(--fs-s); }
.rp-t tbody tr { cursor: default; }
.rp-t tbody td[data-c] { cursor: cell; }
.rp-t tbody tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rp-t tbody tr[aria-selected="true"] > th.rp-lib { box-shadow: inset 3px 0 0 var(--accent); }

/* Sous-totaux et totaux : fond et filet, texte gras (la forme double la couleur) */
.rp-t tbody tr.rp-sous-total > * { background: var(--grid-calc); font-weight: 600; border-top: 1px solid var(--line); }
.rp-t tbody tr.rp-sous-total > th.rp-lib { background: var(--grid-calc); font-family: var(--font); }
.rp-t tbody tr.rp-sous-total > th.rp-lib::before { content: "Σ "; color: var(--ink-2); }
.rp-t tbody tr.rp-total > * { background: var(--bg-2); font-weight: 700; border-top: 2px solid var(--line-fort); }
.rp-t tbody tr.rp-total > th.rp-lib { background: var(--bg-2); font-family: var(--font); }
.rp-t tbody tr.rp-total > th.rp-lib::before { content: "Σ "; color: var(--ink); }
.rp-t .nd { font-weight: 400; }

/* Grands tableaux fenêtrés (2.32.0) : rangées d'espace des lignes non rendues, hauteur posée par le CSSOM. */
.rp-t tbody tr.rp-esp > td, .rp-t tbody tr.rp-esp:hover > td { padding: 0; border: 0; background: transparent; }

/* Écart mine/usine : colonnes signées (le signe « + » ou « - » porte le sens, sans couleur seule ; chiffres alignés par
   .n d'app.css) ; le signe ne se sépare jamais du nombre. Pas de fond propre : il se confondrait avec les sous-totaux. */
.rp-t td.rp-signe { white-space: nowrap; }

/* Cellules et blocs tabulaires : focus d'une cellule (flèches gauche et droite) */
.rp-t tbody td[data-c]:focus { outline: none; }
.rp-t tbody td[data-c]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Graphiques */
.rp-graphe { min-height: 240px; padding: var(--e3); }

/* Sommaire (panneau du dock) */
.rp-sommaire { list-style: none; margin: 0; padding: var(--e2) var(--e3); }
.rp-sommaire ul { list-style: none; margin: 0 0 var(--e3); padding: 0; }
.rp-sommaire .pn-sous { display: block; margin: var(--e2) 0 var(--e1); }
.rp-sommaire .btn { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 20px; padding: 2px var(--e3); }

/* ---------- Rapports de l'Espace de travail (rapports_pdi.js) : disposition des rapports de Pitinfo ---------- */

/* Espace de travail : zone de l'écran à pleine hauteur (la page ne défile jamais, le corps du rapport défile). */
.vue-rapports-pdi { min-height: 0; display: flex; flex-direction: column; }

/* Barre d'onglets (Geology Report) : fixe en tête de la zone de défilement ; l'onglet actif porte le liseré d'accent. */
.rp-onglets { flex: none; display: flex; gap: 2px; padding: 0 var(--e4); border-bottom: 1px solid var(--line); background: var(--bg-1); overflow-x: auto; scrollbar-width: thin; }
.rp-onglet { flex: none; display: inline-flex; align-items: center; gap: var(--e1); height: var(--h-onglets); padding: 0 var(--e4); border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-s); cursor: pointer; white-space: nowrap; }
.rp-onglet:hover { color: var(--ink); background: var(--survol); }
.rp-onglet[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.rp-onglet:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rp-onglet-cpl { padding: 0 var(--e1); border: 1px solid var(--line-fort); border-radius: var(--r1); color: var(--ink-2); font-size: var(--fs-xxs); font-weight: 400; }
.rp-panneau-onglet:focus { outline: none; }

/* Titre de section avec lien de saisie ; bouton « Aller à la saisie » dans la tête des blocs. */
.rp-s-lien { margin-left: var(--e4); text-transform: none; letter-spacing: normal; font-weight: 400; font-size: var(--fs-s); }
.rp-bloc .panneau-tete .rp-lien { margin-left: auto; flex: none; }
.rp-lien-off { white-space: nowrap; }
.rp-s-titre .rp-lien-off { color: var(--ink-2); }

/* Sections complémentaires G-CORE (hors Pitinfo) : repliées par défaut. */
.rp-complement { margin-top: var(--e5); }
.rp-complement > summary { cursor: pointer; padding: var(--e2) 0; color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px dashed var(--line-fort); }
.rp-complement > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rp-complement[open] > summary { margin-bottom: var(--e3); }

/* Intertitre de lignes (All Pits, pit) : une rangée sans cellule, libellé collant à gauche. La classe rp-titre du titre de
   l'écran est neutralisée sur la rangée. */
.rp-t tbody tr.rp-titre { font-size: inherit; white-space: normal; }
.rp-t tbody tr.rp-titre > th .rp-titre-lib { display: inline-block; position: sticky; left: var(--e3); }
.rp-t tbody tr.rp-titre > th { padding: var(--e2) var(--e3) var(--e1); background: var(--bg-3); color: var(--ink); font-family: var(--font); font-size: var(--fs-s); font-weight: 700; text-align: left; border-top: 2px solid var(--line-fort); }

/* Colonnes texte (Pit) après Description ; codes jamais traduits. */
.rp-t th.rp-etiq { text-align: left; border-right: 1px solid var(--line); }
.rp-t td.rp-etiq { white-space: nowrap; font-family: var(--mono); font-size: var(--fs-s); color: var(--ink); border-right: 1px solid var(--line); }

/* Texte pour lecteur d'écran (.sr, absolu) gardé dans sa cellule : il ne déborde jamais du tableau ni de la page. */
.rp-t tbody td { position: relative; }

/* Cellule sans objet : vide, raison au survol. */
.rp-t td.rp-so { background: var(--bg-1); }

/* Écarts en % : flèche et couleur selon le signe de la valeur exacte (▲ vert au-dessus de la référence, ▼ rouge en
   dessous, neutre seulement à zéro exact), sur toutes les lignes ; la flèche et le texte pour lecteur d'écran doublent la
   couleur. */
.rp-t td.rp-ecart { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-ecart-hausse::before { content: "▲ "; font-size: var(--fs-xxs); }
.rp-ecart-baisse::before { content: "▼ "; font-size: var(--fs-xxs); }
.rp-t td.rp-fav { color: var(--ok); font-weight: 600; }
.rp-t td.rp-defav { color: var(--bad); font-weight: 600; }
.rp-t td.rp-neutre { color: var(--ink-2); }

/* Commentaires du jour (Production Comments). */
.rp-textes { list-style: none; margin: 0; padding: 0 var(--e3) var(--e3); }
.rp-texte + .rp-texte { margin-top: var(--e3); padding-top: var(--e3); border-top: 1px solid var(--line); }
.rp-texte-tete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e1) var(--e3); color: var(--ink-2); font-size: var(--fs-s); }
.rp-texte-tete strong { color: var(--ink); }
.rp-texte-corps { margin: var(--e1) 0 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.rp-textes-vide { margin: 0 var(--e3) var(--e3); }

/* Menus : boutons segmentés (périodes, détail, référence du mois, rapport), cases des pits. */
.rp-segments { flex-wrap: wrap; gap: 2px; }
.rp-segments .rb-bouton[aria-pressed="true"] { background: var(--choisi); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
/* Cases des pits sur une seule rangée : le groupe du ruban a deux rangées fixes de 22 px, un retour à la ligne faisait
   sortir des pits du ruban ou recouvrir « Tout cocher » (relecture du 02/11/2026) ; le ruban défile à l'horizontale. */
.rp-pits { flex-wrap: nowrap; gap: 2px var(--e3); white-space: nowrap; }

/* ---------- Daily Mining Report aligné sur l'export PDF de Pitinfo (03/11/2026) ---------- */

/* Compteurs non nuls à signaler (lignes HSE de sens défavorable, Production Delays) : rouge et gras ; un zéro reste « 0 ». */
.rp-t td.rp-alerte { color: var(--bad); font-weight: 600; }
/* Cellule fusionnée (« Jours depuis le dernier LTI ») : une valeur sur toutes les colonnes, centrée. */
.rp-t td.rp-fusion { text-align: center; font-weight: 700; }
/* En-tête Actual / Plan / Variance répété sous chaque intertitre de pit (rangée décorative). */
.rp-t tbody tr.rp-entete-rep > td { height: 20px; background: var(--bg-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.rp-t tbody tr.rp-entete-rep > td.rp-lib-rep { position: sticky; left: 0; z-index: 3; border-right: 1px solid var(--line-fort); }
/* Health and Safety et Production Delays côte à côte (deux colonnes de six sur la grille de douze). */
.rp-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e4); align-items: start; }
.rp-duo > .rp-section + .rp-section { margin-top: 0; }
.rp-duo + .rp-section, .rp-section + .rp-duo, .rp-duo + .rp-dg, .rp-dg + .rp-section { margin-top: var(--e5); }
@media (max-width: 1100px) { .rp-duo { grid-template-columns: minmax(0, 1fr); } }
/* Graphiques en cartouches : deux colonnes, taille standard « moyen » (7 rangées de 40 px). */
.rp-dg-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e4); }
.rp-dg-page + .rp-dg-page { margin-top: var(--e4); }
.rp-dg-cellule { height: 280px; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r1); background: var(--bg-1); overflow: hidden; }
.rp-dg-cellule > .rp-graphe { flex: 1; min-height: 0; padding: 0; position: relative; }
@media (max-width: 1100px) { .rp-dg-page { grid-template-columns: minmax(0, 1fr); } }
/* Bandeau du PDF (charte G-CORE) : à l'impression seulement, l'écran a sa barre de titre. */
.rp-bandeau-impr { display: none; }

/* Impression : tout le rapport, sans défilement ni hauteur bornée */
@media print {
  .rp-ecran, .rp-corps { display: block; overflow: visible; height: auto; }
  .rp-table { max-height: none; overflow: visible; }
  .rp-t thead th, .rp-t th.rp-lib { position: static; }
  .rp-bloc { break-inside: avoid-page; }
  .rp-graphiques[hidden] { display: none !important; }
  /* Rapports PDI : page A4 paysage nommée ; tous les onglets imprimés, à la suite ; liens et barre d'onglets retirés. */
  .rp-ecran[data-modele="pitinfo"] { page: pdi; }
  .rp-onglets, .rp-lien, .rp-s-lien { display: none !important; }
  .rp-ecran .rp-section[role="tabpanel"][hidden] { display: block !important; }
  .rp-t tbody tr.rp-titre .rp-titre-lib { position: static; }
  .rp-t td.rp-fav, .rp-t td.rp-defav { color: #000; }
  /* Daily Mining Report : A4 portrait comme l'export de Pitinfo. Page 1 : bandeau, Health and Safety et Production
     Delays côte à côte, Mining Physicals, Haulage, Feeding, GC Drilling ; page 2 : graphiques (deux colonnes, six par
     page) ; commentaires et compléments seulement si la case est cochée (pages suivantes). Couleurs de la charte G-CORE
     (noir 0D0D0D, ambre F28A2E) et flèches vertes ou rouges gardées à l'impression. */
  .rp-ecran[data-rapport="pdi_daily"] { page: daily; font-size: 7pt; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-tete, .rp-ecran[data-rapport="pdi_daily"] .rp-m,
  .rp-ecran[data-rapport="pdi_daily"] .rp-dg > .rp-s-titre { display: none !important; }
  .rp-ecran[data-rapport="pdi_daily"][data-impr-compl="non"] .rp-section[data-code="production_comments"],
  .rp-ecran[data-rapport="pdi_daily"][data-impr-compl="non"] .rp-complement { display: none !important; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-section[data-code="production_comments"], .rp-ecran[data-rapport="pdi_daily"] .rp-complement { break-before: page; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-bandeau-impr { display: block; margin: 0 0 3mm; padding: 2mm 4mm; background: #0D0D0D; color: #FFFFFF; border-bottom: 1mm solid #F28A2E; font-size: 12pt; font-weight: 700; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-corps { padding: 0; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-section + .rp-section, .rp-ecran[data-rapport="pdi_daily"] .rp-duo + .rp-section { margin-top: 2mm; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-s-titre { margin: 0 0 1mm; font-size: 8pt; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-bloc .panneau-tete { display: none; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t { width: 100%; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t th, .rp-ecran[data-rapport="pdi_daily"] .rp-t td { height: auto; padding: 0 1mm; font-size: 6.5pt; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t td.n { min-width: 0; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t th.rp-lib { min-width: 0; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t td.rp-fav { color: #1E6B48; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t td.rp-defav, .rp-ecran[data-rapport="pdi_daily"] .rp-t td.rp-alerte { color: #B3261E; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-t tbody tr.rp-total > * { background: #E6E6E6; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-dg { break-before: page; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-dg-page + .rp-dg-page { break-before: page; margin-top: 0; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-dg-page { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm; }
  .rp-ecran[data-rapport="pdi_daily"] .rp-dg-cellule { height: 84mm; break-inside: avoid; background: #F2F2F2; border-color: #CCCCCC; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
@page pdi { size: A4 landscape; margin: 10mm; }
@page daily { size: A4 portrait; margin: 8mm; }

@media (forced-colors: active) {
  .rp-onglet[aria-selected="true"] { border-bottom-color: Highlight; }
}
