/* ===========================================================================
   ÉCRAN TABLEAU DE BORD PAIE — VUE DE DIRECTION (.tbp-*)
   Components/Pages/Paie/TableauBord.razor — PAR-01, lot X5.1, porté de
   « Tableau de bord paie DAF.dc.html ».

   Elle ne porte QUE la mise en page propre à cet écran : bandeaux, tuiles,
   cartes, tables, pastilles, lignes d'obstacle et barres viennent
   d'easypaie.css sans y être redéfinis.

   AUCUNE COULEUR LITTÉRALE : tout vient des jetons d'easytech-theme.css. Les
   barres de l'historique sont une seule série — la barre du module
   (.ep-barre), jamais une couleur d'état : un mois en hausse n'est pas « en
   alerte » parce qu'il est plus long.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. LE BANDEAU D'ÉTAT ET L'HORODATAGE.
   --------------------------------------------------------------------------- */
.appgrid .tbp-bandeau { margin-bottom: var(--et-tdb-ecart); }

.appgrid .tbp-etat { align-items: center; }
.appgrid .tbp-etat__texte { flex: 1 1 360px; min-width: 0; }
.appgrid .tbp-etat__chiffres { flex: none; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.appgrid .tbp-etat__libelle { font-size: 12px; color: var(--et-muted-sur-alerte); }
.appgrid .tbp-etat__valeur {
    margin-top: 2px;
    font-family: var(--et-font-mono); font-variant-numeric: tabular-nums;
    font-size: 20px; font-weight: 500; color: var(--et-ink); white-space: nowrap;
}

.appgrid .tbp-horodatage { font-size: 12px; color: var(--et-faint); white-space: nowrap; }

/* Un lien mène là où l'on décide. Un lien et non un bouton : c'est une
   ADRESSE — elle s'ouvre dans un onglet et se met en favori. */
.appgrid .tbp-lien { flex: none; color: var(--et-form-blue-encre); text-decoration: none; font-size: 13px; font-weight: 600; }
.appgrid .tbp-lien:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   2. LES TUILES — chacune est un lien vers l'écran où l'on décide.
   --------------------------------------------------------------------------- */
.appgrid .tbp-indicateurs { margin-bottom: var(--et-tdb-ecart); }
.appgrid a.tbp-tuile { display: block; color: inherit; text-decoration: none; }
.appgrid a.tbp-tuile:hover { border-color: var(--et-form-blue); }
.appgrid a.tbp-tuile:focus-visible { outline: 2px solid var(--et-form-blue); outline-offset: 2px; }
.appgrid .tbp-tuile__ecart {
    font-family: var(--et-font-mono); font-variant-numeric: tabular-nums;
    font-size: 13px; font-weight: 500; color: var(--et-muted);
}
.appgrid .tbp-tuile__detail { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--et-faint); }
/* Sur une tuile teintée, l'écart et le détail passent à l'encre, comme le
   libellé et la précision d'easypaie.css § 5. */
.appgrid .ep-indicateur--critique .tbp-tuile__ecart,
.appgrid .ep-indicateur--critique .tbp-tuile__detail { color: var(--et-ink); }

/* ---------------------------------------------------------------------------
   3. LES COLONNES ET LES CARTES.

   `minmax(0, …)` : sans le minimum à zéro, une conséquence longue impose sa
   largeur à toute la colonne et pousse la seconde hors champ.
   --------------------------------------------------------------------------- */
.appgrid .tbp-colonnes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--et-tdb-gouttiere);
    align-items: start;
    margin-bottom: var(--et-tdb-ecart);
}
.appgrid .tbp-bloc { margin-bottom: var(--et-tdb-ecart); }
.appgrid .tbp-vide { padding: 24px 18px; text-align: center; font-size: 13px; color: var(--et-muted); }
.appgrid .tbp-table-cadre { overflow-x: auto; }

/* ---------------------------------------------------------------------------
   4. LE CIRCUIT.
   --------------------------------------------------------------------------- */
.appgrid .tbp-circuit { list-style: none; margin: 0; padding: 0; }
.appgrid .tbp-etape {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    grid-template-areas: "rang corps quand statut";
    align-items: center;
    gap: 6px 12px;
    padding: var(--et-carte-tete-py) 18px;
    border-top: 1px solid var(--et-rang);
}
.appgrid .tbp-etape:first-child { border-top: 0; }
.appgrid .tbp-etape__rang {
    grid-area: rang;
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--et-hairline); border-radius: 50%;
    font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted);
}
.appgrid .tbp-etape__corps { grid-area: corps; min-width: 0; }
.appgrid .tbp-etape__libelle { font-size: 14px; font-weight: 600; color: var(--et-ink); }
.appgrid .tbp-etape__par { margin-top: 2px; font-size: 12px; color: var(--et-muted); }
.appgrid .tbp-etape__empeche { margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--et-faint); }
.appgrid .tbp-etape__quand { grid-area: quand; font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); white-space: nowrap; }
.appgrid .tbp-etape > .ep-pastille { grid-area: statut; justify-self: end; }

/* ---------------------------------------------------------------------------
   5. LES OBSTACLES — les lignes d'easypaie.css § 10, dans leur carte.
   --------------------------------------------------------------------------- */
.appgrid .tbp-obstacles > .ep-ligne:first-child { border-top: 0; }
.appgrid .tbp-obstacle__compte { flex: 0 1 140px; min-width: 110px; }

/* ---------------------------------------------------------------------------
   6. L'HISTORIQUE DE DOUZE MOIS.
   La longueur d'une barre est relative au mois le plus coûteux de la fenêtre,
   jamais au total : c'est une comparaison de mois, pas une part.
   --------------------------------------------------------------------------- */
.appgrid .tbp-hist { padding: 8px 18px 10px; }
.appgrid .tbp-hist__ligne {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 120px 72px 64px;
    grid-template-areas: "mois barre valeur ecart etat";
    align-items: center;
    gap: 4px 12px;
    padding: 4px 0;
}
.appgrid .tbp-hist__mois { grid-area: mois; font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); }
.appgrid .tbp-hist__barre { grid-area: barre; min-width: 0; }
.appgrid .tbp-hist__valeur { grid-area: valeur; }
.appgrid .tbp-hist__ecart { grid-area: ecart; }
.appgrid .tbp-hist__etat { grid-area: etat; font-size: 12px; color: var(--et-faint); white-space: nowrap; }

/* ---------------------------------------------------------------------------
   7. PALIERS — docs/conventions-responsive.md.
   --------------------------------------------------------------------------- */

/* Sous 1100 px les deux colonnes se mettent l'une sous l'autre : à cette
   largeur, une ligne d'obstacle n'a plus la place de son compte à côté de sa
   conséquence. */
@media (max-width: 1100px) {
    .appgrid .tbp-colonnes { grid-template-columns: minmax(0, 1fr); }
}

/* Règle tactile (lot 02) : sous 1024 px, aucune cible sous 44 px. */
@media (max-width: 1024px) {
    /* min-width aussi : « Ouvrir » et « Détail » tenaient en 36-39 px de large (banc, 2026-10-20). */
    .appgrid .tbp-lien { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
}

/* Sous 720 px, une ligne d'historique passe sur deux rangées : le mois et sa
   barre, puis le montant et l'écart — rien n'est retiré. */
@media (max-width: 720px) {
    .appgrid .tbp-hist__ligne {
        grid-template-columns: 56px minmax(0, 1fr) auto;
        grid-template-areas:
            "mois barre barre"
            "etat valeur ecart";
        padding: 6px 0;
        border-top: 1px solid var(--et-rang);
    }
    .appgrid .tbp-hist__ligne:first-child { border-top: 0; }
    .appgrid .tbp-hist__valeur { text-align: left; }
}

/* Sous 560 px, la date du visa passe sous l'étape. */
@media (max-width: 560px) {
    .appgrid .tbp-etape {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        grid-template-areas:
            "rang corps statut"
            ". quand quand";
        padding: 10px 12px;
    }
    .appgrid .tbp-hist { padding: 6px 12px 8px; }
}
