/* ==========================================================================
   MUR DES LIVRAISONS — feuille de style de frontend/views/jobs-board.html
   --------------------------------------------------------------------------
   Réécrite en une seule passe le 15/10/2026. Avant, les règles étaient
   empilées en correctifs successifs à la fin du fichier (un bloc « pagination »,
   puis un bloc « refonte » qui réécrivait `.mur`, `.livraison`, `.etat-vide`,
   puis un bloc « responsive » qui réimposait le mobile qu'un bloc tardif venait
   d'écraser). Un correctif à la fin gagne toujours : la feuille devenait
   illisible, et la page se comportait différemment selon l'ordre des blocs.
   Ici, chaque famille est écrite UNE fois, avec ses valeurs définitives.

   Quatre règles tenues par ce fichier, toutes vérifiables :
     • aucun jeton n'est inventé : couleurs, rayons, tailles et espacements
       viennent du socle (public/css/hub.css) ;
     • aucun #hex, aucun rgba(255, …) : les voiles translucides passent par
       --rgb-white / --rgb-blue / --rgb-orange, sinon le thème clair casserait ;
     • ce qui appartient au socle n'est pas recopié : la barre latérale et
       .main-content en petit écran sont définis dans hub.css, bloc
       « @media (max-width: 768px) » — les recopier ici les faisait diverger ;
     • aucun !important, sauf le bloc « mouvement réduit », qui doit gagner
       contre le survol des cartes écrit plus haut.

   Restent en pixels, volontairement : les bordures de 1 px, les décalages
   d'icônes, et les largeurs minimales des champs et du pager — ce sont des
   contraintes de mise en page, pas des jetons de charte.

   La page ne contient plus aucun bloc <style> : elle n'a qu'un <link> vers ce
   fichier, ce qui rend toute cette refonte réversible d'un seul lien.
   ========================================================================== */

/* ==========================================================================
   1. EN-TÊTE DE PAGE
   ========================================================================== */

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: var(--space-5);
}
.page-header h1 { font-size: var(--font-5xl); font-weight: var(--font-weight-bold); color: var(--text-primary); }
.page-header h1 span {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.page-header p { color: var(--text-secondary); font-size: var(--font-base); max-width: 72ch; }

.entete-outils { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* Le compte à rebours et l'heure de lecture changent chaque seconde : des
   chiffres à chasse fixe évitent que la ligne tressaute à chaque battement. */
.entete-lecture {
    color: var(--text-muted); font-size: var(--font-sm);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   2. BOUTONS ET CHAMPS
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: var(--font-md); font-weight: var(--font-weight-bold);
    font-family: inherit; text-decoration: none; white-space: nowrap;
    transition: background-color var(--transition-rapide),
                border-color var(--transition-rapide),
                color var(--transition-rapide);
}
.btn-primary { background: var(--accent-blue); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-purple); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: rgba(var(--rgb-blue), 0.35); }
.btn:focus-visible { outline: var(--focus-ring-outline); outline-offset: 2px; }

.champ {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: var(--font-base);
    min-width: 190px;
}
.champ::placeholder { color: var(--text-muted); }
.champ:focus-visible { outline: none; border-color: var(--accent-blue); box-shadow: var(--focus-ring); }
/* Un menu déroulant natif se peint avec les couleurs du système : sans ces deux
   lignes, il s'ouvre en blanc sur un thème sombre, illisible. */
select.champ { cursor: pointer; }
.champ option { background: var(--bg-input); color: var(--text-primary); }
.champ-recherche { min-width: 280px; }

/* ==========================================================================
   3. TITRES DE SECTION
   ========================================================================== */

.section-titre {
    font-size: var(--font-2xs); text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
}

/* ==========================================================================
   4. CHIFFRES DU HUB — trois périodes, quatre mesures chacune
   ========================================================================== */

.chiffres-grille {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-4); margin-bottom: var(--space-7);
}
.chiffres-bloc {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: var(--space-5);
}
.chiffres-titre {
    font-size: var(--font-md); text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-muted); font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
}
.chiffres-liste { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.chiffre { background: var(--bg-input); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.chiffre-valeur {
    display: block; font-size: var(--font-3xl); font-weight: var(--font-weight-bold);
    color: var(--text-primary); word-break: break-word;
    font-variant-numeric: tabular-nums;
}
.chiffre-libelle {
    display: block; font-size: var(--font-2xs); text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
}
/* Une couleur par période : aujourd'hui, la semaine, le total. */
.bloc-aujourdhui .chiffre-valeur { color: var(--accent-blue); }
.bloc-sept-jours .chiffre-valeur { color: var(--accent-purple); }
.bloc-total .chiffre-valeur { color: var(--accent-green); }

/* ==========================================================================
   5. FILTRES
   ========================================================================== */

.filtres {
    display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: var(--space-5);
    margin-bottom: var(--space-7);
}
.filtre { display: flex; flex-direction: column; gap: var(--space-2); }
.filtre-etiquette {
    font-size: var(--font-2xs); text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   6. LE MUR — la grille et son annonce
   ========================================================================== */

.mur-entete {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4);
}
.mur-titre { font-size: var(--font-2xl); font-weight: var(--font-weight-bold); color: var(--text-primary); }
.mur-annonce { color: var(--text-secondary); font-size: var(--font-md); max-width: 90ch; }
/* minmax(300px) : sous cette largeur, deux cartes côte à côte donneraient des
   colonnes de 150 px, où un nom de ville et une entreprise ne tiennent plus. */
.mur {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}

/* ==========================================================================
   7. LA CARTE D'UNE LIVRAISON
   ========================================================================== */

.livraison {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); padding: var(--space-5);
    display: flex; flex-direction: column; gap: var(--space-4);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform var(--transition-rapide),
                border-color var(--transition-rapide),
                background-color var(--transition-rapide),
                box-shadow var(--transition-rapide);
}
.livraison:hover {
    background: var(--bg-card-hover);
    border-color: rgba(var(--rgb-blue), 0.32);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.livraison-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.livraison-nom {
    display: block; font-size: var(--font-xl); font-weight: var(--font-weight-bold);
    color: var(--text-primary); line-height: 1.3; letter-spacing: -0.1px;
}
.livraison-nom.absent { color: var(--text-muted); font-style: italic; font-weight: var(--font-weight-semibold); }
.livraison-membre {
    display: block; font-size: var(--font-xs); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.82;
}
/* La raison d'un nom manquant est une pastille, pas une phrase noyée : elle doit
   se voir sans voler la vedette au nom du conducteur. */
.livraison-raison {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: 3px var(--space-3); border-radius: var(--radius-full);
    background: rgba(var(--rgb-orange), 0.14);
    border: 1px solid rgba(var(--rgb-orange), 0.3);
    font-size: var(--font-sm); font-weight: var(--font-weight-semibold);
    color: var(--accent-orange);
}
.livraison-fin { font-size: var(--font-md); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.livraison-fin i { color: var(--accent-blue); margin-right: var(--space-1); }

/* Le statut vient du hub ; ses libellés inconnus sont affichés tels quels avec
   la classe `inconnu`, jamais rangés de force dans une couleur qui promettrait
   une information que le hub n'a pas donnée. */
.badge-statut {
    display: inline-block; padding: 2px var(--space-3); border-radius: var(--radius-full);
    font-size: var(--font-2xs); font-weight: var(--font-weight-bold);
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.badge-statut.ok { background: rgba(var(--rgb-green), 0.15); color: var(--accent-green); }
.badge-statut.attente { background: rgba(var(--rgb-blue), 0.15); color: var(--accent-blue); }
.badge-statut.alerte { background: rgba(var(--rgb-orange), 0.15); color: var(--accent-orange); }
.badge-statut.inconnu { background: rgba(var(--rgb-white), 0.08); color: var(--text-muted); }

/* ==========================================================================
   8. LE TRAJET — départ, flèche, arrivée
   ========================================================================== */

.trajet { display: flex; align-items: stretch; gap: var(--space-3); }
.trajet-etape {
    flex: 1; min-width: 0; background: var(--bg-input);
    border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4);
}
.trajet-role {
    display: block; font-size: var(--font-2xs); text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); font-weight: var(--font-weight-semibold);
}
.trajet-ville {
    display: block; font-size: var(--font-lg); font-weight: var(--font-weight-bold);
    color: var(--text-primary); word-break: break-word;
}
.trajet-entreprise { display: block; font-size: var(--font-sm); color: var(--text-secondary); word-break: break-word; }
.trajet-fleche { display: flex; align-items: center; color: var(--accent-blue); }
.trajet-mention { font-size: var(--font-sm); color: var(--accent-yellow); }

/* ==========================================================================
   9. LES DÉTAILS DE LA LIVRAISON
   ========================================================================== */

.details { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.detail {
    display: flex; align-items: flex-start; gap: var(--space-2);
    font-size: var(--font-sm); color: var(--text-secondary);
    background: var(--bg-input); border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}
.detail i { color: var(--accent-blue); margin-top: 3px; flex-shrink: 0; }
.detail strong { color: var(--text-primary); font-weight: var(--font-weight-semibold); }
/* Le « (annoncé par le jeu : …) » est une précision, pas la mesure : il se lit
   après, plus discret, jamais à la place du chiffre mesuré. */
.detail-note { color: var(--text-muted); }

/* ==========================================================================
   10. LE PAIEMENT ET SON MOTIF
   ========================================================================== */

.paiement {
    display: flex; justify-content: space-between; align-items: center;
    gap: var(--space-3); flex-wrap: wrap;
    padding-top: var(--space-4); border-top: 1px solid var(--border-color);
}
.paiement-montant {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: var(--font-2xl); font-weight: var(--font-weight-bold);
    color: var(--accent-yellow); font-variant-numeric: tabular-nums;
}
/* « Aucun versement » n'est pas un montant : il s'écrit petit et neutre, pour
   qu'on ne lise jamais un montant là où il n'y en a pas. */
.paiement-montant.absent { color: var(--text-secondary); font-size: var(--font-lg); }
.paiement-note { font-size: var(--font-sm); color: var(--text-muted); }
.raison {
    font-size: var(--font-sm); color: var(--text-secondary);
    background: var(--bg-input); border-left: 2px solid var(--accent-blue);
    border-radius: var(--radius-xs); padding: var(--space-2) var(--space-3);
}
.raison strong { color: var(--text-primary); }

/* ==========================================================================
   11. LES CONTRÔLES DE COHÉRENCE — repliés par défaut
   ========================================================================== */

.controles { font-size: var(--font-sm); color: var(--text-secondary); }
.controles summary { cursor: pointer; font-weight: var(--font-weight-semibold); }
.controles summary:focus-visible { outline: var(--focus-ring-outline); outline-offset: 2px; }
.controles ul {
    list-style: none; margin-top: var(--space-2);
    display: flex; flex-direction: column; gap: var(--space-2);
}
.controles li { display: flex; align-items: flex-start; gap: var(--space-2); }
.controles li i { margin-top: 3px; flex-shrink: 0; }
.controles li.ok i { color: var(--accent-green); }
.controles li.ecart i { color: var(--accent-orange); }
.controles li.neutre i { color: var(--text-muted); }

/* ==========================================================================
   12. LES ÉTATS HONNÊTES — vide, réservé, panne, lecture en cours
   ========================================================================== */

/* grid-column: 1 / -1 — l'état vide occupe TOUTE la grille du mur : affiché
   dans une seule colonne de 300 px, il ressemblerait à une carte de plus. */
.etat-vide {
    grid-column: 1 / -1; text-align: center;
    padding: var(--space-8) var(--space-5);
    background: var(--bg-card); border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg); color: var(--text-secondary);
    overflow: hidden;
}
.etat-vide > i { display: block; font-size: var(--font-8xl); color: var(--text-muted); margin-bottom: var(--space-3); opacity: 0.55; }
.etat-vide h3 { font-size: var(--font-2xl); color: var(--text-primary); margin-bottom: var(--space-2); }
.etat-vide p { max-width: 72ch; margin: 0 auto var(--space-2); font-size: var(--font-md); }
.etat-actions { display: flex; justify-content: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }

/* ==========================================================================
   13. LE PAGER DU MUR — 25 livraisons par page
   ========================================================================== */

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: var(--space-2); flex-wrap: wrap;
    margin: var(--space-6) 0 var(--space-2); padding-top: var(--space-5);
    border-top: 1px solid var(--border-color);
}
.pagination button {
    min-width: 38px; height: 38px; padding: 0 var(--space-3);
    border-radius: var(--radius-sm); cursor: pointer;
    background: rgba(var(--rgb-white), 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit; font-size: var(--font-md); font-weight: var(--font-weight-semibold);
    font-variant-numeric: tabular-nums;
    transition: background-color var(--transition-rapide),
                border-color var(--transition-rapide),
                color var(--transition-rapide);
}
.pagination button:hover:not(:disabled) {
    border-color: var(--accent-blue);
    background: rgba(var(--rgb-blue), 0.12);
}
/* Les deux flèches gardent la cible des numéros : seul le glyphe est plus
   grand, pour qu'on voie du premier coup d'œil où l'on tourne les pages. */
.pagination .pagination-fleche { font-size: var(--font-lg); line-height: 1; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button:focus-visible { outline: var(--focus-ring-outline); outline-offset: 2px; }
/* La page courante : c'est le seul bouton plein du pager, on ne peut pas la
   confondre avec une page voisine cliquable. */
.pagination .pagination-page.actif {
    background: rgba(var(--rgb-blue), 0.22);
    border-color: var(--accent-blue);
    color: var(--text-primary); font-weight: var(--font-weight-bold);
}
.pagination .pagination-vide { opacity: 0.5; padding: 0 2px; }
.pagination .pagination-compte {
    flex-basis: 100%; text-align: center; margin-top: var(--space-2);
    font-size: var(--font-sm); color: var(--text-muted); opacity: 0.9;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   14. PETITS ÉCRANS
   --------------------------------------------------------------------------
   La barre latérale et .main-content ne sont PAS traités ici : hub.css les
   définit déjà sous 768 px. Seul ce qui est propre à cette page l'est.
   ========================================================================== */

@media (max-width: 900px) {
    .mur { grid-template-columns: 1fr; }
    .pagination { gap: var(--space-1); }
    .pagination button { min-width: 34px; height: 34px; padding: 0 var(--space-2); font-size: var(--font-sm); }
    .pagination .pagination-compte { font-size: var(--font-xs); }
}

@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .details { grid-template-columns: 1fr; }
    /* Sur une colonne, la flèche du trajet devient une flèche vers le bas :
       elle garde son sens sans suggérer un départ à droite. */
    .trajet { flex-direction: column; }
    .trajet-fleche { justify-content: center; transform: rotate(90deg); }
    .chiffres-grille { grid-template-columns: 1fr; }
    .filtres { padding: var(--space-4); }
}

@media (max-width: 480px) {
    .chiffres-liste { grid-template-columns: 1fr; }
    .filtre { width: 100%; }
    .champ, .champ-recherche { min-width: 100%; }
}

/* ==========================================================================
   15. MOUVEMENT RÉDUIT
   --------------------------------------------------------------------------
   Ce bloc est le DERNIER du fichier : à spécificité égale, il doit gagner
   contre le survol des cartes écrit plus haut. C'est le seul !important de la
   feuille, et il n'existe que pour tenir contre une préférence système.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .livraison, .livraison:hover { transform: none !important; transition: none !important; }
    .btn, .pagination button { transition: none !important; }
}

/* Habillage « route de nuit » (21/10/2026). */
.page-header h1, h1 { font-family: 'Barlow Condensed','Inter',sans-serif; text-transform: uppercase; font-weight: 800; color: var(--text-primary); }
