/* 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" / "DX-KIT"), 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;
}

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

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

/* "Bus de Communication" : .bus-row (common.css) a un padding horizontal de 6px mais aucune marge, donc son border-bottom (utilisé comme trait de séparation entre lignes) va… */
.bus-row {
  padding-left: 0;
  padding-right: 0;
  margin-left: 6px;
  margin-right: 6px;
}

/* CORRECTION ORDRE DE TABULATION — tableau "Unité(s) extérieure(s) / DX- KIT(s)" (Modèle UE, N° de série UE, Modèle UI, N° de série UI) : dans un <table> classique, la tabulation… */
.dxkit-ue-tab-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.dxkit-ue-tab-grid thead,
.dxkit-ue-tab-grid tbody,
.dxkit-ue-tab-grid tr {
  display: contents;
}
.dxkit-ue-tab-grid th,
.dxkit-ue-tab-grid td {
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.dxkit-ue-tab-grid td:not(.label-col) {
  justify-content: center;
}
.dxkit-ue-tab-grid th:not(:first-child) {
  justify-content: center;
}

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

/* "CHECK-LIST FRIGORIFIQUE" : les intitulés de catégorie ("Charge fluide", "Mise sous pression d'azote", "Tirage au vide") repassent en gras — ".label-col" (règle globale plus haut)… */
.frigo-multi-table td.frigo-cat-col {
  font-weight: 700 !important;
}

/* "CHECK-LIST FRIGORIFIQUE" : les cellules de saisie des colonnes Maître/ Esclave 1-4 utilisent par défaut le gris standard des tableaux (--gray- cell, #f4f4f4, cf. */
.frigo-multi-table td:not(.label-col) {
  background: #eef0f4;
}

/* ZÉBRAGE — "Unité(s) extérieure(s) / DX-KIT(s)" : même alternance de fond (#eef0f4 / blanc) que sur le tableau équivalent du rapport DRV/Utopia. */
.zr-e {
  background: #ffffff !important;
}
.zr-o {
  background: #eef0f4 !important;
}

/* ZÉBRAGE — "Relevé(s) Électrique(s)" (Tension à vide, Tension en charge, Intensité en charge) : même alternance de fond (#eef0f4 / blanc) que sur le tableau équivalent du rapport DRV/Utopia. */
#zebra-releves-electriques table tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-releves-electriques table tbody tr:nth-child(even) td {
  background: #eef0f4;
}
/* La colonne d'intitulé (.label-col) suit le même zébrage que le reste de la ligne (sinon elle resterait blanche à part et casserait l'alternance sur les lignes grises), comme pour… */
#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;
}

/* ZÉBRAGE — "Relevés Unité(s) Extérieure(s) à l'arrêt" : même alternance de fond (#eef0f4 / blanc) que sur le tableau équivalent du rapport DRV/Utopia, pour repérer plus facilement… */
#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;
}
/* La colonne d'intitulé (.label-col) a un fond blanc fixé dans common.css : on la fait suivre le même zébrage que le reste de la ligne, sinon elle "casse" visuellement l'alternance sur les lignes grises. */
#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;
}

/* ZÉBRAGE — "Check-list électrique" > "Unité(s)" (Calibre disjoncteur, Calibre différentiel, Section alimentation) : même alternance de fond (#eef0f4 / blanc) que sur les autres… */
#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;
}

/* Zébrage retiré de "Check-List Installation" > "Unité(s) Extérieure(s)" : depuis le
   passage de ce bloc sur 2 colonnes (style "Check-list hydraulique" de Chiller M),
   le ":nth-child(odd)" ne portait plus que sur la position DANS CHAQUE colonne, ce
   qui zébrait les mêmes lignes (1 et 3) dans les deux colonnes au lieu d'alterner
   sur la liste complète — plus de sens visuel. Les lignes retrouvent donc le style
   ".cl-row" par défaut (bordure de séparation, pas de fond alterné). */

/* ZÉBRAGE — "Réglage Fonctions Optionnelles UE" : même alternance de fond (#eef0f4 / blanc) que sur le tableau équivalent du rapport DRV/Utopia. */
#zebra-opt-ue tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#zebra-opt-ue tbody tr:nth-child(even) td {
  background: #eef0f4;
}

/* ZÉBRAGE — "Réglage Fonctions Optionnelles DX-KIT" (#ui-opt-table) : même alternance de fond que sur "Réglage Fonctions Optionnelles UE" ci-dessus. */
#ui-opt-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}
#ui-opt-table tbody tr:nth-child(even) td {
  background: #eef0f4;
}

/* "Réglage Entrée/Sorties UE" et "Réglage Entrée/Sorties UI" : les champs de saisie affichaient un fond gris (--gray-cell, cf. */
#entree-sorties-ue td,
#entree-sorties-ui td {
  background: #ffffff;
}

/* "Relevés de fonctionnement UE" : la colonne "Afficheur" (codes en italique H1, Eo, Pd...) reprend désormais la même teinte anthracite que l'en-tête du tableau sur toute la colonne… */
.afficheur-col {
  background: #5a5f6c !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

/* "Relevés de fonctionnement DX-KIT" : la colonne "Emplacement / Lieu" affichait le même fond gris standard des tableaux (--gray-cell) que les champs de saisie — remplacé ici par le… */
.emplacement-col {
  background: #eef0f4 !important;
}

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

/* Champ "Intensité maximale :" (repris du rapport DRV) : valeurs du type "35.0 / 40*" plus longues que les 45px par défaut du tableau : on élargit uniquement ce champ. */
.checklist-elec-ue .ligne-intensite-max .input-unit {
  grid-template-columns: 68px 30px 20px;
}
.checklist-elec-ue .ligne-intensite-max .input-unit input.intensite-max {
  width: 68px;
  min-width: 68px;
}
td.label-col.ligne-intensite-max,
.ligne-intensite-max td.label-col {
  font-weight: 700 !important;
}

/* Relevés électriques — tension T/N (voir majTN dans common.js) :
   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;
}

/* ONGLETS PAR UNITÉ (petit écran) — "Check-list frigorifique" et "Relevés de fonctionnement UE"
   (voir majOngletsUnites dans common.js). La barre n'apparaît que sur écran ≤ 860px ; seule la
   colonne de l'unité choisie (data-unit sur le tableau) reste visible. Grand écran et impression :
   tableau complet, barre masquée. */
.unit-tabs {
  display: none !important;
}
@media screen and (max-width: 860px) {
  .unit-tabs {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    background: #fff;
  }
  .unit-tabs[style*="display: none"] {
    display: none !important;
  }
  .unit-tabs button {
    border: 1px solid var(--red);
    background: #fff;
    color: var(--red);
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .unit-tabs button.on {
    background: var(--red);
    color: #fff;
  }
  table.unit-tabs-table[data-unit] .ucell {
    display: none !important;
  }
  table.unit-tabs-table[data-unit="0"] .ucell.u0,
  table.unit-tabs-table[data-unit="1"] .ucell.u1,
  table.unit-tabs-table[data-unit="2"] .ucell.u2,
  table.unit-tabs-table[data-unit="3"] .ucell.u3,
  table.unit-tabs-table[data-unit="4"] .ucell.u4 {
    display: table-cell !important;
  }
}

/* "Réglage Fonctions Optionnelles DX-KIT" — 1re ligne (N°UI, champs dans les en-têtes <th>) :
   1) largeur : les champs gardaient leur largeur naturelle (size="2", ~33px) et débordaient des
      colonnes étroites (table-layout: fixed) ; ils prennent désormais la largeur de leur colonne,
      comme les champs des lignes du dessous ;
   2) lisibilité : texte blanc sur l'en-tête foncé, mais au focus le fond passe en jaune clair
      (règle générale des champs) → texte invisible pendant la saisie. Au focus, le texte passe
      en foncé ; il redevient blanc sur fond foncé une fois la saisie terminée. */
#ui-opt-table th input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}
#ui-opt-table th input:focus {
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a;
}

/* ===== ONGLETS PAR UNITÉ — tableau "Unité(s) extérieure(s) / DX-KIT(s)" (CSS Grid) =====
   Même fonctionnement que les autres tableaux à onglets : sous 860px, seule l'unité choisie
   est affichée, dans la colonne qui suit les libellés (--tab-col, posée par
   marquerCellulesUnitesGrille dans common.js). Grand écran et impression inchangés. */
@media screen and (max-width: 860px) {
  .unit-tabs button.unit-tabs-action {
    border-color: #5a5f6c;
    color: #5a5f6c;
  }
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit] {
    grid-template-columns: auto 1fr !important;
  }
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit="0"] .ucell.u0,
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit="1"] .ucell.u1,
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit="2"] .ucell.u2,
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit="3"] .ucell.u3,
  .dxkit-ue-tab-grid.unit-tabs-table[data-unit="4"] .ucell.u4 {
    display: flex !important;
    grid-column: var(--tab-col) !important;
  }
}
