/*
 * Styles du lot B — machines, chantiers, absences, utilisateurs.
 * Fichier propriété du lot B (lié par base.html.twig). Classes préfixées gp-ref-,
 * couleurs tirées des jetons de app.css.
 */

/* ------------------------------------------------------------------ */
/* En-tête d'écran : titre à gauche, actions à droite (dessous au téléphone). */
/* ------------------------------------------------------------------ */

.gp-ref-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--gp-e3);
    margin-bottom: var(--gp-e4);
}

.gp-ref-entete .gp-page-soustitre {
    margin-bottom: 0;
    max-width: 48rem;
}

.gp-ref-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gp-e2);
}

@media (max-width: 575.98px) {
    .gp-ref-actions,
    .gp-ref-actions > .btn,
    .gp-ref-actions > form,
    .gp-ref-actions > form > .btn {
        width: 100%;
    }
}

.gp-ref-retour {
    display: inline-flex;
    align-items: center;
    gap: var(--gp-e1);
    min-height: var(--gp-cible);
    font-weight: 600;
    text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Listes : cartes au téléphone, tableau au bureau.                    */
/* ------------------------------------------------------------------ */

.gp-ref-compte {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-bottom: var(--gp-e2);
}

.gp-ref-cartes {
    display: grid;
    gap: var(--gp-e2);
}

.gp-ref-carte {
    display: block;
    padding: var(--gp-e3) var(--gp-e4);
    color: inherit;
    text-decoration: none;
    min-height: var(--gp-cible);
}

.gp-ref-carte:hover,
.gp-ref-carte:focus-visible {
    border-color: var(--gp-bleu-chantier);
    color: inherit;
}

.gp-ref-carte__ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gp-e1) var(--gp-e2);
}

.gp-ref-carte__detail {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-top: var(--gp-e1);
    overflow-wrap: anywhere;
}

.gp-ref-code {
    font-family: var(--bs-font-monospace);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--gp-nuit);
}

/* Ligne d'intertitre (type d'engin) dans un tableau ou une liste. */
.gp-ref-groupe > th,
.gp-ref-groupe-titre {
    background: var(--gp-fond-creux);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gp-ardoise-700);
}

.gp-ref-groupe-titre {
    padding: var(--gp-e2) var(--gp-e3);
    border-radius: var(--gp-radius-sm);
    margin: var(--gp-e3) 0 0;
}

/* Élément hors service / inactif : lisible mais en retrait. */
.gp-ref-inactif,
.gp-ref-inactif a:not(.btn) {
    color: var(--gp-ardoise-500);
}

.gp-ref-inactif .gp-ref-code {
    color: var(--gp-ardoise-500);
}

.gp-ref-table td,
.gp-ref-table th {
    vertical-align: middle;
}

/* ------------------------------------------------------------------ */
/* Pagination.                                                         */
/* ------------------------------------------------------------------ */

.gp-ref-pagination .page-link {
    min-width: var(--gp-cible);
    min-height: var(--gp-cible);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gp-bleu-chantier);
}

.gp-ref-pagination .page-item.active .page-link {
    background: var(--gp-bleu-chantier);
    border-color: var(--gp-bleu-chantier);
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* Fiches (chantier, machine, utilisateur) : liste de définitions.     */
/* ------------------------------------------------------------------ */

.gp-ref-fiche dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.gp-ref-fiche dd {
    margin-bottom: var(--gp-e3);
    overflow-wrap: anywhere;
}

.gp-ref-fiche dd:last-child {
    margin-bottom: 0;
}

.gp-ref-verrou {
    display: flex;
    gap: var(--gp-e2);
    align-items: flex-start;
    padding: var(--gp-e3) var(--gp-e4);
    border-radius: var(--gp-radius);
    background: var(--gp-bleu-pale);
    color: var(--gp-bleu);
    font-size: 0.9375rem;
    margin-bottom: var(--gp-e4);
}

/* Affectations à venir d'un chantier : un bloc par jour. */
.gp-ref-jour + .gp-ref-jour {
    border-top: 1px solid var(--gp-trait);
}

.gp-ref-jour {
    padding: var(--gp-e3) var(--gp-e4);
}

.gp-ref-jour__titre {
    font-weight: 700;
    margin-bottom: var(--gp-e2);
}

.gp-ref-jour ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--gp-e2);
}

/* ------------------------------------------------------------------ */
/* Absences : lettres C / M / E, comme sur le planning papier.         */
/* ------------------------------------------------------------------ */

.gp-ref-lettre {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--gp-radius-sm);
    font-weight: 800;
    font-size: 1.05rem;
    background: var(--gp-fond-creux);
    color: var(--gp-ardoise-700);
    flex: none;
}

.gp-ref-lettre--C { background: var(--gp-bleu-pale);  color: var(--gp-bleu); }
.gp-ref-lettre--M { background: var(--gp-rouge-pale); color: var(--gp-rouge); }
.gp-ref-lettre--E { background: var(--gp-vert-pale);  color: var(--gp-vert); }

.gp-ref-absences th[scope="col"] {
    text-align: center;
}

.gp-ref-absences td {
    text-align: center;
    min-width: 4.5rem;
}

.gp-ref-absence {
    display: inline-flex;
    align-items: center;
    gap: var(--gp-e1);
}

.gp-ref-absence .btn {
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 0.35rem;
    line-height: 1;
}

.gp-ref-semaine {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gp-e2);
}

.gp-ref-semaine input[type="week"] {
    max-width: 12rem;
}

/* Motif : trois grands boutons plutôt que trois petites pastilles radio. */
.gp-ref-motifs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gp-e2);
}

.gp-ref-motifs .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-height: 4rem;
    font-weight: 600;
}

.gp-ref-motifs .btn strong {
    font-size: 1.4rem;
    line-height: 1;
}

.gp-ref-conflits {
    margin: var(--gp-e2) 0 0;
    padding-left: 1.2rem;
}

/* ------------------------------------------------------------------ */
/* Associations collaborateur ↔ machine.                               */
/* ------------------------------------------------------------------ */

.gp-ref-associations td:first-child,
.gp-ref-associations th:first-child {
    width: 40%;
}

.gp-ref-associations .form-select {
    min-width: 0;
}

.gp-ref-doublon .form-select {
    border-color: var(--gp-ambre);
    background-color: var(--gp-ambre-pale);
}

.gp-ref-doublon__texte {
    display: block;
    font-size: 0.8125rem;
    color: var(--gp-ambre);
    margin-top: var(--gp-e1);
}

/* ------------------------------------------------------------------ */
/* Mot de passe provisoire : affiché une fois, lisible de loin.        */
/* ------------------------------------------------------------------ */

.gp-ref-mdp {
    border: 2px solid var(--gp-jaune);
    background: var(--gp-jaune-pale);
    border-radius: var(--gp-radius);
    padding: var(--gp-e4);
    margin-bottom: var(--gp-e4);
}

.gp-ref-mdp__valeur {
    display: block;
    font-family: var(--bs-font-monospace);
    font-size: clamp(1.15rem, 0.9rem + 1.5vw, 1.6rem);
    font-weight: 700;
    color: var(--gp-nuit);
    background: var(--gp-surface);
    border-radius: var(--gp-radius-sm);
    padding: var(--gp-e2) var(--gp-e3);
    margin: var(--gp-e2) 0;
    overflow-wrap: anywhere;
    user-select: all;
}
