/* Crewvaluation : feuille du lot C (B9 tableau de bord, réglages). N'emploie que les variables du thème Signal de
   style.css (aucune couleur codée en dur) ; contraste 4,5:1 vérifié par essais/essai_lotC.mjs. */

/* ----- Bandeau : filtre des archivés et lien vers les réglages ----- */

.tdb-actions { align-items: center; }
.bande .tdb-case-archives {
  min-height: var(--hauteur-bouton); padding: 0 16px;
  border: 1.5px solid var(--texte-sur-bleu-2); border-radius: var(--rayon-pastille);
  color: var(--texte-sur-bleu); font-weight: 650;
}
.bande .tdb-case-archives input { accent-color: var(--lime); }
.bande .tdb-case-archives:focus-within { outline: 3px solid var(--lime); outline-offset: 2px; }

/* ----- Tuiles (chevauchent le bandeau) ----- */

.tdb-tuiles { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.tdb-tuile { position: relative; overflow: hidden; color: var(--texte); text-decoration: none; }
.tdb-tuile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--bleu); }
.tdb-tuile .tuile-valeur { overflow-wrap: anywhere; }
.tdb-tuile .tdb-valeur-texte { font-size: 22px; line-height: 1.35; white-space: nowrap; overflow-wrap: normal; }
.tdb-tuile-detail { margin-top: 2px; font-size: 13px; color: var(--texte-2); }
.tdb-tuile-alerte::before { background: var(--danger); }
.tdb-tuile-alerte .tuile-valeur { color: var(--danger); }
.tdb-tuile-lien:hover { box-shadow: 0 0 0 2px var(--bleu), var(--ombre); }
.tdb-tuile-lien:focus-visible { outline-offset: 3px; }

/* ----- Histogramme : une série, bleu du thème, mois courant en marine ----- */

.tdb-histogramme {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px;
  height: 220px; margin-top: 6px;
}
.tdb-colonne { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tdb-valeur-barre {
  height: 20px; font-size: 13px; font-weight: 750; text-align: center; color: var(--texte);
  font-variant-numeric: tabular-nums;
}
.tdb-zone-barre {
  flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid var(--bordure);
}
.tdb-barre { display: block; width: 100%; max-width: 40px; background: var(--bleu); border-radius: 4px 4px 0 0; }
.tdb-barre-courante { background: var(--marine); }
.tdb-mois {
  margin-top: 6px; font-size: 12px; font-weight: 650; text-align: center; color: var(--texte-2);
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.tdb-mois-etroit { display: none; }
.tdb-colonne:hover .tdb-barre { background: var(--bleu-fonce); }
.tdb-colonne:hover .tdb-barre-courante { background: var(--marine); }

/* ----- Tableaux ----- */

.tdb-tableau-auteurs { min-width: 860px; }
.tdb-tableau-equipes { min-width: 860px; }
.tdb-tableau-retards { min-width: 520px; }
.tdb-colonne-fixe { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; }
.tdb-tableau-auteurs td.tdb-chaleur { padding: 8px 6px; text-align: center; border-left: 2px solid var(--surface); }
.tdb-chaleur-0 { color: var(--texte-2); }
.tdb-chaleur-1 { background: var(--note-1); color: var(--note-1-texte); }
.tdb-chaleur-2 { background: var(--note-2); color: var(--note-2-texte); }
.tdb-chaleur-3 { background: var(--note-3); color: var(--note-3-texte); }
.tdb-chaleur-4 { background: var(--note-4); color: var(--note-4-texte); font-weight: 750; }
.tdb-chaleur-5 { background: var(--note-5); color: var(--note-5-texte); font-weight: 800; }
.tdb-tableau-auteurs thead th:not(.tdb-colonne-fixe) { text-align: center; }
.tableau tfoot th, .tableau tfoot td { border-top: 1.5px solid var(--bordure); border-bottom: 0; }
.tdb-total { font-weight: 750; }
.tdb-retard { color: var(--danger); font-weight: 750; }
.tdb-suite { margin: 10px 0 0; }

/* ----- Demandes, comptes, système ----- */

.tdb-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 18px; align-items: start; }
.tdb-groupe + .tdb-groupe { margin-top: 16px; }
.tdb-groupe > h3 { margin-bottom: 6px; }
.tdb-liste { margin: 0; padding: 0; list-style: none; }
.tdb-liste > li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  padding: 9px 0; border-bottom: 1px solid var(--bordure);
}
.tdb-liste > li:last-child { border-bottom: 0; }
.tdb-liste-nom { font-weight: 650; overflow-wrap: anywhere; }
.tdb-pied { margin-top: 14px; }
.tdb-systeme { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.tdb-systeme-ligne { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 4px solid var(--bleu-pale); }
.tdb-systeme dt { font-size: 13px; font-weight: 700; color: var(--texte-2); }
.tdb-systeme dd { margin: 0; font-weight: 650; }
.tdb-systeme-detail { display: block; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.tdb-systeme-alerte { border-left-color: var(--danger); }
.tdb-systeme-alerte dd { color: var(--danger); }

/* ----- Réglages ----- */

.tdb-actuel { margin-bottom: 14px; font-weight: 700; }
.tdb-formulaire { max-width: 520px; }
.tdb-formulaire .champ-texte { max-width: 200px; }
.tdb-formulaire .champ-aide { margin-top: 6px; }
.tdb-formulaire .message-erreur:empty { display: none; }
.tdb-formulaire .message-erreur { margin-top: 10px; }
.tdb-formulaire .actions-formulaire { justify-content: flex-start; }

@media (max-width: 600px) {
  .tdb-actions { width: 100%; }
  .bande .tdb-case-archives { flex: 1 1 100%; }
  .tdb-histogramme { gap: 4px; height: 180px; }
  .tdb-mois { font-size: 12px; }
  .tdb-mois-court { display: none; }
  .tdb-mois-etroit { display: inline; }
  .tdb-tuile .tdb-valeur-texte { font-size: 18px; }
  .tdb-valeur-barre { font-size: 12px; }
  .tdb-colonne-fixe { min-width: 120px; }
  .tdb-grille { grid-template-columns: minmax(0, 1fr); }
}
