/* ==========================================================
   v3.91 — Présentation « CHIPNKE » + mode clair / sombre
   Chargé APRÈS style.css : redéfinit les couleurs (variables) et la forme du menu, de la
   barre du haut, des cartes, boutons et pastilles. Le choix clair/sombre et cuivre/doré est
   posé sur <html> par theme.js (data-theme, data-accent) et mémorisé sur chaque appareil.
   ========================================================== */

/* ---------- Mode clair ---------- */
:root {
  --papier: #F4F5F7;
  --papier-carte: #FFFFFF;
  --fond-menu: #FFFFFF;
  --ligne: #E3E5E8;
  --asphalte-900: #1D2125;
  --asphalte-800: #1D2125;
  --asphalte-700: #2A3036;
  --asphalte-600: #626F7A;
  --survol: #F0F1F3;
  --fond-champ: #FFFFFF;
  --fond-neutre: #ECEEF0;

  --teal: #1E9E55;
  --teal-fond: rgba(30, 158, 85, 0.12);
  --alerte: #D64545;
  --alerte-fond: #FDECEC;
  --bleu-kpi: #2F80ED;
  --orange-kpi: #E2952E;
  --violet-kpi: #7B61FF;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-body);
  --radius: 8px;
  --radius-lg: 10px;
  --ombre-xs: none;
  --ombre-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --ombre-md: 0 6px 18px rgba(0, 0, 0, 0.12);
  --ombre-lg: 0 18px 40px rgba(0, 0, 0, 0.28);
  --ombre-or: none;

  --acc: #C2693B;
  --acc-fonce: #A9572C;
  --acc-pale: rgba(194, 105, 59, 0.12);
  --acc-clair: #E3A27E;
}
:root[data-accent="dore"] { --acc: #B8892E; --acc-fonce: #94701F; --acc-pale: rgba(184, 137, 46, 0.14); --acc-clair: #E3C47F; }

/* ---------- Mode sombre ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --papier: #16191C;
  --papier-carte: #1E2226;
  --fond-menu: #1A1D20;
  --ligne: #2C3136;
  --asphalte-900: #E6E8EA;
  --asphalte-800: #E6E8EA;
  --asphalte-700: #D3D7DB;
  --asphalte-600: #9AA3AC;
  --survol: #262B30;
  --fond-champ: #24292E;
  --fond-neutre: #2A2F34;

  --teal: #3DD68C;
  --teal-fond: rgba(61, 214, 140, 0.14);
  --alerte: #F06464;
  --alerte-fond: #3A1E20;
  --bleu-fond: rgba(76, 154, 255, 0.14);
  --bleu-kpi: #4C9AFF;
  --orange-kpi: #F2A33A;
  --violet-kpi: #9A86FF;

  --ombre-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --ombre-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --ombre-lg: 0 18px 40px rgba(0, 0, 0, 0.6);

  --acc: #D27A4A;
  --acc-fonce: #E08C5E;
  --acc-pale: rgba(210, 122, 74, 0.16);
  --acc-clair: #EBA67F;
}
:root[data-theme="dark"][data-accent="dore"] { --acc: #D4A84B; --acc-fonce: #E2BC66; --acc-pale: rgba(212, 168, 75, 0.16); --acc-clair: #E8CC8A; }

/* La couleur principale remplace l'ancien ambre partout (menus, liens, traits actifs). */
:root, :root[data-theme="dark"] {
  --ambre: var(--acc);
  --ambre-fonce: var(--acc);
  --ambre-clair: var(--acc-clair);
  --principale: var(--acc);
  --principale-fonce: var(--acc-fonce);
  --principale-pale: var(--acc-pale);
  --degrade-or: var(--acc);
  --texte: var(--asphalte-900);
  --texte-doux: var(--asphalte-600);
  --trait: var(--ligne);
  --fond: var(--fond-menu);
}
:root { --bleu-info: var(--bleu-kpi); }

html, body { background: var(--papier); color: var(--asphalte-900); transition: background .2s, color .2s; }

/* ---------- Barre du haut ---------- */
.topbar {
  background: var(--fond-menu);
  border-bottom: 1px solid var(--ligne);
  align-items: center;
  padding: 12px 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar::after { display: none; }
.topbar h1 { border-left: 0; padding-left: 0; font-size: 22px; font-weight: 700; letter-spacing: 0; }
.topbar-right { align-items: center; gap: 10px; }
.topbar-meta { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 13px; }
.topbar-user {
  font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600;
  color: var(--asphalte-900); border: 1px solid var(--ligne); border-radius: 20px; padding: 6px 14px;
}

.btn-rond {
  appearance: none; cursor: pointer; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--ligne); color: var(--asphalte-900);
  display: inline-grid; place-items: center; transition: background .15s;
}
.btn-rond:hover { background: var(--survol); }
.btn-rond svg { width: 18px; height: 18px; }
.btn-theme .ico-soleil { display: none; }
:root[data-theme="dark"] .btn-theme .ico-soleil { display: block; }
:root[data-theme="dark"] .btn-theme .ico-lune { display: none; }
.btn-menu-mobile { background: transparent; border: 1px solid var(--ligne); color: var(--asphalte-900); }

/* ---------- Menu de gauche : groupes en majuscules, icônes au trait ---------- */
.sidebar { width: 236px; background: var(--fond-menu); border-right: 1px solid var(--ligne); }
.brand { border-bottom: 1px solid var(--ligne); }
.nav { gap: 6px; }
.nav-group-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; opacity: 1; padding: 8px 10px 4px; }
.nav-item { font-size: 14px; font-weight: 500; color: var(--asphalte-900); padding: 9px 12px; gap: 12px; border-radius: 8px; }
.nav-item:hover { background: var(--survol); color: var(--asphalte-900); }
.nav-item.active { background: var(--acc-pale); color: var(--acc); font-weight: 700; }
.nav-item.active::before { display: block; background: var(--acc); }
.nav-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: currentColor; }
.nav-ico svg { width: 19px; height: 19px; }

.sidebar-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--ligne); }
.choix-couleur { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--asphalte-600); flex-wrap: wrap; }
.choix-couleur button {
  appearance: none; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 14px; background: transparent; border: 1px solid var(--ligne); color: var(--asphalte-900);
}
.choix-couleur button.on { background: var(--acc); border-color: var(--acc); color: #fff; }

/* ---------- Barre du bas (téléphone) ---------- */
.bottom-nav { background: var(--fond-menu); border-top: 1px solid var(--ligne); box-shadow: none; }
.bottom-nav .nav-item { color: var(--asphalte-600); font-size: 11px; font-weight: 500; }
.bottom-nav .nav-item:hover { background: transparent; }
.bottom-nav .nav-item.active { background: transparent; color: var(--acc); font-weight: 700; }
.bottom-nav .nav-icone svg { width: 22px; height: 22px; display: block; }

/* ---------- Cartes : bordure fine, coins arrondis, pas d'ombre ---------- */
.card, .accordion-group, .fleet-card {
  background: var(--papier-carte);
  border: 1px solid var(--ligne);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.stat-card { border-left: 4px solid var(--c); padding: 16px 20px; }
.stat-card .stat-value { color: var(--c); font-size: 28px; }
.stat-card .stat-icon { background: color-mix(in srgb, var(--c) 16%, transparent); }
.stat-mini { background: var(--papier); }

/* ---------- Boutons ---------- */
.btn { font-size: 13.5px; padding: 8px 16px; border-radius: 8px; }
.btn-primary { background: var(--acc); color: #fff; box-shadow: none; border-radius: 20px; }
.btn-primary:hover { background: var(--acc-fonce); transform: none; box-shadow: none; }
.btn-secondary { background: var(--survol); color: var(--asphalte-900); border: 1px solid var(--ligne); box-shadow: none; }
.btn-secondary:hover { background: var(--fond-neutre); transform: none; }
.btn-ghost { color: var(--bleu-kpi); }
.btn-danger:hover { background: var(--alerte-fond); filter: brightness(.95); }

/* ---------- Champs ---------- */
select, input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input[type="tel"], input[type="search"], input[type="email"], textarea {
  background: var(--fond-champ); color: var(--asphalte-900); border-color: var(--ligne); border-radius: 8px;
}

/* ---------- Fenêtres ---------- */
.modal { border: 1px solid var(--ligne); border-top: 3px solid var(--acc); box-shadow: var(--ombre-lg); }
.modal h2 { font-weight: 700; }
.modal table { border-color: var(--ligne); }
tbody tr:hover { background: var(--survol); }

/* ---------- Bandeaux d'alerte (style CHIPNKE : rouge bordé) ---------- */
.essai-banner { background: var(--acc-pale); color: var(--asphalte-900); border-bottom: 1px solid var(--ligne); }
#alertes-echeances-banner, .essai-banner.essai-urgent {
  background: var(--alerte-fond); color: var(--alerte);
  border: 1px solid color-mix(in srgb, var(--alerte) 40%, transparent); border-top: 0;
  border-radius: 0 0 10px 10px; margin: 0 20px;
}
#alertes-echeances-banner .btn, .essai-banner .essai-banner-btn { background: var(--acc); color: #fff; border-radius: 16px; border: 0; }
#suspension-payer-message.suspension-succes { background: var(--teal-fond); color: var(--teal); }
.message-ephemere { background: #262B30; color: #E6E8EA; }

/* ---------- Pastilles d'état ---------- */
.badge-maintenance, .badge-en_attente, .badge-emise, .badge-etat-grace { background: color-mix(in srgb, var(--orange-kpi) 18%, transparent); color: var(--orange-kpi); }
.badge-validee_client { background: color-mix(in srgb, var(--orange-kpi) 26%, transparent); color: var(--orange-kpi); }
.badge-reforme, .badge-cloture { background: var(--fond-neutre); color: var(--asphalte-600); }
.fleet-photo, .chart-track, .detail-photo, .detail-video { background: var(--fond-neutre); }

/* ---------- Éléments de page CHIPNKE (Parc matériel, puis autres listes) ---------- */
.page-entete { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-entete-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpis-parc { margin-bottom: 16px; }
.kpis-parc .stat-card .stat-icon { display: none; }

.pastilles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pastilles-titre { color: var(--asphalte-600); font-size: 13px; margin-right: 2px; }
.pastille {
  appearance: none; cursor: pointer; font: inherit; font-size: 13.5px;
  background: var(--papier-carte); color: var(--asphalte-900);
  border: 1px solid var(--ligne); border-radius: 20px; padding: 6px 14px;
}
.pastille b { margin-left: 4px; }
.pastille:hover { background: var(--survol); }
.pastille.on { border-color: var(--acc); color: var(--acc); background: var(--acc-pale); }
.legende-couleurs { display: inline-flex; gap: 14px; flex-wrap: wrap; color: var(--asphalte-600); font-size: 12.5px; margin-left: 8px; }
.legende-couleurs i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.recherche-large {
  display: flex; align-items: center; gap: 12px;
  background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 10px;
  padding: 10px 16px; margin: 6px 0 10px; color: var(--asphalte-600);
}
.recherche-large input { flex: 1; border: 0 !important; background: var(--papier) !important; border-radius: 6px; padding: 8px 10px; }

.index-lettres { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 4px 16px; font-weight: 700; font-size: 13px; }
.index-lettres a { color: var(--bleu-kpi); text-decoration: none; }
.index-lettres a:hover { text-decoration: underline; }
.index-lettres span { color: var(--asphalte-600); opacity: .4; }

.separateur-lettre { display: flex; align-items: center; gap: 10px; color: var(--asphalte-600); font-size: 13px; margin: 6px 0 10px; scroll-margin-top: 80px; }
.separateur-lettre b { color: var(--bleu-kpi); font-size: 16px; }
.separateur-lettre::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }

.grille-cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.carte-vehicule {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--papier-carte); border: 1px solid var(--ligne); border-left: 4px solid var(--teal);
  border-radius: 10px; padding: 12px 14px; transition: background .15s, border-color .15s;
}
.carte-vehicule:hover { background: var(--survol); }
.carte-vehicule.etat-rouge { border-left-color: var(--alerte); }
.carte-vehicule.etat-orange { border-left-color: var(--orange-kpi); }
.carte-vehicule-photo { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--fond-neutre); flex: none; }
.carte-vehicule-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-vehicule-corps { min-width: 0; }
.carte-vehicule-titre { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte-vehicule-meta { color: var(--asphalte-600); font-size: 12.5px; margin: 2px 0 6px; }
.carte-vehicule-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Zones qui restent sombres dans les deux modes (vitrine, console) ---------- */
.fleet-photo-upload:hover, .crew-avatar-upload:hover { background: #1B1F23; }
.superadmin-screen { background: linear-gradient(180deg, #1B1F23 0%, #15181B 100%); color: #E6E8EA; }
.vitrine-hero-card { background: linear-gradient(160deg, #262B31, #1B1F23); }
.vitrine-hero-card-topbar { background: #333A42; }
.vitrine-benefices { background: #262B31; }
.vitrine-formules { background: #1B1F23; }
.vitrine-formule { background: #262B31; }
.vitrine-formule-featured { background: linear-gradient(160deg, #333A42, #262B31); }
.vitrine-cta-finale { background: linear-gradient(160deg, #14171A 0%, #1B1F23 100%); }
.vitrine-footer { background: #1B1F23; }
.login-brand-panel, .vitrine-hero { background: linear-gradient(160deg, #14171A 0%, #1B1F23 55%, #22262B 100%); }

/* ---------- Écrans moyens et téléphone ---------- */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grille-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .topbar { padding: 8px 12px; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px; }
  .topbar > div:first-child { align-items: center !important; min-width: 0; }
  .topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { flex-wrap: nowrap !important; width: auto !important; margin: 0 !important; gap: 8px; }
  .topbar-user, .topbar-meta { display: none !important; }
  #alertes-echeances-banner, .essai-banner.essai-urgent { margin: 0 8px; }
  .grid-5 { grid-template-columns: 1fr 1fr; }
  .grille-cartes { grid-template-columns: 1fr; }
  .legende-couleurs { margin-left: 0; }
  .index-lettres { gap: 10px; }
  .page-entete { justify-content: stretch; }
  .page-entete-actions { width: 100%; }
  .page-entete-actions .btn { flex: 1; }
}

/* Impression : toujours sur fond blanc */
@media print {
  :root, :root[data-theme="dark"] { --papier: #fff; --papier-carte: #fff; --asphalte-900: #000; --asphalte-600: #444; --ligne: #ccc; }
}

/* ---------- v3.92 : journal des activités ---------- */
.table-journal td { vertical-align: top; }
.journal-details { color: var(--asphalte-600); font-size: 12px; margin-top: 3px; max-width: 520px; overflow-wrap: anywhere; }
.journal-refus td { background: var(--alerte-fond); }
.journal-barre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.journal-filtres { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.journal-filtres > * { width: auto !important; flex: 1 1 150px; margin: 0; }
.journal-filtres > input[type="search"] { flex: 2 1 220px; }

/* ---------- v3.93 : page Équipe (modèle CHIPNKE) ---------- */
.grille-membres { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.carte-membre { background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 16px 18px; }
.carte-membre-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.carte-membre-tete strong { font-size: 16px; }
.carte-membre-role { color: var(--asphalte-600); font-size: 12.5px; }
.pastille-points { background: color-mix(in srgb, var(--alerte) 16%, transparent); color: var(--alerte); font-weight: 700; border-radius: 16px; padding: 4px 12px; font-size: 13px; white-space: nowrap; }
.carte-membre-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ligne); }
.carte-membre-chiffres span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--asphalte-600); }
.carte-membre-chiffres b { font-size: 22px; }
.carte-membre-chiffres b.petit { font-size: 13px; }
.carte-membre-pied { padding-top: 10px; font-size: 12.5px; color: var(--asphalte-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-equipe td { vertical-align: middle; }
.table-equipe select { width: auto; min-width: 200px; }
.petit-gris { color: var(--asphalte-600); font-size: 12px; margin-top: 2px; }
.membre-inactif td { opacity: .6; }
.badge-role { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--fond-neutre); color: var(--asphalte-600); }
.badge-role-admin { background: color-mix(in srgb, var(--alerte) 16%, transparent); color: var(--alerte); }
.actions-equipe { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-action { appearance: none; cursor: pointer; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; background: transparent; border: 1px solid; white-space: nowrap; }
.btn-action-bleu { color: var(--bleu-kpi); border-color: color-mix(in srgb, var(--bleu-kpi) 50%, transparent); }
.btn-action-violet { color: var(--violet-kpi); border-color: color-mix(in srgb, var(--violet-kpi) 50%, transparent); }
.btn-action-rouge { color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 50%, transparent); }
.btn-action-vert { color: #fff; background: var(--teal); border-color: var(--teal); }
.btn-action:hover { filter: brightness(1.15); background: var(--survol); }
.btn-action-vert:hover { background: var(--teal); }
/* v3.94 */
.membre-attente td { background: color-mix(in srgb, var(--orange-kpi) 8%, transparent); }
.badge-role-attente { background: color-mix(in srgb, var(--orange-kpi) 18%, transparent); color: var(--orange-kpi); }
.numero-pris { border: 1px solid color-mix(in srgb, var(--alerte) 40%, transparent); background: var(--alerte-fond); color: var(--asphalte-900); border-radius: 10px; padding: 12px 14px; margin: 6px 0 10px; font-size: 13.5px; }
/* v3.95 */
.badge-role-ok { background: var(--teal-fond); color: var(--teal); }

/* ==========================================================
   v3.99 — MODÈLE « SECTIONS DÉPLIABLES » (réutilisé page par page)
   entete-page : ligne compacte collée en haut ; bande-chiffres : chiffres courts ;
   section-depliable : bloc qui se replie ; ligne-depliable : une ligne qui s'ouvre au clic.
   ========================================================== */
.entete-page { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0 10px; margin: -8px 0 12px; background: var(--papier); border-bottom: 1px solid var(--ligne); }
.entete-page select, .entete-page input { width: auto !important; border-radius: 18px !important; padding: 6px 12px !important; font-size: 13px; }
.entete-info { color: var(--asphalte-600); font-size: 12.5px; margin-left: auto; }
.bande-chiffres { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.chiffre-court { flex: 1 0 140px; background: var(--papier-carte); border: 1px solid var(--ligne); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 14px; }
.chiffre-court span { display: block; font-size: 12px; color: var(--asphalte-600); }
.chiffre-court b { display: block; font-size: 19px; color: var(--c); white-space: nowrap; }
.chiffre-court small { color: var(--asphalte-600); font-size: 11.5px; }
details.section-depliable { background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
details.section-depliable > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-weight: 700; font-size: 15px; }
details.section-depliable > summary::-webkit-details-marker { display: none; }
details.section-depliable > summary:hover { background: var(--survol); }
details.section-depliable[open] > summary { border-bottom: 1px solid var(--ligne); }
.section-chevron { color: var(--asphalte-600); font-size: 18px; line-height: 1; transition: transform .2s; display: inline-block; }
details[open] > summary .section-chevron { transform: rotate(90deg); }
.section-apercu { font-weight: 500; font-size: 13px; color: var(--asphalte-600); }
.section-compte { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--fond-neutre); color: var(--asphalte-600); border-radius: 10px; padding: 2px 9px; }
.section-texte { padding: 12px 16px; line-height: 1.7; font-size: 13.5px; }
.section-note { margin-top: 6px; font-size: 12px; color: var(--asphalte-600); }
details.ligne-depliable { border-bottom: 1px solid var(--ligne); }
details.ligne-depliable:last-child { border-bottom: 0; }
details.ligne-depliable > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 18px; align-items: center; gap: 12px; padding: 10px 16px; border-left: 3px solid var(--c); }
details.ligne-depliable > summary::-webkit-details-marker { display: none; }
details.ligne-depliable > summary:hover { background: var(--survol); }
.ligne-nom strong { display: block; }
.ligne-nom small { color: var(--asphalte-600); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-montant { text-align: right; font-weight: 800; color: var(--c); white-space: nowrap; }
.ligne-jauge small { display: block; text-align: right; color: var(--asphalte-600); font-size: 11.5px; margin-top: 3px; }
.mini-jauge { display: block; height: 8px; background: var(--fond-neutre); border-radius: 4px; overflow: hidden; }
.mini-jauge i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.ligne-chevron { color: var(--asphalte-600); font-size: 18px; transition: transform .2s; }
details.ligne-depliable[open] .ligne-chevron { transform: rotate(90deg); }
.ligne-detail { padding: 6px 16px 14px 19px; background: var(--survol); border-left: 3px solid var(--c); }
.grille-detail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0; }
.grille-detail div { background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; }
.grille-detail span { display: block; color: var(--asphalte-600); font-size: 11.5px; }
.grille-detail b.moins { color: var(--alerte); }
.phrase-detail { margin: 8px 0; color: var(--asphalte-600); font-size: 13px; }
/* v4.00 — Tableau de bord : ligne dépliable sans jauge, listes de détail, barres du parc. */
.entete-titre { font-size: 15px; }
details.ligne-simple > summary { grid-template-columns: minmax(0, 1fr) auto 18px; }
.liste-detail { list-style: none; margin: 4px 0 10px; padding: 0; font-size: 13.5px; line-height: 1.9; }
.liste-detail small { color: var(--asphalte-600); }
.barres-parc { display: grid; grid-template-columns: 130px minmax(0, 1fr) 40px; gap: 8px 12px; align-items: center; }
.barres-parc b { text-align: right; }
.section-texte .bande-chiffres { margin-bottom: 10px; }
/* v4.01 — Page Contrats : recherche dans l'en-tête, bouton à droite, étiquette Location / Voyage. */
.entete-page input.entete-recherche { flex: 1 1 240px; width: auto !important; }
.entete-action { margin-left: auto; }
.etiquette-type { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 8px; background: var(--fond-neutre); color: var(--asphalte-600); font-size: 11px; font-weight: 600; vertical-align: 1px; }
details.ligne-depliable > summary .ligne-nom strong { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .entete-page { top: 0; }
  .entete-info { margin-left: 0; width: 100%; }
  details.ligne-depliable > summary { grid-template-columns: minmax(0, 1fr) 96px 18px; }
  .ligne-jauge { display: none; }
  details.ligne-simple > summary { grid-template-columns: minmax(0, 1fr) auto 18px; }
  .barres-parc { grid-template-columns: 100px minmax(0, 1fr) 32px; }
  /* v4.00 — Téléphone : les 4 chiffres en 2 × 2 au lieu de défiler ; l'aperçu d'une section
     passe sous son titre au lieu de le couper. */
  .bande-chiffres { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .chiffre-court { padding: 9px 12px; }
  .entete-page input.entete-recherche { flex-basis: 100%; }
  .entete-page select { flex: 1 1 auto; }
  .chiffre-court b { font-size: 17px; }
  details.section-depliable > summary { flex-wrap: wrap; row-gap: 2px; }
  details.section-depliable > summary .section-apercu { order: 3; flex-basis: 100%; padding-left: 28px; }
  .grille-detail { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================
   v4.02 — Barre du haut regroupée : cloche des rappels, menu du compte, pastille de rôle,
   bandeaux restants sur une seule ligne fine ; boutons du haut des pages sur une ligne.
   ========================================================== */
.topbar > div:first-child { align-items: center !important; gap: 10px; min-width: 0; }
.pastille-role { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: var(--fond-neutre); color: var(--asphalte-600); white-space: nowrap; cursor: help; }
.pastille-role.superviseur { background: var(--teal-fond); color: var(--teal); }
.cloche-zone, .menu-compte { position: relative; }
.btn-cloche { position: relative; }
.cloche-compte { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--alerte); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.cloche-compte.cloche-compte-calme { background: var(--orange-kpi); }
.cloche-panneau, .menu-compte-liste { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 12px; box-shadow: var(--ombre-md); overflow: hidden; }
.cloche-panneau { width: 320px; max-width: calc(100vw - 24px); }
.cloche-rappel { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--ligne); font-size: 13.5px; font-weight: 600; color: var(--asphalte-900); }
.cloche-rappel:first-child { border-top: 0; }
.cloche-rappel small { display: block; font-weight: 400; font-size: 12px; color: var(--asphalte-600); margin-top: 2px; }
.cloche-rappel .btn { margin-top: 8px; padding: 5px 12px; font-size: 12.5px; min-height: 0; }
.cloche-point { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--orange-kpi); }
.cloche-rappel.urgent .cloche-point { background: var(--alerte); }
.cloche-vide { padding: 14px; font-size: 13px; color: var(--asphalte-600); }
button.topbar-user { cursor: pointer; background: transparent; }
button.topbar-user::after { content: ' ▾'; color: var(--asphalte-600); }
button.topbar-user:hover { background: var(--survol); }
.menu-compte-liste { width: 230px; display: flex; flex-direction: column; padding: 6px 0; }
.menu-compte-liste .btn { justify-content: flex-start; text-align: left; border: 0; border-radius: 0; padding: 9px 14px; width: 100%; }
.menu-compte-liste #btn-logout { color: var(--alerte); }
.menu-compte-role { padding: 6px 14px 8px; font-size: 12px; color: var(--asphalte-600); border-bottom: 1px solid var(--ligne); margin-bottom: 4px; }
.cloche-panneau.hidden, .menu-compte-liste.hidden { display: none; }
/* Bandeaux restants (délai de grâce, visite super-admin) : une ligne fine. */
.essai-banner, .impersonation-banner { padding: 6px 16px !important; font-size: 12.5px !important; gap: 10px !important; min-height: 0 !important; }
.essai-banner .btn, .impersonation-banner .btn { padding: 3px 10px !important; font-size: 12px !important; min-height: 0 !important; }
#alertes-echeances-banner, #rappel-sauvegarde-banner, #consultation-banner { display: none !important; }
/* Console super-admin : actions en haut. */
.superadmin-haut { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.superadmin-haut #btn-superadmin-logout { margin-left: auto; }
/* Ligne d'actions en haut des pages : recherche + « Importer ▾ » + « + Ajouter ». */
.barre-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.barre-actions input[type=search] { flex: 1 1 260px; width: auto !important; border-radius: 18px !important; padding: 8px 14px !important; }
.barre-actions .barre-compte { color: var(--asphalte-600); font-size: 12.5px; white-space: nowrap; }
.barre-actions .barre-droite { display: flex; gap: 8px; margin-left: auto; }
.menu-importer { position: relative; }
.menu-importer-liste { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; background: var(--papier-carte); border: 1px solid var(--ligne); border-radius: 12px; box-shadow: var(--ombre-md); padding: 6px 0; }
.menu-importer-liste.hidden { display: none; }
.menu-importer-liste .btn { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 9px 14px; font-weight: 600; min-height: 0; }
.menu-importer-liste .btn small { display: block; font-weight: 400; font-size: 12px; color: var(--asphalte-600); }
.menu-importer-liste .btn:hover { background: var(--survol); }
@media (max-width: 900px) {
  /* Téléphone : nom/mot de passe/déconnexion sont déjà dans le menu ☰ (sauf chauffeur). */
  body:not([data-role="chauffeur"]) .menu-compte { display: none; }
  .topbar { flex-wrap: nowrap !important; }
  .topbar > div:first-child { flex: 1 1 auto; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { width: auto !important; flex: none; }
  .pastille-role { font-size: 11px; padding: 2px 8px; }
  .barre-actions input[type=search] { flex-basis: 100%; }
  .barre-actions .barre-droite { margin-left: 0; flex: 1 1 100%; }
  .barre-actions .barre-droite > * { flex: 1 1 0; }
  .barre-actions .barre-droite .btn, .menu-importer > .btn { width: 100%; }
}
@media (max-width: 900px) { .barre-actions .barre-compte { display: none; } }
@media (max-width: 900px) { .menu-importer-liste { left: 0; right: auto; width: min(280px, calc(100vw - 32px)); } }
/* v4.03 — Boîtiers GPS du parc (page Suivi GPS). */
.bloc-boitiers-gps { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 18px; }
.bloc-boitiers-gps > div:first-child { flex: 1 1 280px; }
.bloc-boitiers-gps-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rapport-gps { margin-bottom: 10px; }
.table-rapport-gps td { vertical-align: top; font-size: 13px; }
.case-gps { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: normal; margin: 12px 0 0; }
.case-gps input { width: auto; }
@media (max-width: 900px) { .bloc-boitiers-gps-actions, .bloc-boitiers-gps-actions .btn { width: 100%; } }
/* v4.04 — Page Factures : boutons d'une facture ouverte, lignes « qui nous doit ». */
.actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-ligne .btn { background: var(--papier-carte); border: 1px solid var(--ligne); }
.ligne-client { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--ligne); border-left: 3px solid var(--alerte); }
.ligne-client:first-child { border-top: 0; }
.ligne-client span { flex: 1; min-width: 0; }
.ligne-client small { display: block; color: var(--asphalte-600); font-size: 12px; }
.ligne-client b { color: var(--alerte); white-space: nowrap; }
/* v4.05 — Page Parc matériel : petite photo dans la ligne, pastilles de type compactes. */
.ligne-avec-photo { display: flex !important; align-items: center; gap: 10px; min-width: 0; }
.ligne-avec-photo img { width: 46px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--ligne); flex: none; background: var(--fond-neutre); }
.ligne-avec-photo > span { min-width: 0; }
.ligne-avec-photo small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pastilles-type { margin-bottom: 12px; }
@media (max-width: 900px) {
  .pastilles-type { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .pastilles-type .pastille { flex: none; }
  .ligne-avec-photo img { width: 38px; height: 28px; }
}
.bande-chiffres.rapport-gps { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); overflow: visible; }
/* v4.06 — Page Chauffeurs : photo ronde dans la ligne, classement replié. */
.ligne-avec-photo img.photo-ronde { width: 36px; height: 36px; border-radius: 50%; }
#section-classement .section-texte { line-height: normal; }
.actions-ligne a.btn { text-decoration: none; }
/* v4.07 — Suivi GPS : état de chaque camion (en route, à l'arrêt, hors ligne). */
.pastille-etat-gps { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.entete-page a.btn { text-decoration: none; }
/* v4.08 — Récupération depuis WhatsGPS : tableau de vérification. */
.table-recuperation { min-width: 860px; font-size: 13px; }
.table-recuperation td { vertical-align: middle; }
.table-recuperation input[type=text], .table-recuperation select { width: 100%; min-width: 110px; font-size: 13px; padding: 6px 8px; }
.table-recuperation input[type=checkbox] { width: auto; }
.etiquette-action { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; background: var(--teal-fond); color: var(--teal); }
.etiquette-action.relier { background: color-mix(in srgb, var(--bleu-kpi) 14%, transparent); color: var(--bleu-kpi); }
.modal.modal-large { width: min(1120px, calc(100vw - 24px)) !important; max-width: none !important; }
/* v4.17 — Cartes grises et chauffeurs : aperçu croisé et contrôle des dossiers. */
.pastille-etat { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 8px; font-size: 11.5px; font-weight: 600; }
.pastille-etat.ok { background: var(--teal-fond); color: var(--teal); }
.pastille-etat.av { background: rgba(226, 149, 46, 0.15); color: var(--orange-kpi); }
.pastille-etat.nv { background: rgba(47, 128, 237, 0.13); color: var(--bleu-kpi); }
.pastille-etat.ko { background: var(--alerte-fond); color: var(--alerte); }
.liste-dossiers { border: 1px solid var(--ligne); border-radius: 10px; overflow: hidden; background: var(--papier-carte); }
.ligne-dossier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; padding: 10px 14px; border-top: 1px solid var(--ligne); border-left: 3px solid var(--c); align-items: start; }
.ligne-dossier:first-child, .ligne-controle:first-child { border-top: 0; }
.ligne-dossier small, .ligne-controle small { display: block; color: var(--asphalte-600); font-size: 12px; }
.ligne-dossier select { margin-top: 5px; width: 100%; font-size: 12.5px; padding: 5px 8px; }
.ligne-dossier select.a-trancher { border-color: var(--orange-kpi); }
.ligne-controle { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 9px 14px; border-top: 1px solid var(--ligne); border-left: 3px solid var(--c); cursor: pointer; }
.ligne-controle:hover { background: var(--survol); }
.marques-controle { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 700px) {
  .ligne-dossier { grid-template-columns: 1fr; gap: 6px; }
}
/* v4.18 — Voyages : lignes du formulaire « Nouveau chargement », virements et primes. */
.ligne-chargement { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px 36px; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--ligne); border-left: 3px solid var(--c); align-items: start; }
.ligne-chargement:first-child { border-top: 0; }
.ligne-chargement input { width: 100%; }
.ligne-chargement small { display: block; color: var(--asphalte-600); font-size: 12px; margin-top: 3px; }
.ligne-chargement .pastille-etat { margin-right: 4px; }
.ligne-virement { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.ligne-virement small { display: block; color: var(--asphalte-600); font-size: 12px; }
.section-contenu > .ligne-virement { padding: 9px 16px; }
@media (max-width: 700px) {
  .ligne-chargement { grid-template-columns: minmax(0, 1fr) 36px; }
  .ligne-chargement > div:nth-child(2), .ligne-chargement > div:nth-child(3) { grid-column: 1 / 2; }
  .ligne-chargement > button { grid-column: 2; grid-row: 1; }
}
/* v4.19 — Voyages à valider : bouton « Valider les N » d'un chargement. */
.ligne-groupe-valider { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--ligne); background: var(--alerte-fond); }
.actions-ligne .btn.btn-primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.actions-ligne .btn.btn-primary:hover { background: var(--acc-fonce); }
/* v4.20 — Espace chauffeur : carte « Ma mission ». */
.carte-mission { background: var(--papier-carte); border: 1px solid var(--ligne); border-left: 4px solid var(--bleu-kpi); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.carte-mission-etat { font-size: 11.5px; font-weight: 700; color: var(--bleu-kpi); letter-spacing: .02em; }
.carte-mission-trajet { font-size: 17px; font-weight: 700; margin: 3px 0; }
.carte-mission-ligne { font-size: 13px; color: var(--asphalte-600); }
.carte-mission-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.carte-mission-chiffres > div { background: var(--fond-neutre); border-radius: 8px; padding: 6px 9px; }
.carte-mission-chiffres small { display: block; font-size: 11px; color: var(--asphalte-600); }
.carte-mission-chiffres b { font-size: 15px; }
.carte-mission-large { grid-column: span 2; }
/* v4.24 — Fiche véhicule : genre et attelage. */
.bloc-attelage { background: var(--survol); border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.bloc-attelage .field { margin-bottom: 8px; }

/* v4.27 — Genre d'un poids lourd à côté de son nom (Tracteur, Camion porteur). */
.etiquette-genre { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 7px; font-size: 11px; font-weight: 600; font-style: normal; vertical-align: 1px; color: var(--asphalte-600); background: color-mix(in srgb, var(--asphalte-600) 14%, transparent); }

/* v4.28 — Onglets « Véhicules / Remorques » du parc matériel. */
.onglets-parc { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--ligne); }
.onglet-parc { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 10px 16px; font: inherit; font-weight: 600; color: var(--asphalte-600); cursor: pointer; }
.onglet-parc b { margin-left: 4px; font-weight: 700; }
.onglet-parc.on { color: var(--acc); border-bottom-color: var(--acc); }
@media (max-width: 600px) { .onglet-parc { flex: 1; padding: 10px 8px; } }

/* v4.33 — Facture du gasoil : trombone, étiquette « Facture manquante · Joindre », petit formulaire. */
.facture-gasoil { color: var(--bleu-info); font-size: 12.5px; text-decoration: none; word-break: break-all; }
.facture-gasoil:hover { text-decoration: underline; }
.facture-manquante { display: inline-block; font: inherit; font-size: 12px; line-height: 1.3; padding: 3px 9px; border-radius: 999px;
  border: 1px solid #d9822b; background: rgba(217,130,43,.10); color: #e08a2e; cursor: pointer; text-align: left; }
span.facture-manquante { cursor: default; }
button.facture-manquante:hover { background: rgba(217,130,43,.22); }
.joindre-facture { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; padding: 6px 0; }
.joindre-facture .field { margin: 0; text-align: left; }
.joindre-facture label { font-style: normal; }
.ligne-joindre-facture td { white-space: normal; }
@media (min-width: 601px) { table.table-pleins-gasoil th, table.table-pleins-gasoil td { padding: 10px 8px; } table.table-pleins-gasoil td.cellule-actions .btn { margin-left: 0; padding-left: 6px; padding-right: 6px; } }
.table-pleins-gasoil .sur-tel { display: none; }
@media (max-width: 600px) { .table-pleins-gasoil .sur-ordi { display: none; } .table-pleins-gasoil .sur-tel { display: inline; } }

/* v4.35 — Carte : qui roule et pourquoi. */
.qui-roule { padding: 12px 16px; margin-bottom: 16px; }
.qui-roule-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.qui-roule-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--ligne); flex-wrap: wrap; }
.qui-roule-droite { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.qui-roule-etiquette { font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.qui-roule-etiquette.ok { background: rgba(30,158,85,.14); color: #1E9E55; }
.qui-roule-etiquette.alerte { background: rgba(214,69,69,.14); color: #D64545; font-weight: 600; }
.qui-roule-etiquette.neutre { background: var(--fond-neutre, rgba(138,147,156,.15)); color: var(--asphalte-600); }
.gps-pt.gps-mission { box-shadow: 0 0 0 3px #1E9E55, 0 1px 4px rgba(0,0,0,.45); }
.gps-pt.gps-sans-mission { box-shadow: 0 0 0 3px #D64545, 0 1px 4px rgba(0,0,0,.45); }
.gps-type { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-style: normal; font-size: 11px; line-height: 1; }
.gps-popup-sans-mission { color: #D64545; font-weight: 600; }
@media (max-width: 600px) { .qui-roule-droite { margin-left: 0; } }
.case-ligne { display: flex !important; gap: 8px; align-items: center; font-size: 13px !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; margin: 4px 0; color: var(--texte); }
.case-ligne input { width: auto !important; }
/* v4.35 — Téléphone : les boutons du haut des pages passent à la ligne au lieu de sortir de l'écran. */
@media (max-width: 900px) {
  .barre-actions .barre-droite { flex-wrap: wrap; }
  .barre-actions .barre-droite > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .barre-actions .barre-droite .btn { white-space: normal; }
}
/* v4.36 — Page Rapports. */
.rapport-choix { padding: 18px 20px; margin-bottom: 16px; }
.rapports-raccourcis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.rapports-raccourcis .btn { white-space: normal; text-align: left; }
/* v4.42 — Cases du Suivi GPS cliquables. */
button.gps-carte-chiffre { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; appearance: none; }
button.gps-carte-chiffre:hover { box-shadow: 0 0 0 1px var(--c) inset; }
button.gps-carte-chiffre.actif { box-shadow: 0 0 0 2px var(--c) inset; }
