/* ==========================================================================
   DM-TN Studio 2.0 — Design System
   Charte graphique DM-TN v1.0 (novembre 2026)
   Rouge DM #870000 · Bordeaux #5A0808 · Anthracite #1A1A1A · Crème #F7F4EF
   Segoe UI · titres 28–34 px · corps 14–16 px · secondaire 12 px
   ========================================================================== */

/* --- 1. Jetons ---------------------------------------------------------- */
:root {
  /* Identité */
  --bordeaux: #870000;
  --bordeaux-fonce: #5a0808;
  --bordeaux-clair: #f8eded;
  --anthracite: #1a1a1a;
  --blanc: #ffffff;
  --fond: #f7f4ef;
  --gris: #8c8c8c;
  --gris-fonce: #5f5a54;
  --bordure: #e7e0d6;
  --bordure-forte: #d6cec2;

  /* Sémantique */
  --ok: #1f7a4d;
  --ok-fond: #e8f4ed;
  --attention: #b45309;
  --attention-fond: #fbf3e7;
  --danger: #b91c1c;
  --danger-fond: #fbeaea;
  --info: #1d4ed8;
  --info-fond: #eaf0fb;
  --violet: #5b21b6;
  --violet-fond: #f1ecfb;

  /* Typographie */
  --police: "Segoe UI", Arial, Helvetica, sans-serif;
  --mono: "Consolas", ui-monospace, monospace;
  --ts-xs: 11px;
  --ts-sm: 12.5px;
  --ts-md: 14px;
  --ts-lg: 16px;
  --ts-xl: 21px;
  --ts-2xl: 28px;
  --ts-3xl: 32px;

  /* Espacement / formes */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pilule: 999px;
  --ombre-1: 0 1px 2px rgba(38, 30, 24, 0.05);
  --ombre-2: 0 2px 8px rgba(38, 30, 24, 0.08);
  --ombre-3: 0 18px 48px rgba(38, 30, 24, 0.2);
  --sidebar-l: 248px;
  --header-h: 60px;
  --transition: 140ms ease;
}

/* --- 2. Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: var(--ts-md);
  line-height: 1.5;
  color: var(--anthracite);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--bordeaux); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #eddcdc; color: var(--bordeaux-fonce); }
:focus-visible { outline: 2px solid rgba(135, 0, 0, 0.45); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #d9d1c5; border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #c8bfb1; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* --- 3. Bandeau prototype ---------------------------------------------- */
.proto-banner {
  display: flex; align-items: center; gap: 8px;
  height: 26px; padding: 0 14px;
  background: var(--anthracite); color: #d8dbe2;
  font-size: 10.5px; letter-spacing: 0.02em;
  position: sticky; top: 0; z-index: 60;
}
.proto-banner strong {
  background: var(--bordeaux); color: #fff; padding: 1px 7px;
  border-radius: var(--r-pilule); font-size: 9.5px; letter-spacing: 0.08em;
}
.proto-banner__right { margin-left: auto; font-family: var(--mono); opacity: 0.6; }

/* --- 4. Structure ------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.boot { display: grid; place-items: center; gap: 12px; margin: auto; padding: 60px; color: var(--gris); }
.boot__spinner, .spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--bordure); border-top-color: var(--bordeaux);
  animation: tourne 0.7s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

.sidebar {
  width: var(--sidebar-l); flex: 0 0 var(--sidebar-l);
  background: var(--blanc); border-right: 1px solid var(--bordure);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.sidebar__marque {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--bordure);
}
.sidebar__logo-img { height: 28px; width: auto; display: block; }
.sidebar__nom { font-size: 13px; font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; }
.sidebar__nom span {
  display: block; margin-top: 2px;
  font-size: 9px; font-weight: 600; color: #a0988f; letter-spacing: 0.12em; text-transform: uppercase;
}
.sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 10px 18px; scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { width: 0; height: 0; }
.sidebar__groupe {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #a39a90; padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 34px; padding: 7px 10px; border-radius: var(--r-sm);
  color: #3f3b37; font-size: var(--ts-sm); font-weight: 550;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.nav-item:hover { background: #f5f1ea; }
.nav-item.actif {
  background: var(--bordeaux-clair); color: var(--bordeaux-fonce); font-weight: 650;
  box-shadow: inset 2px 0 0 var(--bordeaux);
}
.nav-item svg { flex: 0 0 16px; opacity: 0.75; }
.nav-item.actif svg { opacity: 1; }
.nav-item__badge {
  margin-left: auto; background: var(--bordeaux); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-pilule);
}
.sidebar__pied {
  border-top: 1px solid var(--bordure); padding: 12px 16px;
  font-size: 10.5px; color: #a0988f; background: #fdfcfa;
}

.contenu { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: var(--header-h); flex: 0 0 var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--blanc);
  border-bottom: 1px solid var(--bordure);
  position: sticky; top: 0; z-index: 20;
}
.header__bloc { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.header__fil {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: #a39a90; line-height: 1;
}
.header__titre { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.header .header__menu { display: none; }
.header__outils { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header__utilisateur {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; margin: 0 4px;
  border: 1px solid var(--bordure); border-radius: var(--r-pilule);
  background: #fdfcfa;
}
.header__utilisateur-nom { font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.header__utilisateur-role { font-size: 10px; color: var(--gris); line-height: 1.2; }
.main { flex: 1; min-width: 0; padding: 20px 24px 30px; overflow-x: hidden; }

/* --- 5. Boutons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--bordure-forte); background: var(--blanc);
  font-size: var(--ts-sm); font-weight: 600; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover { background: #f6f2ec; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primaire { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.btn--primaire:hover { background: var(--bordeaux-fonce); border-color: var(--bordeaux-fonce); }
.btn--sombre { background: var(--anthracite); border-color: var(--anthracite); color: #fff; }
.btn--sombre:hover { background: #2c2e35; }
.btn--danger { background: var(--danger-fond); border-color: #f0c4c4; color: var(--danger); }
.btn--danger:hover { background: #f8dede; }
.btn--ok { background: var(--ok-fond); border-color: #bfe0cc; color: var(--ok); }
.btn--fantome { background: transparent; border-color: transparent; color: var(--gris); }
.btn--fantome:hover { background: #f3efe8; color: var(--anthracite); }
.btn--sm { height: 28px; padding: 0 10px; font-size: var(--ts-xs); border-radius: 7px; }
.btn--icone { width: 34px; padding: 0; }
.btn--sm.btn--icone { width: 28px; }

/* --- 6. Cartes et indicateurs ------------------------------------------ */
.carte {
  background: var(--blanc); border: 1px solid var(--bordure);
  border-radius: var(--r-lg); box-shadow: var(--ombre-1);
}
.carte__entete {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--bordure);
}
.carte__titre { font-size: var(--ts-md); font-weight: 700; letter-spacing: -0.01em; }
.carte__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.carte__corps { padding: 16px; }
.carte__corps--serre { padding: 0; }

.grille { display: grid; gap: 14px; }
.grille--kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.kpi {
  background: var(--blanc); border: 1px solid var(--bordure);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--ombre-1);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.kpi__libelle {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gris);
}
.kpi__valeur {
  font-size: 30px; font-weight: 700; line-height: 1.05;
  letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
}
.kpi__note { font-size: var(--ts-xs); color: var(--gris); }
.kpi--accent { border-left: 3px solid var(--bordeaux); }
.kpi--danger .kpi__valeur { color: var(--danger); }
.kpi--attention .kpi__valeur { color: var(--attention); }
.kpi--ok .kpi__valeur { color: var(--ok); }

/* --- 7. Tableaux -------------------------------------------------------- */
.tableau-enveloppe { overflow: auto; max-height: none; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ts-sm); }
.tableau th {
  position: sticky; top: 0; z-index: 2;
  background: #fbf9f5; text-align: left; font-weight: 700;
  font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; color: #8c867d;
  padding: 9px 12px; border-bottom: 1px solid var(--bordure); white-space: nowrap;
}
.tableau td { padding: 8px 12px; border-bottom: 1px solid #f1ece4; vertical-align: middle; }
.tableau tbody tr:hover td { background: #fdfbf8; }
.tableau tbody tr.selection td { background: var(--bordeaux-clair); }
.tableau tbody tr:last-child td { border-bottom: none; }
.tableau--compacte td { padding: 6px 10px; }
.tableau__ref { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.tableau__secondaire { color: var(--gris); font-size: 11px; }
.col-nombre { text-align: right; font-variant-numeric: tabular-nums; }
.cellule-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Miroir DOEMO/SAI : fonds officiels des statuts (classes bg-status-XX des
   deux sites WebPlans), appliqués à la ligne entière comme dans la source. */
.tableau tbody tr.statut-fond td,
.tableau tbody tr.statut-fond:hover td { background: #d3d7cf; }
.tableau tbody tr.statut-fond-m1 td,
.tableau tbody tr.statut-fond-m1:hover td { background: #ffffff; }
.tableau tbody tr.statut-fond-0 td,
.tableau tbody tr.statut-fond-0:hover td { background: #f0f0f0; }
.tableau tbody tr.statut-fond-4 td,
.tableau tbody tr.statut-fond-4:hover td,
.tableau tbody tr.statut-fond-10 td,
.tableau tbody tr.statut-fond-10:hover td,
.tableau tbody tr.statut-fond-16 td,
.tableau tbody tr.statut-fond-16:hover td { background: #b591d6; }
.tableau tbody tr.statut-fond-5 td,
.tableau tbody tr.statut-fond-5:hover td { background: #cdd08a; }
.tableau tbody tr.statut-fond-15 td,
.tableau tbody tr.statut-fond-15:hover td { background: #d3c89d; }
.tableau tbody tr.statut-fond-20 td,
.tableau tbody tr.statut-fond-20:hover td { background: #fce94f; }
.tableau tbody tr.statut-fond-23 td,
.tableau tbody tr.statut-fond-23:hover td { background: #a7c6ed; }
.tableau tbody tr.statut-fond-26 td,
.tableau tbody tr.statut-fond-26:hover td { background: #73d216; }
.tableau tbody tr.statut-fond-30 td,
.tableau tbody tr.statut-fond-30:hover td { background: #ad7fa8; }
.tableau tbody tr.statut-fond-40 td,
.tableau tbody tr.statut-fond-40:hover td,
.tableau tbody tr.statut-fond-42 td,
.tableau tbody tr.statut-fond-42:hover td { background: #e922d3; }
.tableau tbody tr.statut-fond-44 td,
.tableau tbody tr.statut-fond-44:hover td { background: #729fcf; }
.tableau tbody tr.statut-fond-51 td,
.tableau tbody tr.statut-fond-51:hover td { background: #edd400; }
.tableau tbody tr.statut-fond-55 td,
.tableau tbody tr.statut-fond-55:hover td { background: #9b8d16; }
.tableau tbody tr.statut-fond-40 td,
.tableau tbody tr.statut-fond-42 td,
.tableau tbody tr.statut-fond-55 td { color: #ffffff; }

/* --- 8. Badges et statuts ---------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pilule);
  font-size: 10.5px; font-weight: 650; white-space: nowrap; line-height: 1.5;
  background: #efece7; color: var(--gris-fonce);
}
.badge--nouvelle { background: var(--info-fond); color: var(--info); }
.badge--attente-prod { background: #edeae4; color: #41505f; }
.badge--production { background: var(--attention-fond); color: var(--attention); }
.badge--attente-verif { background: var(--violet-fond); color: var(--violet); }
.badge--verification { background: #ede9fe; color: #6d28d9; }
.badge--attente-corr { background: #fdeee7; color: #b45309; }
.badge--correction { background: #fbe8dd; color: #9a3412; }
.badge--bloque { background: var(--danger-fond); color: var(--danger); }
.badge--valide { background: var(--ok-fond); color: var(--ok); }
.badge--termine { background: #edebe6; color: #374151; }
.badge--doemo { background: #edf2ff; color: #4152b0; }
.badge--sai { background: #e8f5f1; color: #17795b; }
.badge--statut-source { border: 1px solid rgba(26, 26, 26, 0.14); font-weight: 700; }
.badge--urgence { background: var(--danger); color: #fff; }
.badge--priorite { background: #fff3e6; color: #9a3412; }
.badge--ok { background: var(--ok-fond); color: var(--ok); }
.badge--attention { background: var(--attention-fond); color: var(--attention); }
.badge--danger { background: var(--danger-fond); color: var(--danger); }
.badge--neutre { background: #eeebe5; color: var(--gris); }

.pastille { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pastille--ok { background: var(--ok); }
.pastille--attention { background: var(--attention); }
.pastille--danger { background: var(--danger); }
.pastille--gris { background: #b9bdc5; }

/* --- 9. Formulaires ----------------------------------------------------- */
.formulaire { display: grid; gap: 14px; }
.formulaire--2 { grid-template-columns: 1fr 1fr; }
.formulaire--3 { grid-template-columns: repeat(3, 1fr); }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ--large { grid-column: 1 / -1; }
.champ__libelle {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; color: #4a4642;
}
.champ__aide { font-size: 10.5px; color: var(--gris); }
.champ__erreur { font-size: 10.5px; color: var(--danger); font-weight: 600; }
.saisie {
  height: 36px; padding: 0 11px; border-radius: var(--r-sm);
  border: 1px solid var(--bordure-forte); background: var(--blanc);
  font-size: 13px; width: 100%; min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.saisie:hover:not(:focus) { border-color: #c9c0b2; }
.saisie:focus { outline: none; border-color: var(--bordeaux); box-shadow: 0 0 0 3px rgba(135, 0, 0, 0.12); }
textarea.saisie { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.saisie[aria-invalid="true"] { border-color: var(--danger); }
select.saisie { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238c8c8c'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }
.barre-filtres {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  padding: 14px 16px; border-bottom: 1px solid var(--bordure); background: #fdfbf7;
}
.barre-filtres .champ { min-width: 140px; }
.barre-filtres--source { border-top: 1px dashed #e3dbcf; background: #fff; }
.barre-filtres--source .champ { min-width: 122px; }
.barre-filtres__legende {
  align-self: center; margin-right: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gris);
}
.tableau td .truncate { display: inline-block; max-width: 180px; vertical-align: bottom; }
.barre-filtres__actions { margin-left: auto; display: flex; gap: 6px; align-items: end; }

/* --- 10. Modale --------------------------------------------------------- */
.voile {
  position: fixed; inset: 0; background: rgba(26, 22, 19, 0.45);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: apparait 120ms ease;
}
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
.modale {
  background: var(--blanc); border-radius: var(--r-lg); box-shadow: var(--ombre-3);
  width: 100%; max-width: 620px; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modale--large { max-width: 900px; }
.modale__entete { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bordure); }
.modale__titre { font-size: var(--ts-lg); font-weight: 700; }
.modale__corps { padding: 18px; overflow-y: auto; }
.modale__pied { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--bordure); background: #fdfbf7; }

/* --- 11. Toast --------------------------------------------------------- */
.toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  min-width: 260px; max-width: 400px; padding: 11px 14px; border-radius: var(--r-md);
  background: var(--anthracite); color: #fff; box-shadow: var(--ombre-3);
  font-size: var(--ts-sm); display: flex; gap: 9px; align-items: flex-start;
  animation: glisse 160ms ease;
}
@keyframes glisse { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast--ok { background: #175c3a; }
.toast--danger { background: #8f1d1d; }
.toast--attention { background: #7c4313; }

/* --- 12. Divers -------------------------------------------------------- */
.entete-page { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.entete-page__titre {
  font-size: var(--ts-2xl); font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.15; color: var(--bordeaux);
}
.entete-page__desc { margin-top: 5px; color: #6f6961; font-size: 13px; max-width: 780px; }
.entete-page__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.vide { display: grid; place-items: center; gap: 8px; padding: 46px 20px; color: var(--gris); text-align: center; }
.vide svg { color: var(--bordeaux); opacity: 0.55; }
.vide strong { color: var(--anthracite); font-size: var(--ts-md); font-weight: 650; }

.alarne, .alerte {
  border-radius: var(--r-md); padding: 11px 13px; font-size: var(--ts-sm);
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px solid transparent; border-left-width: 3px;
}
.alerte--info { background: var(--info-fond); color: #1e3a8a; border-color: #d4e0f7; border-left-color: var(--info); }
.alerte--attention { background: var(--attention-fond); color: #7c4313; border-color: #f0e0c8; border-left-color: var(--attention); }
.alerte--danger { background: var(--danger-fond); color: #8f1d1d; border-color: #f2cfcf; border-left-color: var(--danger); }
.alerte--neutre { background: #f5f1ea; color: #4a4642; border-color: var(--bordure); border-left-color: var(--bordure-forte); }

.ligne { display: flex; align-items: center; gap: 8px; }
.ligne--serre { gap: 5px; }
.espace { flex: 1; }
.muted { color: var(--gris); }
.mono { font-family: var(--mono); }
.petit { font-size: var(--ts-xs); }
.moyen { font-size: var(--ts-sm); }
.gras { font-weight: 700; }
.italique { font-style: italic; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.texte-ok { color: var(--ok); }
.texte-danger { color: var(--danger); }
.texte-attention { color: var(--attention); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: var(--bordeaux-clair); color: var(--bordeaux-fonce);
  letter-spacing: 0.02em;
}
.avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 9.5px; }
.avatar--lg { width: 40px; height: 40px; flex-basis: 40px; font-size: 13px; }

.onglets { display: flex; gap: 6px; border-bottom: 1px solid var(--bordure); margin-bottom: 16px; flex-wrap: wrap; }
.onglet {
  padding: 9px 13px; border: none; background: none; cursor: pointer;
  font-size: var(--ts-sm); font-weight: 600; color: var(--gris);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.onglet:hover { color: var(--anthracite); }
.onglet.actif { color: var(--bordeaux); border-bottom-color: var(--bordeaux); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 15px; position: relative; }
.timeline__item:not(:last-child)::before {
  content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--bordure);
}
.timeline__point { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--bordure-forte); background: var(--blanc); margin-top: 2px; z-index: 1; }
.timeline__point--bordeaux { border-color: var(--bordeaux); background: var(--bordeaux-clair); }
.timeline__point--ok { border-color: var(--ok); background: var(--ok-fond); }
.timeline__point--danger { border-color: var(--danger); background: var(--danger-fond); }
.timeline__titre { font-size: var(--ts-sm); font-weight: 650; }
.timeline__meta { font-size: 10.5px; color: var(--gris); }

.jauge { height: 7px; border-radius: var(--r-pilule); background: #ece8e1; overflow: hidden; }
.jauge__part { height: 100%; background: var(--bordeaux); border-radius: var(--r-pilule); }
.jauge__part--ok { background: var(--ok); }
.jauge__part--attention { background: var(--attention); }
.jauge__part--danger { background: var(--danger); }

.definitions { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: var(--ts-sm); }
.definitions dt { color: var(--gris); font-weight: 600; }
.definitions dd { margin: 0; }

.barre-recherche { position: relative; display: flex; align-items: center; }
.barre-recherche svg { position: absolute; left: 10px; color: var(--gris); pointer-events: none; }
.barre-recherche .saisie { padding-left: 30px; width: 240px; }

.segments { display: inline-flex; background: #eeebe5; border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.segment {
  border: none; background: none; cursor: pointer; padding: 5px 11px; border-radius: 6px;
  font-size: 11px; font-weight: 650; color: var(--gris);
}
.segment.actif { background: var(--blanc); color: var(--anthracite); box-shadow: var(--ombre-1); }

.liste-nue { list-style: none; margin: 0; padding: 0; }
.liste-nue li { padding: 10px 0; border-bottom: 1px solid #f1ece4; }
.liste-nue li:last-child { border-bottom: none; }

.badge-role { background: #eeebe5; color: #45413c; font-size: 10px; font-weight: 700; padding: 1.5px 7px; border-radius: var(--r-pilule); }

.tableau-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }

/* --- 13. Responsive ---------------------------------------------------- */
@media (max-width: 1200px) {
  .formulaire--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  :root { --sidebar-l: 214px; }
  .fiche { grid-template-columns: 1fr; }
  .messagerie, .ged { grid-template-columns: 1fr; }
  .panneau-droit { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform var(--transition); box-shadow: var(--ombre-3); }
  .sidebar.ouvert { transform: none; }
  .contenu { width: 100%; }
  .formulaire--2, .formulaire--3 { grid-template-columns: 1fr; }
  .header .header__menu { display: inline-flex; }
  .header__titre { font-size: var(--ts-md); }
  .header__utilisateur { padding-right: 4px; }
  .header__utilisateur-nom, .header__utilisateur-role { display: none; }
  .main { padding: 14px 14px 24px; }
  .barre-recherche .saisie { width: 160px; }
  .diff { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .entete-page__titre { font-size: 24px; }
  .entete-page__actions { width: 100%; }
  .kpi__valeur { font-size: 26px; }
  .vide { padding: 34px 14px; }
}
