/* ==========================================================================
   Ododo, design tokens
   Source de vérité pour apps/erp/public/style.css (copier tel quel en tête).
   Conçu pour la projection en amphithéâtre : base 20 px en 1920 × 1080,
   contrastes AA minimum (AAA sur le texte courant).
   ========================================================================== */
:root {
  /* --- Couleurs de marque (SPEC 4.4) --- */
  --od-nuit: #1F2A44;          /* texte, barre de navigation */
  --od-vert: #30A083;          /* couleur du logo, remplissages, focus */
  --od-vert-clair: #3CC7A3;    /* survols, surbrillance ligne agent */
  --od-fond: #F4F6F8;          /* fond de page */
  --od-ambre: #FFB547;         /* alertes */

  /* --- Dérivés (choix de lisibilité, pas de nouvelle couleur de marque) --- */
  --od-vert-fonce: #1F7A62;    /* boutons principaux et liens : 5,2:1 sur blanc (#30A083 ne fait que 3,2:1) */
  --od-vert-fonce-survol: #17644F;
  --od-vert-pale: #E3F6EF;     /* fonds de blocs « agent » */
  --od-ligne-nouvelle: rgba(60, 199, 163, 0.30);
  --od-ambre-pale: #FFF4E0;
  --od-ambre-texte: #7A4B00;   /* 6,6:1 sur ambre pâle */
  --od-rouge: #C2382F;         /* défectueux, suppression : 5,4:1 sur blanc */
  --od-rouge-pale: #FDE6E3;

  /* --- Neutres --- */
  --od-blanc: #FFFFFF;
  --od-texte: var(--od-nuit);          /* 14,3:1 */
  --od-texte-doux: #4A5468;            /* 7,6:1, libellés et textes secondaires */
  --od-texte-pale: #6B7385;            /* 4,8:1, mentions, jamais pour un chiffre */
  --od-bordure: #D5DAE2;
  --od-bordure-forte: #B4BCC9;
  --od-zebra: #F8F9FB;
  --od-survol: #EEF8F4;

  /* --- Statuts des devis (texte / fond), toujours avec une pastille, jamais la couleur seule --- */
  --od-st-brouillon: #475467;  --od-st-brouillon-fond: #E9ECF1;
  --od-st-valide: #1F55B8;     --od-st-valide-fond: #E3ECFB;
  --od-st-envoye: #0B6577;     --od-st-envoye-fond: #DDF2F6;
  --od-st-accepte: #1A6B4F;    --od-st-accepte-fond: #DDF3EA;
  --od-st-refuse: #B42318;     --od-st-refuse-fond: #FDE4E1;
  --od-st-transforme: #FFFFFF; --od-st-transforme-fond: #1F2A44;
  /* Statuts des commandes */
  --od-st-en-cours: #7A4B00;   --od-st-en-cours-fond: #FFF1D6;
  --od-st-livree: #0B6577;     --od-st-livree-fond: #DDF2F6;
  --od-st-facturee: #1A6B4F;   --od-st-facturee-fond: #DDF3EA;
  /* État du parc */
  --od-eq-ok: #1A6B4F;          --od-eq-ok-fond: #DDF3EA;
  --od-eq-defectueux: #B42318;  --od-eq-defectueux-fond: #FDE4E1;
  --od-eq-maintenance: #7A4B00; --od-eq-maintenance-fond: #FFF1D6;

  /* --- Typographie --- */
  --od-police: "Nunito", "Segoe UI", system-ui, sans-serif;
  /* Base fluide : 16 px sur mobile, 18 px vers 1280, 20 px en 1920. */
  --od-base: clamp(16px, 0.42vw + 12px, 20px);
  --od-t-xs: 0.8rem;    /* 16 px : en-têtes de tableau, mentions */
  --od-t-s: 0.9rem;     /* 18 px : textes secondaires */
  --od-t-m: 1rem;       /* 20 px : texte courant, cellules */
  --od-t-l: 1.2rem;     /* 24 px : chiffres clés, titres de carte */
  --od-t-xl: 1.6rem;    /* 32 px : titres de section */
  --od-t-xxl: 2.2rem;   /* 44 px : titre de page */
  --od-t-hero: 2.8rem;  /* 56 px : HT net d'une formule, podium */
  --od-graisse-normale: 500;
  --od-graisse-forte: 700;
  --od-graisse-titre: 800;
  --od-interligne: 1.45;

  /* --- Espacements (base 4 px, exprimés en rem pour suivre la base) --- */
  --od-e-1: 0.2rem;   /* 4 */
  --od-e-2: 0.4rem;   /* 8 */
  --od-e-3: 0.6rem;   /* 12 */
  --od-e-4: 0.8rem;   /* 16 */
  --od-e-5: 1.2rem;   /* 24 */
  --od-e-6: 1.6rem;   /* 32 */
  --od-e-7: 2.4rem;   /* 48 */
  --od-e-8: 3.2rem;   /* 64 */
  --od-cellule-v: 0.9rem;   /* padding vertical des cellules : tableaux aérés */
  --od-cellule-h: 1rem;
  --od-largeur-max: 1760px;
  --od-nav-hauteur: 4.4rem; /* 88 px */

  /* --- Rayons --- */
  --od-r-s: 6px;
  --od-r-m: 10px;
  --od-r-l: 16px;
  --od-r-pilule: 999px;

  /* --- Ombres --- */
  --od-ombre-1: 0 1px 2px rgba(31, 42, 68, 0.06), 0 1px 3px rgba(31, 42, 68, 0.10);
  --od-ombre-2: 0 4px 12px rgba(31, 42, 68, 0.10);
  --od-ombre-3: 0 16px 40px rgba(31, 42, 68, 0.22);
  --od-focus: 0 0 0 4px rgba(48, 160, 131, 0.45);

  /* --- Animations --- */
  --od-duree-surbrillance: 8s; /* ligne créée par l'agent */
}
/* ==========================================================================
   Ododo, feuille de style de référence (à placer après tokens.css)
   Classes en français, une classe par composant, modificateurs en --.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--od-base); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--od-police); font-weight: var(--od-graisse-normale); line-height: var(--od-interligne);
  color: var(--od-texte); background: var(--od-fond);
}
a { color: var(--od-vert-fonce); font-weight: var(--od-graisse-forte); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--od-vert-fonce-survol); }
:focus-visible { outline: none; box-shadow: var(--od-focus); border-radius: var(--od-r-s); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: var(--od-graisse-titre); letter-spacing: -0.01em; }
h1 { font-size: var(--od-t-xxl); }
h2 { font-size: var(--od-t-xl); }
h3 { font-size: var(--od-t-l); }
.chiffre, td.num, th.num, .montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.num { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.discret { color: var(--od-texte-doux); }
.petit { font-size: var(--od-t-s); }
.code { font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: var(--od-graisse-forte); letter-spacing: 0.02em; }

/* ---------- Barre de navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10; background: var(--od-nuit); color: #fff;
  display: flex; align-items: center; gap: var(--od-e-7); height: var(--od-nav-hauteur);
  padding: 0 var(--od-e-7);
}
.nav__logo { display: flex; align-items: center; height: 100%; }
.nav__logo img { height: 2.6rem; width: auto; display: block; }
.nav__menu { display: flex; gap: var(--od-e-2); margin: 0; padding: 0; list-style: none; height: 100%; }
.nav__lien {
  display: flex; align-items: center; height: 100%; padding: 0 var(--od-e-5);
  color: #fff; text-decoration: none; font-size: var(--od-t-m); font-weight: var(--od-graisse-forte);
  border-bottom: 5px solid transparent; border-top: 5px solid transparent; opacity: 0.85;
}
.nav__lien:hover { color: #fff; opacity: 1; border-bottom-color: rgba(60, 199, 163, 0.5); }
.nav__lien--actif { opacity: 1; border-bottom-color: var(--od-vert-clair); }
.nav__droite { margin-left: auto; display: flex; align-items: center; gap: var(--od-e-5); font-size: var(--od-t-s); }
.nav__veille { display: flex; align-items: center; gap: var(--od-e-2); color: #C9D2E3; }
.nav__veille strong { color: #fff; }
.nav__utilisateur {
  display: flex; align-items: center; gap: var(--od-e-2); padding: var(--od-e-2) var(--od-e-4) var(--od-e-2) var(--od-e-2);
  border-radius: var(--od-r-pilule); background: rgba(255, 255, 255, 0.10); font-weight: var(--od-graisse-forte);
}
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--od-vert-clair); color: var(--od-nuit); font-weight: var(--od-graisse-titre); font-size: var(--od-t-s);
}
.nav__burger { display: none; }

/* ---------- Mise en page ---------- */
.page { flex: 1; width: 100%; max-width: var(--od-largeur-max); margin: 0 auto; padding: var(--od-e-7) var(--od-e-7) var(--od-e-8); }
.page--large { max-width: none; }
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--od-e-6); margin-bottom: var(--od-e-6); flex-wrap: wrap; }
.entete-page__sous-titre { margin: var(--od-e-2) 0 0; font-size: var(--od-t-l); color: var(--od-texte-doux); font-weight: 600; }
.fil { font-size: var(--od-t-s); color: var(--od-texte-doux); margin-bottom: var(--od-e-3); font-weight: 600; }
.fil a { font-weight: var(--od-graisse-forte); }
.grille { display: grid; gap: var(--od-e-6); }
.grille--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grille--1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section { margin-top: var(--od-e-7); }
.section__titre { display: flex; align-items: baseline; gap: var(--od-e-4); margin-bottom: var(--od-e-4); }
.section__titre .discret { font-size: var(--od-t-m); font-weight: 600; }

/* ---------- Carte ---------- */
.carte { background: var(--od-blanc); border: 1px solid var(--od-bordure); border-radius: var(--od-r-l); box-shadow: var(--od-ombre-1); padding: var(--od-e-6); }
.carte--sans-marge { padding: 0; overflow: hidden; }
.carte__titre { font-size: var(--od-t-l); font-weight: var(--od-graisse-titre); margin: 0 0 var(--od-e-4); display: flex; align-items: center; gap: var(--od-e-3); }

/* ---------- Boutons (libellés sobres, jamais d'humour) ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--od-e-2);
  min-height: 3rem; padding: 0 var(--od-e-5); border-radius: var(--od-r-m); border: 2px solid transparent;
  font: inherit; font-size: var(--od-t-m); font-weight: var(--od-graisse-titre); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.bouton svg { width: 1.2em; height: 1.2em; flex: none; }
.bouton--principal { background: var(--od-vert-fonce); color: #fff; }
.bouton--principal:hover { background: var(--od-vert-fonce-survol); color: #fff; }
.bouton--secondaire { background: var(--od-blanc); color: var(--od-nuit); border-color: var(--od-nuit); }
.bouton--secondaire:hover { background: var(--od-survol); color: var(--od-nuit); }
.bouton--danger { background: var(--od-blanc); color: var(--od-rouge); border-color: var(--od-rouge); }
.bouton--danger:hover { background: var(--od-rouge-pale); color: var(--od-rouge); }
.bouton--danger-plein { background: var(--od-rouge); color: #fff; }
.bouton--fantome { background: transparent; color: var(--od-vert-fonce); padding: 0 var(--od-e-3); }
.bouton--fantome:hover { background: var(--od-survol); }
.bouton--petit { min-height: 2.3rem; padding: 0 var(--od-e-4); font-size: var(--od-t-s); }
.bouton--icone { min-height: 2.3rem; width: 2.3rem; padding: 0; color: var(--od-texte-doux); background: transparent; }
.bouton--icone:hover { color: var(--od-rouge); background: var(--od-rouge-pale); }
.bouton[disabled] { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: var(--od-e-3); flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.45em; padding: 0.25em 0.8em; border-radius: var(--od-r-pilule);
  font-size: var(--od-t-s); font-weight: var(--od-graisse-titre); line-height: 1.3; white-space: nowrap;
}
.badge::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: currentColor; flex: none; }
.badge--brouillon { color: var(--od-st-brouillon); background: var(--od-st-brouillon-fond); }
.badge--valide { color: var(--od-st-valide); background: var(--od-st-valide-fond); }
.badge--envoye { color: var(--od-st-envoye); background: var(--od-st-envoye-fond); }
.badge--accepte { color: var(--od-st-accepte); background: var(--od-st-accepte-fond); }
.badge--refuse { color: var(--od-st-refuse); background: var(--od-st-refuse-fond); }
.badge--transforme { color: var(--od-st-transforme); background: var(--od-st-transforme-fond); }
.badge--en_cours { color: var(--od-st-en-cours); background: var(--od-st-en-cours-fond); }
.badge--livree { color: var(--od-st-livree); background: var(--od-st-livree-fond); }
.badge--facturee { color: var(--od-st-facturee); background: var(--od-st-facturee-fond); }
.badge--ok { color: var(--od-eq-ok); background: var(--od-eq-ok-fond); }
.badge--defectueux { color: var(--od-eq-defectueux); background: var(--od-eq-defectueux-fond); }
.badge--en_maintenance { color: var(--od-eq-maintenance); background: var(--od-eq-maintenance-fond); }
.badge--neutre { color: var(--od-texte-doux); background: var(--od-st-brouillon-fond); }
.badge--neutre::before, .badge--sans-pastille::before { display: none; }

/* Badge « Agent IA, en période d'essai » : macaron A de jeune conducteur */
.badge-agent {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.2em 0.85em 0.2em 0.25em; border-radius: var(--od-r-pilule);
  background: var(--od-ambre-pale); border: 2px solid var(--od-ambre); color: var(--od-ambre-texte);
  font-size: var(--od-t-s); font-weight: var(--od-graisse-titre); white-space: nowrap; line-height: 1.3;
}
.badge-agent__macaron { width: 1.55em; height: 1.55em; flex: none; display: block; }
.badge-humain { font-size: var(--od-t-s); color: var(--od-texte-pale); font-weight: 600; white-space: nowrap; }

/* ---------- Filtres ---------- */
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-e-5); margin-bottom: var(--od-e-5); }
.puces { display: flex; flex-wrap: wrap; gap: var(--od-e-2); }
.puce {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.35em 1em; border-radius: var(--od-r-pilule);
  border: 2px solid var(--od-bordure-forte); background: var(--od-blanc); color: var(--od-nuit);
  font-size: var(--od-t-s); font-weight: var(--od-graisse-forte); text-decoration: none; cursor: pointer;
}
.puce:hover { border-color: var(--od-vert); color: var(--od-nuit); }
.puce--active { background: var(--od-nuit); border-color: var(--od-nuit); color: #fff; }
.puce--active:hover { color: #fff; }
.puce__compte { font-weight: 600; opacity: 0.75; }
.champ { display: flex; flex-direction: column; gap: var(--od-e-1); }
.champ__libelle { font-size: var(--od-t-s); font-weight: var(--od-graisse-forte); color: var(--od-texte-doux); }
.saisie, .liste-deroulante {
  font: inherit; font-size: var(--od-t-m); font-weight: 600; color: var(--od-nuit); background: var(--od-blanc);
  min-height: 3rem; padding: 0 var(--od-e-4); border: 2px solid var(--od-bordure-forte); border-radius: var(--od-r-m);
}
.saisie:focus, .liste-deroulante:focus { outline: none; border-color: var(--od-vert); box-shadow: var(--od-focus); }
.saisie--recherche { min-width: 22rem; padding-left: 2.8rem; background: var(--od-blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5468' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.9rem center / 1.3rem; }
.saisie--qte { width: 5rem; text-align: right; min-height: 2.6rem; padding: 0 var(--od-e-3); font-variant-numeric: tabular-nums; }
.saisie--pct { width: 4.6rem; text-align: right; min-height: 2.6rem; padding: 0 var(--od-e-3); font-variant-numeric: tabular-nums; }
.direct { display: inline-flex; align-items: center; gap: var(--od-e-2); font-size: var(--od-t-s); font-weight: var(--od-graisse-forte); color: var(--od-vert-fonce); }
.direct::before { content: ""; width: 0.75em; height: 0.75em; border-radius: 50%; background: var(--od-vert); box-shadow: 0 0 0 0 rgba(48, 160, 131, 0.6); animation: od-pouls 1.8s infinite; }
@keyframes od-pouls { 70% { box-shadow: 0 0 0 0.6em rgba(48, 160, 131, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 160, 131, 0); } }

/* ---------- Tableaux aérés ---------- */
.tableau-conteneur { background: var(--od-blanc); border: 1px solid var(--od-bordure); border-radius: var(--od-r-l); box-shadow: var(--od-ombre-1); overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: var(--od-t-m); }
.tableau th {
  text-align: left; font-size: var(--od-t-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--od-graisse-titre);
  color: var(--od-texte-doux); background: var(--od-zebra); padding: var(--od-e-4) var(--od-cellule-h); border-bottom: 2px solid var(--od-bordure);
  white-space: nowrap;
}
.tableau td { padding: var(--od-cellule-v) var(--od-cellule-h); border-bottom: 1px solid var(--od-bordure); vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: var(--od-survol); }
.tableau .num { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tableau td.fort, .tableau .fort { font-weight: var(--od-graisse-titre); }
.tableau__lien-ligne { white-space: nowrap; color: var(--od-nuit); text-decoration: none; font-weight: var(--od-graisse-titre); }
.tableau__lien-ligne:hover { color: var(--od-vert-fonce); text-decoration: underline; }
.tableau__objet { max-width: 34rem; }
.tableau__pied td { background: var(--od-zebra); font-weight: var(--od-graisse-titre); border-top: 2px solid var(--od-bordure); }
.tableau--compact td { padding: var(--od-e-3) var(--od-cellule-h); }

/* Ligne créée par l'agent : surbrillance vert clair qui s'estompe (classe posée à la réception SSE) */
.ligne-nouvelle td { background: var(--od-ligne-nouvelle); animation: od-estompe var(--od-duree-surbrillance) ease-out forwards; }
.ligne-nouvelle td:first-child { box-shadow: inset 8px 0 0 var(--od-vert-clair); }
@keyframes od-estompe { 0%, 40% { background: var(--od-ligne-nouvelle); } 100% { background: transparent; } }
.ligne-nouvelle--figee td { animation: none; } /* pour les captures */
.ligne-inactive td { color: var(--od-texte-pale); background: var(--od-zebra); }
.ligne-inactive .tableau__designation { text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- Notification (toast) ---------- */
.notification {
  position: fixed; right: var(--od-e-7); bottom: var(--od-e-7); z-index: 30; display: flex; align-items: center; gap: var(--od-e-4);
  max-width: 34rem; padding: var(--od-e-5); border-radius: var(--od-r-l); background: var(--od-nuit); color: #fff; box-shadow: var(--od-ombre-3);
  border-left: 8px solid var(--od-vert-clair); font-size: var(--od-t-m);
}
.notification strong { color: var(--od-vert-clair); }
.notification a { color: #fff; }

/* ---------- Pied de page ---------- */
.pied { background: var(--od-blanc); border-top: 1px solid var(--od-bordure); padding: var(--od-e-5) var(--od-e-7); display: flex; align-items: center; gap: var(--od-e-5); flex-wrap: wrap; font-size: var(--od-t-s); color: var(--od-texte-doux); }
.pied img { height: 1.6rem; }
.pied__reset { margin-left: auto; }

/* ---------- En-tête de devis ---------- */
.devis-titre { display: flex; align-items: center; gap: var(--od-e-4); flex-wrap: wrap; }
.devis-titre h1 { font-variant-numeric: tabular-nums; }
.devis-objet { font-size: var(--od-t-l); font-weight: var(--od-graisse-forte); margin: var(--od-e-3) 0 0; max-width: 60rem; }
.meta { display: flex; flex-wrap: wrap; gap: var(--od-e-2) var(--od-e-6); margin-top: var(--od-e-4); font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; }
.meta strong { color: var(--od-nuit); }

/* Bloc client + parc installé */
.client-bloc__nom { font-size: var(--od-t-xl); font-weight: var(--od-graisse-titre); color: var(--od-nuit); text-decoration: none; }
.client-bloc__nom:hover { text-decoration: underline; }
.client-bloc__ligne { margin: var(--od-e-1) 0 0; color: var(--od-texte-doux); font-weight: 600; }
.client-bloc__chiffres { display: flex; flex-wrap: wrap; gap: var(--od-e-2); margin-top: var(--od-e-4); }
.etiquette { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.3em 0.8em; border-radius: var(--od-r-s); background: var(--od-fond); font-size: var(--od-t-s); font-weight: var(--od-graisse-forte); }
.etiquette--vert { background: var(--od-vert-pale); color: var(--od-vert-fonce); }
.parc { display: flex; flex-wrap: wrap; gap: var(--od-e-2); margin: var(--od-e-4) 0; }
.parc__modele { display: inline-flex; align-items: baseline; gap: 0.35em; padding: 0.4em 0.9em; border: 2px solid var(--od-bordure); border-radius: var(--od-r-m); font-weight: var(--od-graisse-forte); }
.parc__modele b { font-size: var(--od-t-l); font-variant-numeric: tabular-nums; }
.alerte-equipement {
  display: grid; grid-template-columns: auto 1fr; gap: var(--od-e-2) var(--od-e-4); align-items: start; margin-top: var(--od-e-4);
  padding: var(--od-e-5); border-radius: var(--od-r-m); background: var(--od-rouge-pale); border: 2px solid var(--od-rouge);
}
.alerte-equipement__icone { width: 2.4rem; height: 2.4rem; color: var(--od-rouge); }
.alerte-equipement__titre { font-weight: var(--od-graisse-titre); font-size: var(--od-t-l); color: var(--od-rouge); }
.alerte-equipement p { margin: var(--od-e-1) 0 0; }

/* Confirmation après validation (illustration-valide.svg) */
.confirmation { display: grid; grid-template-columns: auto 1fr; gap: var(--od-e-6); align-items: center; margin-bottom: var(--od-e-6); padding: var(--od-e-5) var(--od-e-6); background: var(--od-vert-pale); border: 2px solid var(--od-vert); border-radius: var(--od-r-l); }
.confirmation img { width: 9rem; height: 9rem; border-radius: var(--od-r-l); display: block; }
.confirmation__titre { font-size: var(--od-t-xl); font-weight: 900; color: var(--od-vert-fonce); }
.confirmation__texte { margin: var(--od-e-2) 0 0; font-size: var(--od-t-l); font-weight: 600; }
.confirmation__detail { margin: var(--od-e-2) 0 0; font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; }

/* Note de l'agent */
.note-agent { position: relative; background: var(--od-vert-pale); border: 2px solid var(--od-vert); border-radius: var(--od-r-l); padding: var(--od-e-6); }
.note-agent__entete { display: flex; align-items: center; gap: var(--od-e-3); margin-bottom: var(--od-e-4); flex-wrap: wrap; }
.note-agent__entete h2 { font-size: var(--od-t-l); }
.note-agent__texte { margin: 0; font-size: var(--od-t-m); line-height: 1.55; }
.note-agent__texte mark { background: rgba(255, 181, 71, 0.35); color: inherit; padding: 0 0.15em; border-radius: 3px; font-weight: var(--od-graisse-forte); }
.note-agent__pied { margin-top: var(--od-e-4); font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; }

/* Lignes de devis */
.ligne-devis__designation { font-weight: var(--od-graisse-forte); }
.ligne-devis__detail { display: block; font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; margin-top: 2px; }
.etiquette-externe { display: inline-block; margin-left: 0.4em; padding: 0.05em 0.5em; border-radius: var(--od-r-s); background: #2B2D31; color: #F2B705; font-size: var(--od-t-xs); font-weight: var(--od-graisse-titre); vertical-align: 0.15em; }

/* Les trois formules */
.formules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--od-e-5); }
.formule { background: var(--od-blanc); border: 2px solid var(--od-bordure); border-radius: var(--od-r-l); box-shadow: var(--od-ombre-1); display: flex; flex-direction: column; overflow: hidden; }
.formule__entete { padding: var(--od-e-5) var(--od-e-6); background: var(--od-nuit); color: #fff; display: flex; align-items: baseline; justify-content: space-between; gap: var(--od-e-3); }
.formule__nom { font-size: var(--od-t-xl); font-weight: var(--od-graisse-titre); }
.formule__niveau { font-size: var(--od-t-s); color: #C9D2E3; font-weight: var(--od-graisse-forte); }
.formule__lignes { padding: var(--od-e-5) var(--od-e-6); border-bottom: 1px solid var(--od-bordure); }
.formule__ligne { display: flex; justify-content: space-between; gap: var(--od-e-2) var(--od-e-4); align-items: center; flex-wrap: wrap; }
.formule__totaux { padding: var(--od-e-5) var(--od-e-6); display: grid; grid-template-columns: 1fr auto; gap: var(--od-e-2) var(--od-e-4); font-size: var(--od-t-m); flex: 1; align-content: start; }
.formule__totaux dt { color: var(--od-texte-doux); font-weight: 600; }
.formule__totaux dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--od-graisse-forte); white-space: nowrap; }
.formule__remise dt, .formule__remise dd { color: var(--od-vert-fonce); }
.formule__net { padding: var(--od-e-5) var(--od-e-6); background: var(--od-vert-pale); border-top: 2px solid var(--od-vert); }
.formule__net-libelle { font-size: var(--od-t-s); font-weight: var(--od-graisse-titre); text-transform: uppercase; letter-spacing: 0.06em; color: var(--od-vert-fonce); }
.formule__net-montant { font-size: var(--od-t-hero); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.formule__ttc { font-size: var(--od-t-m); font-weight: var(--od-graisse-forte); color: var(--od-texte-doux); }

.remise-globale { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-e-4); padding: var(--od-e-5) var(--od-e-6); background: var(--od-blanc); border: 1px solid var(--od-bordure); border-radius: var(--od-r-l); }
.remise-globale__libelle { font-weight: var(--od-graisse-titre); }

/* Formulaire d'ajout de ligne (brouillon) */
.ajout-ligne { border: 3px solid var(--od-vert); border-radius: var(--od-r-l); background: var(--od-blanc); box-shadow: var(--od-ombre-2); padding: var(--od-e-6); }
.ajout-ligne__onglets { display: inline-flex; padding: 4px; background: var(--od-fond); border-radius: var(--od-r-m); gap: 4px; margin-bottom: var(--od-e-5); }
.ajout-ligne__onglet { padding: 0.5em 1.1em; border-radius: var(--od-r-s); font-weight: var(--od-graisse-titre); color: var(--od-texte-doux); }
.ajout-ligne__onglet--actif { background: var(--od-blanc); color: var(--od-nuit); box-shadow: var(--od-ombre-1); }
.ajout-ligne__champs { display: grid; grid-template-columns: 1.1fr 1.1fr 2fr 1fr 0.7fr 1.3fr; gap: var(--od-e-4); align-items: end; }
.ajout-ligne__champs .saisie, .ajout-ligne__champs .liste-deroulante { width: 100%; min-width: 0; }
.ajout-ligne__calcul { margin-top: var(--od-e-5); padding: var(--od-e-4) var(--od-e-5); border-radius: var(--od-r-m); background: var(--od-vert-pale); font-weight: 600; display: flex; flex-wrap: wrap; gap: var(--od-e-2) var(--od-e-6); align-items: center; }
.ajout-ligne__calcul strong { font-size: var(--od-t-l); font-variant-numeric: tabular-nums; }

/* ---------- Classement : podium ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: var(--od-e-5); margin: var(--od-e-6) 0 var(--od-e-7); }
.podium__place { display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.podium__carte { background: var(--od-blanc); border: 1px solid var(--od-bordure); border-radius: var(--od-r-l) var(--od-r-l) 0 0; padding: var(--od-e-5); box-shadow: var(--od-ombre-1); position: relative; }
.podium__nom { font-size: var(--od-t-l); font-weight: var(--od-graisse-titre); color: var(--od-nuit); text-decoration: none; display: block; }
.podium__secteur { color: var(--od-texte-doux); font-weight: 600; font-size: var(--od-t-s); }
.podium__ca { font-size: var(--od-t-xl); font-weight: 900; font-variant-numeric: tabular-nums; margin-top: var(--od-e-2); white-space: nowrap; }
.podium__socle { display: grid; place-items: center; color: #fff; font-weight: 900; font-size: var(--od-t-hero); border-radius: 0 0 var(--od-r-m) var(--od-r-m); }
.podium__place--1 .podium__socle { height: 9rem; background: var(--od-vert-fonce); }
.podium__place--2 .podium__socle { height: 6.5rem; background: var(--od-nuit); }
.podium__place--3 .podium__socle { height: 4.5rem; background: #4A5468; }
.podium__place--1 .podium__carte { border: 3px solid var(--od-vert); }
.podium__couronne { width: 3.2rem; height: 3.2rem; margin: 0 auto var(--od-e-2); color: var(--od-vert); }
.infobulle {
  position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); width: max-content; max-width: 24rem;
  background: var(--od-nuit); color: #fff; padding: var(--od-e-3) var(--od-e-4); border-radius: var(--od-r-m); font-size: var(--od-t-s); font-weight: var(--od-graisse-forte);
  box-shadow: var(--od-ombre-2);
}
.infobulle::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 10px solid transparent; border-top-color: var(--od-nuit); }
.rang { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--od-fond); font-weight: 900; font-variant-numeric: tabular-nums; }
.rang--1 { background: var(--od-vert-fonce); color: #fff; }
.rang--2 { background: var(--od-nuit); color: #fff; }
.rang--3 { background: #4A5468; color: #fff; }
.evolution--hausse { color: var(--od-st-accepte); font-weight: var(--od-graisse-titre); }
.evolution--baisse { color: var(--od-st-refuse); font-weight: var(--od-graisse-titre); }

/* ---------- Fiche « vie du client » ---------- */
.chiffres-cles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--od-e-4); }
.chiffre-cle { background: var(--od-blanc); border: 1px solid var(--od-bordure); border-radius: var(--od-r-l); padding: var(--od-e-5); box-shadow: var(--od-ombre-1); }
.chiffre-cle__libelle { font-size: var(--od-t-s); font-weight: var(--od-graisse-forte); color: var(--od-texte-doux); }
.chiffre-cle__valeur { font-size: var(--od-t-xl); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.2; margin-top: var(--od-e-1); }
.chiffre-cle__detail { font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; }
.chiffre-cle--accent { background: var(--od-nuit); border-color: var(--od-nuit); color: #fff; }
.chiffre-cle--accent .chiffre-cle__libelle, .chiffre-cle--accent .chiffre-cle__detail { color: #C9D2E3; }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--od-e-4); }
.note {
  position: relative; margin: 0; padding: var(--od-e-5) var(--od-e-5) var(--od-e-5) var(--od-e-6); background: #FFF8E8; border: 1px solid #F4D9A6; border-left: 6px solid var(--od-ambre);
  border-radius: var(--od-r-m); font-size: var(--od-t-m); line-height: 1.5; font-weight: 600; box-shadow: var(--od-ombre-1);
}
.note--importante { background: var(--od-ambre-pale); border-color: var(--od-ambre); border-left-width: 10px; }
.note__drapeau { display: inline-block; margin-bottom: var(--od-e-2); font-size: var(--od-t-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 900; color: var(--od-ambre-texte); }
.liste-formations { display: flex; flex-wrap: wrap; gap: var(--od-e-2); }
.manque { display: flex; align-items: center; gap: var(--od-e-3); margin-top: var(--od-e-4); padding: var(--od-e-4); border-radius: var(--od-r-m); border: 2px dashed var(--od-ambre); background: var(--od-ambre-pale); font-weight: var(--od-graisse-forte); color: var(--od-ambre-texte); }

/* ---------- États vides, 404, attente ---------- */
.etat-vide { display: grid; justify-items: center; text-align: center; gap: var(--od-e-4); padding: var(--od-e-8) var(--od-e-6); }
.etat-vide img { width: min(20rem, 70vw); height: auto; border-radius: 24px; }
.etat-vide__titre { font-size: var(--od-t-xl); font-weight: var(--od-graisse-titre); max-width: 36rem; }
.etat-vide__texte { font-size: var(--od-t-l); color: var(--od-texte-doux); font-weight: 600; margin: 0; max-width: 38rem; }
.page-404__code { font-size: 6rem; font-weight: 900; line-height: 1; color: var(--od-vert); letter-spacing: -0.03em; }
.attente { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(31, 42, 68, 0.72); backdrop-filter: blur(3px); padding: var(--od-e-6); }
.attente__boite { background: var(--od-blanc); border-radius: 24px; box-shadow: var(--od-ombre-3); padding: var(--od-e-7); text-align: center; display: grid; justify-items: center; gap: var(--od-e-4); width: min(40rem, 100%); }
.attente__boite img { width: min(22rem, 70vw); border-radius: 20px; }
.attente__titre { font-size: var(--od-t-xl); font-weight: 900; }
.attente__detail { margin: 0; font-size: var(--od-t-m); color: var(--od-texte-doux); font-weight: 600; }
.barre-progression { width: 100%; height: 12px; border-radius: 999px; background: var(--od-fond); overflow: hidden; position: relative; }
.barre-progression::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 999px; background: linear-gradient(90deg, var(--od-vert), var(--od-vert-clair)); animation: od-progression 1.4s ease-in-out infinite; }
@keyframes od-progression { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- Fenêtre modale ---------- */
.modale-fond { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(31, 42, 68, 0.6); padding: var(--od-e-6); }
.modale { background: var(--od-blanc); border-radius: 20px; box-shadow: var(--od-ombre-3); width: min(38rem, 100%); padding: var(--od-e-7); }
.modale h2 { font-size: var(--od-t-xl); margin-bottom: var(--od-e-3); }
.modale p { margin: 0 0 var(--od-e-6); font-size: var(--od-t-l); color: var(--od-texte-doux); font-weight: 600; }
.choix-formule { display: grid; gap: var(--od-e-3); margin-bottom: var(--od-e-6); }
.choix-formule label { display: flex; justify-content: space-between; align-items: center; gap: var(--od-e-4); padding: var(--od-e-4) var(--od-e-5); border: 2px solid var(--od-bordure-forte); border-radius: var(--od-r-m); font-weight: var(--od-graisse-titre); cursor: pointer; }
.choix-formule label:has(input:checked) { border-color: var(--od-vert); background: var(--od-vert-pale); }
.choix-formule input { width: 1.3rem; height: 1.3rem; accent-color: var(--od-vert-fonce); }

/* ---------- Accueil : tableau de bord ---------- */
.indicateurs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--od-e-5); }
.indicateur {
  display: flex; flex-direction: column; gap: var(--od-e-1); padding: var(--od-e-6); background: var(--od-blanc);
  border: 1px solid var(--od-bordure); border-top: 6px solid var(--od-vert); border-radius: var(--od-r-l); box-shadow: var(--od-ombre-1);
}
.indicateur__entete { display: flex; align-items: center; gap: var(--od-e-3); font-size: var(--od-t-s); font-weight: var(--od-graisse-titre); color: var(--od-texte-doux); }
.indicateur__icone { width: 2.6rem; height: 2.6rem; flex: none; display: grid; place-items: center; border-radius: var(--od-r-m); background: var(--od-vert-pale); color: var(--od-vert-fonce); }
.indicateur__icone svg { width: 1.4rem; height: 1.4rem; }
.indicateur__valeur { font-size: var(--od-t-xl); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.2; margin-top: var(--od-e-3); }
.indicateur__detail { font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; }
.indicateur--accent { background: var(--od-nuit); border-color: var(--od-nuit); border-top-color: var(--od-vert-clair); color: #fff; }
.indicateur--accent .indicateur__entete, .indicateur--accent .indicateur__detail { color: #C9D2E3; }
.indicateur--accent .indicateur__icone { background: rgba(255, 255, 255, 0.12); color: var(--od-vert-clair); }
.indicateur--accent .evolution--hausse { color: var(--od-vert-clair); }
.indicateur--accent .evolution--baisse { color: #FFB4AB; }
.jauge { height: 0.6rem; margin: var(--od-e-2) 0 var(--od-e-1); border-radius: var(--od-r-pilule); background: var(--od-fond); overflow: hidden; }
.jauge__niveau { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--od-vert), var(--od-vert-clair)); }

/* À faire : groupes d'actions, chaque entrée mène à la page où agir */
.a-faire { display: grid; gap: var(--od-e-6); }
.grille > section { min-width: 0; } /* une grille sur une colonne (1fr) ne s'élargit pas pour une ligne insécable */
.a-faire__entete { display: flex; align-items: center; gap: var(--od-e-3); margin-bottom: var(--od-e-3); font-size: var(--od-t-m); }
.a-faire__compte { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 0.5em; border-radius: var(--od-r-pilule); background: var(--od-nuit); color: #fff; font-size: var(--od-t-s); font-weight: 900; font-variant-numeric: tabular-nums; }
.a-faire__liste { display: grid; gap: var(--od-e-2); margin: 0; padding: 0; list-style: none; }
.a-faire__lien {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--od-e-4); align-items: center; padding: var(--od-e-3) var(--od-e-4);
  border: 1px solid var(--od-bordure); border-left: 6px solid var(--od-bordure-forte); border-radius: var(--od-r-m); color: var(--od-nuit); text-decoration: none; font-weight: var(--od-graisse-normale);
}
.a-faire__lien:hover { color: var(--od-nuit); background: var(--od-survol); border-color: var(--od-vert); }
.a-faire__lien--agent { border-left-color: var(--od-ambre); }
.a-faire__lien--proche { border-left-color: var(--od-ambre); background: var(--od-ambre-pale); }
.a-faire__lien--depasse, .a-faire__lien--panne { border-left-color: var(--od-rouge); }
.a-faire__lien--depasse { background: var(--od-rouge-pale); }
.a-faire__titre { font-weight: var(--od-graisse-titre); }
.a-faire__detail { font-size: var(--od-t-s); color: var(--od-texte-doux); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-faire__droite { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: var(--od-e-1); text-align: right; }
.echeance { display: inline-block; padding: 0.15em 0.7em; border-radius: var(--od-r-pilule); font-size: var(--od-t-s); font-weight: var(--od-graisse-titre); white-space: nowrap; background: var(--od-fond); color: var(--od-texte-doux); }
.echeance--proche { background: var(--od-ambre); color: var(--od-nuit); }
.echeance--depasse { background: var(--od-rouge); color: #fff; }

/* Graphique en barres (SVG rendu par le serveur, positions en %) ; l'équivalent textuel est un tableau .sr */
.graphique { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--od-e-3); height: 17rem; }
.graphique__axe { position: relative; min-width: 4.6rem; height: 100%; font-size: var(--od-t-xs); font-weight: var(--od-graisse-forte); color: var(--od-texte-doux); font-variant-numeric: tabular-nums; text-align: right; }
.graphique__axe span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.graphique__svg { display: block; width: 100%; height: 100%; overflow: visible; font-family: var(--od-police); }
.graphique__grille { stroke: var(--od-bordure); stroke-width: 1; stroke-dasharray: 4 6; }
.graphique__base { stroke: var(--od-bordure-forte); stroke-width: 2; }
.graphique__barre { fill: var(--od-nuit); transition: fill 0.15s; }
.graphique__vide { stroke: var(--od-bordure-forte); stroke-width: 4; stroke-linecap: round; }
.graphique__zone { fill: transparent; }
.graphique__mois { fill: var(--od-texte-doux); font-size: var(--od-t-xs); font-weight: var(--od-graisse-forte); text-anchor: middle; }
.graphique__valeur { fill: var(--od-nuit); font-size: var(--od-t-s); font-weight: 900; text-anchor: middle; opacity: 0; transition: opacity 0.15s; font-variant-numeric: tabular-nums; }
.graphique__colonne:hover .graphique__barre { fill: var(--od-vert-fonce); }
.graphique__colonne:hover .graphique__valeur, .graphique__colonne--courant .graphique__valeur { opacity: 1; }
.graphique__colonne--courant .graphique__barre { fill: var(--od-vert); }
.graphique__colonne--courant .graphique__mois { fill: var(--od-vert-fonce); font-weight: 900; }
.graphique__colonne--courant .graphique__valeur { fill: var(--od-vert-fonce); }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .chiffres-cles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ajout-ligne__champs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav__veille { display: none; }
  .graphique__mois--secondaire { display: none; }
}
@media (max-width: 1100px) {
  .grille--2-1, .grille--1-1 { grid-template-columns: 1fr; }
  .formules { grid-template-columns: 1fr; }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: var(--od-e-4); padding: 0 var(--od-e-5); }
  .nav__lien { padding: 0 var(--od-e-3); }
  .page { padding: var(--od-e-6) var(--od-e-5) var(--od-e-7); }
}
@media (max-width: 760px) {
  .nav { height: auto; flex-wrap: wrap; padding: var(--od-e-3) var(--od-e-4); gap: var(--od-e-2); }
  .nav > nav { order: 3; width: 100%; min-width: 0; }
  .nav__menu { width: 100%; height: auto; overflow-x: auto; }
  .nav__lien { height: 2.8rem; }
  .nav__droite { margin-left: auto; }
  .chiffres-cles, .notes { grid-template-columns: 1fr 1fr; }
  .podium { grid-template-columns: 1fr; }
  .confirmation { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .podium__place--1 { order: -1; }
  .podium__socle { height: 3rem !important; font-size: var(--od-t-xl); }
  .saisie--recherche { min-width: 0; width: 100%; }
  .filtres { gap: var(--od-e-3); }
  .indicateurs { grid-template-columns: 1fr; }
  .indicateur { padding: var(--od-e-5); }
  .a-faire__lien { grid-template-columns: minmax(0, 1fr); }
  .a-faire__droite { grid-column: 1; grid-row: auto; justify-items: start; text-align: left; margin-top: var(--od-e-2); }
  .graphique { height: 14rem; }
  .graphique__axe { min-width: 3.6rem; }
  /* Tableaux en cartes : chaque cellule porte data-libelle */
  .tableau--cartes thead { display: none; }
  .tableau--cartes tr { display: block; padding: var(--od-e-4); border-bottom: 1px solid var(--od-bordure); }
  .tableau--cartes td { display: flex; justify-content: space-between; gap: var(--od-e-4); padding: var(--od-e-1) 0; border: 0; text-align: right; }
  .tableau--cartes td::before { content: attr(data-libelle); font-weight: var(--od-graisse-forte); color: var(--od-texte-doux); text-align: left; }
  .tableau--cartes td[data-libelle="Désignation"] { display: block; text-align: left; font-size: var(--od-t-l); }
  .tableau--cartes td[data-libelle="Désignation"]::before { display: none; }
  .tableau--cartes .ligne-nouvelle td:first-child { box-shadow: none; }
  .tableau--cartes .ligne-nouvelle { box-shadow: inset 8px 0 0 var(--od-vert-clair); }
  .notification { left: var(--od-e-4); right: var(--od-e-4); bottom: var(--od-e-4); }
}
@media print { .nav, .pied, .actions, .notification { display: none; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
