/* ================================================================
   VALDOR - feuille de style
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --or: #e0b64a;
  --or-clair: #f4d98a;
  --or-sombre: #b8892c;
  --vert: #2f9068;
  --bleu: #4d8fd6;
  --violet: #9a7ad1;
  --orange: #d8a13a;
  --rouge: #c0603f;
  --rayon: 12px;
  --rayon-s: 8px;
  --ombre: 0 18px 40px rgba(0, 0, 0, .38);
  --transition: .18s ease;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --police-titre: Georgia, "Times New Roman", serif;
}

[data-theme="sombre"] {
  --fond: #070b12;
  --fond-2: #0d1522;
  --fond-3: #131d2e;
  --fond-4: #1a2639;
  --bordure: #1f2c42;
  --bordure-douce: #182335;
  --texte: #e9eef6;
  --texte-doux: #93a2ba;
  --texte-faible: #64748b;
}

[data-theme="sombre"] {
  --texte-faible: #64748b;
  --halo: radial-gradient(circle at 15% -10%, rgba(224, 182, 74, .10), transparent 55%),
          radial-gradient(circle at 90% 5%, rgba(47, 144, 104, .10), transparent 50%);
}

[data-theme="clair"] {
  --fond: #eef1f6;
  --fond-2: #ffffff;
  --fond-3: #f6f8fb;
  --fond-4: #eaeef5;
  --bordure: #d8dfea;
  --bordure-douce: #e5eaf2;
  --texte: #16202f;
  --texte-doux: #55637a;
  --texte-faible: #8792a5;
  --or: #a9781c;
  --or-clair: #c79a33;
  --ombre: 0 12px 30px rgba(22, 32, 47, .10);
  --halo: radial-gradient(circle at 15% -10%, rgba(169, 120, 28, .07), transparent 55%);
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  background-image: var(--halo);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

a { color: var(--bleu); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bordure); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--fond-4); background-clip: padding-box; }

/* ---------------- Connexion ---------------- */
.connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.connexion__decor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 182, 74, .13), transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(47, 144, 104, .12), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(77, 143, 214, .10), transparent 45%);
}

.connexion__carte {
  position: relative;
  width: min(400px, 100%);
  padding: 38px 34px 28px;
  background: var(--fond-2);
  border: 1px solid var(--bordure);
  border-radius: 20px;
  box-shadow: var(--ombre);
  text-align: center;
}

.connexion__carte::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(224, 182, 74, .55), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.connexion__logo { width: 92px; height: 92px; margin-bottom: 14px; }

.connexion__titre {
  font-family: var(--police-titre);
  font-size: 30px;
  letter-spacing: 7px;
  color: var(--or);
  margin-bottom: 2px;
}

.connexion__sous-titre { margin: 0 0 26px; color: var(--texte-doux); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }

.connexion__note { margin: 18px 0 0; font-size: 11.5px; color: var(--texte-faible); }

/* ---------------- Champs & boutons ---------------- */
.champ { display: block; text-align: left; margin-bottom: 14px; }
.champ__label { display: block; font-size: 12px; font-weight: 600; color: var(--texte-doux); margin-bottom: 6px; letter-spacing: .3px; }
.champ__aide { display: block; font-size: 11.5px; color: var(--texte-faible); margin-top: 5px; }

input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--texte);
  background: var(--fond-3);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-s);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

textarea { resize: vertical; min-height: 88px; line-height: 1.55; }

input:focus, select:focus, textarea:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(224, 182, 74, .16);
}

input::placeholder, textarea::placeholder { color: var(--texte-faible); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texte-doux) 50%), linear-gradient(135deg, var(--texte-doux) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texte);
  background: var(--fond-3);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-s);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { background: var(--fond-4); border-color: var(--texte-faible); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--or { background: linear-gradient(160deg, var(--or-clair), var(--or)); border-color: var(--or-sombre); color: #1a1204; }
.btn--or:hover { background: linear-gradient(160deg, #fbe6a4, #e9c25c); border-color: var(--or); }
.btn--vert { background: var(--vert); border-color: var(--vert); color: #fff; }
.btn--vert:hover { filter: brightness(1.12); }
.btn--rouge { background: transparent; border-color: rgba(192, 96, 63, .5); color: var(--rouge); }
.btn--rouge:hover { background: rgba(192, 96, 63, .12); border-color: var(--rouge); }
.btn--fantome { background: transparent; }
.btn--large { padding: 12px 20px; font-size: 15px; }
.btn--petit { padding: 5px 10px; font-size: 12.5px; }
.btn--bloc { width: 100%; }

.icone-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  font-size: 15px;
  color: var(--texte-doux);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--rayon-s);
  cursor: pointer;
  transition: all var(--transition);
}
.icone-btn:hover { background: var(--fond-4); color: var(--texte); }

.alerte { padding: 10px 13px; border-radius: var(--rayon-s); font-size: 13px; margin: 0 0 14px; border: 1px solid transparent; }
.alerte--erreur { background: rgba(192, 96, 63, .12); border-color: rgba(192, 96, 63, .35); color: #e08a6c; }
.alerte--info { background: rgba(77, 143, 214, .10); border-color: rgba(77, 143, 214, .3); color: var(--bleu); }
.alerte--succes { background: rgba(47, 144, 104, .12); border-color: rgba(47, 144, 104, .35); color: #4fbb8c; }
.alerte--attention { background: rgba(216, 161, 58, .12); border-color: rgba(216, 161, 58, .35); color: var(--orange); }

/* ---------------- Structure ---------------- */
.app { display: flex; min-height: 100vh; }

.barre-laterale {
  width: 246px;
  flex: 0 0 246px;
  display: flex;
  flex-direction: column;
  background: var(--fond-2);
  border-right: 1px solid var(--bordure);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.marque { display: flex; align-items: center; gap: 11px; padding: 4px 6px 20px; }
.marque__logo { width: 42px; height: 42px; flex: 0 0 42px; }
.marque__texte { display: flex; flex-direction: column; overflow: hidden; }
.marque__texte strong { font-family: var(--police-titre); font-size: 17px; letter-spacing: 3px; color: var(--or); }
.marque__texte span { font-size: 11px; color: var(--texte-faible); letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.navigation { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.navigation__groupe { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--texte-faible); padding: 16px 10px 6px; }

.nav-lien {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--rayon-s);
  color: var(--texte-doux);
  font-size: 13.8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: all var(--transition);
  position: relative;
}
.nav-lien:hover { background: var(--fond-3); color: var(--texte); }
.nav-lien--actif { background: var(--fond-4); color: var(--texte); }
.nav-lien--actif::before { content: ""; position: absolute; left: 0; top: 20%; height: 60%; width: 3px; border-radius: 3px; background: var(--or); }
.nav-lien__icone { width: 18px; text-align: center; font-size: 15px; opacity: .95; }
.nav-lien__pastille { margin-left: auto; min-width: 20px; padding: 1px 6px; font-size: 11px; font-weight: 700; text-align: center; border-radius: 20px; background: var(--or); color: #1a1204; }
.nav-lien__pastille--alerte { background: var(--rouge); color: #fff; }

.barre-laterale__pied { padding-top: 14px; border-top: 1px solid var(--bordure-douce); display: flex; flex-direction: column; gap: 10px; }

.profil { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: var(--rayon-s); background: var(--fond-3); }
.profil__avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(150deg, var(--or-clair), var(--or-sombre)); color: #1a1204; font-weight: 700; font-size: 12.5px; }
.profil__infos { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.profil__infos strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profil__infos span { font-size: 11px; color: var(--texte-faible); }

.zone { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.entete {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--bordure);
  background: color-mix(in srgb, var(--fond-2) 82%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.entete__menu { display: none; }
.entete__titre { flex: 1; min-width: 0; }
.entete__titre h1 { font-size: 20px; }
.entete__titre p { margin: 2px 0 0; font-size: 12.5px; color: var(--texte-faible); }
.entete__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.contenu { flex: 1; padding: 22px 26px 60px; max-width: 1500px; width: 100%; }

/* ---------------- Cartes & grilles ---------------- */
.grille { display: grid; gap: 16px; }
.grille--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pile { display: flex; flex-direction: column; gap: 16px; }
.ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ligne--fin { justify-content: flex-end; }
.ligne--espace { justify-content: space-between; }

.carte {
  background: var(--fond-2);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
}
.carte__entete { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bordure-douce); }
.carte__entete h3 { font-size: 14.5px; }
.carte__entete .ligne { margin-left: auto; }
.carte__corps { padding: 18px; }
.carte__corps--compact { padding: 10px 18px 14px; }

.stat {
  position: relative;
  padding: 17px 18px;
  background: var(--fond-2);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
}
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--or)); }
.stat__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--texte-faible); }
.stat__valeur { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__detail { font-size: 12px; color: var(--texte-doux); margin-top: 3px; }

/* ---------------- Tableaux ---------------- */
.tableau-enveloppe { overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tableau th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--texte-faible);
  border-bottom: 1px solid var(--bordure);
  white-space: nowrap;
  background: var(--fond-2);
  position: sticky;
  top: 0;
}
table.tableau th.triable { cursor: pointer; user-select: none; }
table.tableau th.triable:hover { color: var(--texte); }
table.tableau td { padding: 11px 14px; border-bottom: 1px solid var(--bordure-douce); vertical-align: middle; }
table.tableau tbody tr { transition: background var(--transition); }
table.tableau tbody tr:hover { background: var(--fond-3); }
table.tableau tbody tr:last-child td { border-bottom: none; }
table.tableau .col-actions { text-align: right; white-space: nowrap; }

.cellule-membre { display: flex; align-items: center; gap: 10px; }
.pastille-initiales {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 11.5px; font-weight: 700;
  background: var(--fond-4);
  color: var(--texte-doux);
  border: 1px solid var(--bordure);
}
.cellule-membre__nom { font-weight: 600; }
.cellule-membre__sous { font-size: 11.5px; color: var(--texte-faible); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.badge__point { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.puce-grade { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.puce-grade__point { width: 8px; height: 8px; border-radius: 2px; }

.vide { text-align: center; padding: 46px 20px; color: var(--texte-faible); }
.vide__icone { font-size: 34px; opacity: .35; display: block; margin-bottom: 10px; }
.vide strong { display: block; color: var(--texte-doux); font-size: 15px; margin-bottom: 5px; }

/* ---------------- Filtres ---------------- */
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filtres input[type="search"], .filtres select { width: auto; min-width: 170px; }
.filtres .recherche { flex: 1; min-width: 220px; max-width: 380px; }
.compteur-resultats { font-size: 12.5px; color: var(--texte-faible); margin-left: auto; }

.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bordure); margin-bottom: 18px; overflow-x: auto; }
.onglet {
  padding: 9px 15px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--texte-faible);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.onglet:hover { color: var(--texte); }
.onglet--actif { color: var(--or); border-bottom-color: var(--or); }

/* ---------------- Pipeline candidatures ---------------- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.colonne { background: var(--fond-2); border: 1px solid var(--bordure); border-radius: var(--rayon); display: flex; flex-direction: column; min-height: 130px; }
.colonne__entete { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--bordure-douce); font-size: 12.5px; font-weight: 700; }
.colonne__compte { margin-left: auto; font-size: 11.5px; color: var(--texte-faible); background: var(--fond-4); padding: 1px 8px; border-radius: 20px; }
.colonne__corps { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; max-height: 62vh; }

.carte-candidat {
  padding: 11px 12px;
  background: var(--fond-3);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-s);
  cursor: pointer;
  transition: all var(--transition);
}
.carte-candidat:hover { border-color: var(--or); transform: translateY(-1px); }
.carte-candidat__nom { font-weight: 600; font-size: 13.5px; }
.carte-candidat__meta { font-size: 11.5px; color: var(--texte-faible); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.carte-candidat__pied { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

.etoiles { display: inline-flex; gap: 1px; color: var(--or); font-size: 13px; letter-spacing: 1px; }
.etoiles--saisie span { cursor: pointer; transition: transform .1s; }
.etoiles--saisie span:hover { transform: scale(1.22); }
.etoiles__vide { color: var(--texte-faible); opacity: .45; }

/* ---------------- Graphiques ---------------- */
.barres { display: flex; flex-direction: column; gap: 11px; }
.barre__tete { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.barre__tete span:last-child { color: var(--texte-faible); font-variant-numeric: tabular-nums; }
.barre__piste { height: 7px; background: var(--fond-4); border-radius: 20px; overflow: hidden; }
.barre__remplissage { height: 100%; border-radius: 20px; transition: width .5s cubic-bezier(.4, 0, .2, 1); }

.histogramme { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.histogramme__colonne { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.histogramme__paire { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; justify-content: center; }
.histogramme__barre { width: 45%; max-width: 26px; border-radius: 4px 4px 0 0; min-height: 3px; transition: height .5s ease; position: relative; }
.histogramme__barre:hover::after { content: attr(data-valeur); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--fond-4); border: 1px solid var(--bordure); padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-bottom: 4px; white-space: nowrap; }
.histogramme__legende { font-size: 11px; color: var(--texte-faible); text-transform: capitalize; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--texte-doux); }
.legende__item { display: inline-flex; align-items: center; gap: 6px; }
.legende__carre { width: 9px; height: 9px; border-radius: 2px; }

/* ---------------- Modales ---------------- */
.voile { position: fixed; inset: 0; background: rgba(3, 6, 12, .68); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modale {
  width: min(680px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--fond-2);
  border: 1px solid var(--bordure);
  border-radius: 16px;
  box-shadow: var(--ombre);
  animation: apparition .18s ease;
}
.modale--large { width: min(920px, 100%); }
.modale--petite { width: min(430px, 100%); }
@keyframes apparition { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modale__entete { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--bordure-douce); }
.modale__entete h2 { font-size: 16.5px; flex: 1; }
.modale__corps { padding: 20px; overflow-y: auto; }
.modale__pied { display: flex; gap: 9px; justify-content: flex-end; padding: 15px 20px; border-top: 1px solid var(--bordure-douce); flex-wrap: wrap; }

.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.grille-champs--3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pleine-largeur { grid-column: 1 / -1; }
.section-titre { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--or); margin: 6px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--bordure-douce); grid-column: 1 / -1; }

.bloc-info { background: var(--fond-3); border: 1px solid var(--bordure-douce); border-radius: var(--rayon-s); padding: 13px 15px; }
.bloc-info h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--texte-faible); margin-bottom: 7px; }
.bloc-info p { margin: 0; font-size: 13.5px; white-space: pre-wrap; line-height: 1.6; }

.liste-def { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.liste-def dt { color: var(--texte-faible); font-size: 12.5px; }
.liste-def dd { margin: 0; }

.chrono { display: flex; flex-direction: column; gap: 0; }
.chrono__item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.chrono__item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 1px; background: var(--bordure); }
.chrono__item:last-child::before { display: none; }
.chrono__point { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; margin-top: 4px; background: var(--fond-4); border: 2px solid var(--or); z-index: 1; }
.chrono__contenu { flex: 1; font-size: 13px; }
.chrono__meta { font-size: 11.5px; color: var(--texte-faible); margin-top: 2px; }

/* ---------------- Toasts & chargement ---------------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 250px; max-width: 380px;
  padding: 12px 15px;
  background: var(--fond-3);
  border: 1px solid var(--bordure);
  border-left: 3px solid var(--or);
  border-radius: var(--rayon-s);
  box-shadow: var(--ombre);
  font-size: 13.5px;
  animation: glisse .22s ease;
  pointer-events: auto;
}
@keyframes glisse { from { opacity: 0; transform: translateX(24px); } }
.toast--succes { border-left-color: var(--vert); }
.toast--erreur { border-left-color: var(--rouge); }
.toast--info { border-left-color: var(--bleu); }
.toast__sortie { animation: sortie .2s ease forwards; }
@keyframes sortie { to { opacity: 0; transform: translateX(24px); } }

.chargement { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 300; opacity: 0; transition: opacity .2s; pointer-events: none; }
.chargement--actif { opacity: 1; }
.chargement__anneau { height: 100%; width: 35%; background: linear-gradient(90deg, transparent, var(--or), transparent); animation: defile 1s linear infinite; }
@keyframes defile { from { transform: translateX(-100%); } to { transform: translateX(400%); } }

/* ---------------- Divers ---------------- */
.texte-doux { color: var(--texte-doux); }
.texte-faible { color: var(--texte-faible); font-size: 12.5px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.separateur { height: 1px; background: var(--bordure-douce); margin: 18px 0; }
.puce-alerte { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 10px; border-radius: var(--rayon-s); background: var(--fond-3); }
.interrupteur { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.interrupteur input { width: auto; }
.zone-depot { border: 2px dashed var(--bordure); border-radius: var(--rayon); padding: 26px; text-align: center; color: var(--texte-faible); transition: all var(--transition); cursor: pointer; }
.zone-depot:hover, .zone-depot--survol { border-color: var(--or); color: var(--texte-doux); background: var(--fond-3); }

@media (max-width: 900px) {
  .barre-laterale { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--ombre); }
  .barre-laterale--ouverte { transform: translateX(0); }
  .entete__menu { display: inline-grid; }
  .contenu { padding: 18px 15px 50px; }
  .entete { padding: 13px 15px; }
}

/* ---------------- Matrice des permissions ---------------- */
input[type="checkbox"] { accent-color: var(--or); }

table.matrice th:first-child,
table.matrice td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--fond-2);
  border-right: 1px solid var(--bordure);
}
table.matrice tbody tr:hover td:first-child { background: var(--fond-3); }
table.matrice td { padding: 8px 14px; }
table.matrice .mono { font-size: 10.5px; opacity: .7; }
table.matrice input[type="checkbox"]:disabled { opacity: .45; }

/* Espaces de navigation */
.navigation__groupe { position: relative; }
.navigation__groupe::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 2px;
  height: 1px;
  background: linear-gradient(90deg, var(--bordure), transparent);
}

/* ================================================================
   Animations
   Discretes et rapides : elles doivent accompagner l action,
   jamais la faire attendre.
   ================================================================ */

/* --- Apparition du contenu d une vue --- */
@keyframes entreeVue {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.contenu > * {
  animation: entreeVue .32s cubic-bezier(.2, .8, .3, 1) both;
}

/* Les tuiles et cartes arrivent en cascade */
.grille--stats .stat,
.grille--2 > *,
.grille--3 > * {
  animation: entreeVue .38s cubic-bezier(.2, .8, .3, 1) both;
}
.grille--stats .stat:nth-child(1), .grille--2 > *:nth-child(1), .grille--3 > *:nth-child(1) { animation-delay: .02s; }
.grille--stats .stat:nth-child(2), .grille--2 > *:nth-child(2), .grille--3 > *:nth-child(2) { animation-delay: .06s; }
.grille--stats .stat:nth-child(3), .grille--2 > *:nth-child(3), .grille--3 > *:nth-child(3) { animation-delay: .10s; }
.grille--stats .stat:nth-child(4), .grille--2 > *:nth-child(4), .grille--3 > *:nth-child(4) { animation-delay: .14s; }
.grille--3 > *:nth-child(5) { animation-delay: .18s; }
.grille--3 > *:nth-child(6) { animation-delay: .22s; }

/* --- Lignes de tableau --- */
@keyframes entreeLigne {
  from { opacity: 0; }
  to   { opacity: 1; }
}
table.tableau tbody tr { animation: entreeLigne .3s ease both; }

/* --- Reliefs au survol --- */
.stat, .carte { transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--or) 35%, var(--bordure)); }
.carte-candidat { transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.carte-candidat:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.grille--3 .carte[data-ouvrir]:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--or) 40%, var(--bordure)); }

/* --- Boutons --- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity .2s;
}
.btn:active::after { opacity: .08; }
.btn--or:hover { box-shadow: 0 4px 16px rgba(224, 182, 74, .22); }

/* --- Navigation --- */
.nav-lien { transition: background var(--transition), color var(--transition), transform .14s ease; }
.nav-lien:hover { transform: translateX(2px); }
.nav-lien--actif::before { animation: entreeCurseur .28s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes entreeCurseur {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
.nav-lien__pastille { animation: pastilleEntree .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pastilleEntree {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* --- Graphiques --- */
.histogramme__barre { animation: pousseBarre .6s cubic-bezier(.2, .8, .3, 1) both; transform-origin: bottom; }
@keyframes pousseBarre {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
.barre__remplissage { animation: remplitBarre .7s cubic-bezier(.2, .8, .3, 1) both; transform-origin: left; }
@keyframes remplitBarre {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* --- Chronologies --- */
.chrono__item { animation: entreeVue .34s cubic-bezier(.2, .8, .3, 1) both; }
.chrono__item:nth-child(2) { animation-delay: .04s; }
.chrono__item:nth-child(3) { animation-delay: .08s; }
.chrono__item:nth-child(4) { animation-delay: .12s; }
.chrono__item:nth-child(5) { animation-delay: .16s; }
.chrono__point { transition: transform var(--transition), box-shadow var(--transition); }
.chrono__item:hover .chrono__point { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(224, 182, 74, .12); }

/* --- Etat de chargement --- */
@keyframes pulsation { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }
.chargement-texte { animation: pulsation 1.3s ease-in-out infinite; }

/* --- Respect des preferences systeme --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .chargement__anneau, .dem__filet i { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
}
