/* ============================================================
   Styles dédiés à la page « Heures planifiées par affaire »
   Préfixe : pha- (Planning Heures Affaires)
   ============================================================ */

:root {
  /* Hauteur réelle d'une ligne, partagée entre le rendu des lignes et le
     calcul de la hauteur maximale (20 lignes visibles). */
  --pha-hauteur-ligne-graph: 26px;   /* barre 18px + gap 8px */
  --pha-hauteur-ligne-table: 33px;   /* hauteur réelle d'une ligne de tableau compacte */
  --pha-lignes-visibles: 20;
}

/* ---------- Conteneur défilant du graphique ---------- */
.pha-graph-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(var(--pha-hauteur-ligne-graph) * var(--pha-lignes-visibles));
  scroll-behavior: smooth;
}

.pha-graph-scroll:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: -2px;
}

/* Ligne du graphique : hauteur fixe pour stabiliser le calcul */
.pha-graph-row {
  height: var(--pha-hauteur-ligne-graph);
  align-items: center;
  gap: 8px;
}

.pha-graph-label {
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pha-graph-bar {
  height: 18px;
  overflow: hidden;
}

.pha-graph-hours {
  min-width: 70px;
}

/* ---------- Conteneur défilant du tableau ---------- */
.pha-table-scroll {
  overflow: auto;             /* défilement horizontal (petits écrans) ET vertical */
  max-height: calc(var(--pha-hauteur-ligne-table) * var(--pha-lignes-visibles));
  scroll-behavior: smooth;
}

.pha-table-scroll:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: -2px;
}

.pha-table {
  margin-bottom: 0;
  white-space: nowrap;
  border-collapse: separate;
  border-spacing: 0;
}

.pha-table th,
.pha-table td {
  height: var(--pha-hauteur-ligne-table);
}

/* En-têtes visibles pendant le défilement vertical */
.pha-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-light, #f8f9fa);
  box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
}

/* Cellules à texte long : troncature avec contenu complet au survol */
.pha-truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pha-num {
  text-align: end;
}
