/* 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);
}

/* TITRE D'EN-TÊTE : titre sur 2 lignes ("Rapport d'assistance à la mise en service" / "PAC Air/Eau"), même police agrandie et même padding que sur le rapport DRV/Utopia (qui a le… */
.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;
}

/* 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;
}
/* "Check-list hydraulique" : 3 champs texte ("Volume d'eau chauffage", "Marque"/"Type" de "Traitement du circuit") redevenaient transparents à cause de la règle générique ci-dessus… */
.hydro-table .hydro-field-box {
  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;
}

/* "CHECK-LIST INSTALLATION" : suppression des traits horizontaux (border- bottom des lignes ".cl-row"/".coord-row") et verticaux (border-left entre les 2 colonnes ".coord-col" du… */
#zebra-cl-install > .cl-row:nth-child(odd),
#zebra-cl-install > .coord-grid:nth-child(odd) {
  background: #eef0f4;
}
#zebra-cl-install .cl-row,
#zebra-cl-install .coord-row {
  border-bottom: none;
}
#zebra-cl-install .coord-col + .coord-col {
  border-left: none;
}
/* La ligne "Matériaux tuyauterie / Diamètre" est un ".cl-row" (padding horizontal 6px, common.css) imbriqué dans un ".coord-col" qui a lui-même son propre padding horizontal (5px)… */
#zebra-cl-install .coord-col {
  padding-left: 0;
  padding-right: 0;
}

/* "RELEVÉ(S) ÉLECTRIQUE(S)" (Tension à vide, Tension en charge, Intensité en charge) : zébrage des 3 tableaux */
#zebra-releves-electriques table tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-releves-electriques table tbody tr:nth-child(even) td {
  background: #eef0f4;
}
#zebra-releves-electriques table tbody tr:nth-child(odd) td.label-col {
  background: #ffffff !important;
}
#zebra-releves-electriques table tbody tr:nth-child(even) td.label-col {
  background: #eef0f4 !important;
}

/* ===== "RELEVÉS UNITÉ EXTÉRIEURE À L'ARRÊT" : zébrage du tableau ===== */
#zebra-releves-ue-arret table tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-releves-ue-arret table tbody tr:nth-child(even) td {
  background: #eef0f4;
}
#zebra-releves-ue-arret table tbody tr:nth-child(odd) td.label-col {
  background: #ffffff !important;
}
#zebra-releves-ue-arret table tbody tr:nth-child(even) td.label-col {
  background: #eef0f4 !important;
}

/* ===== "RÉGLAGE FONCTIONS OPTIONNELLES UE" : zébrage du tableau ===== */
#zebra-opt-ue tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-opt-ue tbody tr:nth-child(even) td {
  background: #eef0f4;
}

/* "RÉGLAGE ENTRÉE/SORTIES UE" : suppression du fond gris des champs texte (fond blanc, une seule ligne de saisie) */
#entree-sorties-ue td {
  background: #ffffff;
}

/* ===== "MODÈLE(S) UNITÉ(S)" : zébrage du tableau ===== */
#zebra-modeles-ue tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-modeles-ue tbody tr:nth-child(even) td {
  background: #eef0f4;
}
#zebra-modeles-ue tbody tr:nth-child(odd) td.label-col {
  background: #ffffff !important;
}
#zebra-modeles-ue tbody tr:nth-child(even) td.label-col {
  background: #eef0f4 !important;
}

/* ===== "CHECK-LIST ÉLECTRIQUE" > "Unité(s)" : zébrage du tableau ===== */
#zebra-checklist-elec-ue tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-checklist-elec-ue tbody tr:nth-child(even) td {
  background: #eef0f4;
}
#zebra-checklist-elec-ue tbody tr:nth-child(odd) td.label-col {
  background: #ffffff !important;
}
#zebra-checklist-elec-ue tbody tr:nth-child(even) td.label-col {
  background: #eef0f4 !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;
}

/* Relevés électriques — tension T/N (voir majTN dans common.js, repris du rapport DX-KIT) :
   5 V ≤ T/N < 10 V → fond rouge 50 % + gras ; T/N ≥ 10 V → fond rouge + gras blanc. */
tr.tn-row td.tn-warn {
  background: rgba(200, 16, 46, 0.5) !important;
}
tr.tn-row td.tn-alert {
  background: #c8102e !important;
}
tr.tn-row td.tn-warn input,
tr.tn-row td.tn-alert input {
  background: transparent !important;
}
tr.tn-row td.tn-warn,
tr.tn-row td.tn-warn input {
  font-weight: 700 !important;
}
tr.tn-row td.tn-alert,
tr.tn-row td.tn-alert input {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  font-weight: 700 !important;
}
tr.tn-row td.tn-warn,
tr.tn-row td.tn-alert {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* "Check-list installation" > "Unité(s) Extérieure(s)" : bloc sur 2 colonnes repris à l'identique du
   rapport DX-KIT (#zebra-cl-install-ue). On rétablit ici le style par défaut du DX-KIT (traits de
   séparation entre lignes, trait vertical entre colonnes, padding des colonnes, pas de fond zébré),
   que les règles "#zebra-cl-install ..." ci-dessus neutralisaient. */
#zebra-cl-install > #zebra-cl-install-ue {
  background: none;
}
#zebra-cl-install #zebra-cl-install-ue .cl-row {
  border-bottom: 1px solid #e8e8e8;
}
#zebra-cl-install #zebra-cl-install-ue .cl-row:last-child {
  border-bottom: none;
}
#zebra-cl-install #zebra-cl-install-ue .coord-col {
  padding: 3px 5px;
}
#zebra-cl-install #zebra-cl-install-ue .coord-col + .coord-col {
  border-left: 1px solid var(--border);
}

/* "Limites de fonctionnement" (Chauffage / Refroidissement - Circuits 1 et 2) : ligne découpée en
   3 colonnes (libellé | Température maxi eau | Température mini eau). Sur grand écran et à
   l'impression, rendu identique à l'ancienne ligne (titre aligné à droite puis champ + °C). Sur
   petit écran, le titre de chaque colonne passe au-dessus de son champ pour que tout tienne. */
.coord-row.limites-fct-row {
  display: grid;
  grid-template-columns: 170px 1fr 1fr;
  align-items: center;
  column-gap: 8px;
}
.limites-fct-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.limites-fct-titre {
  white-space: nowrap;
}
.limites-fct-saisie {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.limites-fct-saisie input {
  width: 60px;
  flex: 0 0 60px;
}
.limites-fct-unite {
  min-width: 22px;
}
@media screen and (max-width: 860px) {
  .coord-row.limites-fct-row {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 4px;
  }
  .limites-fct-label {
    width: auto !important;
    white-space: normal;
    line-height: 1.2;
  }
  .limites-fct-cell {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: center;
  }
  .limites-fct-titre {
    white-space: normal;
    line-height: 1.2;
  }
}

/* "Sources chauffage", "Entrée/sortie & sondes" et "Relevés de fonctionnement" (.src-table) sur petit écran : la partie de droite (grille 260px + 1fr, libellés de 150px)
   débordait de l'écran. En dessous de 860px, chaque ligne garde ses 2 colonnes mais chaque champ
   passe son libellé au-dessus du champ de saisie (+ unité). Les champs sont alignés à gauche dans
   leur colonne et calés en bas de ligne : ils restent alignés verticalement d'une ligne à l'autre. */
@media screen and (max-width: 860px) {
  .src-table td.hydro-label-col {
    width: 88px;
    padding: 3px 4px;
    font-size: 8.5px;
  }
  .src-table .src-field-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 6px;
    align-items: end;
  }
  .src-table .src-field {
    display: grid;
    grid-template-columns: min-content 1fr;
    align-items: center;
    column-gap: 4px;
    row-gap: 2px;
    min-width: 0;
  }
  .src-table .src-field > span:first-child {
    grid-column: 1 / -1;
    width: auto !important;
    white-space: normal;
    text-align: left;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .src-table .src-unit {
    justify-self: start;
  }
  /* Listes déroulantes (largeur fixe en ligne, ex. 140px pour "Entrée 1 :") : elles prennent
     toute la largeur de leur colonne au lieu de déborder sur la colonne voisine. */
  .src-table .src-field select {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }
}
