/* ===========================================================================
   ÉCRAN HISTORIQUE SALARIAL (.hsa-*)
   Components/Pages/Paie/HistoriqueSalarial.razor — lot X5.3, porté de
   « Historique salarial.dc.html ».

   Elle ne porte QUE la mise en page propre à cet écran : la frise des
   décisions, la carte de position, les deux colonnes de la progression.
   Bandeaux, tuiles, cartes, pastilles, barres, tables (en cartes par
   easypaie.css § 18) et sélecteur de vues viennent d'easypaie.css sans y être
   redéfinis.

   AUCUNE COULEUR LITTÉRALE. Les natures de décision prennent les pastilles du
   module (encre au rang « -ink ») ; l'alerte d'avantage prend le pâle de
   l'avertissement et son encre, celle de promotion le bleu teinté.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. LA BANDE DU SALARIÉ ET LES BANDEAUX.
   --------------------------------------------------------------------------- */
.appgrid .hsa-outils { margin-bottom: 14px; }
.appgrid .hsa-salarie { min-width: 240px; }
.appgrid .hsa-identite { font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); }
.appgrid .hsa-bandeau { margin-bottom: 14px; align-items: center; }
.appgrid .hsa-bandeau > div:first-child { flex: 1 1 320px; min-width: 0; }
.appgrid .hsa-bandeau__action { flex: none; margin-left: auto; }
.appgrid .hsa-bloc { margin-bottom: 14px; }
.appgrid .hsa-vide { padding: 18px; text-align: center; font-size: 13px; color: var(--et-muted); }
.appgrid .hsa-mono { font-family: var(--et-font-mono); font-variant-numeric: tabular-nums; }
.appgrid .hsa-lien { font-weight: 600; }

/* ---------------------------------------------------------------------------
   2. LES TUILES — cinq, et le libellé passe à la ligne au lieu de s'abréger.
   --------------------------------------------------------------------------- */
.appgrid .hsa-indicateurs { margin-bottom: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.appgrid .hsa-indicateurs .ep-indicateur__libelle { white-space: normal; overflow: visible; }
.appgrid .hsa-indicateur__detail { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--et-faint); }
.appgrid .hsa-indicateurs .ep-indicateur--critique .hsa-indicateur__detail { color: var(--et-ink); }
.appgrid .hsa-indicateurs .ep-indicateur--critique .ep-indicateur__valeur { color: var(--et-avertissement-ink); }

/* ---------------------------------------------------------------------------
   3. LA FRISE DES DÉCISIONS — une rangée par décision : la date, l'acte, la
   situation, le brut ; l'alerte sous l'acte. `minmax(0, …)` : sans minimum à
   zéro, un motif long impose sa largeur à toute la colonne.
   --------------------------------------------------------------------------- */
.appgrid .hsa-decisions { list-style: none; margin: 0; padding: 0; }
.appgrid .hsa-decision {
    display: grid;
    grid-template-columns: 112px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 6px 18px;
    padding: 12px 18px 12px 15px;
    border-top: 1px solid var(--et-rang);
    border-left: 3px solid transparent;
}
.appgrid .hsa-decision:first-child { border-top: 0; }
.appgrid .hsa-decision--promotion { border-left-color: var(--et-succes); background: var(--et-surface-3); }
.appgrid .hsa-decision--future { border-left-color: var(--ep-bleu-bordure); }
.appgrid .hsa-decision__date {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    font-family: var(--et-font-mono); font-size: 13px; color: var(--et-ink);
}
.appgrid .hsa-decision__marque { font-family: var(--et-font); }
.appgrid .hsa-decision__tete { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.appgrid .hsa-decision__libelle { font-size: 14px; font-weight: 600; color: var(--et-ink); }
.appgrid .hsa-decision__motif { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--et-muted); }
.appgrid .hsa-decision__reference { margin-top: 4px; font-family: var(--et-font-mono); font-size: 12px; color: var(--et-faint); }
.appgrid .hsa-decision__lien { margin-top: 4px; font-size: 12px; color: var(--et-ink); }
.appgrid .hsa-decision__rectifiee { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--et-avertissement-ink); }
.appgrid .hsa-decision__etiquette { font-size: 12px; color: var(--et-faint); }
.appgrid .hsa-decision__valeur { font-size: 13px; font-weight: 500; color: var(--et-ink); }
.appgrid .hsa-decision__sous { margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--et-muted); }
.appgrid .hsa-decision__montant { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.appgrid .hsa-decision__montant .hsa-decision__valeur { font-size: 14px; white-space: nowrap; }
.appgrid .hsa-decision__ecart { font-family: var(--et-font-mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.appgrid .hsa-ecart--hausse { color: var(--et-succes-ink); }
.appgrid .hsa-ecart--neutre { color: var(--et-muted); }
.appgrid .hsa-decision__alerte {
    grid-column: 2 / -1;
    padding: var(--et-alerte-py) 11px;
    border: 1px solid var(--et-hairline);
    font-size: 12px; line-height: 1.5;
}
.appgrid .hsa-alerte--avantage { background: var(--et-avertissement-bg); border-color: var(--et-avertissement-bord); color: var(--et-avertissement-ink); }
.appgrid .hsa-alerte--info { background: var(--et-tint); border-color: var(--ep-bleu-bordure); color: var(--et-form-blue-d); }

/* ---------------------------------------------------------------------------
   4. LA PROGRESSION ET LA POSITION — deux colonnes, la frise d'années à gauche.
   --------------------------------------------------------------------------- */
.appgrid .hsa-colonnes {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}
.appgrid .hsa-annees__barre { width: 34%; min-width: 120px; }
.appgrid .hsa-annee--en-cours > td { background: var(--et-surface-3); }
.appgrid .hsa-mention { display: block; margin-top: 2px; font-size: 12px; color: var(--et-muted); }
.appgrid .hsa-mois--incomplet { color: var(--et-avertissement-ink); font-weight: 600; }

.appgrid .hsa-position { padding: 6px 18px 12px; }
.appgrid .hsa-position__ligne { padding: 9px 0; border-top: 1px solid var(--et-rang); }
.appgrid .hsa-position__ligne:first-child { border-top: 0; }
.appgrid .hsa-position__tete {
    display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
    gap: 2px 12px; margin-bottom: 5px;
}
.appgrid .hsa-position__libelle { font-size: 13px; font-weight: 600; color: var(--et-ink); }
.appgrid .hsa-position__base { font-size: 12px; color: var(--et-muted); }
.appgrid .hsa-position .ep-barre__valeur { min-width: 96px; text-align: right; }

/* ---------------------------------------------------------------------------
   5. LA FENÊTRE DE SAISIE — ce que le gabarit ne porte pas.
   --------------------------------------------------------------------------- */
.appgrid .hsa-motif, .hsa-motif { height: auto; min-height: 56px; resize: vertical; }
.hsa-salaire { max-width: 200px; }

/* ---------------------------------------------------------------------------
   6. PALIERS — docs/conventions-responsive.md.
   --------------------------------------------------------------------------- */

/* Sous 1100 px : la progression et la position s'empilent, les tuiles vont par trois. */
@media (max-width: 1100px) {
    .appgrid .hsa-colonnes { grid-template-columns: minmax(0, 1fr); }
    .appgrid .hsa-indicateurs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Sous 1024 px : la rangée de décision passe sur deux lignes — la date et l'acte,
   puis la situation et le brut côte à côte. */
@media (max-width: 1024px) {
    .appgrid .hsa-decision { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .appgrid .hsa-decision__date { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; }
    .appgrid .hsa-decision__corps { grid-column: 1 / -1; }
    .appgrid .hsa-decision__alerte { grid-column: 1 / -1; }
    .appgrid .hsa-annees__barre { width: auto; min-width: 0; }
}

@media (max-width: 720px) {
    .appgrid .hsa-indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sur un téléphone : une colonne, et le sélecteur de vues tient la largeur de la
   bande en trois parts égales. */
@media (max-width: 559px) {
    .appgrid .hsa-indicateurs { grid-template-columns: minmax(0, 1fr); }
    .appgrid .hsa-decision { grid-template-columns: minmax(0, 1fr); padding-left: 9px; padding-right: 12px; }
    .appgrid .hsa-salarie { width: 100%; min-width: 0; }
    .appgrid .hsa-vues { width: 100%; }
    .appgrid .hsa-vues .ep-vues__btn {
        flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; white-space: normal;
    }
    .appgrid .hsa-position { padding-left: 12px; padding-right: 12px; }
}
