/* HABILLAGE VISUEL DE CE RAPPORT — repris du style adopté sur le rapport DRV / UTOPIA (style "B+D" : bandeau anthracite / rouge + police Segoe UI + coins arrondis), appliqué ici à… */

/* POLICE : Segoe UI partout (au lieu du mélange Arial Narrow/Segoe UI d'origine, --font est utilisée par common.css pour tous les champs de saisie, boutons, zone remarques, etc.). */
:root {
  --font: "Segoe UI", Inter, -apple-system, Arial, sans-serif;
}
body {
  font-family: var(--font);
}

/* "ANCIEN GRIS" (--gray-cell, #f4f4f4 dans common.css) : remplacé partout par le gris du zébrage (#eef0f4), pour que toutes les cellules qui n'ont pas (encore) de zébrage explicite… */
:root {
  --gray-cell: #eef0f4;
}

/* TITRE D'EN-TÊTE : titre sur 2 lignes ("Rapport d'intervention technique" / "SAMURAÏ M"), même police agrandie et même padding que sur le rapport DRV/Utopia (qui a le même titre sur 2 lignes). */
.page-header-title h1 {
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: -0.2px;
}
/* Le titre sur 2 lignes en 24px prend plus de hauteur que l'original (19px). */
.page {
  padding-top: 5mm;
}
.page-header {
  margin-bottom: 2px;
  padding-bottom: 2px;
}

/* EN-TÊTES DE TABLEAU (<th>) : teinte anthracite au lieu du gris neutre --gray-header, pour un ensemble plus cohérent. */
table thead tr th,
table tr:first-child th,
th {
  background: #5a5f6c !important;
  color: #fff !important;
}

/* SOUS-TITRES DE BLOC : rouge Hitachi plein + texte blanc, au lieu du gris d'origine --gray-header. */
.sub-section-title {
  background: var(--red) !important;
  color: #fff !important;
}
/* Exception : "Pressostat HP :" (tableau "Sécurité") et "Consigne variable :" (bloc "Consignes système") — les ".sub-section-title-inline" du rapport — ne sont pas des bandeaux de… */
.pressostat-row .sub-section-title-inline {
  background: transparent !important;
  color: var(--text) !important;
  font-weight: 400 !important;
}

/* CHAMPS DE SAISIE : gris plus foncé pour bien se détacher des cellules de tableau, coins arrondis et halo rouge au focus. */
input[type="text"],
input[type="date"],
input[type="time"],
select {
  background: #d7d9df !important;
  border-radius: 7px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  background: #fffde7 !important;
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
/* Les champs texte insérés dans des cellules de tableau restent transparents (ils suivent le fond de la cellule, zébrée ou non). */
td input[type="text"],
td input[type="date"],
td input[type="time"],
th input[type="text"],
th input[type="date"],
th input[type="time"] {
  background: transparent !important;
}
/* "Relevés et réglages pompe" : les champs "Intensité pompe :" (".coord-input-w6" réorganisés en cellule de tableau) redevenaient transparents à cause de la règle générique… */
td input.coord-input-w6[type="text"] {
  background: #d7d9df !important;
}

/* ===== BOUTONS D'ACTION : coins arrondis, cohérents avec le reste. ===== */
.btn {
  border-radius: 8px;
}

/* ZONES DE REMARQUES / SIGNATURE / PHOTO / AVERTISSEMENT : coins arrondis pour rester cohérent. */
.remarks-area,
.signature-pad-wrap,
.switch-cell,
.warning-box {
  border-radius: 8px;
}
/* Fond de la zone "Remarques" aligné sur le gris de zébrage plutôt que --gray-cell (un peu plus foncé). */
.remarks-area {
  background: #eef0f4 !important;
}
/* Titres "Signature intervenant"/"Signature client"/etc. */
.signature-label {
  background: #5a5f6c !important;
}

/* HOMOGÉNÉISATION DES TAILLES/GRAISSES DE POLICE DU CORPS DU RAPPORT (hors en-tête/pied de page, titres, sous-titres et en-têtes de tableau) : plusieurs libellés communs à tous les… */
.coord-label,
.intervenant-row .label,
.bus-row .label,
.cl-label {
  font-weight: 400 !important;
}
td.label-col {
  font-size: 11px !important;
  font-weight: 400 !important;
}

/* ===== PAGE & BLOCS : coins arrondis + ombre douce (style B) ===== */
.page {
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(20, 20, 30, 0.14);
  overflow: hidden;
}
.block,
.completion-block {
  border-radius: 12px;
  border-color: #e2e2e6;
  box-shadow: 0 2px 10px rgba(20, 20, 30, 0.06);
  overflow: hidden;
}

/* ===== LOGO D'EN-TÊTE : "BOSCH" en rouge (même rouge que le reste du rapport) ===== */
.hitachi-logo .logo-text {
  color: var(--red);
}

/* ===== BANDEAU DE SECTION : anthracite + liseré rouge, texte MAJUSCULE conservé (style D) ===== */
.section-title {
  background: #20232b !important;
  position: relative;
  padding-left: 18px !important;
  padding-right: 18px !important;
  text-transform: uppercase;
  /* Voir csnet2-style.css : arrondi propre du bandeau, nécessaire quand il
     est utilisé seul (pages "SUITE REMARQUES" générées à l'impression),
     sans effet indésirable ailleurs (bandeau à hauteur fixe). */
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.section-title::before,
.section-title::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
}
.section-title::before {
  left: 0;
}
.section-title::after {
  right: 0;
}

/* TABULATION PAR COLONNE — "Relevés de fonctionnement" (.rf-mesures-table) : même principe que ".ue-tab-grid" sur le rapport DRV/Utopia. */
.rf-tab-grid {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.rf-tab-grid thead,
.rf-tab-grid tbody,
.rf-tab-grid tr {
  display: contents;
}
.rf-tab-grid th,
.rf-tab-grid td {
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rf-tab-grid td.label-col {
  justify-content: flex-start;
}

/* "Sécurité" > "Pressostat HP :" sur petit écran : le libellé et les 4 circuits sur une seule ligne
   débordaient (Circuit 4 hors écran). En dessous de 860px, "Pressostat HP :" passe sur sa propre
   ligne, puis les 4 circuits se partagent la largeur, chacun avec son libellé au-dessus de sa liste
   (listes alignées sur une même ligne). Grand écran et impression : inchangés. */
@media screen and (max-width: 860px) {
  .pressostat-hp-row {
    flex-direction: column;
  }
  .pressostat-hp-row .sub-section-title-inline {
    flex: none;
    padding: 2px 0;
  }
  .pressostat-hp-row table {
    flex: none;
    width: 100%;
    table-layout: fixed;
  }
  .pressostat-hp-row table td {
    padding: 2px;
    font-size: 11px !important;
  }
  .pressostat-hp-row .pressostat-cell {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .pressostat-hp-row .pressostat-cell span {
    white-space: nowrap;
  }
}

/* "Consignes système" > "Consigne variable :" (MODE FROID et MODE CHAUD, affichée si "Régulation
   sur l'eau" = Variable) sur petit écran : la ligne libellé + 4/5 champs (grille 6 colonnes)
   débordait. En dessous de 860px, "Consigne variable :" passe sur sa propre ligne, puis les champs
   A… E se rangent sur une grille de 3 colonnes (A B C / D E) identique en froid et en chaud :
   les champs restent alignés verticalement d'un mode à l'autre. Grand écran et impression : inchangés. */
@media screen and (max-width: 860px) {
  .pressostat-row.consigne-var-row.consigne-var-row-6col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 2px;
  }
  .consigne-var-row-6col .sub-section-title-inline {
    grid-column: 1 / -1;
    padding: 2px 0;
  }
  .consigne-var-row-6col .pressostat-cell {
    padding: 2px 2px;
  }
}
