/* Centrale — feuille de style. Couleurs par rôle ; le mode sombre redéfinit les mêmes rôles. */

:root {
  color-scheme: light;
  --plan: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efeb;
  --encre: #101214;
  --encre-2: #4c4d4a;
  --encre-3: #84827c;
  --trait: #e1e0d9;
  --bordure: rgba(11, 11, 11, 0.11);
  --accent: #1f5fc4;
  --accent-survol: #184d9f;
  --accent-doux: #e6eefb;
  --sur-accent: #ffffff;
  --sur-critique: #ffffff;
  --barre: #14171c;
  --barre-encre: #e9eaec;
  --barre-encre-2: #9aa0aa;
  --barre-actif: #252a33;
  --serie: #2a78d6;
  --bon: #0b7a0b;
  --bon-fond: #e3f3e1;
  --alerte: #8a5a00;
  --alerte-fond: #fdf0cf;
  --critique: #b42a2a;
  --critique-fond: #fbe6e4;
  --neutre-fond: #ecebe6;
  --ombre: 0 1px 2px rgba(16, 18, 20, 0.05), 0 4px 16px rgba(16, 18, 20, 0.05);
  --rayon: 10px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --plan: #0f1011;
    --surface: #1a1a19;
    --surface-2: #242423;
    --encre: #f4f4f2;
    --encre-2: #c3c2b7;
    --encre-3: #8d8b84;
    --trait: #2c2c2a;
    --bordure: rgba(255, 255, 255, 0.11);
    --accent: #5b9bef;
    --accent-survol: #7db0f3;
    --accent-doux: #1c2a40;
    --sur-accent: #0b1220;
    --sur-critique: #2a0b0b;
    --barre: #0a0b0d;
    --barre-actif: #1d2026;
    --serie: #3987e5;
    --bon: #4cc24c;
    --bon-fond: #14301a;
    --alerte: #f2b93b;
    --alerte-fond: #33290f;
    --critique: #f07a7a;
    --critique-fond: #3a1818;
    --neutre-fond: #2a2a28;
    --ombre: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--plan);
  color: var(--encre);
  font: 14px/1.5 var(--police);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.icone { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muet { color: var(--encre-3); }
.second { color: var(--encre-2); }
.petit { font-size: 12.5px; }
.chiffres { font-variant-numeric: tabular-nums; }

/* ── Structure ─────────────────────────────────────────────────────────── */
.appli { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.barre {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 12px 14px;
  background: var(--barre); color: var(--barre-encre);
}
.marque { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: inherit; }
.marque:hover { text-decoration: none; }
.marque-logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: #1f5fc4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 13a7 7 0 0 1 14 0v6a2 2 0 0 1-2 2h-1v-7h3M9 14h3v7h-1a2 2 0 0 1-2-2z' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/26px no-repeat;
}
.marque-texte { display: grid; line-height: 1.2; min-width: 0; }
.marque-texte strong { font-size: 16px; letter-spacing: -0.01em; }
.marque-texte small { color: var(--barre-encre-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav { display: grid; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--barre-encre-2); font-weight: 520;
}
#nav a:hover { color: var(--barre-encre); background: var(--barre-actif); text-decoration: none; }
#nav a[aria-current="page"] { color: #fff; background: var(--barre-actif); }
#nav .pastille { margin-left: auto; }
.pastille {
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: #2f6fd0; color: #fff; font-size: 11.5px; font-weight: 650; line-height: 20px; text-align: center;
}
.etat-ia {
  margin-top: auto; display: flex; align-items: center; gap: 9px;
  padding: 10px; border-radius: 8px; color: var(--barre-encre-2); font-size: 12.5px; line-height: 1.3;
}
.etat-ia:hover { background: var(--barre-actif); text-decoration: none; }
.etat-ia i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #46c06a; }
.etat-ia.manque i { background: #f0b232; }

.contenu { min-width: 0; display: flex; flex-direction: column; }
#vue { flex: 1; padding: 26px 32px 48px; max-width: 1320px; width: 100%; outline: none; }
#vue.pleine { padding: 0; max-width: none; display: flex; }
#vue > .hote { display: contents; }
.entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.entete p { color: var(--encre-2); margin-top: 3px; max-width: 70ch; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

#bandeau:empty { display: none; }
.bandeau {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 32px; background: var(--alerte-fond); color: var(--encre);
  border-bottom: 1px solid var(--bordure); font-size: 13.5px;
}
.bandeau svg { color: var(--alerte); }
.bandeau > span { flex: 1; min-width: 0; }

/* ── Éléments ──────────────────────────────────────────────────────────── */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte-corps { padding: 18px 20px; }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--trait); }
.carte-titre p { color: var(--encre-3); font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--encre);
  font-weight: 560; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.principal { background: var(--accent); border-color: transparent; color: var(--sur-accent); }
.btn.principal:hover { background: var(--accent-survol); }
.btn.danger { color: var(--critique); }
.btn.danger.plein { background: var(--critique); color: var(--sur-critique); border-color: transparent; }
.btn.discret { border-color: transparent; background: transparent; color: var(--encre-2); }
.btn.discret:hover { background: var(--surface-2); color: var(--encre); }
.btn.mini { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.carre { width: 36px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.champ { display: grid; gap: 5px; }
.champ > span { font-weight: 560; font-size: 13px; }
.champ > small { color: var(--encre-3); font-size: 12.5px; line-height: 1.4; }
input[type="text"], input[type="search"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--encre);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
::placeholder { color: var(--encre-3); }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.formulaire { display: grid; gap: 16px; }
.interrupteur { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.interrupteur input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.interrupteur span { display: grid; }
.interrupteur small { color: var(--encre-3); font-size: 12.5px; }

.etiquette {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
  background: var(--neutre-fond); color: var(--encre-2);
}
.etiquette svg { width: 13px; height: 13px; }
.etiquette.bon { background: var(--bon-fond); color: var(--bon); }
.etiquette.alerte { background: var(--alerte-fond); color: var(--alerte); }
.etiquette.critique { background: var(--critique-fond); color: var(--critique); }
.etiquette.accent { background: var(--accent-doux); color: var(--accent); }
.point { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--c, var(--encre-3)); }

.avatar {
  --t: 36px; width: var(--t); height: var(--t); border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--c, var(--encre-3)); color: #fff;
  font-weight: 650; font-size: calc(var(--t) * 0.42);
}

table.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: 12px; font-weight: 600; color: var(--encre-3); padding: 9px 20px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.tableau td { padding: 11px 20px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface-2); }
.defile-x { overflow-x: auto; }

.vide { display: grid; justify-items: center; gap: 10px; padding: 44px 24px; text-align: center; color: var(--encre-2); }
.vide svg { width: 30px; height: 30px; color: var(--encre-3); }
.vide p { max-width: 46ch; }

.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--trait); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets button { flex: none; white-space: nowrap; }
.onglets button {
  padding: 9px 14px; border: 0; background: none; cursor: pointer; font-weight: 560; color: var(--encre-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 7px;
}
.onglets button:hover { color: var(--encre); }
.onglets button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.segments { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-2); gap: 2px; }
.segments button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-weight: 560; font-size: 13px; color: var(--encre-2); }
.champ > .segments, .liste-entete > .segments { justify-self: start; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--encre); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

dialog {
  border: 1px solid var(--bordure); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px));
  background: var(--surface); color: var(--encre); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
dialog.large { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 12, 16, 0.5); }
.modale-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--trait); }
.modale-corps { padding: 20px; display: grid; gap: 16px; max-height: min(70vh, 640px); overflow-y: auto; }
.modale-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--trait); }

#avis { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.avis {
  padding: 10px 14px; border-radius: 9px; background: var(--encre); color: var(--plan);
  box-shadow: var(--ombre); max-width: 380px; font-size: 13.5px;
}
.avis.erreur { background: var(--critique); color: var(--sur-critique); }

/* ── Tableau de bord ───────────────────────────────────────────────────── */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tuile { padding: 16px 18px; display: grid; gap: 2px; }
.tuile .libelle { color: var(--encre-2); font-size: 13px; }
.tuile .valeur { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.tuile .note { color: var(--encre-3); font-size: 12.5px; }
.bord-grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bord-colonne { display: grid; gap: 18px; min-width: 0; }

.graphe { position: relative; padding: 18px 20px 12px; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .grille line { stroke: var(--trait); stroke-width: 1; }
.graphe .base { stroke: var(--encre-3); stroke-opacity: 0.6; stroke-width: 1; }
.graphe text { fill: var(--encre-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphe .colonne { fill: var(--serie); }
.graphe .zone { fill: transparent; cursor: default; }
.graphe .zone:hover + .colonne, .graphe g:focus-visible .colonne { fill: var(--accent-survol); }
.graphe g:focus { outline: none; }
.infobulle {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%);
  padding: 7px 10px; border-radius: 8px; background: var(--encre); color: var(--plan);
  font-size: 12.5px; line-height: 1.35; white-space: nowrap; z-index: 5;
}
.infobulle strong { display: block; font-size: 14px; }

.barres { display: grid; gap: 11px; padding: 16px 20px 18px; }
.barre-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; font-size: 13px; }
.barre-ligne .piste { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.barre-ligne .piste i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--serie); min-width: 2px; }

/* ── Centre d'appels ───────────────────────────────────────────────────── */
.console { display: grid; grid-template-columns: 328px minmax(0, 1fr); flex: 1; min-height: 0; height: 100vh; }
.liste-appels { display: flex; flex-direction: column; border-right: 1px solid var(--bordure); background: var(--surface); min-height: 0; }
.liste-entete { padding: 20px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--trait); }
.liste-entete .ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.liste-entete h1 { font-size: 17px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.liste-entete .ligne .btn { flex: none; padding: 0 11px; }
.liste-entete > .segments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; background: none; }
.liste-entete > .segments button { padding: 4px 10px; border: 1px solid var(--bordure); white-space: nowrap; }
.liste-entete > .segments button[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); border-color: transparent; box-shadow: none; }
.liste-corps { overflow-y: auto; flex: 1; }
.appel-item {
  display: grid; gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--trait);
  color: inherit; cursor: pointer; border-left: 3px solid transparent;
}
.appel-item:hover { background: var(--surface-2); text-decoration: none; }
.appel-item[aria-current="true"] { background: var(--accent-doux); border-left-color: var(--accent); }
.appel-item .haut { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.appel-item { grid-template-columns: minmax(0, 1fr); }
.appel-item .haut strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.appel-item .haut > span { flex: none; white-space: nowrap; }
.appel-item .apercu { color: var(--encre-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appel-item .bas { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--encre-3); }
.direct { display: inline-flex; align-items: center; gap: 5px; color: var(--bon); font-weight: 600; font-size: 12px; }
.direct::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pouls 1.6s ease-in-out infinite; }
@keyframes pouls { 50% { opacity: 0.35; } }

.zone-poste { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.zone-poste > .vide { margin: auto; }
.poste { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; height: 100vh; }
.fil { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.fil-entete { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--bordure); background: var(--surface); flex-wrap: wrap; }
.fil-entete .qui { display: grid; line-height: 1.3; min-width: 0; flex: 1 1 140px; }
.fil-entete .qui > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil-entete > .actions { flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; }
.fil-etiquettes { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 48px; margin-top: -4px; }
.fil-etiquettes:empty { display: none; }
.bouton-fiche { display: none; }
.fil-entete .qui strong { font-size: 15px; }
.fil-corps { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.bulle { max-width: min(640px, 82%); display: grid; gap: 4px; }
.bulle .auteur { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--encre-3); }
.bulle .texte {
  padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--bordure); border-top-left-radius: 4px;
}
.bulle.appelant { align-self: flex-end; justify-items: end; }
.bulle.appelant .texte { background: var(--accent); color: var(--sur-accent); border-color: transparent; border-radius: 14px; border-top-right-radius: 4px; }
.bulle .sources { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; color: var(--encre-3); }
.source { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--encre-2); font-size: 12px; line-height: 20px; border: 0; cursor: help; }
.source svg { width: 12px; height: 12px; }
.bulle .activite { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--encre-3); }
.frappe { display: inline-flex; gap: 4px; padding: 4px 0; }
.frappe i { width: 6px; height: 6px; border-radius: 50%; background: var(--encre-3); animation: frappe 1.2s infinite ease-in-out; }
.frappe i:nth-child(2) { animation-delay: 0.15s; }
.frappe i:nth-child(3) { animation-delay: 0.3s; }
@keyframes frappe { 0%, 60%, 100% { opacity: 0.25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.evenement {
  align-self: center; display: flex; align-items: center; gap: 8px; max-width: 90%;
  padding: 5px 12px; border-radius: 8px; background: var(--surface-2); color: var(--encre-2); font-size: 12.5px; text-align: center;
}
.evenement svg { width: 14px; height: 14px; flex: none; }
.evenement.escalade { background: var(--critique-fond); color: var(--critique); }
.evenement.ticket { background: var(--accent-doux); color: var(--accent); }
.evenement.erreur { background: var(--critique-fond); color: var(--critique); }

.saisie { padding: 14px 22px 18px; border-top: 1px solid var(--bordure); background: var(--surface); display: grid; gap: 8px; }
.saisie form { display: flex; gap: 8px; align-items: flex-end; }
.saisie textarea { min-height: 42px; max-height: 140px; resize: none; }
.saisie .aide { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--encre-3); flex-wrap: wrap; }
.btn.micro.ecoute { background: var(--critique); color: var(--sur-critique); border-color: transparent; animation: pouls 1.4s infinite; }
.btn[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); border-color: transparent; }

.fiche { border-left: 1px solid var(--bordure); background: var(--surface); overflow-y: auto; padding: 18px; display: grid; gap: 20px; align-content: start; }
.fiche section { display: grid; gap: 8px; }
.fiche h3 { color: var(--encre-3); font-weight: 600; font-size: 12px; }
.fiche .agent-ligne { display: flex; gap: 10px; align-items: center; }
.fiche dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; }
.fiche dt { color: var(--encre-3); }
.fiche dd { margin: 0; text-align: right; }
.fiche .extrait { padding: 9px 11px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; display: grid; gap: 4px; }
.fiche .extrait q { color: var(--encre-2); quotes: "« " " »"; }
.ticket-mini { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--bordure); font-size: 13px; display: grid; gap: 3px; }

/* ── Agents ────────────────────────────────────────────────────────────── */
.grille-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.agent-carte { padding: 18px; display: grid; gap: 12px; color: inherit; align-content: start; }
.agent-carte:hover { text-decoration: none; border-color: var(--accent); }
.agent-carte .tete { display: flex; gap: 12px; align-items: center; }
.agent-carte .tete div { min-width: 0; }
.agent-carte .tete strong { font-size: 15px; display: block; }
.agent-carte .resume { color: var(--encre-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 58px; }
.agent-carte .stats { display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--trait); font-size: 12.5px; color: var(--encre-2); flex-wrap: wrap; }
.agent-carte .stats b { color: var(--encre); font-variant-numeric: tabular-nums; }
.agent-tete { display: flex; gap: 14px; align-items: center; }
.retour { display: inline-flex; align-items: center; gap: 5px; color: var(--encre-2); font-size: 13px; margin-bottom: 12px; }
.couleurs { display: flex; gap: 8px; flex-wrap: wrap; }
.couleurs label { cursor: pointer; }
.couleurs input { position: absolute; opacity: 0; pointer-events: none; }
.couleurs i { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--bordure); }
.couleurs input:checked + i { box-shadow: 0 0 0 2px var(--encre); }
.couleurs input:focus-visible + i { box-shadow: 0 0 0 2px var(--accent); }

.etat-base { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--rayon); background: var(--accent-doux); margin-bottom: 16px; }
.etat-base svg { color: var(--accent); margin-top: 2px; }
.etat-base p { color: var(--encre-2); font-size: 13px; }
.ajouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ajout {
  display: grid; gap: 4px; padding: 14px 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface);
}
.ajout:hover, .ajout.survol { border-color: var(--accent); background: var(--accent-doux); }
.ajout svg { color: var(--accent); }
.ajout strong { font-weight: 600; }
.ajout small { color: var(--encre-3); font-size: 12.5px; line-height: 1.35; }
.passage { padding: 12px 20px; border-bottom: 1px solid var(--trait); display: grid; gap: 4px; }
.passage:last-child { border-bottom: 0; }
.passage p { color: var(--encre-2); font-size: 13px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lacune { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 13px 20px; border-bottom: 1px solid var(--trait); }
.lacune:last-child { border-bottom: 0; }
.rangee { display: flex; gap: 8px; align-items: center; }
.rangee > input, .rangee > select { flex: 1; }
.note-encadree { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); color: var(--encre-2); font-size: 13px; }
.note-encadree code, code.adresse { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.etapes { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--encre-2); font-size: 13.5px; }

/* Paramètres › Ligne téléphonique : étapes numérotées, numéros Twilio, résultat de la vérification */
.etape-titre { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--trait); }
.etape-no { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-doux); color: var(--accent); font-size: 12px; font-weight: 700; }
.ligne-numeros { display: grid; gap: 8px; justify-items: start; }
.ligne-numero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; width: 100%; padding: 11px 14px; border: 1px solid var(--bordure); border-radius: 8px; }
.ligne-numero .qui { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ligne-manuel summary { cursor: pointer; color: var(--encre-2); font-size: 13px; }
.ligne-manuel[open] summary { margin-bottom: 10px; }
.adresse-copiable { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.points { display: grid; gap: 8px; }
.points:empty { display: none; }
.verif-point { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.45; color: var(--encre-2); }
.verif-point svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--alerte); }
.verif-point.bon svg { color: var(--bon); }
.verif-point.critique svg { color: var(--critique); }
.verif-point.critique { color: var(--encre); }
.pile { display: grid; gap: 18px; }
.pile > *, .bord-colonne > * { min-width: 0; }
.rangee > select { min-width: 0; }
.importation-suivi .carte-titre { flex-wrap: wrap; }
.pile.etroite { max-width: 820px; }

@media (max-width: 1100px) {
  .bord-grille { grid-template-columns: 1fr; }
  .poste { grid-template-columns: minmax(0, 1fr); }
  .fiche { display: none; }
  /* La fiche prend la place de la conversation quand on la demande. */
  .bouton-fiche { display: inline-flex; }
  .bouton-fiche[aria-expanded="true"] { background: var(--accent-doux); color: var(--accent); border-color: transparent; }
  .poste.fiche-ouverte { grid-template-rows: auto minmax(0, 1fr); }
  .poste.fiche-ouverte .fil > :not(.fil-entete) { display: none; }
  .poste.fiche-ouverte .fiche { display: grid; border-left: 0; }
}
@media (max-width: 820px) {
  .appli { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .barre { position: static; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; }
  #deconnexion { margin-left: 0; }
  .marque { padding: 4px 6px; }
  .marque-texte, .etat-ia span, #nav a span.nom { display: none; }
  #nav { display: flex; }
  .etat-ia { margin: 0 0 0 auto; }
  #vue { padding: 18px 16px 40px; }
  .console { grid-template-columns: 1fr; height: auto; }
  .console.ouvert .liste-appels { display: none; }
  .console:not(.ouvert) .zone-poste { display: none; }
  .poste { height: calc(100vh - 56px); }
  .grille-2 { grid-template-columns: 1fr; }
  .bandeau { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; }
}
@media (min-width: 821px) {
  /* Bandeau « IA non connectée » au-dessus du Centre d'appels : la saisie reste dans l'écran. */
  .contenu:has(.bandeau) .console, .contenu:has(.bandeau) .poste { height: calc(100vh - 64px); }
}
@media (max-width: 520px) {
  /* Téléphone : deux rangées — marque, état de l'IA et déconnexion ; puis les sept entrées. */
  .barre { flex-wrap: wrap; overflow-x: visible; row-gap: 2px; }
  #nav { order: 3; flex: 1 0 100%; justify-content: space-between; }
  .poste { height: calc(100vh - 100px); }
}
