/* ==========================================================================
   POINTAGES EN DIRECT (/app/pointages-direct) — .pdi-*, un seul écran.
   Le moniteur temps réel d'EasyTime : les derniers passages du jour, le plus
   récent en haut, découpés par heure. Maquette du 2026-09-29
   (docs/modeles/design_handoff_pointages_direct/). Charte seule (--et-*).

   LE SENS N'EST PLUS UNE COULEUR D'ÉTAT. Le vert (entrée) et le bleu (sortie)
   disaient « réussite » et « information » d'un passage qui n'est ni l'un ni
   l'autre : une flèche et un libellé, sur une teinte neutre. La pastille d'état
   du flux reste une MARQUE, la seule place où une couleur d'état se pose telle
   quelle — l'ambre y prend --et-avertissement-mark, l'ambre pur ne passant pas
   3:1 sur blanc.
   ========================================================================== */

/* ---- l'état du flux, dans l'en-tête ---- */
.pdi-flux  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-left: auto; }
.pdi-etat  { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--et-ink); }
.pdi-etat.est-pause { color: var(--et-avertissement-ink); }
.pdi-pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--et-muted); }
.pdi-etat.est-direct  .pdi-pastille { background: var(--et-succes); }
.pdi-etat.est-secours .pdi-pastille { background: var(--et-form-blue); }
.pdi-etat.est-pause   .pdi-pastille { background: var(--et-avertissement-mark); }
.pdi-lu    { font-size: 12px; color: var(--et-muted); white-space: nowrap; }
.pdi-pause { display: inline-flex; align-items: center; gap: 6px; }
.pdi-vues  { margin: 4px 0 16px; }

/* ---- le cadre du flux ---- */
.pdi-cadre {
    background: var(--et-surface);
    border: 1px solid var(--et-hairline);
    display: flex;
    flex-direction: column;
}
.pdi-outils   { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--et-hairline); }
.pdi-terminal { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--et-muted); }
.pdi-terminal .mx-select { min-width: 240px; }

/* La tranche horaire : une bande discrète, collée en haut au défilement. */
.pdi-heure-tete {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: baseline; gap: 10px;
    padding: 6px 16px;
    background: var(--et-surface-2);
    border-top: 1px solid var(--et-hairline);
    font-size: 12px; color: var(--et-muted);
}
.pdi-heure-lib { font-family: var(--et-font-mono); font-weight: 600; color: var(--et-ink); }

/* ---- la ligne : l'heure d'abord, en gros ---- */
.pdi-liste { list-style: none; margin: 0; padding: 0; }
.pdi-ligne {
    display: grid;
    grid-template-columns: 96px 40px minmax(0, 1.2fr) minmax(0, 1fr) 110px;
    align-items: center;
    column-gap: 12px;
    min-height: 56px;
    padding: 8px 16px;
    border-top: 1px solid var(--et-rang);
}
.pdi-ligne:hover { background: var(--et-survol); }
/* Arrivée depuis la lecture précédente : la teinte de sélection, le temps d'un regard. */
.pdi-ligne.est-nouveau { background: var(--et-tint); }
/* Le matricule inconnu : filet rouge, le seul geste que ce flux demande. */
.pdi-ligne.est-inconnu { box-shadow: inset 3px 0 0 var(--et-danger); }

.pdi-temps { font-family: var(--et-font-mono); font-size: 16px; font-weight: 600; color: var(--et-ink); }
.pdi-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--et-tint); color: var(--et-form-blue-encre);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* La photo de fiche, quand le salarié en a une : elle remplit le disque et remplace les
   initiales. Recadrée au centre, jamais déformée — les photos d'enrôlement sont en portrait. */
.pdi-photo { width: 100%; height: 100%; object-fit: cover; }

.pdi-qui { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.pdi-nom { font-size: 14px; font-weight: 700; color: var(--et-ink); text-decoration: none; }
a.pdi-nom:hover { color: var(--et-lien); text-decoration: underline; }
.pdi-nom.est-inconnu { color: var(--et-danger-ink); }
.pdi-matricule { font-family: var(--et-font-mono); font-size: 12px; color: var(--et-muted); }
.pdi-hors { font-size: 12px; font-weight: 700; color: var(--et-danger-ink); }
.pdi-ou   { font-size: 13px; color: var(--et-muted); min-width: 0; }

.pdi-sens {
    justify-self: end;
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 26px; padding: 0 10px;
    border: 1px solid var(--et-hairline);
    font-size: 13px; font-weight: 600; white-space: nowrap;
    color: var(--et-ink);
}
.pdi-sens.est-entree { background: var(--et-tint); }
.pdi-sens.est-sortie { background: var(--et-surface-2); }
.pdi-fleche { font-family: var(--et-font-mono); }

.pdi-vide { padding: 32px 16px; color: var(--et-muted); text-align: center; }

.pdi-pied {
    display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--et-hairline);
    font-size: 13px; color: var(--et-muted);
}
.pdi-pied a { font-weight: 600; }

/* ---- sous 1024 px : l'heure et l'avatar à gauche, le reste sur deux lignes ---- */
@media (max-width: 1024px) {
    .pdi-flux     { flex: 1 1 100%; margin-left: 0; }
    .pdi-pause    { min-height: 44px; margin-left: auto; }
    .pdi-terminal { flex: 1 1 100%; }
    .pdi-terminal .mx-select { flex: 1 1 auto; min-width: 0; min-height: 44px; }
    .pdi-ligne {
        grid-template-columns: 76px 36px minmax(0, 1fr) auto;
        grid-template-areas: "t a q s" "t a o o";
        column-gap: 10px; row-gap: 2px;
        padding: 10px 12px;
    }
    .pdi-temps  { grid-area: t; font-size: 14px; }
    .pdi-avatar { grid-area: a; }
    .pdi-qui    { grid-area: q; }
    .pdi-ou     { grid-area: o; }
    .pdi-sens   { grid-area: s; }
    /* Le nom et le lien de pied au doigt : 44 px, la ligne grandit de quelques pixels. */
    a.pdi-nom, .pdi-pied a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 640px) {
    .pdi-outils { padding: 12px; }
}
