/*
 * Voyages scolaires : ce que le module ajoute à css/style.css de PiloteBud.
 * Aucune couleur nouvelle : tout vient des jetons de :root (bleu nuit) et de .panneau-tableau (clair).
 */

/* Indicateur sans anneau : même hauteur que le premier, contenu en haut. */
.kpis .kpi { align-items: flex-start; }
.kpis .kpi-rec { align-items: center; }
.kpi .jauge-legende .realise { background: var(--rec); }

/* Cinquième indicateur : encaissements en attente de titre, cliquable. Le premier garde un peu plus de place pour l'anneau. */
@media screen and (min-width: 1281px) {
  .kpis { grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); }
}
.kpi-clic { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.kpi-clic:hover { background: var(--surface-2); border-color: var(--bordure); }
.kpi-clic:focus-visible { outline: 2px solid var(--dep); outline-offset: 2px; }
.kpi-valeur.attente { color: var(--attention); }
.kpi-lien { margin-top: 6px; color: var(--dep); font-size: 12.5px; font-weight: 600; }
.kpi-clic:hover .kpi-lien { text-decoration: underline; text-underline-offset: 3px; }

/* Liste des encaissements en attente de titre (panneau latéral). */
.attente-intro { margin-top: 16px; color: var(--encre-2); max-width: 80ch; }
.attente-filtres { margin: 14px 0 8px; }
.attente-filtres input[type="search"] { width: 320px; }
.attente-compte { margin-bottom: 6px; color: var(--encre-2); font-weight: 600; }
.attente-table small.tiers { display: block; color: var(--encre-3); font-size: 11px; }
.attente-table td.attente-libelle { white-space: normal; min-width: 180px; }
.retour-attente { display: inline-block; margin-bottom: 4px; font-size: 12.5px; }

/* ---------- Recouvrement par voyage ---------- */
.panneau-voyages { margin-bottom: 16px; }
.serie-reste { background: var(--critique); }
.voyages-liste { display: grid; gap: 2px; }
.voyage-ligne {
  display: grid; grid-template-columns: minmax(180px, 1.1fr) 84px minmax(120px, 2fr) 48px 110px;
  align-items: center; gap: 16px;
  width: calc(100% + 20px); margin: 0 -10px; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.voyage-ligne:hover { background: var(--survol); }
.voyage-nom { min-width: 0; }
.voyage-nom b { display: block; font-weight: 600; }
.voyage-nom small { display: block; color: var(--encre-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voyage-effectif, .voyage-taux { color: var(--encre-2); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.voyage-ligne .piste { border-radius: 5px; }
.voyage-ligne .piste .realise { background: var(--rec); }
/* La partie non réglée d'un voyage qui a un reste est teintée, pour le repérer d'un coup d'œil. */
.voyage-ligne .piste.avec-reste { background: color-mix(in srgb, var(--critique) 55%, var(--piste)); }
.voyage-reste { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--encre-2); }
.voyage-reste.negatif { color: var(--critique-encre); }

/* ---------- Tableau voyage → élève ---------- */
.impression-entete { display: none; }
.filtres .case { color: var(--encre); }
.tableau-voyages .col-texte { text-align: left; padding-left: 14px; white-space: normal; }
.tableau-voyages td.libelle { min-width: 260px; }
.tableau-voyages .tri {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer;
}
.tableau-voyages .tri:hover { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; }
.tri-fleche { display: inline-block; width: 9px; font-size: 9px; color: var(--dep); }
tr.niveau-voyage td { background: var(--surface-2); font-weight: 650; }
tr.niveau-voyage .code { font-weight: 400; }
tr.niveau-eleve .libelle-contenu { padding-left: 26px; }
tr.niveau-eleve td { color: var(--encre-2); }
tr.niveau-eleve td.reste { color: var(--critique-encre); font-weight: 650; }
tr.niveau-voyage td.reste { color: var(--critique-encre); }
tr.niveau-eleve.annule td, tr.niveau-eleve.annule .lien-cgr { color: var(--encre-3); font-style: italic; }
.tableau-voyages tfoot td.reste { color: var(--critique-encre); }
.tableau-voyages .exec { justify-content: flex-start; }

.statut { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 550; color: var(--encre); }
.statut-annule { color: var(--encre-3); font-weight: 400; }
.puce {
  display: inline-block; margin: 1px 4px 1px 0; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--encre-2); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
/* Le liseré garde la pastille lisible sur une ligne survolée, dont le fond est le même. */
.puce[data-info] { cursor: help; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.puce-debit { background: color-mix(in srgb, var(--critique) 22%, transparent); color: var(--encre); }
.puce-hors { background: color-mix(in srgb, var(--attention) 28%, transparent); color: var(--encre); }

/* ---------- Fiche d'un élève ---------- */
.detail-section h4 .statut { font-size: 12.5px; }
.panneau-lateral .negatif { color: var(--critique-encre); }

@media screen and (max-width: 1280px) {
  .tableau-voyages td.libelle { min-width: 200px; }
}
@media screen and (max-width: 1133px) {
  .tableau-voyages { min-width: 980px; }
}
@media screen and (max-width: 760px) {
  .voyage-ligne { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .voyage-ligne .voyage-nom { grid-column: 1; }
  .voyage-ligne .voyage-reste { grid-column: 2; grid-row: 1; }
  .voyage-ligne .piste { grid-column: 1; grid-row: 2; }
  .voyage-ligne .voyage-taux { grid-column: 2; grid-row: 2; }
  .voyage-effectif { display: none; }
  .chiffres-eleve { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Impression : le tableau tel qu'affiché, en A4 paysage (règles de style.css) ---------- */
@media print {
  .kpis, .panneau-voyages, .source { display: none !important; }
  .panneau-tableau { break-before: auto; }
  .panneau-tableau .panneau-titre { display: none; }
  .impression-entete { display: block; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--encre); }
  .impression-entete h1 { font-size: 16px; }
  .impression-entete p { margin-top: 2px; color: var(--encre-2); font-size: 10px; }
  .chevron, .chevron-vide, .tri-fleche { display: none; }
  .tableau-voyages { min-width: 0; }
  .tableau-voyages .col-texte { padding-left: 8px; }
  tr.niveau-eleve .libelle-contenu { padding-left: 12px; }
  tr.niveau-voyage td { background: var(--surface-2) !important; }
  .lien-cgr { color: inherit; }
  .puce { padding: 0 4px; font-size: 8.5px; }
  .credit { display: block; margin-top: 8px; color: var(--encre-3); font-size: 9px; text-align: right; }
}
