/* ============================================================
   Fibrix — Suivi des interventions fibre
   Design system : clair professionnel · accent cyan #0891B2
   Typographie : Inter · icônes SVG · micro-animations 150-300ms

   Coque au dessin de Toron (02/09/2026) : le rail sombre à gauche qui range
   les écrans en deux familles, la barre haute qui nomme l'écran ouvert, la
   barre basse à cinq parts égales pour le technicien, la connexion en deux
   panneaux. LES COULEURS RESTENT CELLES DE FIBRIX : le rail est dans le
   cyan de la marque, pas dans le vert de Toron.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* L'attribut hidden doit TOUJOURS gagner, même contre display:flex */
[hidden] { display: none !important; }

:root {
  /* Marque */
  --primaire: #0E7490;         /* cyan-700 : boutons (contraste AAA texte blanc) */
  --primaire-vif: #0891B2;     /* cyan-600 : accents, liens, survols */
  --primaire-clair: #ECFEFF;   /* cyan-50 : fonds teintés */
  --primaire-bord: #A5F3FC;    /* cyan-200 */
  --accent: #22D3EE;           /* cyan-400 : lueurs, indicateur live */

  /* Le rail : la barre latérale de Toron, déclinée dans le cyan de Fibrix.
     Fond cyan très foncé, texte cyan pâle, et la ligne ouverte prend la
     couleur exacte des boutons (--primaire) : c'est la même marque partout. */
  --rail:            #0B3A4A;
  --rail-survol:     #124D61;
  --rail-actif:      #0E7490;
  --rail-texte:      #A5D9E6;
  --rail-texte-vif:  #ECFEFF;
  --rail-section:    #5CA6BC;
  --rail-trait:      #155467;

  /* Neutres */
  --fond: #F8FAFC;
  --surface: #FFFFFF;
  --texte: #0F172A;
  --texte-2: #475569;
  --texte-3: #64748B;
  --bord: #E2E8F0;
  --bord-fort: #CBD5E1;

  /* Les cartes de chiffres : l'ardoise de Toron, qui est déjà la couleur du
     texte de Fibrix (#0F172A). Le chiffre en blanc, le libellé en gris. */
  --ardoise-kpi: #0F172A;

  /* Sémantique */
  --succes: #16A34A;
  --succes-fond: #DCFCE7;
  --succes-texte: #15803D;
  --danger: #DC2626;
  --danger-fond: #FEE2E2;
  --danger-texte: #B91C1C;
  --alerte-fond: #FEF9C3;
  --alerte-survol: #FEF08A;

  /* Effets */
  --ombre-1: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .16);
  --ombre-2: 0 4px 12px rgba(15, 23, 42, .08);
  --ombre-3: 0 16px 40px rgba(15, 23, 42, .16);
  --rayon: 10px;
  --rayon-grand: 16px;
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--fond);
  color: var(--texte);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

svg.icone { width: 18px; height: 18px; flex: none; }
svg.icone-petite { width: 15px; height: 15px; flex: none; }

:focus-visible {
  outline: 2px solid var(--primaire-vif);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Marque ---------- */
.logo-marque {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06B6D4 0%, #0E7490 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(8, 145, 178, .35);
  flex: none;
}
.logo-marque svg { width: 24px; height: 24px; }
.logo-marque img, .logo-connexion img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-connexion img { padding: 8px; }

/* ==========================================================================
   LA COQUE — le rail sombre à gauche, la zone claire à droite.
   Avant : un bandeau blanc et cinq onglets sur une rangée. Le rail les range
   en deux familles (GÉNÉRAL / ADMINISTRATION), garde de la place pour le
   suivant, et laisse toute la largeur au tableau.
   ========================================================================== */
.appli { min-height: 100dvh; display: flex; flex-direction: column; }
/* Deux colonnes seulement là où il y a un rail : l'espace technicien n'en a
   pas, son en-tête reste une bande pleine largeur. Une classe, pas :has(). */
.appli-rail { flex-direction: row; }

/* La case qui ouvre le rail sur téléphone. En CSS pur : un tiroir qui dépend
   du JavaScript est un tiroir qui reste fermé quand le réseau lâche. */
.rail-bascule { position: absolute; opacity: 0; pointer-events: none; }

.rail {
  position: fixed; inset-block: 0; left: 0; z-index: 50;
  width: 264px; flex: 0 0 264px;
  background: var(--rail); color: var(--rail-texte);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}

.rail-marque {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--rail-trait);
}
.rail-marque .logo-marque { width: 38px; height: 38px; border-radius: 10px; }
.rail-marque .marque-nom {
  display: block; color: #fff; font-size: 19px; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.05;
}
.rail-marque .rail-espace {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--accent); line-height: 1.2;
}
.rail-fermer {
  display: none; margin-left: auto; background: none; border: 0;
  color: var(--rail-texte); font-size: 18px; cursor: pointer; padding: 2px 4px;
}

/* La navigation : deux familles, et le nom de la famille au-dessus. */
.rail .onglets {
  position: relative;                      /* la pastille glissante se pose ici */
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px;
}
.rail-groupe {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--rail-section);
  padding: 16px 12px 7px;
}
.rail .rail-groupe:first-child { padding-top: 4px; }

.rail .onglet {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--rayon);
  padding: 10px 12px; min-height: 42px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--rail-texte);
  cursor: pointer; white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.rail .onglet:hover { color: var(--rail-texte-vif); background: var(--rail-survol); }
.rail .onglet.actif { color: #fff; }
.rail .onglet.actif:hover { background: none; }
.rail .onglet svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .78; }
.rail .onglet.actif svg { opacity: 1; }

/* La pastille : elle glisse d'une ligne à l'autre au lieu de s'éteindre et
   de se rallumer. Tant que le script n'est pas passé, le fond de la ligne
   ouverte fait le travail. */
.onglets { position: relative; }
.onglet-trait { position: absolute; pointer-events: none; }
.rail .onglets .onglet-trait {
  left: 10px; right: 10px; top: 0; z-index: 0;
  background: var(--rail-actif); border-radius: var(--rayon);
}
.rail .onglets:not(.trait-mobile) .onglet.actif { background: var(--rail-actif); }

/* Le compteur : ce qui attend une main. */
.onglet-compte {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff;
  border-radius: 99px; font-size: 11px; font-weight: 700;
}
.onglet-compte:empty, .onglet-compte[hidden] { display: none; }

.rail-pied {
  border-top: 1px solid var(--rail-trait);
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.rail-qui { font-size: 11.5px; color: var(--rail-section); }
.rail-qui b { display: block; font-size: 13.5px; color: var(--rail-texte-vif); font-weight: 600; }
.rail-pied .btn {
  background: transparent; color: var(--rail-texte);
  border: 1px solid rgba(255, 255, 255, .18); justify-content: center;
}
.rail-pied .btn:hover {
  background: rgba(255, 255, 255, .09); color: #fff;
  border-color: rgba(255, 255, 255, .3); transform: none; box-shadow: none;
}

/* ---------- La zone ---------- */
.zone { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; }

.barre-haute {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
  padding: 13px 24px;
  display: flex; align-items: center; gap: 16px;
}
.barre-haute h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.barre-haute p { margin: 1px 0 0; font-size: 13px; color: var(--texte-3); }
.barre-fin { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.burger {
  display: none; flex-direction: column; gap: 4px;
  cursor: pointer; padding: 6px; margin-left: -6px;
}
.burger span { display: block; width: 19px; height: 2px; background: var(--texte); border-radius: 2px; }

.rail-voile { display: none; }

.contenu { width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px 24px 70px; flex: 1; }

/* ---------- L'indicateur temps réel ---------- */
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--succes-texte);
  background: var(--succes-fond);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.live .point {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--succes);
  animation: pulsation 1.8s infinite;
}
.live.deconnecte { color: var(--danger-texte); background: var(--danger-fond); }
.live.deconnecte .point { background: var(--danger); animation: none; }
@keyframes pulsation {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  60% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

/* ---------- Le téléphone : le rail devient un tiroir ----------
   Sous 980 px le rail sort du flux et se tire par-dessus la page. Le voile
   qui l'accompagne est un label : cliquer à côté referme, sans JavaScript. */
@media (max-width: 980px) {
  .rail { transform: translateX(-100%); box-shadow: var(--ombre-3); }
  .rail-bascule:checked ~ .rail { transform: none; }
  .rail-bascule:checked ~ .rail-voile {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(15, 23, 42, .45);
  }
  .rail-fermer { display: block; }
  .zone { margin-left: 0; }
  .burger { display: flex; }
  .contenu { padding: 18px 16px 70px; }
  .barre-haute { padding: 11px 16px; }
}
@media (max-width: 620px) {
  .barre-haute p { display: none; }
}

/* ==========================================================================
   L'ESPACE TECHNICIEN — en-tête sombre et barre basse à cinq parts égales.
   Cinq onglets sur une rangée qui glissait : sur un téléphone de 390 px,
   « Mon véhicule » et « Mes documents » n'avaient aucun pixel à l'écran.
   La barre basse règle le problème au lieu de le signaler : cinq parts
   égales, toutes visibles, toutes au pouce.
   ========================================================================== */
.tech-entete {
  background: var(--rail); color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 18px 16px;
}
.tech-haut { display: flex; align-items: center; gap: 12px; max-width: 1400px; margin: 0 auto; }
.tech-haut > div:not(.logo-marque) { min-width: 0; }
.tech-entete .qui {
  font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tech-entete .ou {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--rail-texte); margin-top: 4px;
}
.tech-entete .ou .live {
  background: rgba(255, 255, 255, .08); color: #8FE0AE;
  border: 1px solid rgba(255, 255, 255, .16); padding: 3px 10px; font-size: 12px;
}
.tech-entete .ou .live.deconnecte { color: #FCA5A5; }
.tech-entete .btn-sortie {
  margin-left: auto; background: rgba(255, 255, 255, .1); color: #fff;
  border-color: rgba(255, 255, 255, .18);
}
.tech-entete .btn-sortie:hover {
  background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3);
  transform: none; box-shadow: none;
}

.tech-corps {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 18px 16px calc(86px + env(safe-area-inset-bottom));
}

.onglets.tech-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 0;
  background: var(--rail); border-top: 1px solid var(--rail-trait);
  padding-bottom: env(safe-area-inset-bottom);
}
.tech-bas .onglet {
  position: relative; z-index: 1;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; padding: 9px 4px 10px; min-height: 58px;
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--rail-texte);
  cursor: pointer; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .15s ease;
}
.tech-bas .onglet svg { width: 21px; height: 21px; flex: 0 0 21px; opacity: .7; }
.tech-bas .onglet.actif { color: var(--accent); }
.tech-bas .onglet.actif svg { opacity: 1; }
/* La pastille glissante devient le rail lumineux au-dessus de l'onglet ouvert. */
.tech-bas .onglet-trait {
  top: 0; left: 0; height: 3px; z-index: 0;
  background: var(--accent); border-radius: 0 0 3px 3px;
}
.tech-bas:not(.trait-mobile) .onglet.actif { box-shadow: inset 0 3px 0 var(--accent); }
/* Les messages ne passent pas sous la barre basse. */
body.tech .toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* ---------- Navigation en dossiers (technicien > mois > interventions) ---------- */
.fil-ariane {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.fil-ariane button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--bord);
  color: var(--primaire);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 13px;
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.fil-ariane button:hover { background: var(--primaire-clair); border-color: var(--primaire-bord); }
.fil-ariane .separateur { color: var(--texte-3); }
.fil-ariane .actuel {
  font-weight: 700;
  color: var(--texte);
  padding: 7px 4px;
}

.grille-dossiers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.enveloppe-dossier { position: relative; display: flex; }
.enveloppe-dossier .carte-dossier { flex: 1; }
.btn-export-mois {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 11px;
  min-height: 30px;
  font-size: 11.5px;
  z-index: 2;
}

.carte-dossier {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-grand);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  animation: montee .3s cubic-bezier(.4, 0, .2, 1) backwards;
}
.carte-dossier:hover {
  box-shadow: var(--ombre-2);
  transform: translateY(-2px);
  border-color: var(--primaire-bord);
}
.carte-dossier .icone-dossier {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 11px;
  background: var(--primaire-clair);
  color: var(--primaire);
  display: flex; align-items: center; justify-content: center;
}
.carte-dossier .icone-dossier svg { width: 22px; height: 22px; }
.carte-dossier > span:last-child { min-width: 0; }
.carte-dossier .nom {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carte-dossier .detail {
  display: block;
  font-size: 12px;
  color: var(--texte-3);
  margin-top: 3px;
}
.carte-dossier .puce-nok {
  display: inline-block;
  margin-left: 6px;
  background: var(--danger-fond);
  color: var(--danger-texte);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* ---------- Icônes 3D ---------- */
.icone-3d { width: 26px; height: 26px; vertical-align: middle; flex: none; }
.icone-3d-grande { width: 34px; height: 34px; flex: none; }
.ligne-echeance .icone-3d { width: 24px; height: 24px; margin-right: 7px; }
.ligne-echeance { justify-content: flex-start; gap: 4px; }
.ligne-echeance .jours { margin-left: auto; }
.carte-vehicule .photo .sans-photo img { width: 88px; height: 88px; }
.onglet .icone-3d { width: 22px; height: 22px; }

/* ---------- Pastilles opérateur et matériel ---------- */
.pastille.op-Free { background: #FEE2E2; color: #B91C1C; }
.pastille.op-Bouygues { background: #DBEAFE; color: #1D4ED8; }
.pastille.op-Orange { background: #FFEDD5; color: #C2410C; }
.pastille.op-SFR { background: #FCE7F3; color: #BE185D; }
.pastille.stock-ok { background: var(--succes-fond); color: var(--succes-texte); }
.pastille.stock-bas { background: var(--alerte-fond); color: #A16207; }
.pastille.stock-vide { background: var(--danger-fond); color: var(--danger-texte); }
.pastille.mat-ONU { background: #E0E7FF; color: #4338CA; }
.pastille.mat-KIT { background: #CCFBF1; color: #0F766E; }

/* ---------- Parc de véhicules ---------- */
.grille-vehicules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.carte-vehicule {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-grand);
  overflow: hidden;
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--transition), transform var(--transition);
  animation: montee .3s cubic-bezier(.4, 0, .2, 1) backwards;
}
.carte-vehicule:hover { box-shadow: var(--ombre-2); transform: translateY(-2px); }
.carte-vehicule .photo {
  height: 150px;
  background: var(--fond);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--bord);
  position: relative;
}
.carte-vehicule .photo img { width: 100%; height: 100%; object-fit: cover; }
.carte-vehicule .photo .sans-photo { color: var(--bord-fort); }
.carte-vehicule .photo .sans-photo svg { width: 46px; height: 46px; }
.carte-vehicule .corps { padding: 14px 16px 16px; }
.carte-vehicule .modele {
  font-size: 16px; font-weight: 800; letter-spacing: -.01em;
}
.carte-vehicule .immat {
  display: inline-block;
  margin-top: 5px;
  font-family: "Consolas", monospace;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--fond);
  border: 1px solid var(--bord-fort);
  border-radius: 6px;
  padding: 2px 9px;
}
.carte-vehicule .tech {
  font-size: 12.5px; color: var(--texte-3); margin-top: 7px;
  display: flex; align-items: center; gap: 6px;
}
.carte-vehicule .echeances { margin-top: 11px; display: flex; flex-direction: column; gap: 5px; }
.ligne-echeance {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 7px;
}
.ligne-echeance .jours { font-weight: 700; }
.ech-ok { background: var(--succes-fond); color: var(--succes-texte); }
.ech-bientot { background: var(--alerte-fond); color: #A16207; }
.ech-depasse { background: var(--danger-fond); color: var(--danger-texte); }

.badge-etat {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: var(--ombre-1);
}
.badge-etat.ok { background: var(--succes); color: #fff; }
.badge-etat.bientot { background: #F59E0B; color: #fff; }
.badge-etat.depasse { background: var(--danger); color: #fff; }
.badge-etat.inconnu { background: var(--bord-fort); color: var(--texte-2); }

.actions-vehicule {
  display: flex; gap: 7px; margin-top: 13px; flex-wrap: wrap;
}
.actions-vehicule .btn { flex: 1; min-height: 38px; font-size: 12.5px; padding: 7px 10px; }

.apercu-photo { margin-top: 12px; }
/* Photo prise par le technicien, en vignette dans la liste des dossiers */
td.cellule-photo { text-align: center; }
.lien-photo {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--primaire); background: #ECFEFF; border: 1px solid #A5F3FC;
  text-decoration: none;
}
.lien-photo:hover { background: #CFFAFE; }
.lien-photo { cursor: pointer; font-family: inherit; }

/* Photos d'un dossier (jusqu'à 5) dans le formulaire */
.photos-dossier {
  margin-top: 4px; padding: 12px; border-radius: 12px;
  border: 1px dashed var(--bord-fort); background: var(--fond, #F8FAFC);
}
.photos-entete {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; margin-bottom: 10px;
}
.photos-compte { font-size: 12px; color: var(--texte-3); font-weight: 600; }
.photos-grille {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
}
.photos-vide { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--texte-3); }
.photo-vignette { position: relative; aspect-ratio: 1; }
.photo-voir {
  display: block; width: 100%; height: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; background: #E2E8F0;
}
.photo-voir img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-retirer {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px;
  border-radius: 50%; border: 2px solid #fff; background: #DC2626; color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.photos-boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-bouton { flex: 1; min-width: 150px; justify-content: center; cursor: pointer; font-size: 13px; }
.photo-bouton.desactive { opacity: .45; }

/* Visionneuse plein écran */
.galerie-voile {
  position: fixed; inset: 0; z-index: 2000; background: rgba(2, 6, 23, .94);
  display: flex; align-items: center; justify-content: center;
}
.galerie-voile[hidden] { display: none; }
.galerie-voile img {
  max-width: calc(100vw - 32px); max-height: calc(100vh - 110px);
  object-fit: contain; border-radius: 8px;
}
.galerie-haut {
  position: absolute; top: 0; left: 0; right: 0; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; color: #fff; font-size: 14px; font-weight: 600;
}
.galerie-compte { flex: 1; }
.galerie-ouvrir { color: #67E8F9; font-size: 13px; }
.galerie-fermer, .galerie-fleche {
  border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.galerie-fermer { width: 40px; height: 40px; font-size: 18px; }
.galerie-fleche {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; font-size: 32px; line-height: 1;
}
.galerie-fleche[hidden] { display: none; }
.galerie-fleche.gauche { left: 12px; }
.galerie-fleche.droite { right: 12px; }
.apercu-photo img {
  max-width: 100%; max-height: 180px;
  border-radius: 10px; border: 1px solid var(--bord);
}

.facultatif {
  font-weight: 500;
  font-size: 11px;
  color: var(--texte-3);
}
.info-stock {
  margin-top: 12px;
  padding: 9px 13px;
  border-radius: 9px;
  background: var(--primaire-clair);
  border: 1px solid var(--primaire-bord);
  color: var(--primaire);
  font-size: 12.5px;
  font-weight: 600;
}
.info-stock:empty { display: none; }
.info-stock.alerte {
  background: var(--danger-fond);
  border-color: #FCA5A5;
  color: var(--danger-texte);
}
.mini-photo {
  width: 34px; height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--bord);
  cursor: pointer;
}

.libelle-champ {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-2);
}
.montant { font-variant-numeric: tabular-nums; font-weight: 700; }
.pastille.paye { background: var(--succes-fond); color: var(--succes-texte); }
.pastille.attente { background: var(--alerte-fond); color: #A16207; }
.pastille.avance { background: #FEF3C7; color: #B45309; }
.pastille.remboursement { background: var(--succes-fond); color: var(--succes-texte); }
.stat.solde-positif { border-left: 4px solid #F59E0B; }
.stat.solde-nul { border-left: 4px solid var(--succes); }

/* ---------- Statistiques ----------
   Les cartes de chiffres en ardoise, comme Toron : le chiffre en blanc, le
   libellé en gris, et seule la VALEUR prend une couleur (vert ce qui va,
   ambre ce qui attend). La carte, elle, reste sobre. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--ardoise-kpi);
  color: #fff;
  border: 1px solid var(--ardoise-kpi);
  border-radius: var(--rayon-grand);
  padding: 16px 17px 15px;
  box-shadow: var(--ombre-1);
  animation: montee .3s cubic-bezier(.4, 0, .2, 1) backwards;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat:hover { box-shadow: var(--ombre-2); transform: translateY(-1px); }
.stat:nth-child(2) { animation-delay: .04s; }
.stat:nth-child(3) { animation-delay: .08s; }
.stat:nth-child(4) { animation-delay: .12s; }
.stat:nth-child(5) { animation-delay: .16s; }
.stat:nth-child(6) { animation-delay: .20s; }
.stat:nth-child(7) { animation-delay: .24s; }
@keyframes montee {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat .valeur {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.stat .libelle {
  font-size: 11.5px;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 5px;
  display: flex; align-items: center; gap: 6px;
}
.stat .libelle::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.stat.ok .libelle::before { background: #4ADE80; }
.stat.ok .valeur { color: #4ADE80; }
.stat.nok .libelle::before { background: #FBBF24; }
.stat.nok .valeur { color: #FBBF24; }
.stat.sav .libelle::before { background: #F59E0B; }
.stat.sav .valeur { color: #FBBF24; }
.stat.solde-positif { border-left: 4px solid #F59E0B; }
.stat.solde-nul { border-left: 4px solid #4ADE80; }

/* ---------- Barre d'actions ---------- */
.barre-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtres input, .filtres select {
  padding: 9px 12px;
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--texte);
  min-height: 40px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filtres input:hover, .filtres select:hover { border-color: var(--primaire-vif); }
.filtres input:focus, .filtres select:focus {
  outline: none;
  border-color: var(--primaire-vif);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}

.champ-recherche { position: relative; }
.champ-recherche svg {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--texte-3);
  pointer-events: none;
}
.champ-recherche input { padding-left: 34px; min-width: 240px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--ombre-2); }
.btn:active { transform: scale(.97); box-shadow: none; }

.btn-principal { background: var(--primaire); color: #fff; }
.btn-principal:hover { background: var(--primaire-vif); }
.btn-vert { background: var(--succes); color: #fff; }
.btn-vert:hover { background: #15803D; }
.btn-bleu { background: #1D4ED8; color: #fff; }
.btn-bleu:hover { background: #2563EB; }
.btn-orange { background: #C2410C; color: #fff; }
.btn-orange:hover { background: #EA580C; }
.btn-discret {
  background: var(--surface);
  color: var(--texte-2);
  border: 1px solid var(--bord-fort);
}
.btn-discret:hover { background: var(--fond); color: var(--texte); }
.btn-sortie {
  background: var(--surface);
  color: var(--texte-2);
  border: 1px solid var(--bord-fort);
  padding: 8px 12px;
}
.btn-sortie:hover { color: var(--danger-texte); border-color: var(--danger); background: var(--danger-fond); }

.btn-editer, .btn-danger {
  background: transparent;
  padding: 7px;
  min-height: 34px;
  min-width: 34px;
  border-radius: 7px;
  box-shadow: none;
}
.btn-editer { color: var(--primaire-vif); }
.btn-editer:hover { background: var(--primaire-clair); transform: none; box-shadow: none; }
.btn-danger { color: var(--texte-3); }
.btn-danger:hover { background: var(--danger-fond); color: var(--danger-texte); transform: none; box-shadow: none; }

/* ---------- Tableau ---------- */
.carte-tableau {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-grand);
  overflow: hidden;
  box-shadow: var(--ombre-1);
}
.tableau-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: var(--fond);
  color: var(--texte-3);
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--bord);
  position: sticky;
  top: 0;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  white-space: nowrap;
  transition: background var(--transition);
}
tbody td.remarque { white-space: normal; max-width: 300px; color: var(--texte-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primaire-clair); }
tbody tr.ligne-nok td { background: var(--alerte-fond); }
tbody tr.ligne-nok:hover td { background: var(--alerte-survol); }

.pastille {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.pastille.PLP { background: #DBEAFE; color: #1D4ED8; }
.pastille.RACC { background: #EDE9FE; color: #6D28D9; }
.pastille.SAV { background: var(--succes-fond); color: var(--succes-texte); }
.pastille.BRASSAGE { background: #FEF3C7; color: #B45309; }
.pastille.OK { background: var(--succes-fond); color: var(--succes-texte); }
.pastille.NOK { background: var(--danger-fond); color: var(--danger-texte); }
.pastille.typo { background: #F1F5F9; color: var(--texte-2); font-weight: 600; }

.etat-vide { text-align: center; padding: 56px 20px; color: var(--texte-3); }
.etat-vide svg { width: 52px; height: 52px; color: var(--bord-fort); margin-bottom: 12px; }
.etat-vide p:first-of-type { font-size: 16px; font-weight: 600; color: var(--texte-2); margin-bottom: 6px; }
.pied-tableau {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--texte-3);
  border-top: 1px solid var(--bord);
  background: var(--fond);
}

/* ---------- Modale ---------- */
.voile {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fondu .2s ease;
}
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.modale {
  background: var(--surface);
  border-radius: var(--rayon-grand);
  padding: 26px;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--ombre-3);
  animation: apparitionModale .22s cubic-bezier(.4, 0, .2, 1);
}
@keyframes apparitionModale {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modale h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 9px;
}
.modale h2 svg { color: var(--primaire-vif); }

.grille-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.grille-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texte-2);
}
.grille-form input, .grille-form select, .grille-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--texte);
  background: var(--surface);
  min-height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.grille-form input:focus, .grille-form select:focus, .grille-form textarea:focus {
  outline: none;
  border-color: var(--primaire-vif);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}
.pleine-largeur { grid-column: 1 / -1; }
.boutons-modale { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--texte);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--ombre-3);
  animation: apparitionToast .25s cubic-bezier(.4, 0, .2, 1);
  max-width: 380px;
  border-left: 4px solid var(--accent);
}
.toast.succes { border-left-color: var(--succes); }
.toast.erreur { background: var(--danger); border-left-color: #FCA5A5; }
@keyframes apparitionToast {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Page de connexion ----------
   Deux panneaux, comme Toron : à gauche ce que fait Fibrix, à droite les
   portes. La moitié sombre donne au premier écran la même identité que le
   rail de l'espace employeur — on reconnaît le logiciel avant d'être entré. */
.page-connexion { background: var(--fond); }
.ecran-connexion {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.cx-vitrine {
  position: relative; overflow: hidden;
  background: var(--rail); color: var(--rail-texte-vif);
  display: flex; align-items: center;
  padding: 48px clamp(28px, 5vw, 72px);
}
/* Une lueur très basse, pour que le cyan ne soit pas un aplat mort. */
.cx-vitrine::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(90% 60% at 15% 0%, rgba(34, 211, 238, .18), transparent 60%),
    radial-gradient(70% 50% at 90% 100%, rgba(8, 145, 178, .22), transparent 60%);
  pointer-events: none;
}
.cx-vitrine-dedans { position: relative; z-index: 1; max-width: 480px; }

.cx-marque { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.cx-marque .logo-marque { width: 48px; height: 48px; border-radius: 13px; animation: cx-tourne 1.5s cubic-bezier(.34, 1.3, .5, 1) .25s both; }
.cx-marque .marque-nom { display: block; color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.cx-marque .marque-sous { display: block; font-size: 12px; color: var(--rail-section); margin-top: 3px; }
@keyframes cx-tourne {
  from { transform: perspective(600px) rotateY(-95deg); opacity: 0; }
  to   { transform: perspective(600px) rotateY(0);      opacity: 1; }
}

.cx-vitrine h1 {
  font-size: clamp(30px, 4vw, 44px); font-weight: 800;
  line-height: 1.08; letter-spacing: -.025em; color: #fff;
}
.cx-pitch {
  margin: 16px 0 30px; font-size: 15.5px; line-height: 1.55;
  color: var(--rail-texte); max-width: 42ch;
}
.cx-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.cx-points li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14.5px; color: var(--rail-texte-vif);
}
.cx-points i {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px;
  background: var(--f); box-shadow: 0 0 0 4px color-mix(in srgb, var(--f) 26%, transparent);
}
/* Le fil : une lueur qui parcourt une fibre. Deux éléments, zéro image. */
.cx-fil {
  margin-top: 42px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--rail-trait) 12%, var(--rail-trait) 88%, transparent);
  position: relative; overflow: hidden;
}
.cx-fil span {
  position: absolute; top: 0; bottom: 0; width: 120px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: cx-passe 4.8s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes cx-passe {
  0%   { transform: translateX(-140px); opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(560px); opacity: 0; }
}
.cx-pied { margin: 26px 0 0; font-size: 12.5px; color: var(--rail-section); }

.connexion {
  display: flex; flex-direction: column; justify-content: center;
  padding: 44px clamp(20px, 4vw, 56px);
  overflow-y: auto;
}
.cx-titre { margin-bottom: 22px; }
.cx-titre h2 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.cx-titre p { margin: 4px 0 0; color: var(--texte-3); font-size: 14.5px; }

.cartes-espaces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  max-width: 620px;
  perspective: 1200px;
}
.carte-espace {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-grand);
  padding: 24px 22px 22px;
  box-shadow: var(--ombre-1);
  text-align: left;
  transform-style: preserve-3d;
  transition: box-shadow .28s cubic-bezier(.2, .7, .3, 1), transform .28s cubic-bezier(.2, .7, .3, 1), border-color var(--transition);
  animation: montee .4s cubic-bezier(.4, 0, .2, 1) backwards;
}
.carte-espace:nth-child(1) { animation-delay: .15s; }
.carte-espace:nth-child(2) { animation-delay: .22s; }
/* La carte visée s'incline vers le lecteur et se soulève — sans bibliothèque. */
.carte-espace:hover { transform: perspective(1200px) rotateX(1.4deg) translateY(-3px); border-color: var(--primaire-bord); }
.carte-espace:focus-within {
  box-shadow: var(--ombre-3);
  transform: perspective(1200px) rotateX(2.2deg) translateY(-5px) scale(1.004);
}
/* La bague de couleur en tête de carte : cyan pour le terrain, violet pour le bureau. */
.carte-espace::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.carte-espace.terrain::before { background: var(--primaire-vif); }
.carte-espace.bureau::before  { background: #6D28D9; }

.carte-espace .icone-espace {
  width: 46px; height: 46px;
  margin: 0 0 12px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
}
.carte-espace .icone-espace svg { width: 24px; height: 24px; }
.icone-espace.technicien { background: var(--primaire-clair); color: var(--primaire); }
.icone-espace.employeur { background: #EDE9FE; color: #6D28D9; }
.carte-espace h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.carte-espace p { font-size: 13px; color: var(--texte-3); margin-bottom: 16px; min-height: 38px; }
.carte-espace form { display: flex; flex-direction: column; gap: 10px; }
.carte-espace input {
  padding: 12px;
  border: 1.5px solid var(--bord-fort);
  border-radius: 10px;
  font-size: 17px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 3px;
  font-weight: 600;
  min-height: 48px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.carte-espace input::placeholder { letter-spacing: 0; font-weight: 400; font-size: 14px; }
.carte-espace input:focus {
  outline: none;
  border-color: var(--primaire-vif);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}
.carte-espace .btn { width: 100%; min-height: 46px; font-size: 14.5px; }
.lien-apk {
  margin-top: 22px;
  font-size: 13px;
  color: var(--texte-3);
  max-width: 620px;
}
.lien-apk a {
  color: var(--primaire);
  font-weight: 700;
  text-decoration: none;
}
.lien-apk a:hover { text-decoration: underline; }

.message-erreur {
  margin-top: 18px;
  background: var(--danger-fond);
  color: var(--danger-texte);
  font-weight: 600;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 10px;
  display: inline-block;
  animation: apparitionToast .25s ease;
}

/* Sous 900 px les deux panneaux s'empilent : la vitrine devient un bandeau
   court en tête, et les portes prennent tout le reste. Un technicien qui
   ouvre l'application à 7 h veut son clavier, pas une affiche. */
@media (max-width: 900px) {
  .ecran-connexion { grid-template-columns: 1fr; }
  .cx-vitrine { padding: 24px 20px 22px; align-items: flex-start; }
  .cx-vitrine-dedans { max-width: none; width: 100%; }
  .cx-marque { margin-bottom: 16px; }
  .cx-vitrine h1 { font-size: clamp(22px, 6.4vw, 30px); }
  .cx-pitch { margin: 10px 0 0; font-size: 14px; }
  .cx-points, .cx-fil, .cx-pied { display: none; }
  .connexion { padding: 22px 18px 40px; justify-content: flex-start; }
  .cartes-espaces, .lien-apk { max-width: none; }
}

/* ---------- Bandeau technicien (modale) ---------- */
.bandeau-technicien {
  background: var(--primaire-clair);
  border: 1px solid var(--primaire-bord);
  color: var(--primaire);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bandeau-technicien .verrou {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-3);
  background: var(--surface);
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: auto;
}

/* ---------- Gestion des techniciens ---------- */
.aide { font-size: 13px; color: var(--texte-3); margin-bottom: 16px; }
.ligne-ajout { display: flex; gap: 8px; margin-bottom: 16px; }
.ligne-ajout input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--bord-fort);
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
  min-height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ligne-ajout input:focus {
  outline: none;
  border-color: var(--primaire-vif);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}
.table-techniciens th { font-size: 11px; padding: 9px 12px; }
.table-techniciens td { padding: 9px 12px; }
.code-technicien {
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 15px;
  font-weight: 700;
  background: var(--primaire-clair);
  color: var(--primaire);
  border: 1px dashed var(--primaire-bord);
  padding: 3px 11px;
  border-radius: 7px;
  letter-spacing: 2px;
}

/* ---------- Adaptatif ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .grille-form { grid-template-columns: 1fr; }
  .contenu, .tech-corps { padding-left: 12px; padding-right: 12px; }
  .tech-entete { padding-left: 14px; padding-right: 14px; }
  .tech-entete .qui { font-size: 19px; }
  .btn { min-height: 44px; }
  .filtres input, .filtres select { min-height: 44px; width: 100%; }
  .champ-recherche { width: 100%; }
  .champ-recherche input { min-width: 0; }
  .filtres { width: 100%; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .btn-editer, .btn-danger { min-height: 44px; min-width: 44px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .rail .onglet { min-height: 46px; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Bandeau de période d'essai ---------- */
.bandeau-essai {
  max-width: 1400px;
  margin: 16px auto -4px;
  padding: 11px 18px;
  border-radius: var(--rayon);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
}
@media (max-width: 720px) { .bandeau-essai { margin: 12px 12px -2px; } }
.bandeau-essai.info {
  background: var(--primaire-clair);
  border: 1px solid var(--primaire-bord);
  color: var(--primaire);
}
.bandeau-essai.bientot {
  background: var(--alerte-fond);
  border: 1px solid #FDE047;
  color: #A16207;
}
.bandeau-essai.expire {
  background: var(--danger-fond);
  border: 1px solid #FCA5A5;
  color: var(--danger-texte);
}

/* ---------- Documents des techniciens (AIPR, habilitation, carte pro…) ---------- */
.bloc-documents { margin-bottom: 26px; }
.bloc-documents h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--texte-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--bord);
}
.bloc-documents h3 svg { color: var(--primaire-vif); }
.bloc-documents h3 .compteur {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  background: var(--primaire-clair);
  color: var(--primaire);
  border: 1px solid var(--primaire-bord);
  border-radius: 999px;
  padding: 2px 9px;
}

.grille-documents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 13px;
}

.carte-document {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-grand);
  padding: 15px;
  box-shadow: var(--ombre-1);
  transition: box-shadow var(--transition), transform var(--transition);
  animation: montee .3s cubic-bezier(.4, 0, .2, 1) backwards;
}
.carte-document:hover { box-shadow: var(--ombre-2); transform: translateY(-2px); }

.carte-document .haut { display: flex; align-items: flex-start; gap: 11px; }
.carte-document .icone-doc {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 11px;
  background: var(--primaire-clair);
  color: var(--primaire);
  display: flex; align-items: center; justify-content: center;
}
.carte-document .titres { min-width: 0; flex: 1; }
.carte-document .type {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.3;
}
.carte-document .titres .libelle {
  display: block;
  font-size: 12.5px;
  color: var(--texte-3);
  margin-top: 1px;
}
/* La pastille du parc véhicules est positionnée en absolu sur la photo :
   dans une carte document elle reprend sa place dans le flux. */
.carte-document .haut .badge-etat {
  position: static;
  flex: none;
  align-self: flex-start;
  white-space: nowrap;
}

.infos-document {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--fond);
  border-radius: 9px;
  padding: 10px 12px;
}
.infos-document dt {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--texte-3);
}
.infos-document dd {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texte);
  font-variant-numeric: tabular-nums;
}
.infos-document .jours { font-size: 11.5px; font-weight: 600; }

.remarque-document {
  font-size: 12.5px;
  color: var(--texte-2);
  border-left: 3px solid var(--bord-fort);
  padding-left: 9px;
}
.fichier-document {
  font-size: 11.5px;
  color: var(--texte-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-document {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 3px;
}
.actions-document .btn { padding: 7px 13px; min-height: 36px; font-size: 12.5px; }
.actions-document a.btn { text-decoration: none; }

/* Partenaire (donneur d'ordre) : teinte ardoise, neutre à côté des opérateurs */
.pastille.partenaire {
  background: #E2E8F0;
  color: #334155;
  border: 1px solid var(--bord-fort);
}

/* Heure du dossier : posée automatiquement (heure de France), non modifiable */
input.champ-fige,
input.champ-fige:focus {
  background: #f1f3f5;
  color: #5b6470;
  cursor: not-allowed;
  box-shadow: none;
}
