/* Panel Atlas — mise en page et composants. Les couleurs viennent de tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--police);
  font-size: 14px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-texte); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Barres de défilement discrètes dans les zones qui défilent */
.defile, .vue-tableau, .palette-liste, .tableau-cadre, .sidebar { scrollbar-width: thin; scrollbar-color: var(--bord-fort) transparent; }
.sans-js { padding: 40px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Charpente ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--largeur-barre) minmax(0, 1fr); min-height: 100vh; }
.zone-principale { display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 16px 12px 12px;
  background: var(--barre);
  border-right: 1px solid var(--bord);
  overflow-y: auto;
}

.marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 2px; color: var(--texte); }
.marque:hover { text-decoration: none; }
.marque img { flex-shrink: 0; }
.marque-texte { font-size: 15px; font-weight: 300; letter-spacing: 0.42em; }
.marque-sous {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--bord-fort);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-2);
}

.serveur-carte {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-petit);
  background: var(--carte);
}
.serveur-texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.serveur-texte strong { font-size: 13px; }
.serveur-texte span { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pastille-etat { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--texte-3); box-shadow: 0 0 0 3px var(--carte-3); }
.pastille-etat.en-ligne { background: var(--bon); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bon) 22%, transparent); }
.pastille-etat.hors-ligne { background: var(--critique); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critique) 22%, transparent); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-groupe {
  margin: 12px 10px 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-3);
}
.nav-groupe:first-child { margin-top: 2px; }
.nav-lien {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--texte-2);
  transition: background .12s, color .12s;
}
.nav-lien svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-lien:hover { color: var(--texte); background: var(--carte-2); text-decoration: none; }
.nav-lien.actif { color: var(--texte); background: var(--accent-doux); }
.nav-lien.actif::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-lien.actif svg { color: var(--accent-texte); }

.utilisateur {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 8px 4px;
  border-top: 1px solid var(--bord);
}
.utilisateur-texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.utilisateur-texte strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utilisateur-texte span { font-size: 12px; color: var(--texte-3); }
.utilisateur .icone-btn { margin-left: auto; }

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sur-accent);
  background: linear-gradient(135deg, #0096c7, #0077b6);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.grand { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* Barre du haut */
.barre-haut {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--hauteur-haut);
  padding: 0 28px;
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.fil { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--texte-3); }
.fil strong { font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil-sep { opacity: .6; }

.recherche-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(380px, 40vw);
  height: 36px;
  margin-left: auto;
  padding: 0 8px 0 12px;
  border: 1px solid var(--bord);
  border-radius: 10px;
  color: var(--texte-3);
  background: var(--carte);
  text-align: left;
  transition: border-color .12s;
}
.recherche-btn:hover { border-color: var(--bord-fort); }
.recherche-icone svg { width: 16px; height: 16px; }
.recherche-texte { flex: 1; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
kbd {
  padding: 2px 6px;
  border: 1px solid var(--bord-fort);
  border-radius: 6px;
  font-family: var(--police);
  font-size: 11px;
  font-weight: 600;
  color: var(--texte-2);
  background: var(--carte-2);
}

.badge-demo {
  flex-shrink: 0;
  padding: 6px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-texte);
  background: var(--accent-doux);
}

.icone-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--bord);
  border-radius: 10px;
  color: var(--texte-2);
  background: var(--carte);
  transition: color .12s, border-color .12s, background .12s;
}
.icone-btn:hover { color: var(--texte); border-color: var(--bord-fort); }
.icone-btn svg { width: 17px; height: 17px; }
.icone-btn.discret { width: 30px; height: 30px; border-color: transparent; background: transparent; }
.icone-btn.discret:hover { background: var(--carte-2); }
.menu-mobile { display: none; }

.contenu { width: 100%; max-width: 1480px; margin: 0 auto; padding: 26px 28px 48px; outline: none; }

/* ── Éléments de page ──────────────────────────────────────────────────── */
.page-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-titre { font-family: var(--police-titre); font-size: 26px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.page-sous { margin-top: 4px; font-size: 13.5px; color: var(--texte-2); }

.grille { display: grid; gap: 16px; }
.grille-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille-principale { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.grille-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grille-2-egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pile { display: flex; flex-direction: column; gap: 16px; }
.espace { margin-bottom: 16px; }

.carte {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--carte);
}
.carte-tete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 12px; margin-bottom: 14px; }
.carte-titre { font-size: 14.5px; font-weight: 650; }
.carte-sous { margin-top: 2px; font-size: 12.5px; color: var(--texte-3); }
.carte-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.carte-outils .champ { width: auto; height: 32px; font-size: 13px; }
.carte-pied { margin-top: 12px; }

/* Bandeau d'état du serveur */
.bandeau {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-bottom: 16px;
  padding: 14px 20px;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--carte);
}
.bandeau-nom { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.bandeau-info { font-size: 13px; color: var(--texte-3); }
.bandeau-info strong { margin-left: 4px; font-weight: 600; color: var(--texte); }
.bandeau-actions { display: flex; gap: 8px; margin-left: auto; }

/* Indicateurs */
.tuile { display: flex; flex-direction: column; min-height: 118px; }
.tuile-label { font-size: 13px; color: var(--texte-2); }
.tuile-valeur { margin-top: 6px; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.tuile-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.tuile-sous { font-size: 12px; color: var(--texte-3); }
.tuile-courbe { flex-shrink: 0; width: 132px; height: 38px; }

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--bord-fort);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  background: var(--carte-2);
  white-space: nowrap;
  transition: background .12s, border-color .12s, filter .12s, opacity .12s;
}
.btn:hover { background: var(--carte-3); }
.btn svg { width: 15px; height: 15px; }
.btn.principal { border-color: transparent; color: var(--sur-accent); background: var(--accent); }
.btn.principal:hover { filter: brightness(1.08); }
.btn.danger { border-color: color-mix(in srgb, var(--critique) 45%, transparent); color: #ffd9d9; background: color-mix(in srgb, var(--critique) 22%, transparent); }
:root[data-theme="light"] .btn.danger { color: #9b1c1c; background: color-mix(in srgb, var(--critique) 10%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--critique) 32%, transparent); }
.btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-texte); background: var(--accent-doux); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn.charge { pointer-events: none; opacity: .7; }

.segments { display: inline-flex; padding: 3px; border: 1px solid var(--bord); border-radius: 9px; background: var(--carte-2); }
.segment { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--texte-3); background: transparent; }
.segment:hover { color: var(--texte); }
.segment[aria-pressed="true"] { color: var(--texte); background: var(--carte-3); }

/* Puces et badges */
.puce {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--texte-2);
  background: var(--carte-3);
  white-space: nowrap;
}
.puce svg { width: 13px; height: 13px; }
.puce.accent { color: var(--accent-texte); background: var(--accent-doux); }
.puce.bon { color: var(--bon); background: color-mix(in srgb, var(--bon) 14%, transparent); }
.puce.attention { color: var(--attention); background: color-mix(in srgb, var(--attention) 14%, transparent); }
.puce.critique { color: var(--critique); background: color-mix(in srgb, var(--critique) 14%, transparent); }
:root[data-theme="dark"] .puce.critique { color: #f08a8a; }

/* Statistiques en ligne */
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--bord); }
.chiffre-label { font-size: 12.5px; color: var(--texte-3); }
.chiffre-valeur { margin-top: 3px; font-size: 18px; font-weight: 650; }
.chiffre-sous { font-size: 12px; color: var(--texte-3); }

/* Listes */
.liste { display: flex; flex-direction: column; }
.ligne { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-top: 1px solid var(--bord); }
.ligne:first-child { border-top: 0; padding-top: 2px; }
.ligne-icone { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; color: var(--texte-2); background: var(--carte-2); }
.ligne-icone svg { width: 15px; height: 15px; }
.ligne-icone.bon { color: var(--bon); background: color-mix(in srgb, var(--bon) 14%, transparent); }
.ligne-icone.attention { color: var(--attention); background: color-mix(in srgb, var(--attention) 14%, transparent); }
.ligne-icone.critique { color: var(--critique); background: color-mix(in srgb, var(--critique) 14%, transparent); }
.ligne-texte { flex: 1; min-width: 0; }
.ligne-titre { font-size: 13px; font-weight: 600; }
.ligne-detail { margin-top: 1px; font-size: 12.5px; color: var(--texte-2); overflow-wrap: anywhere; }
.ligne-meta { margin-top: 2px; font-size: 11.5px; color: var(--texte-3); }
.vide { padding: 18px 0 6px; font-size: 13px; text-align: center; color: var(--texte-3); }

/* Compte à rebours */
.rebours { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Jauges machine */
.jauge + .jauge { margin-top: 14px; }
.jauge-tete { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12.5px; color: var(--texte-2); }
.jauge-tete strong { font-weight: 600; color: var(--texte); }
.jauge-piste { height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, var(--carte-2)); overflow: hidden; }
.jauge-remplie { height: 100%; border-radius: 99px; background: var(--accent); }
.jauge-remplie.attention { background: var(--attention); }
.jauge-remplie.critique { background: var(--critique); }

/* Tableaux */
.tableau-cadre { overflow-x: auto; margin: 0 -20px; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau th {
  padding: 9px 12px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--texte-3);
  border-bottom: 1px solid var(--bord);
  white-space: nowrap;
}
.tableau td { padding: 10px 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau th:first-child, .tableau td:first-child { padding-left: 20px; }
.tableau th:last-child, .tableau td:last-child { padding-right: 20px; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr.cliquable { cursor: pointer; }
.tableau tbody tr.cliquable:hover td { background: var(--carte-2); }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau .faible { color: var(--texte-3); }
.tableau .fort { font-weight: 650; }
.tableau .date { white-space: nowrap; color: var(--texte-3); }
.tableau-cadre.defile { max-height: 470px; overflow-y: auto; }
.tableau-cadre.defile thead th { position: sticky; top: 0; z-index: 1; background: var(--carte); }
.tableau tr.detail-ligne td { padding-top: 12px; padding-bottom: 14px; background: var(--carte-2); }
.tableau tr[aria-expanded="true"] td { background: var(--carte-2); border-bottom-color: transparent; }
.mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.mono.insecable { white-space: nowrap; overflow-wrap: normal; }
.lien {
  padding: 0;
  border: 0;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--accent-texte);
  background: transparent;
}
.lien:hover { text-decoration: underline; }
.cellule-nom { display: flex; align-items: center; gap: 10px; }
.cellule-nom .avatar { width: 30px; height: 30px; font-size: 11px; }
.cellule-nom strong { display: block; font-weight: 600; }
.cellule-nom span { font-size: 12px; color: var(--texte-3); }

/* Champs */
.champ {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--bord-fort);
  border-radius: 9px;
  background: var(--carte-2);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.champ { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.champ:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }
.champ.invalide { border-color: var(--critique); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critique) 18%, transparent); }
.etiquette { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--texte-2); }
.aide { margin-top: 5px; font-size: 12px; color: var(--texte-3); }
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.champs-ligne { display: flex; gap: 10px; align-items: center; }
.champs-ligne .champ { flex: 1; }
.case { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); }

/* Onglets */
.onglets { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--bord); }
.onglet {
  position: relative;
  height: 38px;
  padding: 0 12px;
  border: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texte-3);
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.onglet:hover { color: var(--texte); }
.onglet[aria-selected="true"] { color: var(--texte); }
.onglet[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* Fiche joueur */
.fiche-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.fiche-nom { font-family: var(--police-titre); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.fiche-ids { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 12.5px; color: var(--texte-3); }
.fiche-ids code { font-family: var(--mono); font-size: 12px; color: var(--texte-2); }
.fiche-ids > span { display: inline-flex; align-items: center; gap: 4px; }
.fiche-ids .icone-btn { width: 24px; height: 24px; border-radius: 6px; }
.fiche-ids .icone-btn svg { width: 14px; height: 14px; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.persos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.perso { display: flex; flex-direction: column; gap: 12px; }
.perso-tete { display: flex; align-items: center; gap: 12px; }
.perso-tete strong { display: block; font-size: 15px; }
.perso-tete span { font-size: 12.5px; color: var(--texte-3); }
.perso-argent { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.perso-argent div { padding: 8px 10px; border-radius: 9px; background: var(--carte-2); }
.perso-argent span { display: block; font-size: 11.5px; color: var(--texte-3); }
.perso-argent strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.perso-vide { display: grid; place-items: center; min-height: 180px; border-style: dashed; color: var(--texte-3); font-size: 13px; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.details dt { color: var(--texte-3); }

/* ── Graphiques ────────────────────────────────────────────────────────── */
.graphe { position: relative; }
.graphe svg { overflow: visible; }
.graphe text { font-family: var(--police); font-size: 11px; fill: var(--texte-3); }
.graphe .etiquette-fin { font-size: 12px; font-weight: 650; fill: var(--texte); }
.graphe .grille-ligne { stroke: var(--grille); stroke-width: 1; shape-rendering: crispEdges; }
.graphe .axe-ligne { stroke: var(--axe); stroke-width: 1; shape-rendering: crispEdges; }
.graphe .viseur { stroke: var(--axe); stroke-width: 1; }
.graphe .barre-zone { cursor: default; }
.graphe .barre-zone:focus { outline: none; }
.graphe .barre-zone:focus .barre, .graphe .barre-zone:hover .barre { filter: brightness(1.22); }
.recharge { opacity: .55; transition: opacity .15s; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.cle-ligne { display: inline-block; width: 16px; height: 2px; border-radius: 2px; }
.cle-carre { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.graphe .repere { stroke: var(--texte-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.graphe .repere-texte { font-size: 10.5px; }

/* Listes à barres horizontales (flux, catégories, signatures) */
.liste-barres { display: flex; flex-direction: column; gap: 4px; }
.liste-barres.defile { max-height: 460px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.barre-ligne { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }
button.barre-ligne {
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  text-align: left;
  background: transparent;
}
button.barre-ligne:hover { background: var(--carte-2); }
button.barre-ligne[aria-pressed="true"] { background: var(--accent-doux); }
.barre-ligne-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.barre-ligne-nom { min-width: 0; overflow-wrap: anywhere; }
.barre-ligne-tete strong { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barre-ligne-meta { font-size: 11.5px; color: var(--texte-3); }
.barre-h { height: 6px; border-radius: 99px; background: var(--carte-2); overflow: hidden; }
.barre-h span { display: block; height: 100%; border-radius: 99px; }
button.barre-ligne:hover .barre-h { background: var(--carte-3); }

/* Filtres de recherche */
.filtres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.filtres-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 16px; }
.filtres-actions .aide { margin: 0 0 0 4px; }

/* Note d'avertissement en tête de page */
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--attention) 35%, transparent);
  border-radius: var(--rayon-petit);
  background: color-mix(in srgb, var(--attention) 8%, transparent);
  font-size: 13px;
  color: var(--texte-2);
}
.note svg { flex-shrink: 0; width: 17px; height: 17px; margin-top: 1px; color: var(--attention); }

.perso-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-ressource { display: flex; justify-content: flex-end; gap: 6px; }
.btn.petit { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.petit svg { width: 14px; height: 14px; }

.bulle {
  position: absolute;
  z-index: 3;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--bord-fort);
  border-radius: 9px;
  background: var(--carte-3);
  box-shadow: var(--ombre);
  pointer-events: none;
  font-size: 12px;
}
.bulle-titre { margin-bottom: 5px; color: var(--texte-3); }
.bulle-ligne { display: flex; align-items: center; gap: 8px; }
.bulle-ligne + .bulle-ligne { margin-top: 3px; }
.bulle-ligne strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.bulle-ligne span { color: var(--texte-2); }

.vue-tableau { max-height: 320px; overflow: auto; }

/* ── Calques : fenêtre, palette de commandes, notifications ────────────── */
.voile {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: var(--voile);
  backdrop-filter: blur(3px);
  animation: apparait .14s ease-out;
}
.fenetre {
  width: min(520px, 100%);
  padding: 20px 22px;
  border: 1px solid var(--bord-fort);
  border-radius: 16px;
  background: var(--carte);
  box-shadow: var(--ombre);
  animation: monte .16s ease-out;
}
.fenetre-titre { font-size: 17px; font-weight: 700; }
.fenetre-texte { margin: 6px 0 16px; font-size: 13.5px; color: var(--texte-2); }
.fenetre-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.erreur-texte { min-height: 18px; font-size: 12.5px; font-weight: 600; color: var(--critique); }
.erreur-texte:empty { display: none; }
:root[data-theme="dark"] .erreur-texte { color: #f08a8a; }

.palette { width: min(620px, 100%); padding: 0; overflow: hidden; }
.palette-champ { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--bord); }
.palette-champ svg { width: 18px; height: 18px; color: var(--texte-3); }
.palette-champ input { flex: 1; height: 54px; border: 0; outline: none; font-size: 15px; background: transparent; }
.palette-liste { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette-groupe { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-3); }
.palette-choix { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; text-align: left; background: transparent; }
.palette-choix svg { width: 16px; height: 16px; color: var(--texte-3); }
.palette-choix .avatar { width: 28px; height: 28px; font-size: 11px; }
.palette-choix[aria-selected="true"] { background: var(--accent-doux); }
.palette-choix strong { display: block; font-size: 13.5px; font-weight: 600; }
.palette-choix span { font-size: 12px; color: var(--texte-3); }
.palette-pied { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--bord); font-size: 12px; color: var(--texte-3); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 11px 14px;
  border: 1px solid var(--bord-fort);
  border-radius: 11px;
  background: var(--carte-3);
  box-shadow: var(--ombre);
  font-size: 13px;
  animation: monte .18s ease-out;
}
.toast svg { flex-shrink: 0; width: 17px; height: 17px; }
.toast.bon svg { color: var(--bon); }
.toast.critique svg { color: var(--critique); }

.chargement { padding: 60px 0; text-align: center; color: var(--texte-3); }
.message-page { max-width: 520px; margin: 10vh auto; text-align: center; }
.message-page h1 { margin: 14px 0 6px; font-size: 22px; }
.message-page p { color: var(--texte-2); }

@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Écrans plus étroits ───────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .grille-principale { grid-template-columns: minmax(0, 1fr); }
  .grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .grille-2, .grille-2-egal, .persos { grid-template-columns: minmax(0, 1fr); }
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; z-index: 30; width: var(--largeur-barre); transform: translateX(-100%); transition: transform .18s ease-out; }
  .app.menu-ouvert .sidebar { transform: none; box-shadow: var(--ombre); }
  .voile-mobile { position: fixed; inset: 0; z-index: 25; background: var(--voile); }
  .menu-mobile { display: grid; }
  .barre-haut { padding: 0 16px; }
  .contenu { padding: 20px 16px 40px; }
  .recherche-texte, .recherche-btn kbd { display: none; }
  .recherche-btn { width: 36px; padding: 0; justify-content: center; }
  .badge-demo { display: none; }
}
@media (max-width: 560px) {
  .grille-4, .filtres { grid-template-columns: minmax(0, 1fr); }
  .page-titre { font-size: 22px; }
}
