:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3250;
  --accent: #4f6ef7;
  --accent-hover: #3d5ae8;
  --text: #e8eaf6;
  /* #7b82aa tombait pile sur 4,50:1 contre --surface — conforme, mais sans la moindre
     marge — et passait sous le seuil (3,99:1) dès que le texte se posait sur
     --surface2 : sous-titres de cartes, compteurs, libellés de la cartographie.
     Cette valeur garde 4,9:1 au minimum sur les deux fonds. */
  --text-muted: #8b92b8;
  --green: #22c55e;
  --yellow: #f59e0b;
  /* Légèrement éclaircis : sur le fond teinté de leur badge (#3b1212, #0f1f3b) et sur
     --surface2, les valeurs précédentes plafonnaient entre 3,97 et 4,46:1. */
  --red: #f56060;
  --blue: #5a95f8;
  --orange: #f97316;
  /* Alias sémantiques (utilisés en inline depuis le JS). Ils suivent les couleurs de
     statut, qui sont maintenant déclinées par thème (cf. le bloc LIGHT THEME) : les
     teintes vives ci-dessus sont calibrées pour un fond sombre et tombaient à 2,2:1
     sur le blanc du thème clair, qui est pourtant le thème par défaut. */
  --success: var(--green);
  --warning: var(--yellow);
  --danger: var(--red);

  /* Aplats de couleur portant du texte blanc. Ils ne peuvent pas être `--accent` /
     `--red` / `--orange` : ces teintes-là doivent rester lisibles en TEXTE sur la
     surface du thème, ce qui les veut claires en sombre — l'exact inverse de ce
     qu'exige un fond sous du blanc. D'où deux jeux distincts, identiques dans les
     deux thèmes pour qu'un bouton ne change pas de teinte en changeant de thème. */
  --accent-fill: #4059d8;    /* blanc dessus : 5,77:1 */
  --danger-fill: #b91c1c;    /* blanc dessus : 6,47:1 */
  --warning-fill: #b45309;   /* blanc dessus : 5,02:1 */
  --success-fill: #15803d;   /* blanc dessus : 5,02:1 */

  /* Accent employé comme TEXTE sur la surface : plus clair que `--accent`, qui ne
     tient que 3,93:1 sur le fond sombre. */
  --accent-text: #7c93ff;    /* sur --surface sombre : 5,98:1 */

  /* ── Feu tricolore de la latence ──
     Réservé aux mesures de latence (trunks SIP, liaison PCM), où l'on doit voir le
     niveau AVANT de lire le chiffre. Les pastilles de statut ordinaires (badge-green
     & co.) restent des teintes douces : si tout devient vif, plus rien ne ressort.
     Volontairement IDENTIQUES dans les deux thèmes — un feu de circulation ne change
     pas de couleur la nuit — et portées par une encre foncée, seule façon de garder
     des teintes réellement saturées tout en restant lisible (8,45 / 8,97 / 5,12:1 ;
     du texte blanc aurait imposé des couleurs ternes, à 2,3:1). */
  --lamp-good: #22c55e;
  --lamp-warn: #f59e0b;
  --lamp-bad:  #ef4444;
  --lamp-ink:  #0b1005;

  /* Champs de saisie — jeu de couleurs propre aux contrôles de formulaire, pour que
     tous (input, select, textarea) aient le même rendu où qu'ils soient posés : sur
     le fond de page, dans une carte ou dans une modale. */
  --field-bg: #1c1f2c;
  --field-bg-hover: #232739;
  --field-border: #343a5c;
  --ring: color-mix(in srgb, var(--accent) 22%, transparent);
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b92b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  --shadow-modal: 0 24px 60px -12px rgba(0, 0, 0, .6), 0 8px 20px -8px rgba(0, 0, 0, .4);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #e4e7f2;
  --border: #c8ccdf;
  --text: #1a1d2e;
  --text-muted: #5a6080;

  /* Couleurs de statut du thème clair. Ce sont exactement les teintes déjà utilisées
     par les badges clairs ci-dessous (#15803d, #b91c1c…) : elles existaient dans le
     fichier mais n'étaient pas promues en tokens, si bien que tout le reste — grands
     chiffres des tuiles, pastilles, et les dizaines de `color:var(--danger)` posés en
     inline depuis le JS — gardait la palette du thème sombre sur fond blanc. */
  --green:  #15803d;   /* sur blanc : 5,02:1  (était 2,28) */
  --yellow: #b45309;   /* sur blanc : 5,02:1  (était 2,15) */
  --red:    #b91c1c;   /* sur blanc : 6,47:1  (était 3,76) */
  --blue:   #1d4ed8;   /* sur blanc : 6,70:1  (était 3,68) */
  --orange: #c2410c;   /* sur blanc : 5,18:1  (était 2,80) */

  /* En thème clair, l'accent est assez foncé pour servir aussi de couleur de texte. */
  --accent-text: #3d5ae8;   /* sur blanc : 5,49:1 */

  --field-bg: #f7f8fc;
  --field-bg-hover: #ffffff;
  --field-border: #ccd1e3;
  --ring: color-mix(in srgb, var(--accent) 16%, transparent);
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  --shadow-modal: 0 24px 60px -12px rgba(26, 29, 46, .22), 0 8px 20px -8px rgba(26, 29, 46, .12);
}
[data-theme="light"] .badge-green  { background: #dcfce7; color: #15803d; }
[data-theme="light"] .badge-red    { background: #fee2e2; color: #b91c1c; }
[data-theme="light"] .badge-yellow { background: #fef3c7; color: #b45309; }
[data-theme="light"] .badge-grey   { background: #f1f5f9; color: #475569; }
[data-theme="light"] .badge-blue   { background: #dbeafe; color: #1d4ed8; }
[data-theme="light"] .badge-orange { background: #ffedd5; color: #c2410c; }
[data-theme="light"] .dot-grey     { background: #9ca3af; }
[data-theme="light"] tbody tr.cdr-flagged { background: color-mix(in srgb, var(--yellow) 12%, transparent); }
[data-theme="light"] tbody tr.cdr-flagged:hover { background: color-mix(in srgb, var(--yellow) 20%, var(--surface2)); }
[data-theme="light"] tbody tr.cdr-emergency { background: color-mix(in srgb, var(--red) 13%, transparent); }
[data-theme="light"] tbody tr.cdr-emergency:hover { background: color-mix(in srgb, var(--red) 20%, var(--surface2)); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.lucide { display: inline-block; vertical-align: middle; flex-shrink: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ── CONTRÔLES DE FORMULAIRE ──────────────────────────────────────────────────
   Style unique pour TOUS les champs du site (page, cartes, modales, vue mobile).
   Les règles spécifiques plus bas (.form-group, .filters, .plan-field…) ne portent
   plus que sur la géométrie (largeur, taille de police) : la peau vient d'ici. */
.field,
input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="number"], input[type="search"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  /* background-color (et non le raccourci background) : le caret des <select> est une
     background-image, qu'un raccourci effacerait au survol/focus. */
  background-color: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 9px;
  padding: .55rem .75rem;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  /* Accorde les widgets natifs (calendrier, heure, mot de passe) au thème courant. */
  color-scheme: dark;
}
[data-theme="light"] .field,
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
  color-scheme: light;
}

.field:hover:not(:disabled):not(:focus),
input:hover:not(:disabled):not(:focus):not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--field-border));
  background-color: var(--field-bg-hover);
}

.field:focus,
input:focus:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--field-bg-hover);
  box-shadow: 0 0 0 3px var(--ring);
}
/* Cases à cocher : anneau de focus seul, le rendu natif (accent-color) est conservé. */
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--ring);
}

.field:disabled,
input:disabled, select:disabled, textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}

::placeholder { color: var(--text-muted); opacity: .7; }

textarea { resize: vertical; line-height: 1.5; }

/* <select> : flèche native remplacée par un chevron accordé au thème. */
select {
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.1rem;
  background-image: var(--caret);
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: 1rem;
}
/* Les options déroulantes gardent sinon le fond blanc du système sous Windows/Linux. */
select option { background: var(--surface); color: var(--text); }

/* Icône du sélecteur de date : discrète, révélée au survol. */
input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input:hover::-webkit-calendar-picker-indicator { opacity: 1; }

input[type="checkbox"], input[type="radio"] {
  width: 1.05rem; height: 1.05rem;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Sélecteur de fichier : le bouton natif est illisible en thème sombre. */
input[type="file"] {
  font-size: .85rem; color: var(--text-muted);
  padding: .4rem .5rem;
}
input[type="file"]::file-selector-button {
  font: inherit; font-size: .85rem;
  margin-right: .7rem; padding: .35rem .8rem;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }

/* ── LOGIN ── */
/* Colonne, et non ligne : la version se pose SOUS la carte. En ligne, elle en était
   un deuxième élément flex — affichée à droite du cadre, et lui prenant sa largeur sur
   un téléphone (le bouton Google repassait sur deux lignes). */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  width: min(360px, 100%);
}
/* En-tête de la page de connexion : logo, nom, accroche, puis les trois univers servis. */
.login-brand { text-align: center; margin-bottom: 1.75rem; }
.login-logo {
  display: block; margin: 0 auto .85rem; width: 56px; height: 56px; border-radius: 14px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
}
.login-box h1 { font-size: 1.6rem; letter-spacing: -.01em; margin-bottom: .2rem; }
.login-box p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .85rem; }
.login-box .login-tagline {
  margin-bottom: .35rem; font-size: 1rem; font-weight: 500; font-style: italic;
  color: var(--accent-text); letter-spacing: .01em;
}
/* ── Accès hors période ──────────────────────────────────────────────────────
   L'écran qui remplace le formulaire quand un compte à durée déterminée (« chef de
   PC ») se présente avant l'ouverture ou après la fermeture de sa mission.

   Volontairement NEUTRE, ni rouge ni alarmant : la personne n'a rien fait de mal, son
   mot de passe est bon, c'est le calendrier qui décide. Un bandeau d'erreur l'enverrait
   chercher une faute qui n'existe pas. L'accent orange est celui des états « en
   attente » du reste du panel, pas celui des pannes. */
.login-periode { text-align: center; }
.login-periode-icon {
  width: 54px; height: 54px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--orange) 16%, transparent);
  color: var(--orange);
}
.login-box.login-periode h1 {
  font-size: 1.22rem; line-height: 1.3; margin-bottom: .6rem; letter-spacing: -.01em;
}
.login-box .login-periode-lead {
  font-size: .9rem; color: var(--text); margin-bottom: 1.1rem; line-height: 1.5;
}
/* Les deux bornes, alignées en colonnes : on les relit pour les recopier ou les dicter
   au cadre de permanence, donc elles doivent se lire d'un coup d'œil et non dans une
   phrase. `tabular-nums` garde les heures alignées. */
.login-periode-dates {
  text-align: left; margin-bottom: 1.1rem;
  border: 1px solid var(--border); border-radius: 9px; overflow: hidden;
}
.login-periode-dates > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  padding: .6rem .8rem; font-size: .84rem;
}
.login-periode-dates > div + div { border-top: 1px solid var(--border); }
.login-periode-dates span { color: var(--text-muted); }
.login-periode-dates strong {
  font-weight: 600; text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.login-box .login-periode-aide {
  font-size: .8rem; line-height: 1.5; margin-bottom: 1.25rem;
}
.login-periode .btn { width: 100%; }
/* Écran des données personnelles : même gabarit, en accent plutôt qu'en alerte, et
   des points à lire — alignés à gauche, une phrase centrée sur quatre lignes se lit mal. */
.login-info .login-periode-icon {
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.login-info-points {
  text-align: left; margin: 0 0 1rem; padding-left: 1.1rem;
  font-size: .88rem; line-height: 1.5;
}
.login-info-points li + li { margin-top: .55rem; }
.login-info .login-periode-aide { text-align: left; }
.login-info .login-periode-aide a { color: var(--accent-text); }
.login-info-rappel { margin: .75rem 0 0; font-size: .75rem; color: var(--text-muted); }

/* Version affichée avant connexion : volontairement effacée — c'est une information
   de support, pas un élément de la page. */
.login-version {
  margin: 1rem 0 0; text-align: center; font-size: .72rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.login-privacy { margin: .5rem 0 0; text-align: center; font-size: .72rem; }
.login-privacy a { color: var(--text-muted); }
.login-box .login-scope {
  margin-bottom: 0; font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
}
/* Les deux moyens de connexion restent invisibles tant que la config Google n'est pas
   connue : sans cela le formulaire s'afficherait puis se replierait sous les yeux.
   Hauteur réservée pour que le bloc d'état, dessous, ne saute pas. */
.login-methods.login-pending { visibility: hidden; min-height: 6rem; }
/* Accès par mot de passe, replié sous le bouton Google : un simple pli discret. */
.login-pw { margin-top: 1rem; }
.login-pw summary {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  list-style: none; cursor: pointer; user-select: none;
  padding: .55rem .5rem; border-radius: 8px;
  color: var(--text-muted); font-size: .82rem; font-weight: 500;
  transition: color .15s, background .15s;
}
.login-pw summary::-webkit-details-marker { display: none; }
.login-pw summary:hover { color: var(--accent-text); background: var(--surface2); }
.login-pw summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.login-pw-chevron { transition: transform .2s; }
.login-pw[open] .login-pw-chevron { transform: rotate(180deg); }
.login-pw[open] summary { margin-bottom: .75rem; }
.login-pw-scope { margin: 0 0 1rem; text-align: center; font-size: .78rem; color: var(--text-muted); }
/* Sans Google : le formulaire est le seul moyen, son pli n'a plus lieu d'être. */
.login-pw-only .login-pw { margin-top: 0; }
.login-pw-only .login-pw summary, .login-pw-only .login-pw-scope { display: none; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .4rem; font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
/* La peau des champs vient de la section « CONTRÔLES DE FORMULAIRE » : ici, la géométrie. */
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: 1.05rem; }
/* Indication sous un champ (« Vide pour délier. », format attendu…) */
.form-hint { display: block; margin-top: .35rem; color: var(--text-muted); font-size: .75rem; line-height: 1.4; }

/* Bouton secondaire par défaut : bordé et posé sur --surface2. Sans ça, un <button class="btn">
   nu est un simple texte flottant, invisible à côté du bouton primaire d'une modale. */
.btn {
  /* gap : une icône suivie de son libellé (« Tout déconnecter ») était collée au texte,
     l'espace de tête d'un nœud texte étant supprimé dans un conteneur flex. */
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.2rem; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  color: var(--text);
  /* Quelques boutons sont des <a> (lien de rappel, ouverture de Maps, bouton d'appel
     du mobile) : sans cela ils gardaient le soulignement par défaut du navigateur et
     ne ressemblaient pas aux <button> qui les entourent. */
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
/* Pas de largeur imposée : le width: 100% d'origine venait de la page de connexion, et
   une cinquantaine de règles et de styles en ligne l'annulaient ailleurs. La pleine
   largeur est posée là où elle est voulue (connexion, pieds de feuille sur téléphone). */
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.login-box .btn-primary { width: 100%; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
/* Action destructrice (suppression, exclusion…) dans les modales de confirmation */
.btn-danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-fill) 82%, #000); border-color: color-mix(in srgb, var(--danger-fill) 82%, #000); color: #fff; }
/* Bouton plein désactivé. Baisser l'opacité d'un bouton plein délave le fond ET le
   texte blanc dans la même proportion : « M'activer partout » inactif tombait vers
   2:1, illisible, et se lisait encore comme un bouton actif un peu pâle. On sort
   donc du remplissage — surface neutre, libellé en texte atténué (≈ 5:1 dans les
   deux thèmes) — et le survol ne répond plus. */
.btn-primary:disabled, .btn-success:disabled, .btn-danger:disabled,
.btn-primary[disabled], .btn-success[disabled], .btn-danger[disabled] {
  background: var(--surface2); border-color: var(--border);
  color: var(--text-muted); cursor: default; opacity: 1;
}
.btn-primary:disabled:hover, .btn-success:disabled:hover, .btn-danger:disabled:hover {
  background: var(--surface2); border-color: var(--border); color: var(--text-muted);
}
/* Connexion Google : fond blanc et texte sombre imposés par la charte Google, dans les
   deux thèmes (le bouton doit rester identifiable). */
.btn-google {
  width: 100%; gap: .6rem;
  background: #fff; color: #1f1f1f; font-weight: 500;
  border: 1px solid #dadce0;
}
/* La couleur au survol est réaffirmée : le survol générique de .btn passerait le
   libellé en bleu accent, hors charte Google. */
.btn-google:hover { background: #f5f6f8; color: #1f1f1f; border-color: #dadce0; }
.error-msg { color: var(--red); font-size: .85rem; margin-top: .75rem; }
/* Erreur de validation d'une modale (showModal `validate`) : la boîte reste ouverte, le
   message se pose au-dessus des boutons. Pendant l'envoi, le bouton de validation se
   grise : un second clic serait de toute façon ignoré. */
.modal-error { margin: 0 0 .75rem; }
.modal-box[aria-busy="true"] .modal-footer .btn-primary,
.modal-box[aria-busy="true"] .modal-footer .btn-danger { opacity: .6; pointer-events: none; }
/* Motif de la déconnexion sur /login : une information, pas une erreur de saisie —
   d'où le ton neutre plutôt que le rouge du message d'échec. */
.login-notice {
  font-size: .85rem; line-height: 1.45; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .7rem .85rem; margin: 0 0 1rem;
}
/* Demande d'ouverture de compte, sous le refus Google « aucun compte ». */
.login-demande { margin-top: .75rem; display: flex; flex-direction: column; gap: .75rem; }
.login-demande .btn { width: 100%; }
.login-demande .login-notice { margin: 0; }
/* `display` ci-dessus (et celui de .btn) l'emporterait sur l'attribut hidden. */
.login-demande[hidden], .login-demande [hidden] { display: none; }
.login-status {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.login-status-item {
  display: flex;
  align-items: center;
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── LAYOUT ── */
/* ── LAYOUT : sidebar de navigation + colonne principale ──────────────────────
   La nav à deux niveaux (dropdown de pôle + barre d'onglets défilante) est devenue
   une sidebar : les pôles sont des groupes repliables, générés par app.js depuis la
   config NAV. Le <header> ne garde que le fil d'Ariane et les actions du compte. */
.layout { display: flex; flex: 1; align-items: stretch; min-height: 100vh; }
.layout-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; height: 52px; position: sticky; top: 0; z-index: 100;
}
/* `text-overflow` sur le conteneur ne suffit pas : ce sont les deux <span> qui
   portent le texte. Sans lui, le fil d'Ariane était coupé en plein mot dès 1440 px
   (« Poste de commandem »). */
/* Le titre de la page (crumb-tab) ne se coupe jamais : sur les pages du PCM, les
   voyants de latence et de liaison prenaient toute la place et il ne restait que
   « Pos… Pos… ». app.js pose en min-width la largeur du titre : le pôle cède d'abord,
   puis les voyants (.link-stat). */
.crumb { flex: 1; min-width: 5rem; display: flex; align-items: baseline; gap: .45rem;
  font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.crumb > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* Quand la place manque, c'est le pôle (« Poste de commandement ») qui s'abrège, pas
   l'onglet en cours (« Historique ») : le second dit où l'on est, le premier se déduit
   de la sidebar. Un flex-shrink très supérieur concentre la réduction sur le pôle. */
.crumb #crumb-pole { flex: 0 1 auto; flex-shrink: 999; }
.crumb #crumb-tab { flex: none; overflow: visible; }
.crumb b { color: var(--text); font-size: .95rem; font-weight: 600; }
.crumb #crumb-pole:not(:empty)::after { content: " ·"; }
/* Indicateur de latence de l'en-tête (modules/linkstat.js) : deux chiffres et deux
   points de couleur, rien de plus — c'est un voyant, pas un tableau de bord. */
.link-stat {
  flex: 0 1 auto; min-width: 0; overflow: hidden;
  display: flex; align-items: center; gap: 1rem;
  font-size: .75rem; color: var(--text-muted); cursor: pointer; user-select: none;
  padding: .3rem .6rem; border-radius: 8px;
}
.link-stat:hover { background: var(--surface2); }
.link-stat:empty { display: none; }
.link-stat-item { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.link-stat-dot { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.link-stat-value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* Même feu tricolore que les pastilles de latence : c'est la même mesure, vue depuis
   le bandeau. La pastille est un repère, pas du texte — elle peut rester saturée. */
.link-stat-good .link-stat-dot { background: var(--lamp-good); }
.link-stat-warn .link-stat-dot { background: var(--lamp-warn); }
.link-stat-warn .link-stat-value { color: var(--yellow); }
.link-stat-bad  .link-stat-dot { background: var(--lamp-bad); }
.link-stat-bad  .link-stat-value { color: var(--red); }
.link-stat-none .link-stat-value { color: var(--text-muted); font-weight: 500; }
/* Les paliers du bandeau sont regroupés plus bas, après les règles du compte —
   voir « Bandeau : ce qui cède, et dans quel ordre ». */
/* Pastilles d'état COT / PCM : à côté des voyants, mais en pilule — c'est un état de
   service, pas une mesure. Elles restent sur écran étroit, réduites à leur point. */
/* Dernier recours de la ligne : si même le fil d'Ariane réduit à son plancher ne
   suffit pas (cadre sur un écran étroit : trois pastilles au lieu de deux), ce sont
   les pastilles qui se rognent, jamais la pastille du compte — perdre la déconnexion
   coûte plus cher que perdre la fin du mot « assurée ». */
.hdr-states { flex: 0 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: .4rem; }
.hdr-states:empty { display: none; }
.hdr-state {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; cursor: pointer; user-select: none;
  padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: .75rem; color: var(--text-muted); background: var(--surface);
}
.hdr-state:hover { background: var(--surface2); }
.hdr-state:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.hdr-state-label { font-weight: 600; color: var(--text); }
.hdr-state-good .link-stat-dot { background: var(--lamp-good); }
.hdr-state-bad { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }
.hdr-state-bad .link-stat-dot { background: var(--lamp-bad); }
.hdr-state-bad .hdr-state-value { color: var(--red); }
.hdr-state-warn { border-color: color-mix(in srgb, var(--yellow) 55%, var(--border)); }
.hdr-state-warn .link-stat-dot { background: var(--lamp-warn); }
.hdr-state-warn .hdr-state-value { color: var(--yellow); }
.hdr-state-value { font-weight: 500; }
@media (max-width: 640px) { .hdr-state { padding: .2rem .45rem; } }

/* Bouton menu (ouverture de la sidebar) et voile : n'existent que sur écran étroit. */
#btn-sidebar { display: none; }
.sb-backdrop { display: none; }

.sidebar {
  width: 236px; flex: none;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; z-index: 150;
}
.sb-logo {
  height: 52px; flex: none; display: flex; align-items: center;
  padding: 0 1rem; border-bottom: 1px solid var(--border);
}
.sb-logo .logo { font-weight: 700; font-size: 1.05rem; color: var(--accent-text); letter-spacing: .02em; display: flex; align-items: center; gap: .35rem; }
.logo-stack { display: flex; flex-direction: column; line-height: 1.15; }
.logo-subtitle { font-size: .65rem; font-weight: 500; color: var(--text-muted); letter-spacing: .03em; }

nav { display: flex; gap: .25rem; }
nav button {
  background: none; border: none; color: var(--text-muted);
  padding: .4rem .9rem; border-radius: 6px; cursor: pointer;
  font-size: .875rem; transition: all .15s;
}
nav button:hover { background: var(--surface2); color: var(--text); }
nav button.active { background: var(--surface2); color: var(--accent-text); font-weight: 600; }

.sb-nav { flex-direction: column; gap: 0; flex: 1; overflow-y: auto;
  padding: .3rem .55rem 1rem; scrollbar-width: thin; }
.sb-group + .sb-group { margin-top: .15rem; }
.sb-head {
  width: 100%; display: flex; align-items: center; gap: .5rem; text-align: left;
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: .55rem .5rem .45rem;
}
.sb-head .lucide { margin-left: auto; transition: transform .15s; opacity: .7; }
.sb-group.open .sb-head .lucide { transform: rotate(180deg); }
.sb-items { display: none; flex-direction: column; gap: 2px; }
.sb-group.open .sb-items { display: flex; }
.sb-item {
  width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left;
  padding: .42rem .6rem; font-size: .855rem;
}
.sb-item .lucide { flex: none; opacity: .85; }
/* Libellé long (« Cartographie du routage », « Historique des statuts ») : sur deux
   lignes plutôt que coupé en « Cartographie du routa… ». */
.sb-item-label { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
/* Les pastilles (compteur d'appels, point non-lu) se calent à droite de la ligne. */
.sb-item .nav-calls-badge, .sb-item .nav-unread-dot { margin-left: 0; }

/* Écran étroit : la sidebar sort de l'écran, le bouton menu du bandeau la ramène
   par-dessus le contenu (voile cliquable derrière). Dès 1100 px et non 900 : sur un
   écran 1920 coupé en deux (~960 px), ses 237 px laissaient 329 px par carte à la
   page Poste, colonnes de la ligne tronquées. */
@media (max-width: 1100px) {
  #btn-sidebar { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; z-index: 300;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.sb-open .sidebar { transform: none; box-shadow: var(--shadow-modal); }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    z-index: 250; display: none; }
  body.sb-open .sb-backdrop { display: block; }
}

/* Pastille « non lu » sur un sous-onglet (historique des statuts) */
.nav-unread-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-left: 6px; vertical-align: middle;
}

/* Répartition des appels pris par cadre (page Statistiques VIGIE) */
.vigie-stat-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.vigie-stat-name { flex: 0 0 160px; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vigie-stat-bar { flex: 1; height: 12px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.vigie-stat-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.vigie-stat-count { flex: 0 0 2.5rem; text-align: right; font-weight: 600; font-size: .85rem; }
/* Délai moyen de décroché : la sonnerie du mobile avant réponse, pas l'annonce
   d'accueil — celle-ci est la même pour tout le monde et ne départage personne. */
.vigie-stat-ring {
  flex: 0 0 4.2rem; text-align: right; font-size: .8rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.vigie-stat-head {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
}
.vigie-stat-head .vigie-stat-count, .vigie-stat-head .vigie-stat-ring { font-weight: 600; }
.vigie-medal { margin-right: .3rem; }
/* Rang des trois cadres les plus rapides (vigie-stats-core.js MEDALS). */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; border-radius: 50%; vertical-align: -.2rem;
  font-size: .7rem; font-weight: 700; color: #fff;
}
.rank-1 { background: #c9a227; }
.rank-2 { background: #8e9aa6; }
.rank-3 { background: #b0703c; }
/* Temps mesuré mais hors classement (trop peu d'appels) : visible, puisque c'est une
   mesure réelle, mais assez effacé pour qu'on ne le compare pas aux médaillés. */
.vigie-stat-ring-unranked { opacity: .55; }
.vigie-unranked-mark { margin-left: .1rem; }
.vigie-podium {
  margin-top: .9rem; font-size: .82rem; color: var(--text-muted);
  padding-top: .7rem; border-top: 1px solid var(--border);
}
.vigie-podium strong { color: var(--text); }
.vigie-podium-note { font-size: .74rem; }
.nav-calls-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger-fill); color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  margin-left: 6px; vertical-align: middle; line-height: 1;
}
/* ── Présence : qui d'autre est connecté (modules/presence.js) ──
   Pastilles qui se chevauchent, comme dans un document partagé ; la liste au survol. */
.presence { position: relative; flex: none; }
.presence[hidden] { display: none; }
.presence-stack {
  display: flex; align-items: center; padding: .15rem;
  background: none; border: none; border-radius: 999px; cursor: default; font: inherit;
}
.presence-stack:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.presence-bubble {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--surface2); color: var(--accent-text);
  border: 2px solid var(--surface);
  font-weight: 700; font-size: .68rem;
  display: flex; align-items: center; justify-content: center;
}
.presence-stack .presence-bubble + .presence-bubble { margin-left: -8px; }
.presence-more { color: var(--text-muted); }
.presence-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 240px; max-height: 60vh; overflow-y: auto; padding: .5rem; z-index: 400;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-modal);
}
/* Pont invisible entre les pastilles et la liste : le survol ne se perd pas en chemin. */
.presence-pop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.presence-pop[hidden] { display: none; }
.presence-title { margin: .1rem .3rem .4rem; font-size: .72rem; color: var(--text-muted); }
.presence-pop ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.presence-pop li { display: flex; align-items: center; gap: .6rem; padding: .35rem .3rem; border-radius: 7px; }
.presence-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.presence-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence-role { font-size: .68rem; color: var(--text-muted); white-space: nowrap; }
.presence-where { display: flex; gap: .3rem; color: var(--text-muted); flex: none; }

/* ── Menu utilisateur (pastille + panneau déroulant, à droite du bandeau) ── */
.user-menu { position: relative; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: .55rem;
  padding: .2rem .55rem .2rem .25rem;
  background: none; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); cursor: pointer; font: inherit;
  transition: border-color .15s;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--surface2); color: var(--accent-text);
  font-weight: 700; font-size: .72rem;
  display: flex; align-items: center; justify-content: center;
}
.user-id { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.user-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-sub { font-size: .68rem; color: var(--text-muted); white-space: nowrap; }
.user-caret { color: var(--text-muted); flex: none; }
.user-chip[aria-expanded="true"] .user-caret { transform: rotate(180deg); }

.user-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 230px; padding: .35rem; z-index: 400;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column; gap: 2px;
}
.user-pop[hidden] { display: none; }
.user-pop hr { border: none; border-top: 1px solid var(--border); margin: .25rem .2rem; }
.user-pop-item {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  background: none; border: none; color: var(--text); cursor: pointer; font: inherit;
  font-size: .85rem; padding: .5rem .6rem; border-radius: 7px;
  transition: background .15s;
}
.user-pop-item:hover { background: var(--surface2); }
.user-pop-item .lucide { flex: none; color: var(--text-muted); }
.user-pop-item.danger, .user-pop-item.danger .lucide { color: var(--red); }
.user-pop-item.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ── Bandeau : ce qui cède, et dans quel ordre ────────────────────────────────
   Le <header> est une ligne qui ne se replie pas : fil d'Ariane (élastique), puis
   pastilles d'état, voyants de latence, présences et pastille du compte — tous en
   `flex: none`. Quand la somme des inélastiques dépasse la largeur, ce n'est pas le
   fil d'Ariane qui trinque (il est déjà réduit à zéro) mais le DERNIER de la ligne :
   la pastille du compte sort de l'écran, et avec elle le menu — donc la déconnexion
   et la bascule mobile. Mesuré avant correction : débordement dès 1280 px.

   D'où ces paliers, du moins utile au plus utile. Ils doivent rester APRÈS les
   déclarations de base : `.user-id { display: flex }` est déclaré plus haut sans
   media query, et à spécificité égale c'est la dernière règle qui gagne — un
   `@media` placé avant lui n'a aucun effet (le palier 1024 était mort ainsi).

   Le compte n'est jamais masqué : c'est le seul chemin vers la déconnexion. */
@media (max-width: 1500px) {
  /* « Opérateur 16 ms » → « ● 16 ms » : le chiffre et sa couleur suffisent. */
  .link-stat-label { display: none; }
  .link-stat { gap: .6rem; }
}
@media (max-width: 1400px) {
  /* La liaison Internet du PCM (« Tél. Bouygues · Données Starlink », deux noms
     d'opérateur et deux jauges) pèse 268 px à elle seule, plus que les pastilles
     d'état et la pastille du compte réunies. Elle sort tôt : c'est le seul voyant
     qui a sa propre page (Réseau → Liaison Internet PCM), et une coupure se lit
     aussi sur les latences restées à sa gauche. */
  .link-stat-item[data-link="wan"] { display: none; }
}
@media (max-width: 1200px) {
  /* « COT ouvert » → « ● COT » : la couleur du point porte déjà l'état. */
  .hdr-state-value { display: none; }
  .hdr-state { padding: .2rem .5rem; }
}
@media (max-width: 1024px) {
  /* La pastille se réduit à l'avatar ; nom et rôle restent dans le menu déroulé. */
  .user-id { display: none; }
}
@media (max-width: 900px) {
  /* Les voyants de latence quittent le bandeau, la page « Qualité réseau » les
     porte en entier. */
  .link-stat { display: none; }
}

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; }
/* Les pastilles d'état sont des lampes, pas du texte : elles prennent la palette
   saturée du feu tricolore. Sur 7 px, les teintes assagies du thème clair (nécessaires
   dès qu'il s'agit de lire un mot) ne se distinguaient plus les unes des autres. */
.dot-green { background: var(--lamp-good); }
.dot-yellow { background: var(--lamp-warn); }
.dot-red { background: var(--lamp-bad); }
.dot-grey { background: #555; }
.dot-blue { background: var(--blue); }
/* « En pause » (modules/status.js, agentStatus). Seule pastille hors palette du feu
   tricolore : sur 8 px, `--lamp-warn` ne se distinguerait pas de « Sonne », alors que
   les deux états n'appellent pas du tout la même réaction. Elle suit donc son badge
   (badge-orange), qui est déjà la couleur de la pause partout ailleurs. Sans cette
   règle, le point était simplement transparent — un poste en pause n'avait pas de
   pastille du tout. */
.dot-orange { background: var(--orange); }

main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; width: 100%; }
.section { display: none; }
.section.active { display: block; }

/* ── CARDS GRID ── */
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .9rem 1rem;
}
.card-title { font-weight: 600; font-size: .9rem; }
.card-sub { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.card-badge {
  display: inline-flex; align-items: center; margin-top: .5rem;
  font-size: .75rem; padding: .2rem .6rem; border-radius: 999px;
}
.badge-green { background: #16361e; color: var(--green); }
.badge-red { background: #3b1212; color: var(--red); }
.badge-yellow { background: #3b2c0a; color: var(--yellow); }
/* #666 sur ce fond ne tenait que 2,86:1 — le plus mauvais des badges du thème sombre,
   alors que les cinq autres tournent au-dessus de 5:1 grâce à leur couleur de statut. */
.badge-grey { background: #1e1e2e; color: #9aa0c4; }
.badge-blue { background: #0f1f3b; color: var(--blue); }
.badge-orange { background: #3b1e0a; color: var(--orange); }

/* Pastille « lampe » : aplat saturé et encre foncée, pour les valeurs de latence.
   Elle se lit au coup d'œil là où les badges pâles obligeaient à déchiffrer le
   chiffre pour savoir si la liaison allait bien. */
.badge-lamp-good { background: var(--lamp-good); color: var(--lamp-ink); font-weight: 700; }
.badge-lamp-warn { background: var(--lamp-warn); color: var(--lamp-ink); font-weight: 700; }
.badge-lamp-bad  { background: var(--lamp-bad);  color: var(--lamp-ink); font-weight: 700; }

/* Onglet Utilisateurs vu par un chef de PC : la liste réduite du serveur n'a ni poste,
   ni mobiles, ni actions — les colonnes correspondantes disparaissent. */
#tab-users.users-reduced .col-poste, #tab-users.users-reduced .col-mob,
#tab-users.users-reduced .col-act { display: none; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface); padding: .65rem 1rem;
  text-align: left; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody tr.cdr-new { animation: cdr-flash 2.5s ease-out forwards; }
@keyframes cdr-flash {
  0%   { background: color-mix(in srgb, var(--accent) 25%, transparent); }
  100% { background: transparent; }
}
tbody td { padding: .65rem 1rem; font-size: .875rem; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 2rem; }

/* ── Appels vers numéros d'urgence ── */
tbody tr.cdr-emergency {
  background: color-mix(in srgb, var(--red) 9%, transparent);
  box-shadow: inset 3px 0 0 var(--red);
}
tbody tr.cdr-emergency:hover { background: color-mix(in srgb, var(--red) 15%, var(--surface2)); }
.dst-emergency {
  display: inline-flex; align-items: center; gap: .25rem;
  font-weight: 700; color: var(--red);
}
.emergency-label {
  display: inline-block; margin-top: .15rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--red);
}

/* ── FILTERS ── */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; align-items: flex-end; }
.filters input, .filters select { padding: .45rem .65rem; font-size: .85rem; }
.filters select { padding-right: 1.9rem; }
.filters .btn { font-size: .85rem; padding: .45rem 1rem; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin-top: 1rem; }
.pagination button {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: .35rem .8rem; border-radius: 6px; cursor: pointer; font-size: .8rem;
}
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination span { font-size: .8rem; color: var(--text-muted); }

/* ── AUDIO PLAYER ── */
.audio-cell { display: flex; gap: .4rem; align-items: center; min-width: 320px; }
.audio-cell audio { height: 34px; width: 100%; min-width: 280px; accent-color: var(--accent); }
.btn-dl {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .2rem .5rem; border-radius: 4px; cursor: pointer; font-size: .75rem;
}
.btn-dl:hover { border-color: var(--accent); color: var(--accent); }

/* ── LIVE CALLS ── */
.duration-cell { font-variant-numeric: tabular-nums; }

/* ── HISTORIQUE DES STATUTS ── */
#btn-events { position: relative; }
.events-list { max-height: 72vh; overflow-y: auto; display: flex; flex-direction: column; gap: .15rem; margin-top: 1rem; }
.ev-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem; border-bottom: 1px solid var(--border); font-size: .85rem;
}
.ev-row:last-child { border-bottom: none; }
.ev-ico { display: inline-flex; flex-shrink: 0; }
.ev-text { flex: 1; min-width: 0; }
.ev-time { color: var(--text-muted); font-size: .75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-green .ev-ico  { color: var(--green); }
.ev-red .ev-ico    { color: var(--red); }
.ev-orange .ev-ico { color: var(--orange); }
.ev-blue .ev-ico   { color: var(--accent-text); }
.ev-grey .ev-ico   { color: var(--text-muted); }
.ev-empty { color: var(--text-muted); text-align: center; padding: 2rem 0; font-size: .85rem; }

/* ── JOURNAL (pôle Administration) ─────────────────────────────────────────
   Reprend la ligne d'événement (.ev-row) en la rendant dépliable : le détail vit dans
   un bloc frère, masqué par défaut. */
.jr-filters {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
/* Dans son panneau, la liste prend la hauteur de l'écran (moins l'en-tête de page) et
   ses lignes ont le même retrait que les filtres. */
.jr-panel .events-list { margin-top: .5rem; max-height: calc(100vh - 290px); min-height: 240px; }
.jr-panel .ev-row { padding: .55rem .5rem; border-radius: 6px; }
.jr-panel .jr-expand { margin: 0 .5rem; }
.jr-filters #jr-search { flex: 1; min-width: 200px; font-size: .8rem; padding: .4rem .6rem; }
.jr-window { font-size: .8rem; padding: .4rem 1.9rem .4rem .5rem; }   /* droite : place du chevron */
.jr-chk {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8rem; color: var(--text-muted); white-space: nowrap; cursor: pointer;
}
.jr-sep { width: 1px; height: 18px; background: var(--border); }
/* Dit ce que les filtres RETIRENT de la liste : sans cela, « Technique » décoché par
   défaut faisait croire que le journal ne contient pas les événements d'Asterisk. */
.jr-hint { font-size: .75rem; color: var(--text-muted); padding: .5rem .1rem 0; }
.jr-freeze-btn { background: var(--surface); border: 1px solid var(--border); }
.jr-freeze-btn.active { background: var(--accent-fill); color: #fff; border-color: var(--accent-fill); }

.jr-row { cursor: pointer; }
.jr-row:hover { background: var(--surface2); }
.jr-row .jr-caret { color: var(--text-muted); display: inline-flex; transition: transform .15s; }
.jr-row.open .jr-caret { transform: rotate(90deg); }
.jr-meta { display: block; color: var(--text-muted); font-size: .72rem; margin-top: .1rem; }

.jr-expand { padding: .6rem .75rem .8rem 2.1rem; border-bottom: 1px solid var(--border); }
.jr-detail {
  display: grid; grid-template-columns: minmax(120px, max-content) 1fr;
  gap: .3rem .9rem; margin: 0; font-size: .8rem;
}
.jr-detail dt { color: var(--text-muted); }
.jr-detail dd { margin: 0; word-break: break-word; }
.jr-json {
  margin: 0; padding: .4rem .55rem; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .75rem; overflow-x: auto; white-space: pre;
}
.jr-empty-detail { color: var(--text-muted); font-size: .8rem; }

/* ── MODAL ──────────────────────────────────────────────────────────────────
   Une modale ne se ferme QUE par ses boutons (Annuler / Valider) ou Échap : aucun
   clic sur le fond ne la referme, pour ne pas perdre une saisie en cours d'un
   geste malheureux. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 10, 16, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  animation: modal-fade .15s ease-out;
}
[data-theme="light"] .modal-overlay { background: rgba(26, 29, 46, .38); }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-modal);
  padding: 1.5rem 1.6rem;
  width: 440px; max-width: 100%;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  animation: modal-pop .18s cubic-bezier(.2, .8, .3, 1);
}
/* La boîte reçoit le focus à l'ouverture (modals.js) : c'est un conteneur, pas un
   contrôle, son contour n'indique rien — et en plein écran il traçait un liseré. */
.modal-box:focus { outline: none; }
/* Formulaire riche (création d'utilisateur, fiche complète) : deux colonnes tiennent. */
.modal-box-lg { width: 720px; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-box { animation: none; }
}

/* Le fond de page ne défile plus derrière une modale ouverte. */
body.modal-open { overflow: hidden; }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.modal-title { font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
/* Texte d'explication sous le titre, ou corps d'une modale d'information. */
.modal-desc { color: var(--text-muted); font-size: .875rem; line-height: 1.55; }
.modal-head .modal-desc { margin-top: .3rem; }

.modal-footer {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: 1.5rem; padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.modal-footer .btn { width: auto; min-width: 96px; }

.btn-close {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 30px; height: 30px; margin: -.25rem -.35rem 0 0;
  background: none; border: none; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-close:hover { background: var(--surface2); color: var(--text); }
.btn-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* ── FEUILLE GLISSANTE (mobile) ──
   Sous 640 px, la même modale devient une feuille ancrée en bas de l'écran. Une
   boîte flottante au milieu est hostile sur un téléphone : elle arrive sans
   transition, ses boutons tombent hors de portée du pouce, et le clavier virtuel la
   coupe en deux. Ancrée en bas, elle monte depuis le bord, ses actions sont là où le
   pouce se trouve, et le clavier la pousse sans la masquer.
   La barre de préhension et le glissement vers le bas (modals.js) disent qu'elle se
   referme d'un geste — sans supprimer la croix, qui reste le chemin sûr. */
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box, .modal-box-lg {
    width: 100%;
    /* Coins arrondis en haut seulement : elle sort du bord, elle n'y flotte pas. */
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    max-height: 92vh;
    /* Encoche / barre d'accueil iPhone : sans ça le dernier bouton passe dessous. */
    padding: 1.4rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1);
    transition: transform .16s ease-out;
    touch-action: pan-y;
  }
  /* Barre de préhension : c'est elle qui annonce le geste. */
  .modal-box::before {
    content: ''; display: block;
    width: 38px; height: 4px; margin: -.55rem auto .9rem;
    border-radius: 999px; background: var(--border);
  }
  /* L'en-tête est la zone de glissement : il ne doit pas sélectionner de texte. */
  .modal-head { user-select: none; -webkit-user-select: none; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; min-height: 44px; }

  /* Formulaire long (création et accès d'un compte) : plein écran, pas une feuille.
     En-tête et boutons restent en place pendant qu'on fait défiler les champs, et
     aucun glissement ne referme la page (modals.js ne le branche pas) : on ne perd
     pas une fiche à moitié remplie d'un geste du pouce. */
  .modal-box.modal-plein {
    height: 100vh; height: 100dvh; max-height: none;
    border-radius: 0; border: 0; padding-top: 0; padding-bottom: 0;
  }
  .modal-box.modal-plein::before { display: none; }
  .modal-plein .modal-head {
    position: sticky; top: 0; z-index: 2; align-items: center;
    background: var(--surface); border-bottom: 1px solid var(--border);
    margin: 0 -1.1rem 1rem; padding: calc(.8rem + env(safe-area-inset-top, 0px)) 1.1rem .8rem;
  }
  .modal-plein .modal-footer {
    position: sticky; bottom: 0; z-index: 2; flex-direction: row;
    background: var(--surface);
    margin: 1.25rem -1.1rem 0; padding: .75rem 1.1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
  }
  .modal-plein .modal-footer .btn { flex: 1; width: auto; }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-box, .modal-box-lg { animation: none; transition: none; }
}

/* Bouton icône header */
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .3rem .6rem; border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ── RAPPORT DE VACATION ──
   Panneau plein écran, enfant DIRECT de <body> : c'est ce qui permet à la règle
   d'impression plus bas de masquer tous ses frères d'un seul sélecteur. */
#report-panel, #event-panel {
  display: none;
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg); overflow-y: auto;
}
#report-panel.open, #event-panel.open { display: block; }
body.report-open { overflow: hidden; }

.report-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem 1.2rem; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.report-bar-title { font-weight: 600; }
.report-bar-spacer { flex: 1 1 auto; }
.report-bar .btn { width: auto; flex: none; }
.report-field { font-size: .8rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .35rem; }
.report-field input, .report-field select { width: auto; font-size: .8rem; padding: .2rem .4rem; }

.report-doc { max-width: 1100px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.report-doc-head { margin-bottom: 1.4rem; }
.report-title { margin: 0 0 .3rem; font-size: 1.3rem; font-weight: 600; }
.report-period { margin: 0; font-size: .9rem; }
.report-meta { margin: .15rem 0 0; font-size: .76rem; color: var(--text-muted); }
.report-h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin: 1.8rem 0 .6rem; font-weight: 600; }
.report-count { color: var(--accent-text); text-transform: none; letter-spacing: 0; }
.report-empty { color: var(--text-muted); font-size: .85rem; padding: 2rem 0; text-align: center; }

.report-kpis {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.report-kpi { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; }
.report-kpi-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); }
.report-kpi-value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1.2; }
.report-kpi-sub { font-size: .72rem; color: var(--text-muted); }

.report-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.report-table th, .report-table td {
  text-align: left; padding: .35rem .5rem; vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.report-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 600; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table .nowrap { white-space: nowrap; }
.report-num { font-size: .74rem; color: var(--text-muted); }
.report-muted td { color: var(--text-muted); }
.report-voie { font-size: .7rem; color: var(--accent-text); }
.report-flagged { background: color-mix(in srgb, var(--orange) 10%, transparent); }

/* Impression : le panneau devient la page. Tout le reste disparaît — barre de
   navigation, onglets, bandeaux — sinon le PDF sortirait avec l'interface autour. */
@media print {
  body.report-open > *:not(#report-panel):not(#event-panel) { display: none !important; }
  body.report-open { overflow: visible; }
  #report-panel.open, #event-panel.open { position: static; overflow: visible; background: #fff; color: #000; }
  .report-bar { display: none !important; }
  .report-doc { max-width: none; padding: 0; }
  .report-kpi, .report-table th, .report-table td { border-color: #bbb; }
  .report-title, .report-kpi-value { color: #000; }
  .report-table { font-size: .72rem; }
  /* Une ligne d'appel ne doit pas être coupée entre deux pages. */
  .report-table tr { break-inside: avoid; }
  .report-table thead { display: table-header-group; }
}

/* ── RAPPORT D'ÉVÉNEMENT ── (même panneau, mêmes règles d'impression que la vacation) */
.event-name-input { min-width: 16rem; }
.event-title { margin: 0 0 .2rem; font-size: 1.6rem; font-weight: 700; }
.event-kicker { margin: 0 0 .2rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); }
.event-hero { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap;
  margin-bottom: 1rem; }
.event-hero-value { font-size: 4.2rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--accent-text); }
.event-hero-label { font-size: .95rem; font-weight: 600; }
.event-hero-sub { font-size: .8rem; color: var(--text-muted); }
.event-hero .report-kpis { flex: 1 1 420px; }
.report-table tfoot td { font-weight: 600; font-size: 1em; border-top: 1px solid var(--border); }
#event-step { min-width: 5.5rem; }
.report-table .sub td:first-child { padding-left: 1.4rem; color: var(--text-muted); }
.event-chart { width: 100%; height: auto; display: block; }
.event-chart .grid { stroke: color-mix(in srgb, var(--border) 70%, transparent); stroke-width: 1; }
.event-chart .axis-text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.event-chart .bar-in { fill: var(--accent); }
.event-chart .bar-out { fill: var(--orange); }
/* Internes : 3e teinte de la série (validée contre l'accent et l'orange, sombre et clair). */
.event-chart .bar-int { fill: #11a597; }
[data-theme="light"] .event-chart .bar-int { fill: #0d9488; }
.event-chart .bar-hit { fill: transparent; }
.event-chart .bar-hit:hover { fill: color-mix(in srgb, var(--text) 8%, transparent); }
.event-chart .peak-label { fill: var(--text); font-size: 11px; font-weight: 600; }
.event-legend { display: flex; gap: 1.2rem; font-size: .78rem; color: var(--text-muted);
  margin: .2rem 0 0; }
.event-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px;
  margin-right: .35rem; vertical-align: -1px; }
.event-legend .in { background: var(--accent); }
.event-legend .out { background: var(--orange); }
.event-legend .int { background: #11a597; }
[data-theme="light"] .event-legend .int { background: #0d9488; }
/* Pastille de cellule dans l'en-tête du tableau « Par cellule » du rapport COT. */
.event-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px;
  margin-right: .3rem; vertical-align: -1px; }
@media print {
  .event-hero-value { color: #000; }
  .event-chart .bar-in, .event-legend .in { fill: #3d5ae8; background: #3d5ae8; }
  .event-chart .bar-out, .event-legend .out { fill: #c2410c; background: #c2410c; }
  .event-chart .bar-int, .event-legend .int { fill: #0d9488; background: #0d9488; }
  .event-chart, .event-legend i, .event-dot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  /* Une section ne se coupe pas entre deux pages : un tableau par ligne dont l'en-tête
     reste en bas de la page 1 ne se lit plus. */
  .event-section { break-inside: avoid; }
  /* Le SVG est réduit de moitié sur une page A4 : graduations agrandies d'autant. */
  .event-chart .axis-text, .event-chart .peak-label { font-size: 18px; }
}

/* Étiquettes de compte rendu (Personnalisation) : une ligne par étiquette, le libellé
   modifiable sur place, les actions à droite. */
.tags-list { display: flex; flex-direction: column; }
.tag-row {
  display: flex; gap: .6rem; align-items: center;
  padding: .45rem 0; border-top: 1px solid var(--border);
}
.tag-row:first-child { border-top: none; padding-top: 0; }
.tag-row .tag-label { flex: 1; max-width: 520px; }
.tag-row .card-badge { margin-top: 0; }
.tag-row .btn { width: auto; }
.tag-row .tag-save[hidden] { display: none; }
/* Désactivée : encore là, encore lisible, mais visiblement hors service. */
.tag-row.is-off .tag-label { opacity: .55; text-decoration: line-through; }
.tag-new-row {
  display: flex; gap: .6rem; align-items: center;
  margin-top: .75rem; padding-top: .9rem; border-top: 1px solid var(--border);
}
.tag-new-row input { flex: 1; max-width: 520px; }
.tag-new-row .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }

/* ── HEAT MAP VIGIE (une case par jour) ──
   Deux signaux distincts sur une même case : l'intensité dit le VOLUME, le liseré
   rouge dit qu'un appel y est resté sans réponse. Un jour chargé et un jour raté ne
   doivent pas se confondre. */
.vh-controls { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .9rem; }
.vh-legend { margin-left: auto; font-size: .72rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .35rem; }
.vh-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.vh-swatch-missed { background: var(--surface2); box-shadow: inset 0 0 0 2px var(--red); margin-left: .5rem; }

.vh-months { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.vh-month-title { margin: 0 0 .4rem; font-size: .78rem; color: var(--text-muted);
  text-transform: capitalize; }
.vh-grid { display: grid; grid-template-columns: repeat(7, 26px); gap: 3px; }
.vh-dow { font-size: .62rem; color: var(--text-muted); text-align: center; }
.vh-pad { }
.vh-cell {
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 5px;
  cursor: pointer; position: relative; font: inherit;
  outline: 2px solid transparent; transition: outline-color .12s;
}
.vh-cell:hover { outline-color: var(--accent); }
.vh-num { font-size: .62rem; color: var(--text-muted); line-height: 26px; }
/* Journée avec un appel sans réponse : le liseré, indépendant de l'intensité. */
.vh-missed { box-shadow: inset 0 0 0 2px var(--red); }
.vh-on { outline-color: var(--accent); }

.vh-day { margin-top: 1.1rem; }
.vh-day:empty { display: none; }
.vh-day-title { margin: 0 0 .4rem; font-size: .8rem; font-weight: 600; }
.vh-day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-width: 460px; }
.vh-day-list li { display: flex; align-items: center; gap: .6rem; font-size: .84rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); padding-top: .3rem; }
.vh-day-list li:first-child { border-top: none; }
.vh-day-time { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.vh-day-who { flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.vh-empty { color: var(--text-muted); font-size: .84rem; margin: .5rem 0; }

/* ── CONSIGNES DU JOUR ──
   En tête de la page Poste. Ton sobre : ce n'est pas une alerte, c'est ce que
   l'équipe doit avoir sous les yeux. Le rouge reste réservé aux appels manqués. */
.consignes { margin-bottom: 1.1rem; }
.consignes-box {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 10px; padding: .7rem .9rem;
}
/* Aucune consigne : l'encart se fait discret, il ne reste que pour le bouton. */
.consignes-box.is-empty {
  background: none; border-color: var(--border); padding: .4rem .5rem;
}
.consignes-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.consignes-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 600;
}
.consignes-count {
  background: var(--accent-fill); color: #fff; border-radius: 999px;
  font-size: .68rem; font-weight: 700; padding: 0 .35rem; min-width: 16px; text-align: center;
}
.consigne-spacer { flex: 1 1 auto; }
.consigne-add {
  background: none; border: none; cursor: pointer; padding: .2rem 0;
  font: inherit; font-size: .78rem; color: var(--accent-text);
  display: inline-flex; align-items: center; gap: .25rem;
}
.consigne-add:hover { text-decoration: underline; }

.consignes-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .6rem; }
.consigne { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  padding-top: .5rem; }
.consigne:first-child { border-top: none; padding-top: 0; }
.consigne-text { margin: 0; font-size: .9rem; white-space: pre-wrap; }
.consigne-meta {
  margin: .2rem 0 0; font-size: .72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.consigne-del {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 0 .15rem; line-height: 0; margin-left: auto;
}
.consigne-del:hover { color: var(--red); }

.consigne-form { margin-top: .6rem; }
.consigne-input { width: 100%; font: inherit; font-size: .88rem; resize: vertical; }
.consigne-form-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .45rem;
}
.consigne-days { font-size: .78rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .3rem; }
.consigne-days select { width: auto; font-size: .78rem; padding: .18rem 1.5rem .18rem .4rem; }
.consigne-form-row .btn { width: auto; }

/* ── PAGE « POSTE » : en-tête ──
   Titre, poste de rattachement, horloge. L'horloge est volontairement grosse : elle
   sert à horodater une main courante à la main, à un mètre de l'écran. */
.poste-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.poste-header-id { min-width: 0; }
.poste-title { margin: 0 0 .35rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.poste-me { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: .84rem; color: var(--text-muted); }
.poste-me strong { color: var(--text); }
.poste-me-none { color: var(--orange); }
.poste-me-select { font-size: .8rem; padding: .18rem 1.6rem .18rem .4rem; width: auto; }
/* Les numéros des lignes sous l'horloge, en pastilles, au niveau du choix de poste :
   l'opérateur les dicte à un appelant sans les chercher. Remplis par app.js
   (setLineNumbers, [data-line]). */
.poste-lines { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem .6rem; margin: .5rem 0 0; }
.poste-line {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .22rem .65rem; border-radius: 999px; font-size: .76rem; color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.poste-line strong { font-size: .92rem; color: var(--text); letter-spacing: .4px; white-space: nowrap; }

.poste-clock { text-align: right; flex: none; }
/* L'heure se lit à un mètre de l'écran, debout : c'est la taille qui fait la
   fonction. Chiffres tabulaires, sinon elle tressaute à chaque seconde. */
.poste-clock-time {
  font-size: 3.2rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.poste-clock-date { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

/* Attente moyenne : le chiffre qui dit si la ligne tient ou prend du retard. */
.poste-wait {
  margin-top: .8rem; padding-top: .6rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: baseline; gap: .4rem;
}
.poste-wait:empty { display: none; }
.poste-wait-value { font-size: 1.15rem; font-weight: 600; color: var(--accent-text);
  font-variant-numeric: tabular-nums; }
.poste-wait-label { font-size: .72rem; color: var(--text-muted); line-height: 1.3; }

@media (max-width: 640px) {
  .poste-clock { text-align: left; }
  .poste-clock .poste-lines { justify-content: flex-start; }
  .poste-clock-time { font-size: 2.4rem; }
  .poste-title { font-size: 1.35rem; }
}

/* ── PAGE « POSTE » (plan de travail de l'opérateur) ──
   Deux colonnes sur grand écran, une seule dès qu'on descend : les blocs sont
   indépendants, empiler ne perd rien. Chaque bloc plafonne sa hauteur et défile
   à l'intérieur, sinon un annuaire bavard repousserait les appels en cours hors
   de l'écran — exactement ce que la page cherche à éviter. */
/* Trois modules par rangée sur grand écran. La rangée du haut est celle qu'on
   regarde pendant un appel (consignes, sa propre saisie, l'annuaire) ; celle du bas
   entre deux appels. On passe à deux colonnes puis à une seule quand la place manque.
   Sur deux colonnes, ce qui sert pendant un appel remonte : annuaire et ligne (C E),
   puis sa saisie et l'historique (B F), consignes et postes en dernier (A D). Sur une
   seule, la ligne passe devant l'annuaire : E C B F A D. */
.poste-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1500px) { .poste-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1500px) {
  .poste-grid > [id$="-mod-c"] { order: 1; }
  .poste-grid > [id$="-mod-e"] { order: 2; }
  .poste-grid > [id$="-mod-b"] { order: 3; }
  .poste-grid > [id$="-mod-f"] { order: 4; }
  .poste-grid > [id$="-mod-a"] { order: 5; }
  .poste-grid > [id$="-mod-d"] { order: 6; }
}
/* Pages Poste, cartes proches de leur largeur minimale (moins de ~460 px : portable en
   1536, écran de 1680, demi-écran) : tout le contenu des cartes réduit de 14 %, texte
   et marges ensemble — `zoom` et non `font-size`, la plupart des tailles étant en rem.
   Paliers déduits de la largeur des cartes : (écran − 318) / 3 en trois colonnes,
   (écran − 300) / 2 en deux avec le menu, (écran − 64) / 2 menu replié. */
@media (min-width: 1501px) and (max-width: 1700px),
       (min-width: 1101px) and (max-width: 1220px),
       (min-width: 901px) and (max-width: 984px) {
  .poste-page .poste-grid { zoom: .86; }
}
@media (max-width: 900px)  {
  .poste-grid { grid-template-columns: 1fr; }
  .poste-grid > [id$="-mod-e"] { order: 1; }
  .poste-grid > [id$="-mod-c"] { order: 2; }
}
.poste-card { display: flex; flex-direction: column; min-width: 0; }
.poste-card-head {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem;
}
.poste-card-title {
  margin: 0; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); flex: 1 1 auto;
}
.poste-card-title span { color: var(--accent-text); text-transform: none; letter-spacing: 0; }
/* Périmètre d'une carte (« · vos cellules ») : précise le titre, sans l'accent d'un compteur. */
.poste-card-title .poste-card-scope { color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
/* Numéros des cellules ajoutés sous celui du COT, dans la même colonne de pastilles. */
.poste-lines-more { display: contents; }
.poste-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: .75rem; color: var(--accent-text); flex: none;
}
.poste-link:hover { text-decoration: underline; }
.poste-empty { color: var(--text-muted); font-size: .82rem; padding: .8rem 0; }

/* #poste-recent n'y figure plus : un sélecteur d'identifiant l'emportait sur
   `.poste-page .poste-scroll { max-height: none }`, et la liste s'arrêtait à 22rem au
   milieu de la carte « Derniers appels ». Elle remplit désormais sa carte. */
.poste-ext-list, #poste-contacts { max-height: 22rem; overflow-y: auto; }

.poste-ext {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .38rem 0; font-size: .84rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.poste-ext:first-child { border-top: none; }
.poste-ext-mine { font-weight: 600; }
.poste-ext-id {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem;
}
.poste-ext-num { font-variant-numeric: tabular-nums; }
/* Le nom du poste ne se tronque pas et ne disparaît pas : il passe à la ligne. */
.poste-ext-label { color: var(--text); font-weight: 400; word-break: break-word; }
.poste-ext-state { font-size: .78rem; color: var(--text-muted); font-weight: 400;
  flex: none; margin-left: auto; }
.poste-ext-tag {
  font-size: .68rem; color: var(--accent-text); font-weight: 400;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 4px; padding: 0 .3rem;
}
/* Demi-carte (trois colonnes, cf. .poste-grid) : le nom tient seul sa ligne, l'état et
   les étiquettes passent dessous, alignés sur le nom et non sous le point — en flux
   libre, chaque ligne se repliait à sa façon et l'état sautait de droite à gauche. */
.poste-page .poste-ext-list { container-type: inline-size; }
@container (max-width: 20rem) {
  .poste-ext { position: relative; padding-left: 1.05rem; row-gap: .2rem; column-gap: .35rem; }
  .poste-ext > .status-dot { position: absolute; left: 0; top: .78rem; }
  .poste-ext-id { flex: 1 0 100%; }
  .poste-ext-state { margin-left: 0; }
}

.poste-recent-list, .poste-contact-list { list-style: none; margin: 0; padding: 0; }
.poste-recent-row, .poste-contact {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .38rem 0; font-size: .84rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.poste-recent-row:first-child, .poste-contact:first-child { border-top: none; }
/* ── F : historique court ──
   Grille stricte à trois colonnes — heure, corps, action — plutôt qu'un flex. Dans
   une colonne d'un tiers d'écran, quatre blocs en flex se repliaient chacun à leur
   guise et rien ne s'alignait plus d'une ligne à l'autre. Ici le nom et l'état
   tiennent la première ligne, le détail la seconde, et le bouton de rappel occupe
   les deux — quelle que soit la largeur. */
.poste-recent-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto auto;
  grid-template-areas:
    "when name  badge call"
    "when meta  meta  call";
  column-gap: .5rem;
  align-items: center;
  padding: .4rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.poste-recent-row:first-child { border-top: none; }

/* La date n'apparaît que hors du jour même (cf. dayLabel) : sur une liste courte,
   répéter « aujourd'hui » à chaque ligne n'apprend rien et mange la largeur. */
.poste-recent-when {
  grid-area: when; align-self: center;
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .82rem;
}
.poste-recent-day { display: block; font-size: .66rem; line-height: 1.1; }
.poste-recent-time { line-height: 1.2; }

.poste-recent-name {
  grid-area: name; min-width: 0; font-size: .86rem;
  display: flex; align-items: center; gap: .4rem;
  white-space: nowrap;
}
.poste-recent-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Sens de l'appel : pastille colorée, mêmes teintes que la carte « Ligne PCM » voisine
   (.call-dir) — bleu l'entrant, vert le sortant, gris l'interne. */
.poste-recent-dir {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.3rem; height: 1.3rem; border-radius: 5px;
  background: var(--surface2); color: var(--text-muted);
}
.poste-recent-dir.dir-in  { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-text); }
.poste-recent-dir.dir-out { background: color-mix(in srgb, var(--green) 20%, transparent);  color: var(--success); }
.poste-recent-badge { grid-area: badge; justify-self: end; }
/* Seconde ligne : l'étiquette de la ligne empruntée, puis le détail, qui se coupe. */
.poste-recent-meta {
  grid-area: meta; min-width: 0; font-size: .72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: .4rem; white-space: nowrap;
  margin-top: .1rem;
}
.poste-recent-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Ligne empruntée : même habillage que les étiquettes de « Postes du PCM » — moyens en
   plein, principale au trait, interne en gris. */
.poste-recent-line {
  flex: none; display: inline-flex; align-items: center; gap: .2rem;
  font-size: .66rem; font-weight: 600; line-height: 1.35;
  color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 4px; padding: 0 .3rem 0 .25rem;
}
.poste-recent-line.is-bilan { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.poste-recent-line.is-int { color: var(--text-muted); border-color: var(--border); padding-left: .3rem; }
/* Bouton-icône plutôt que « Rappeler » en toutes lettres : le mot coûtait 70 px
   dans une colonne qui n'en a pas 400, et c'est lui qui poussait la ligne à se
   replier. L'intitulé complet reste dans l'infobulle. */
.poste-recent-call {
  grid-area: call; align-self: center; justify-self: end;
  width: 30px; height: 30px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
button.poste-recent-call:hover { border-color: var(--green); color: var(--green); }

.poste-contact .btn {
  width: auto; flex: none; padding: .2rem .65rem; font-size: .76rem;
  white-space: nowrap;
}
/* Les numéros d'une fiche d'annuaire passent à la ligne d'un bloc quand la carte se
   resserre, au lieu de déborder du cadre. */
.poste-contact-nums {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin-left: auto; flex: none;
}

/* Table des appels en cours dans une carte : sans mise en page fixe, une cellule
   large impose sa largeur et fait défiler la carte entière horizontalement. */
.poste-card .table-wrap { overflow-x: auto; }
.poste-card table { table-layout: fixed; width: 100%; }
.poste-card table th, .poste-card table td {
  padding-left: .4rem; padding-right: .4rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Colonnes inégales : l'appelant (numéro espacé « 06 12 34 56 78 » et son icône) a
   besoin de place, la durée très peu. */
.poste-card table th:nth-child(1) { width: 36%; }
.poste-card table th:nth-child(2) { width: 26%; }
.poste-card table th:nth-child(3) { width: 14%; }

/* ── B : l'appel que ce poste tient ──
   Le module se souligne d'un liseré quand un appel est en cours : c'est le seul
   endroit de la page qui change d'état pendant qu'on parle, et l'œil doit le
   retrouver sans le chercher. */
.poste-card-live.is-live {
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  box-shadow: inset 0 2px 0 0 var(--green);
}
.poste-live-state { font-size: .75rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .35rem; }
.poste-live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: poste-pulse 1.6s ease-in-out infinite;
}
@keyframes poste-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .poste-live-dot { animation: none; } }
.poste-live-timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.poste-live-done { color: var(--text-muted); }
.poste-live-who { margin: 0 0 .7rem; font-size: 1rem; font-weight: 600; }
.poste-live-at { font-weight: 400; font-size: .82rem; color: var(--text-muted); margin-left: .4rem; }

/* ── Ce qu'on fait de l'appel (modules/poste-live.js) ──
   Quatre gros boutons, une ligne d'état en couleur, puis les blocs « En attente » et
   « Conférence ». Les boutons gardent leur place quand l'état change : l'œil et la main
   les retrouvent au même endroit à chaque appel. */
.appel-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
@container (min-width: 30rem) { .appel-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.appel-btn {
  width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  gap: .45rem; font-weight: 600; font-size: .85rem; padding: .45rem .5rem;
}
.appel-btn svg { flex: none; }
.appel-btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.appel-btn-danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.appel-statut {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 .55rem; padding: .5rem .65rem;
  border-radius: 8px; font-size: .86rem; font-weight: 600; line-height: 1.35;
  border: 1px solid transparent;
}
.appel-statut svg { flex: none; margin-top: .1rem; }
.appel-statut.is-info { background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.appel-statut.is-ok { background: color-mix(in srgb, var(--green) 12%, transparent);
  border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green); }
.appel-statut.is-warn { background: color-mix(in srgb, var(--orange) 12%, transparent);
  border-color: color-mix(in srgb, var(--orange) 40%, transparent); color: var(--orange); }
.appel-statut.is-err { background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }
.appel-chrono { font-variant-numeric: tabular-nums; }
.appel-bloc { margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--border); }
.appel-bloc-titre { display: flex; align-items: center; gap: .35rem; margin: 0 0 .35rem;
  font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .02em; }
.appel-ligne { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .3rem 0; }
.appel-ligne + .appel-ligne { border-top: 1px dashed var(--border); }
.appel-ligne-nom { min-width: 0; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.appel-ligne-sub { display: block; font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.appel-ligne.is-invite .appel-ligne-nom { color: var(--text-muted); font-style: italic; }
.appel-ligne-btns { display: inline-flex; gap: .3rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.appel-ligne .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
.appel-tag { margin-left: .4rem; padding: .05rem .4rem; border-radius: 999px; font-size: .68rem;
  font-weight: 500; background: var(--surface2); color: var(--text-muted); white-space: nowrap; }
/* Boutons d'un participant : icône seule (libellé au survol et pour les lecteurs d'écran),
   pour que la carte, de hauteur fixe, garde « Ajouter quelqu'un » en vue. */
.appel-ligne .btn.appel-ic { padding: .3rem .45rem; min-width: 34px; justify-content: center; }
.appel-ligne .btn.appel-ic.is-on { color: var(--orange); border-color: var(--orange); }
.appel-tag.is-ok { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.appel-conf-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin: .1rem 0 .4rem; }
.appel-conf-actions .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
.appel-aide { margin: .35rem 0 0; font-size: .76rem; color: var(--text-muted); }
/* Fenêtre « Conférence » : deux choix, chacun avec ce qu'il fait. */
.appel-choix { display: flex; flex-direction: column; gap: .55rem; }
.appel-choix-btn {
  display: flex; align-items: flex-start; gap: .7rem; text-align: left; font: inherit;
  padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text); cursor: pointer; font-size: .84rem;
}
.appel-choix-btn:hover, .appel-choix-btn:focus-visible { border-color: var(--accent); }
.appel-choix-btn svg { flex: none; color: var(--accent); margin-top: .1rem; }
.appel-choix-btn strong { display: block; font-size: .92rem; margin-bottom: .15rem; }

/* Fenêtre « Choisir un destinataire » (modules/choix-destinataire.js). */
.dest-search { display: flex; align-items: center; gap: .45rem; padding: 0 .6rem;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); }
.dest-search input { flex: 1; border: 0; background: transparent; padding: .6rem 0; font: inherit;
  color: var(--text); outline: none; }
.dest-search:focus-within { border-color: var(--accent); }
.dest-list { margin-top: .5rem; max-height: min(55vh, 26rem); overflow-y: auto; }
.dest-section { margin: .7rem 0 .25rem; font-size: .72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .03em; }
.dest-row {
  width: 100%; display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; min-height: 44px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text);
  font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
}
.dest-row:hover:not(:disabled) { background: var(--surface2); }
.dest-row.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dest-row:disabled { opacity: .5; cursor: not-allowed; }
.dest-ic { display: flex; color: var(--text-muted); flex: none; }
.dest-label { flex: 1; min-width: 0; font-weight: 500; }
.dest-sub { display: block; font-size: .75rem; font-weight: 400; color: var(--text-muted); }
.dest-etat { flex: none; font-size: .72rem; padding: .1rem .45rem; border-radius: 999px;
  background: var(--surface2); color: var(--text-muted); }
.dest-etat.is-libre { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.dest-etat.is-occupe, .dest-etat.is-sonne { color: var(--orange);
  background: color-mix(in srgb, var(--orange) 14%, transparent); }

.poste-search { width: 100%; margin-bottom: .6rem; }

/* Deux champs d'appel, un par ligne présentée (modules/poste.js) : icône de la ligne, champ,
   et le numéro que verra le correspondant. Celui de la ligne par défaut de l'opérateur est
   encadré ; l'autre reste pleinement utilisable. */
.poste-dialers { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .6rem; }
.poste-dialer {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: .15rem .5rem; padding: .35rem .45rem;
  border: 1px solid var(--border); border-radius: 8px;
}
.poste-dialer .poste-search { margin-bottom: 0; }
.poste-dialer-icon { display: flex; color: var(--text-muted); }
.poste-dialer-cid { grid-column: 2; font-size: .72rem; color: var(--text-muted); }
.poste-dialer-cid strong { font-variant-numeric: tabular-nums; color: var(--text); }
.poste-dialer.is-default {
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.poste-dialer.is-default .poste-dialer-icon { color: var(--accent-text); }
.poste-results-line {
  display: flex; align-items: center; gap: .3rem; margin: 0 0 .3rem;
  font-size: .72rem; color: var(--text-muted);
}
.poste-contact-name { flex: 1 1 9rem; min-width: 0; }
.poste-contact-company { display: block; font-size: .74rem; color: var(--text-muted); }

/* ── PAGES « POSTE » (PCM et centre opérationnel) : six cartes de taille fixe, sur un seul écran ──
   Une carte ne grandit ni ne rétrécit avec ce qu'elle contient : toutes ont la même
   taille, et c'est leur contenu qui défile à l'intérieur, sous un titre qui reste en
   place. Un opérateur retrouve donc chaque module au même endroit toute la vacation,
   qu'il y ait trois consignes ou aucune, un appel en file ou dix.
   Limité à .poste-page : la page Poste du COT partage ces classes sans ce besoin. */
.poste-page .poste-header { flex-wrap: nowrap; align-items: center; gap: 1.5rem; margin-bottom: .9rem; }
.poste-page .poste-header-id { flex: 1 1 auto; }
.poste-page .poste-title { font-size: 1.45rem; margin-bottom: .2rem; }
.poste-page .poste-lines { flex-direction: column; align-items: flex-end; margin: 0; gap: .3rem; }
.poste-page .poste-clock-time { font-size: 2.9rem; }
.poste-page .poste-clock-date { margin-top: .2rem; }
/* Demi-écran (~960 px) : titre, numéros des lignes et horloge restent chacun sur une
   ligne — l'en-tête passe d'environ 190 px de haut à 70, rendus aux cartes. */
@media (max-width: 1100px) {
  .poste-page .poste-header { gap: 1rem; }
  .poste-page .poste-title { font-size: 1.2rem; white-space: nowrap; }
  .poste-page .poste-line { white-space: nowrap; }
  .poste-page .poste-clock-time { font-size: 2.1rem; }
}
.poste-page .poste-grid { grid-auto-rows: 27rem; align-items: stretch; }
/* Trois colonnes sur un écran trop bas pour la page plein écran (portable en 1536×730) :
   la rangée du haut garde la hauteur basse du plein écran, celle du bas ses 27rem. */
/* Trois colonnes : grille de six pistes. En haut, trois cartes égales (2 + 2 + 2) ; en
   bas, la liste des postes n'a besoin que d'une demi-carte, sa moitié revient à la
   ligne, qui tient les appels en attente et en cours (1 + 3 + 2). */
@media (min-width: 1501px) {
  .poste-page .poste-grid { grid-template-rows: 15.5rem; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .poste-page .poste-grid > .poste-card { grid-column: span 2; }
  .poste-page .poste-grid > [id$="-mod-d"] { grid-column: span 1; }
  .poste-page .poste-grid > [id$="-mod-e"] { grid-column: span 3; }
}
.poste-page .poste-card { min-height: 0; overflow: hidden; }
.poste-page .poste-card-head { flex: none; }
.poste-page .poste-live-body, .poste-page .poste-scroll, .poste-page .poste-card-body,
.poste-page .consignes-list {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
  /* Place de la barre réservée : le texte ne se réagence pas quand elle apparaît. */
  scrollbar-gutter: stable; scrollbar-width: thin;
}
/* Consignes : l'encadré rétrécit à la place disponible et c'est sa liste qui défile —
   titre, bouton d'ajout et formulaire restent visibles, la bordure n'est pas coupée. */
.poste-page #poste-consignes {
  flex: 1 1 auto; min-height: 0; margin-bottom: 0;
  display: flex; flex-direction: column;
}
.poste-page .consignes-box { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.poste-page .consignes-head, .poste-page .consigne-form { flex: none; }
/* Attente moyenne sur la ligne de titre de « Consignes & ligne ». */
.poste-page .poste-card-head .poste-wait {
  margin: 0; padding: 0; border: 0; gap: .35rem; flex: 0 1 auto; min-width: 0;
}
.poste-page .poste-card-head .poste-wait-value { font-size: 1rem; white-space: nowrap; }
.poste-page #poste-mod-a .poste-card-title { white-space: nowrap; }
.poste-page .poste-card-head .poste-wait-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
/* Le correspondant de « Votre appel » sur la ligne de titre. */
.poste-page .poste-card-live .poste-card-title { flex: none; }
.poste-page .poste-card-head .poste-live-who {
  flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Votre appel : les boutons se rangent sur la largeur de la carte (requête de conteneur). */
.poste-page .poste-live-body { container-type: inline-size; }
.poste-page .poste-dialers { flex: none; }
/* Le numéro présenté à droite du champ plutôt que dessous : deux lignes de moins, qui
   reviennent à la liste des résultats. */
.poste-page .poste-dialers { container-type: inline-size; margin-bottom: 0; }
/* Résultats de recherche : liste déroulante sous les champs, PAR-DESSUS les cartes du
   dessous — la carte Annuaire reste basse, et la liste n'est bornée que par l'écran.
   La carte laisse donc déborder (overflow visible) ; ses champs ne défilent jamais. */
.poste-page .poste-card-search { overflow: visible; }
.poste-page .poste-search-wrap { position: relative; flex: none; }
.poste-page .poste-results {
  position: absolute; top: calc(100% + .3rem); left: 0; right: 0; z-index: 60;
  max-height: min(32rem, 60vh); overflow-y: auto;
  padding: .5rem .8rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .12);
}
.poste-page .poste-results[hidden] { display: none; }
/* La carte laissant déborder (liste déroulante), c'est l'aide qui se coupe si la place manque. */
.poste-page .poste-search-hint { padding: .7rem 0 0; font-size: .8rem; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.poste-page .poste-dialer { grid-template-columns: auto minmax(0, 1fr) auto; }
.poste-page .poste-dialer-cid { grid-column: auto; white-space: nowrap; }
/* Carte étroite (écran de 1680 px) : le champ tronquerait son aide, le numéro repasse dessous. */
@container (max-width: 29rem) {
  .poste-page .poste-dialer { grid-template-columns: auto minmax(0, 1fr); }
  .poste-page .poste-dialer-cid { grid-column: 2; }
}
.poste-page .poste-card-body > .poste-sub-title:first-child { margin-top: 0; }
.poste-page .poste-card-body .poste-sub-title { margin-top: .7rem; }
.poste-page .poste-card-body .rec-banner { margin-bottom: .5rem; padding: .4rem .75rem; }
/* Attente : principale et moyens côte à côte, les autres files (VIGIE, hors file, qui
   n'apparaissent que si elles retiennent quelqu'un) en pleine largeur dessous. Un titre
   de section trop long pour sa demi-carte passe sur deux lignes plutôt que de déborder. */
.poste-page .wait-board-compact {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem;
}
.poste-page .wait-board-compact > .wait-sec:nth-child(n+3) { grid-column: 1 / -1; }
/* Carte trop étroite (écran de 1680 px) : un numéro ne tient plus dans une demi-carte,
   les deux lignes reviennent l'une sous l'autre. */
.poste-page #poste-mod-e .poste-card-body { container-type: inline-size; }
@container (max-width: 28rem) {
  .poste-page .wait-board-compact { grid-template-columns: minmax(0, 1fr); }
}
.poste-page .wait-sec-head { flex-wrap: wrap; row-gap: .15rem; }
.poste-page .wait-sec .wait-empty { padding: .15rem .2rem; }
/* Appel pris dans une demi-carte : conversation et numéro en haut, nom et attente subie
   dessous — sur une seule rangée, le numéro chevauchait l'attente. */
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-row.wait-live {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "talk num num" "name name waited";
  row-gap: .05rem;
}
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-live .wait-who { display: contents; }
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-live .wait-talk-cell { grid-area: talk; }
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-live .wait-num { grid-area: num; }
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-live .wait-name { grid-area: name; min-width: 0; }
.poste-page .wait-board-compact > .wait-sec:nth-child(-n+2) .wait-live .wait-waited { grid-area: waited; }
/* L'opérateur Moyens, sur sa ligne de « Postes du PCM » (remplace l'ancien bandeau). */
.poste-ext-tag-bilan {
  display: inline-flex; align-items: center; gap: .2rem;
  background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; font-weight: 600;
}
/* Les mêmes étiquettes en interrupteurs (accès PCM, modules/poste.js lineTagsHtml) :
   pleines = le poste est sur la ligne, cliquer l'en retire ; en pointillé = cliquer l'y
   met. Celles des postes qui n'y vont qu'en renfort n'apparaissent qu'au survol — sauf
   sur un écran tactile, où il n'y a pas de survol. */
button.poste-ext-tag {
  font-family: inherit; line-height: inherit; background: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .2rem;
}
button.poste-ext-tag-bilan { background: var(--accent-fill); }
button.poste-ext-tag:hover:not(:disabled) { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent); }
button.poste-ext-tag:disabled { opacity: .45; cursor: progress; }
.poste-ext-tag.is-off { border-style: dashed; border-color: var(--border); color: var(--text-muted); }
.poste-ext-tag.is-hover { display: none; }
.poste-ext:hover .poste-ext-tag.is-hover,
.poste-ext:focus-within .poste-ext-tag.is-hover { display: inline-flex; }
@media (hover: none) { .poste-ext-tag.is-hover { display: inline-flex; } }
@media (max-width: 640px) {
  .poste-page .poste-header { flex-wrap: wrap; align-items: flex-start; }
  .poste-page .poste-lines { align-items: flex-start; }
}

/* Écran d'au moins 1500×850 (celui du PC est en 1920×1080) : la page occupe toute la
   largeur et toute la hauteur, sans défilement. Les deux rangées de cartes se partagent
   ce que laissent l'en-tête et les bandeaux ; si des bandeaux s'accumulent au point de
   descendre les cartes sous 17rem, c'est la page qui défile, pas les cartes qui s'écrasent.
   Le pied de page est masqué sur cette page seulement.
   Le bandeau des appels manqués (hors de la section) garde son titre et son compteur,
   mais sa liste défile au-delà de trois appels. */
@media (min-width: 1500px) and (min-height: 850px) {
  .layout-main:has(> main > .poste-page.active) { height: 100vh; }
  /* Le pied de page (mentions, documentation, version) reste sur toutes les autres pages :
     ici, sa hauteur revient aux cartes. */
  .layout-main:has(> main > .poste-page.active) > .app-footer { display: none; }
  main:has(> .poste-page.active) {
    flex: 1 1 0; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column;
    max-width: none; padding: 1rem 1.5rem;
  }
  main:has(> .poste-page.active) > * { flex: none; }
  /* Base nulle, pas « auto » : sur la hauteur de leur contenu, les cartes reprendraient
     la taille de la plus bavarde. Sous 17rem, les rangées débordent et main défile. */
  main > .poste-page.active { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  /* Rangée du haut basse et fixe (compte rendu de deux lignes, annuaire en liste
     déroulante) ; celle du bas — postes, attente, derniers appels — prend le reste. */
  .poste-page .poste-grid {
    flex: 1 1 0; min-height: 0;
    grid-template-rows: 15.5rem minmax(17rem, 1fr); grid-auto-rows: auto;
  }
  main:has(> .poste-page.active) .missed-banner { margin-bottom: .9rem; padding: .55rem .95rem; }
  main:has(> .poste-page.active) .missed-list { max-height: 6.2rem; overflow-y: auto; }
  .poste-page .poste-banners:not(:empty) { margin-bottom: .9rem; }
  .poste-page .poste-banners .topo-pcm-warning { margin-bottom: .5rem; }
  .poste-page .poste-banners .topo-pcm-warning:last-child { margin-bottom: 0; }
}


/* ── ALERTE APPELS MANQUÉS (PC) ──
   Deux tons volontairement distincts : le rouge est réservé aux appels qui ont
   sonné dans le vide. Un raccrochage pendant l'annonce reste gris — le signaler en
   rouge rendrait le bandeau permanent, donc invisible. */
.missed-banner {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: .75rem .95rem; margin-bottom: 1.1rem;
}
.missed-alarm {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
}
.missed-head {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  font-size: .9rem;
}
.missed-ico { display: inline-flex; color: var(--text-muted); }
.missed-alarm .missed-ico, .missed-alarm .missed-head strong { color: var(--red); }
.missed-sub { font-size: .76rem; color: var(--text-muted); }
.missed-spacer { flex: 1 1 auto; }
.missed-head .btn { width: auto; flex: none; padding: .25rem .75rem; font-size: .78rem; }

.missed-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .3rem; }
.missed-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-size: .84rem; padding: .28rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.missed-time { font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 3.1rem; }
.missed-who { flex: 1 1 12rem; min-width: 0; }
.missed-num { color: var(--text-muted); font-size: .8rem; margin-left: .35rem; }
.missed-num-strong { font-variant-numeric: tabular-nums; }
.missed-why { font-size: .76rem; color: var(--text-muted); }
.missed-row .btn { width: auto; flex: none; padding: .22rem .7rem; font-size: .78rem; }


.missed-more {
  margin-top: .5rem; background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--accent-text); padding: .2rem 0;
}
.missed-more:hover { text-decoration: underline; }

/* ── ENREGISTREMENT DES APPELS ──
   Bandeau d'état de la ligne + pastille par appel. Le rouge est réservé à
   « ça enregistre » : c'est l'état qui doit sauter aux yeux, pas l'inverse. */
.rec-banner {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .55rem .85rem; border-radius: 8px; margin-bottom: 1rem;
  font-size: .84rem; border: 1px solid transparent;
}
.rec-banner-ico { display: inline-flex; }
.rec-banner-text { flex: 1 1 auto; min-width: 0; }
.rec-banner .btn { width: auto; padding: .28rem .7rem; font-size: .78rem; flex: none; }
.rec-banner-on {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red);
}
.rec-banner-off {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-color: var(--border); color: var(--text-muted);
}
.rec-banner-unknown {
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  border-color: color-mix(in srgb, var(--orange) 35%, transparent);
  color: var(--orange);
}

.rec-cell { white-space: nowrap; }
.rec-cell .rec-btn { padding: .22rem .45rem; vertical-align: middle; }
.rec-btn-on { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }
.rec-btn-on:hover { border-color: var(--red); color: var(--red); }
.hangup-cell { white-space: nowrap; width: 1%; }
.hangup-cell .hangup-btn { padding: .22rem .45rem; vertical-align: middle; }
.hangup-btn:hover { border-color: var(--red); color: var(--red); }

/* Pastille d'état : elle bat pendant l'enregistrement. Le battement s'arrête si
   l'utilisateur a demandé moins d'animations (prefers-reduced-motion) — la couleur
   pleine suffit alors à distinguer les deux états. */
.rec-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); margin-right: .45rem; vertical-align: middle;
  animation: rec-pulse 1.6s ease-in-out infinite;
}
.rec-dot-off { background: var(--border); animation: none; }
@keyframes rec-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); }
  50%      { opacity: .55; box-shadow: 0 0 0 4px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot { animation: none; }
}

/* Bouton supprimer dans tableau */
/* Actions d'une ligne de tableau : boutons-icônes homogènes, alignés, sans retour à la
   ligne (cinq boutons texte de tailles différentes rendaient la colonne illisible). */
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--surface2); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); }

/* Formulaire de création : deux colonnes franches (un auto-fit produisait 3 colonnes
   pour 4 champs, avec un champ orphelin sur la seconde ligne), une seule si trop étroit. */
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem;
}
/* Champ occupant les deux colonnes (e-mail et son explication). */
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}
/* Intertitre à l'intérieur d'un formulaire (« Facultatif ») */
.form-legend {
  font-weight: 600; font-size: .75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin: .5rem 0 .9rem; padding-top: .9rem;
  border-top: 1px solid var(--border);
}

.btn-delete {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: .2rem .5rem; border-radius: 4px; cursor: pointer; font-size: .75rem;
}
.btn-delete:hover { border-color: var(--red); color: var(--red); }

/* Boutons secondaires de la table utilisateurs (Poste / Mobiles / MDP) : bordés et
   lisibles en clair comme en nuit (sinon, en .btn nu, ils sont invisibles). */
.btn-pwd {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 4px; cursor: pointer;
}
.btn-pwd:hover { border-color: var(--accent); color: var(--accent); }

/* ── Test de routage : chaîne d'acheminement et de débordement ── */
/* Un bloc par ligne du PCM (principale, moyens). */
.route-case + .route-case { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.route-case-title { margin: 0 0 .4rem; font-size: .9rem; font-weight: 600; }
.route-case-did { font-weight: 400; color: var(--text-muted); }
.route-verdict:not(:empty) { margin-top: .6rem; }
.route-summary { margin-top: .6rem; font-weight: 600; }
.route-chain { margin: .8rem 0 0; padding: 0; list-style: none; }
.route-step {
  display: flex; gap: .6rem; padding: .55rem 0 .55rem .1rem;
  border-left: 2px solid var(--border); margin-left: .7rem; padding-left: .9rem;
}
.route-step:first-child { border-top-left-radius: 2px; }
.route-step.is-ringing { border-left-color: var(--green); }
.route-step-num {
  flex-shrink: 0; width: 20px; height: 20px; margin-left: -1.9rem; margin-top: .1rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface2); border: 1px solid var(--border);
  font-size: .7rem; font-weight: 600; color: var(--text-muted);
}
.route-step.is-ringing .route-step-num { border-color: var(--green); color: var(--green); }
.route-step-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.route-step-members { margin-top: .25rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.route-step-members span { font-size: .8rem; color: var(--text-muted); }
.route-step-members span.is-off { text-decoration: line-through; opacity: .7; }
.route-step-flow { margin-top: .25rem; font-size: .8rem; color: var(--text-muted); }
.route-step-flow::before { content: "↳ "; }
.route-issue { margin-top: .5rem; color: var(--red); font-size: .82rem; }
.route-issue::before { content: "⚠ "; }

/* Les bandeaux d'acheminement de la page Poste reprennent l'habillage de la
   topologie : même sens, même apparence, l'opérateur n'a pas à réapprendre un code
   couleur. Rouge = PCM désactivé (rien ne sonne au PC), orange = renvoi mobile
   (les mobiles sonnent à la place des postes) — le même orange que le badge de la
   topologie pour ce mode. */
#poste-banners:not(:empty) { margin-bottom: 1.1rem; }
.topo-pcm-warning {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: .6rem 1rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.topo-pcm-warning.is-warn {
  background: color-mix(in srgb, var(--orange) 14%, var(--surface));
  border-color: var(--orange);
  color: color-mix(in srgb, var(--orange) 80%, var(--text));
}
/* Bandeau informatif (page Poste du COT : état du COT, rappels) : pas une alerte. */
.topo-pcm-warning.is-info {
  background: color-mix(in srgb, var(--blue) 10%, var(--surface));
  border-color: var(--blue);
  color: color-mix(in srgb, var(--blue) 80%, var(--text));
}
.topo-pcm-warning > svg { flex: none; }
.poste-banner-text { flex: 1; min-width: 0; }
/* Le bouton de rétablissement se tient à droite, dans la couleur du bandeau : il
   rétablit l'acheminement normal, ce n'est pas une action destructrice. */
.topo-pcm-warning .btn {
  flex: none; width: auto; margin-left: auto;
  padding: .3rem .8rem; font-size: .8rem; white-space: nowrap;
  color: inherit; border-color: currentColor; background: transparent;
}
.topo-pcm-warning .btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
@media (max-width: 640px) {
  .topo-pcm-warning { flex-wrap: wrap; }
  .topo-pcm-warning .btn { margin-left: 0; width: 100%; }
}

.topo-me-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  align-self: flex-end;
  margin-bottom: .75rem;
  padding: .35rem .7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .78rem;
}
.topo-me-bar select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .4rem;
  font-size: .78rem;
}

.btn-pcm-defaults {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .75rem;
  cursor: pointer;
}
.btn-pcm-defaults:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── TOGGLE BUTTONS (stats controls) ── */
.btn-toggle {
  padding: .25rem .6rem;
  font-size: .75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-toggle:hover { border-color: var(--accent); color: var(--accent); }
.btn-toggle.active { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

/* ── STATS ── */
.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
/* Le libellé est réservé sur deux lignes, qu'il en occupe une ou deux. Sans cela, le
   premier libellé un peu long (« Entrants non répondus », « Débordés sur l'astreinte »)
   passait à la ligne et faisait descendre SON chiffre de 18 px : les grands nombres
   d'une même rangée ne partageaient plus de ligne de base. Le défaut dépendait de la
   longueur du texte et de la largeur de l'écran, donc il s'aggravait en se rétrécissant.
   Réserver la place rend l'alignement indépendant du contenu. */
.stats-kpis > .card > .card-sub:first-child {
  /* Deux lignes pleines : `lh` vaut la hauteur de ligne calculée de l'élément, ce qui
     reste juste si la police ou l'interlignage changent (2,6em, mesuré à la main,
     laissait encore 5 px de décalage). Repli en em pour les moteurs sans `lh`. */
  min-height: 3em;
  min-height: 2lh;
  margin-top: 0;
}
.stats-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: .4rem;
  font-variant-numeric: tabular-nums;
}
/* Mesures « mauvaises quand elles ne sont pas nulles » (entrants non répondus, appels
   débordés, appels perdus). Leur couleur était figée dans le HTML, donc attachée à la
   NATURE de la mesure et non à sa valeur : « Entrants non répondus 0 » s'affichait en
   rouge, c'est-à-dire que le meilleur résultat possible se présentait comme une
   alarme. La teinte n'arrive maintenant qu'avec le compte, posée par les modules. */
.stats-alert-warn.is-alert { color: var(--orange); }
.stats-alert-bad.is-alert  { color: var(--red); }

/* ── FACTURATION ── */
.fact-card-meta { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; }
.fact-badge {
  display: inline-block;
  font-size: .74rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.fact-badge.fact-paid {
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
/* Cartes de synthèse agrandies (prix mis en avant) — propre à la Facturation. */
#fact-totals {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
#fact-totals .card { padding: 1.5rem 1.75rem; }
#fact-totals .card-sub { font-size: .85rem; }
#fact-totals .stats-value { font-size: 3rem; margin-top: .5rem; }
#fact-totals .fact-card-meta { font-size: .9rem; margin-top: .5rem; }

.fact-breakdown { margin-bottom: .75rem; }
.fact-rates { font-size: .82rem; color: var(--text-muted); margin-bottom: .6rem; }
.fact-rates b { color: var(--text); font-weight: 600; }
.fact-breakdown-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.fact-breakdown-table th {
  text-align: left; font-weight: 500; color: var(--text-muted);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .3rem .6rem; border-bottom: 1px solid var(--border);
}
.fact-breakdown-table td { padding: .35rem .6rem; border-bottom: 1px solid var(--border); }
.fact-breakdown-table tr:last-child td { border-bottom: none; }

/* ── HISTOGRAM ── */
.histo-outer {
  padding-bottom: 1.75rem;
  position: relative;
}
.histo-with-axis {
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.histo-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  min-width: 2rem;
  flex-shrink: 0;
  text-align: right;
}
.histo-ytick {
  font-size: .6rem;
  color: var(--text-muted);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.histo-main {
  flex: 1;
  min-width: 0;
}
.histo-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to top,
    transparent 0px,
    transparent calc(25% - 1px),
    color-mix(in srgb, var(--border) 60%, transparent) calc(25% - 1px),
    color-mix(in srgb, var(--border) 60%, transparent) 25%
  );
}
.histo-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  cursor: default;
}
/* Colonne empilée : sortants au-dessus, entrants en dessous — la hauteur totale
   est le volume de la tranche (cf. renderHistogram). */
.histo-stack {
  width: 100%;
  min-width: 2px;
  display: flex;
  flex-direction: column;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.histo-seg { width: 100%; transition: filter .1s; }
.histo-in { background: color-mix(in srgb, var(--accent) 62%, transparent); }
.histo-out { background: color-mix(in srgb, var(--orange) 62%, transparent); }
.histo-col:hover .histo-seg { filter: brightness(1.25) saturate(1.2); }

.histo-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: .9rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.histo-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.histo-swatch {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}

/* Histogramme du COT : une couleur par CELLULE, plus un neutre pour tout ce qui
   n'est allé dans aucune cellule (abandon au serveur vocal, touche 6 / COT fermé,
   appels sortants).

   ── Pourquoi ces valeurs-là, et pas les couleurs de statut du panel ────────────
   Cinq séries côte à côte dans une même colonne, ça ne s'improvise pas : il faut
   qu'un daltonien distingue deux segments qui se touchent. La suite ci-dessous est
   celle d'une palette catégorielle validée (écart perceptuel ≥ 8 en OKLab sur chaque
   paire ADJACENTE de la pile, sous protanopie comme sous deutéranopie), déclinée en
   deux jeux : les valeurs du thème sombre ne sont pas les claires « éclaircies », ce
   sont les mêmes teintes reprises pour un fond sombre.

   ── L'ordre de la pile n'est pas libre ────────────────────────────────────────
   Le neutre est en SOCLE (bas de colonne), pas en tête. Posé au sommet il touchait le
   magenta de Santé, et ces deux-là sont indiscernables sous protanopie (ΔE 1,3) : un
   cadre daltonien aurait lu « Santé » là où il n'y avait que des abandons. Contre le
   bleu d'Opérations, en bas, l'écart passe à 16.

   ── La couleur suit la CELLULE, jamais le rang ────────────────────────────────
   `--cot-1` … `--cot-9` sont indexés sur le SLOT de la cellule (sa file 73N), son
   identité durable : la touche du serveur vocal se règle désormais dans le panel, et
   indexer sur elle — ou sur la position dans un tableau — repeindrait les cellules à
   chaque changement de menu. Les slots 1-5 sont les cinq cellules d'origine, avec
   leurs couleurs d'avant. 6-9 ajoutés le 23/09/2026, contrôlés au validateur de
   palette (écart daltonien ≥ 8,4 entre voisins en sombre, ≥ 9,1 en clair ; en clair,
   plusieurs teintes restent sous 3:1 contre le fond — le tableau par cellule et la
   légende nommée en tiennent lieu). `x` : cellule supprimée dont le slot a été repris. */
:root {
  --cot-1: #3987e5;   /* 1 Opérations  */
  --cot-2: #d95926;   /* 2 Effectif    */
  --cot-3: #199e70;   /* 3 Logistique  */
  --cot-4: #c98500;   /* 4 Hébergement */
  --cot-5: #d55181;   /* 5 Santé       */
  --cot-6: #8d6be0;
  --cot-7: #8f9a1c;
  --cot-8: #1fa3b8;
  --cot-9: #b56e45;
  --cot-hors: #656980;
}
[data-theme="light"] {
  --cot-1: #2a78d6;
  --cot-2: #eb6834;
  --cot-3: #1baf7a;
  --cot-4: #eda100;
  --cot-5: #e87ba4;
  --cot-6: #7b5bd6;
  --cot-7: #869418;
  --cot-8: #1b9bb0;
  --cot-9: #b0612f;
  --cot-hors: #545a72;
}
.histo-cot-1 { background: var(--cot-1); }
.histo-cot-2 { background: var(--cot-2); }
.histo-cot-3 { background: var(--cot-3); }
.histo-cot-4 { background: var(--cot-4); }
.histo-cot-5 { background: var(--cot-5); }
.histo-cot-6 { background: var(--cot-6); }
.histo-cot-7 { background: var(--cot-7); }
.histo-cot-8 { background: var(--cot-8); }
.histo-cot-9 { background: var(--cot-9); }
.histo-cot-x { background: var(--cot-hors); }
.histo-cot-hors { background: var(--cot-hors); }

/* Deux pixels de fond entre segments : c'est l'écart, pas un filet, qui sépare deux
   aplats voisins — un contour ajouterait de l'encre qui ne porte aucune donnée. */
.histo-cot .histo-stack { gap: 2px; }

/* Tableau par cellule : la « vue tableau » de l'histogramme. Elle n'est pas un
   supplément décoratif — trois des cinq teintes passent sous 3:1 sur fond clair, et
   c'est ce tableau qui garantit que chaque valeur reste lisible sans la couleur. */
.cot-cell-name { display: inline-flex; align-items: center; gap: .5rem; }
.cot-cell-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── HEAT MAP (activité par jour et par heure) ── */
.heat-wrap { overflow-x: auto; }
.heat-grid { min-width: 520px; }
.heat-row {
  display: grid;
  grid-template-columns: 5.5rem repeat(24, minmax(0, 1fr)) 2.6rem;
  gap: 2px;
  align-items: center;
  padding: 1px 0;
  border-radius: 4px;
}
.heat-row.active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.heat-head { margin-bottom: .25rem; }
.heat-hlbl {
  font-size: .6rem;
  color: var(--text-muted);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
button.heat-day {
  background: none; border: none; padding: .1rem .35rem .1rem 0;
  font-size: .72rem; color: var(--text-muted); text-align: right;
  cursor: pointer; white-space: nowrap; border-radius: 4px;
}
button.heat-day:hover { color: var(--accent); }
.heat-row.active button.heat-day { color: var(--accent-text); font-weight: 600; }
div.heat-day { min-width: 0; }
.heat-cell {
  height: 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: outline-color .1s;
  outline: 1px solid transparent;
}
.heat-cell:hover { outline-color: var(--accent); }
.heat-total {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.heat-note { font-size: .72rem; color: var(--text-muted); margin-top: .75rem; }

/* Bandeau « journée sélectionnée » */
.stats-day-chip {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 8px; padding: .5rem .85rem; margin-bottom: 1rem;
}
.stats-day-chip strong { color: var(--text); }
/* Dates libres du bilan COT : à la taille des boutons voisins, pas d'un champ de formulaire. */
.cot-stats-dates input[type="date"] { font-size: .75rem; padding: .2rem .4rem; width: auto; }
/* Tableau par membre : une ligne d'intertitre par sorte (membres, postes, mobiles). */
.cot-members-group td { font-size: .72rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; padding-top: .9rem; }
.cot-members-bar { display: block; height: 4px; border-radius: 2px; margin-top: .3rem;
  background: var(--accent); opacity: .55; }
.histo-col[data-date] { cursor: pointer; }
.stats-day-chip .btn { padding: .25rem .7rem; font-size: .78rem; width: auto; }
.histo-labels {
  display: flex;
  gap: 2px;
  margin-top: .3rem;
}
.histo-lbl {
  flex: 1;
  font-size: .6rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

/* ── CDR ANNOTATIONS ── */
.cdr-actions { white-space: nowrap; width: 118px; text-align: center; }

.btn-callback {
  background: none; border: none;
  cursor: pointer; padding: 0 .4rem 0 0;
  color: var(--green);
  transition: color .15s, transform .1s;
  line-height: 0; vertical-align: middle;
}
.btn-callback:hover { color: var(--green); transform: scale(1.15); }

/* Rappel VIGIE : couleur de l'astreinte — c'est le mobile du cadre qui sonne,
   pas un poste, et la ligne VIGIE est présentée au destinataire. */
.btn-callback-vigie,
.btn-callback-vigie:hover { color: var(--orange); }

.btn-flag {
  background: none; border: none;
  cursor: pointer; padding: 0;
  color: var(--text-muted); opacity: .4;
  transition: color .15s, opacity .15s;
  line-height: 0; vertical-align: middle;
}
.btn-flag:hover         { color: var(--yellow); opacity: 1; }
.btn-flag.flagged       { color: var(--yellow); opacity: 1; }
.btn-flag.flagged:hover { color: var(--text-muted); opacity: .6; }

.btn-note-toggle {
  background: none; border: none;
  cursor: pointer; padding: 0 0 0 .4rem;
  color: var(--text-muted); opacity: .4;
  transition: color .15s, opacity .15s;
  line-height: 0; vertical-align: middle;
}
.btn-note-toggle:hover    { color: var(--accent); opacity: 1; }
.btn-note-toggle.has-note { color: var(--accent-text); opacity: 1; }

.btn-cdr-delete {
  background: none; border: none;
  cursor: pointer; padding: 0 0 0 .4rem;
  color: var(--text-muted); opacity: .4;
  transition: color .15s, opacity .15s, transform .1s;
  line-height: 0; vertical-align: middle;
}
.btn-cdr-delete:hover     { color: var(--red); opacity: 1; transform: scale(1.15); }
.btn-cdr-delete:disabled  { cursor: default; opacity: .3; }

tbody tr.cdr-flagged { background: color-mix(in srgb, var(--yellow) 6%, transparent); }
tbody tr.cdr-flagged:hover { background: color-mix(in srgb, var(--yellow) 11%, var(--surface2)); }

tbody tr.note-row         { background: var(--surface2) !important; }
tbody tr.note-row:hover   { background: var(--surface2) !important; }
tbody tr.note-row td      { padding: .4rem 1rem .6rem; border-top: none; }

.note-expand { display: flex; flex-direction: column; gap: .45rem; }
.note-textarea { width: 100%; font-size: .85rem; min-height: 62px; }
.note-tag { align-self: flex-start; font-size: .85rem; max-width: 100%; }
.note-row-actions { display: flex; gap: .5rem; }
.note-row-actions .btn { padding: .35rem .9rem; font-size: .8rem; }

/* ── FOOTER ── */
.app-footer {
  text-align: center;
  padding: .75rem 1.5rem;
  font-size: .75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.app-footer a { color: var(--text-muted); }
.app-footer a:hover { color: var(--text); }
#app-footer-text:not([hidden])::after { content: "·"; margin: 0 .6rem; }
/* Version en service. Même séparateur que le texte de pied de page : les trois éléments
   (mention, Documentation, version) se lisent comme une seule ligne. */
.app-footer .app-version::before { content: "·"; margin: 0 .6rem; color: var(--text-muted); }
.app-footer .app-version { font-variant-numeric: tabular-nums; }
.app-footer .app-privacy::before { content: "·"; margin: 0 .6rem; color: var(--text-muted); }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--surface2); border: 1px solid var(--border);
  padding: .7rem 1.2rem; border-radius: 8px; font-size: .85rem;
  display: none; z-index: 1000; max-width: 320px;
}
#toast.show { display: block; }
#toast.error { border-color: var(--red); color: var(--red); }

/* Rechercher / Réinitialiser des filtres d'historique : ensemble, en bas de la ligne de
   filtres — sans ce groupe, « Réinitialiser » passait seul à la ligne suivante. */
/* Valeur de tuile en texte ou longue (Statut du serveur) : plus petite, et elle passe à
   la ligne entre deux mots plutôt que de sortir de la carte. */
.stats-value.stats-value-long { font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
.filters-actions { display: flex; gap: .5rem; align-self: flex-end; }
.filters-actions .btn:not(.btn-primary) { background: var(--surface); }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 640px) {
  /* iOS zoome sur tout champ sous 16px au moment où on le touche (cf. mobile.css) :
     même règle pour les pages hors vue mobile ouvertes sur un téléphone (connexion,
     appel, rappel). */
  input, select, textarea { font-size: 16px; }

  header { padding: 0 .75rem; gap: .4rem; }
  /* Le fil d'Ariane garde la page, le pôle passe à la trappe. */
  .crumb #crumb-pole { display: none; }

  main { padding: 1rem .75rem; }

  .login-wrap { padding: 1rem; justify-content: flex-start; padding-top: 3rem; }
  .login-box { border-radius: 8px; }

  /* Filtres CDR empilés */
  .filters > div { width: 100%; }
  .filters input, .filters select { width: 100% !important; }

  /* Stats header empilé */
  .stats-header { flex-direction: column; align-items: flex-start; gap: .75rem; }


  /* Audio player plus compact */
  .audio-cell { min-width: 0; }
  .audio-cell audio { width: 100%; min-width: 180px; }

  /* Toast plus proche du bas */
  #toast { right: .75rem; left: .75rem; max-width: none; bottom: .75rem; }
}

/* ── Annuaire (contacts externes) ─────────────────────────────────────────── */
/* Page Annuaire (modules/contacts.js) : barre de recherche et filtres, sélection en lot,
   étiquettes d'entité et d'univers, vues Entités / Import / Doublons. */
.contacts-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.contacts-toolbar .contacts-search { flex: 1 1 22rem; min-width: 0; padding: .65rem 1rem; border-radius: 10px; font-size: .95rem; }
.contacts-toolbar select { width: auto; }
.contacts-toolbar .contacts-add { width: auto; margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; }
.contacts-f-hors { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--text-muted); }
.contacts-f-hors[hidden] { display: none; }
.contacts-lot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem;
  padding: .5rem .75rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface2);
}
.contacts-lot select { width: auto; }
.contacts-lot[hidden] { display: none; }
.contacts-count { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.contacts-intro { color: var(--text-muted); font-size: .8rem; margin-bottom: .8rem; max-width: 760px; }
.contacts-muted { color: var(--text-muted); font-size: .8rem; }
.contacts-hint { display: block; margin-top: .2rem; color: var(--text-muted); font-size: .75rem; }
.contacts-field { display: block; margin-bottom: .75rem; font-size: .85rem; }
.contacts-field input, .contacts-field select { display: block; width: 100%; margin-top: .25rem; }
.contacts-univers { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem .6rem; margin: 0 0 .75rem; }
.contacts-univers legend { font-size: .85rem; padding: 0 .25rem; }
.contacts-univers label { display: inline-flex; align-items: center; gap: .3rem; margin-right: .9rem; font-size: .85rem; }
.contacts-dates { display: flex; gap: .75rem; }
.contacts-dates .contacts-field { flex: 1; }
.contacts-row-actions { white-space: nowrap; text-align: right; }
.contacts-row-actions .icon-btn + .icon-btn { margin-left: .3rem; }
.contact-sel { flex: none; width: 1rem; height: 1rem; margin: 0; }
.contact-card .contact-id { flex: 1 1 14rem; min-width: 0; }
.contact-actions { display: flex; gap: .35rem; }
.contact-card-hors { opacity: .6; }
.contact-tag {
  display: inline-flex; align-items: center; gap: .25rem; vertical-align: middle; margin-left: .45rem;
  font-size: .68rem; font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 .45rem;
}
.contact-tag-entite { color: var(--accent-text); border-color: var(--accent); }
.contact-tag-hors { color: var(--orange); border-color: var(--orange); }
.contact-tag-conf { color: var(--red); border-color: var(--red); }
.contacts-check { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: .75rem; font-size: .85rem; }
.contacts-check input { margin-top: .15rem; }
.hdr-annuaire { display: inline-flex; align-items: center; gap: .35rem; flex: none; }
.hdr-annuaire[hidden] { display: none; }
@media (max-width: 900px) { .hdr-annuaire span { display: none; } }

.import-options { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; font-size: .85rem; }
.import-options label:not(.import-file) { display: flex; flex-direction: column; gap: .25rem; }
.import-options select { width: auto; }
.import-file { display: inline-flex; align-items: center; gap: .35rem; width: auto; }
.import-resume { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.import-resume > div {
  display: flex; flex-direction: column; min-width: 7rem; padding: .5rem .75rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.import-resume b { font-size: 1.2rem; }
.import-resume span { font-size: .75rem; color: var(--text-muted); }
.import-resume .import-suppr { border-color: var(--orange); }
.import-resume .import-err { border-color: var(--red); }
.import-bloquant { display: flex; gap: .4rem; align-items: center; color: var(--red); font-size: .85rem; margin: .5rem 0; }
.import-details { margin: .5rem 0; font-size: .85rem; }
.import-details summary { cursor: pointer; font-weight: 600; }
.import-details ul { margin: .4rem 0 0 1.2rem; max-height: 18rem; overflow-y: auto; }
.import-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.import-actions .btn { width: auto; }
.import-confirm { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--orange); }
.doublon { margin-bottom: .6rem; padding: .6rem .9rem; }
.doublon-num { display: flex; align-items: center; gap: .4rem; font-weight: 600; margin-bottom: .35rem; }
.doublon ul { list-style: none; margin: 0; padding: 0; }
.doublon li { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; font-size: .85rem; }
.doublon li .btn { width: auto; margin-left: auto; }
/* Annuaire › Statistiques : les tuiles de la page Statistiques, par rubrique. */
.annuaire-stats-titre { margin: .4rem 0 .5rem; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.annuaire-stat-alerte { color: var(--orange); }
.annuaire-stat-sub { margin-top: .2rem; }

.contacts-results { display: flex; flex-direction: column; gap: .6rem; }
.contacts-empty { color: var(--text-muted); font-size: .9rem; padding: 1rem 0; }

.contact-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem;
}
.contact-name    { font-weight: 600; font-size: .95rem; }
.contact-company { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }

.contact-numbers { display: flex; flex-wrap: wrap; gap: .5rem; }
.contact-call {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .35rem .8rem; cursor: pointer;
  font-size: .85rem; transition: border-color .15s, color .15s;
}
.contact-call svg  { color: var(--green); }
.contact-call:hover { border-color: var(--green); color: var(--green); }
/* Le temps qu'un appel parte : plus de survol vert ni de clic possible. */
.contact-call:disabled { opacity: .5; cursor: default; }
.contact-call:disabled:hover { border-color: var(--border); color: var(--text); }
.contact-num-type {
  font-size: .7rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0 .4rem;
}
/* Numéro d'urgence : liseré et badge rouges, partout où la fiche apparaît (annuaire,
   recherche, page Poste, mobile). C'est la fiche qu'on cherche quand ça presse — elle
   doit se repérer sans lire. */
.contact-card-urgence, .m-contact-urgence { border-left: 3px solid var(--red); }
.contact-badge-urgence {
  display: inline-block; vertical-align: middle; margin-left: .45rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 0 .4rem;
}
/* GesCOT (modules/gescot.js) : inscrit de l'événement, et fiche d'un moyen — dans
   l'annuaire comme dans les résultats des champs d'appel du PC. */
.contact-badge-gescot {
  display: inline-block; vertical-align: middle; margin-left: .45rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .03em;
  color: var(--accent-text); border: 1px solid var(--accent); border-radius: 999px; padding: 0 .4rem;
}
.gescot-muted { color: var(--text-muted); font-size: .8rem; }
.gescot-affectation {
  display: inline-block; vertical-align: middle; margin-left: .35rem;
  font-size: .68rem; font-weight: 600; color: var(--green);
  border: 1px solid var(--green); border-radius: 999px; padding: 0 .4rem;
}
.gescot-inconnu { color: var(--orange); font-size: .78rem; }
.gescot-etat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: .7rem 1rem; display: flex; flex-direction: column; gap: .25rem; font-size: .9rem;
}
.gescot-etat.is-alerte { border-left: 3px solid var(--orange); }
.gescot-alerte { color: var(--orange); font-size: .85rem; }
.gescot-moyens { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: .6rem; }
.gescot-moyen {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; margin-bottom: .4rem;
}
.gescot-moyens .gescot-moyen { margin-bottom: 0; }
.gescot-moyen-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .5rem; }
.gescot-indicatif { font-weight: 700; font-size: 1rem; }
.gescot-statut { margin-left: auto; font-size: .75rem; border-radius: 999px; padding: .05rem .5rem; }
.gescot-statut.is-on { color: var(--green); border: 1px solid var(--green); }
.gescot-statut.is-off { color: var(--orange); border: 1px solid var(--orange); }
.gescot-chef, .gescot-bord {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .3rem .6rem;
  font-size: .88rem;
}
.gescot-chef.is-vide { color: var(--orange); }
.gescot-equipe { font-size: .8rem; }
.gescot-seconde { border-top: 1px dashed var(--border); padding-top: .35rem; }
/* Badge « ⏎ » : ce numéro-là est celui que la touche Entrée composera. Le repère est
   le même dans l'annuaire complet et dans celui de la page Poste — c'est la même
   promesse, elle doit avoir la même tête. */
.call-enter {
  font-family: inherit; font-size: .75rem; line-height: 1; margin-left: .35rem;
  color: var(--text-muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 4px; padding: .1rem .3rem;
}
.contact-call:hover .call-enter,
.poste-dial:hover .call-enter { border-color: var(--green); color: var(--green); }

/* ── Éditeur de touches DSS Fanvil ── */
.fanvil-tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.fanvil-tab {
  padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  font-size: .85rem; font-weight: 600; transition: all .15s;
}
.fanvil-tab:hover { color: var(--text); border-color: var(--accent); }
.fanvil-tab.active { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

.fanvil-banner {
  display: flex; align-items: center; gap: .85rem;
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border: 1px solid var(--orange); border-radius: 8px;
  padding: .7rem 1rem; margin-bottom: 1.25rem;
}
.fanvil-banner-text { flex: 1; color: var(--orange); font-size: .85rem; line-height: 1.4; }
.fanvil-banner button {
  flex-shrink: 0; background: var(--warning-fill); color: #fff; border: none;
  border-radius: 6px; padding: .5rem 1rem; font-size: .85rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
}
.fanvil-banner button:hover { filter: brightness(1.08); }
.fanvil-banner button:disabled { opacity: .6; cursor: default; }

.fanvil-page { margin-bottom: 1.5rem; }
.fanvil-page-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 700; margin: 0 0 .55rem .15rem;
}
.fanvil-keys { display: flex; flex-direction: column; gap: .5rem; }
.fanvil-key {
  display: grid;
  grid-template-columns: 2rem .9rem minmax(160px, 1.6fr) minmax(120px, 1.1fr) minmax(150px, 1.6fr) minmax(90px, .8fr);
  gap: .6rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--border); border-radius: 8px; padding: .5rem .7rem;
}
.fanvil-key.head { background: transparent; border: none; padding: .1rem .7rem; }
.fanvil-key.head span {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
}
.fanvil-key[data-color="Green"]  { border-left-color: var(--green); }
.fanvil-key[data-color="Blue"]   { border-left-color: #3b82f6; }
.fanvil-key[data-color="Yellow"] { border-left-color: #eab308; }
.fanvil-key[data-color="Purple"] { border-left-color: #a855f7; }
.fanvil-key[data-color="Red"]    { border-left-color: var(--red); }
.fanvil-keynum {
  width: 1.7rem; height: 1.7rem; border-radius: 6px; background: var(--surface2);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}
.fanvil-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--border); }
.fanvil-dot[data-color="Green"]  { background: var(--green); }
.fanvil-dot[data-color="Blue"]   { background: #3b82f6; }
.fanvil-dot[data-color="Yellow"] { background: #eab308; }
.fanvil-dot[data-color="Purple"] { background: #a855f7; }
.fanvil-dot[data-color="Red"]    { background: var(--red); }
.fanvil-key select, .fanvil-key input { width: 100%; padding: .45rem .6rem; font-size: .85rem; }
.fanvil-key select { padding-right: 1.9rem; }

.fanvil-actionbar {
  display: flex; gap: .9rem; align-items: center; flex-wrap: wrap;
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.fanvil-actionbar .btn { width: auto; }
@media (max-width: 720px) {
  .fanvil-key { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; }
  .fanvil-key.head { display: none; }
  .fanvil-key .fanvil-dot { display: none; }
  .fanvil-keynum { align-self: flex-start; }
}

/* ── Onglet VIGIE : roster cadres + glisser-déposer ──────────────────────── */
/* `.vigie-subtitle` a disparu le 22/09/2026 avec le dernier titre posé à la main de
   « Paramètres VIGIE » : la page est passée aux .panel communs aux trois écrans de
   réglages. Rien ne l'utilisait ailleurs. */
.vigie-card-name { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.vigie-badge {
  display: inline-block; font-size: .65rem; font-weight: 700; vertical-align: middle;
  padding: .05rem .3rem; border-radius: 4px; background: var(--surface2); color: var(--text-muted);
}
.vigie-roster-card { min-width: 210px; cursor: grab; display: flex; flex-direction: column; gap: .45rem; }
.vigie-roster-card:active { cursor: grabbing; }
.vigie-roster-card.dragging { opacity: .45; }
/* Bascule en cours sur ce cadre : la carte s'estompe et n'accepte plus de clic, le
   temps de l'aller-retour. Elle dit « c'est parti » et interdit le second clic
   impatient, qui enverrait la bascule inverse. */
.vigie-roster-card.pending { opacity: .6; pointer-events: none; }
.vigie-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.vigie-card-nums { font-size: .8rem; color: var(--text-muted); }
.vigie-chip-reactivate { border-color: var(--warning); color: var(--warning); }
.vigie-chip-reactivate:hover { background: var(--warning-fill); color: #fff; border-color: var(--warning-fill); }
.vigie-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.vigie-chip {
  font-size: .75rem; padding: .2rem .5rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.vigie-chip:hover { border-color: var(--accent); color: var(--accent); }
.vigie-chip.on { background: var(--success-fill); border-color: var(--success-fill); color: #fff; }
.vigie-dropzone { min-height: 64px; border-radius: 10px; padding: .4rem; transition: background .15s, outline-color .15s; outline: 2px dashed transparent; outline-offset: -2px; }
.vigie-dropzone.drag-over { outline-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Diagramme de routage des appels VIGIE : origine → 790 → 690 → 695 */
.vigie-flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: .5rem; max-width: 880px; margin: 0 0 1.75rem; }
.vigie-flow-node {
  flex: 1 1 0; min-width: 132px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .85rem .6rem;
}
.vigie-flow-origin { border-style: dashed; }
.vigie-flow-num { font-size: 1.45rem; font-weight: 700; line-height: 1; color: var(--accent-text); height: 1.45rem; display: flex; align-items: center; }
.vigie-flow-num svg { width: 26px; height: 26px; }
/* Le nœud d'origine porte le numéro de la ligne (dix chiffres espacés), pas un
   numéro d'extension : plus petit, sinon il déborde de sa case. */
.vigie-flow-origin .vigie-flow-num { font-size: 1.05rem; letter-spacing: .4px; white-space: nowrap; }
/* Badge « Ligne VIGIE 02 30 21 34 74 » dans l'en-tête de « Qui est d'astreinte ».
   C'est LE numéro à connaître — celui que composent les appelants et qu'on donne aux
   correspondants — à ne pas confondre avec la présentation « VIGIE → cadre », qui ne
   sert qu'à reconnaître l'appel sur son mobile. Rempli par app.js (setVigieDid). */
.vigie-line-badge {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.vigie-line-badge strong { font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: .4px; white-space: nowrap; }
.vigie-flow-primary .vigie-flow-num { color: var(--success); }
.vigie-flow-overflow .vigie-flow-num { color: var(--blue); }
.vigie-flow-label { font-size: .82rem; font-weight: 600; margin-top: .4rem; }
.vigie-flow-sub { font-size: .72rem; color: var(--text-muted); }
.vigie-flow-arrow { display: flex; align-items: center; color: var(--text-muted); font-size: 1.3rem; font-weight: 700; }
@media (max-width: 640px) {
  .vigie-flow { flex-direction: column; align-items: stretch; }
  .vigie-flow-arrow { justify-content: center; transform: rotate(90deg); }
}

/* ── HABILLAGE DE FULLCALENDAR ──
   La bibliothèque expose ses couleurs en variables CSS et le panel n'en définissait
   AUCUNE : le calendrier gardait donc ses valeurs claires par défaut (page blanche,
   bandes grises, bordures #ddd, boutons bleu ardoise). En thème sombre, la bande de
   jour de la vue liste — un gris clair — recevait le texte clair du panel : illisible.
   On mappe ici chaque variable sur les jetons du panel, ce qui fait suivre le thème
   automatiquement, dans les deux sens. */
.fc {
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface2);
  --fc-neutral-text-color: var(--text-muted);
  --fc-border-color: var(--border);
  --fc-small-font-size: .8em;

  /* Boutons : ceux du panel, pas le bleu ardoise de la bibliothèque. */
  --fc-button-text-color: var(--text);
  --fc-button-bg-color: var(--surface2);
  --fc-button-border-color: var(--border);
  --fc-button-hover-bg-color: var(--surface2);
  --fc-button-hover-border-color: var(--accent);
  /* Bouton actif et pastilles d'événement portent du texte blanc : même jeu d'aplats
     que le reste de l'interface, plutôt que l'accent brut (4,28:1 sous du blanc). */
  --fc-button-active-bg-color: var(--accent-fill);
  --fc-button-active-border-color: var(--accent-fill);

  --fc-event-bg-color: var(--accent-fill);
  --fc-event-border-color: var(--accent-fill);
  --fc-event-text-color: #fff;
  --fc-event-selected-overlay-color: color-mix(in srgb, var(--accent) 25%, transparent);

  --fc-more-link-bg-color: var(--surface2);
  --fc-more-link-text-color: var(--text);
  --fc-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent);
  --fc-today-bg-color: color-mix(in srgb, var(--accent) 10%, transparent);
  --fc-now-indicator-color: var(--red);
  --fc-non-business-color: color-mix(in srgb, var(--text-muted) 12%, transparent);
}
/* Le bouton actif passe en blanc sur accent : le texte doit suivre, sinon il reste
   sombre sur sombre. */
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { color: #fff; }
.fc .fc-button-primary:disabled { opacity: .5; }
.fc .fc-toolbar-title { color: var(--text); }
.fc a { color: inherit; }

/* ── Vue LISTE (mobile) ──
   C'est elle qui rendait le plus mal : bande de jour illisible, lignes tassées,
   heures qui se replient. On la traite comme une liste du panel, pas comme un
   tableau de calendrier. */
.fc .fc-list { border-color: var(--border); border-radius: 10px; overflow: hidden; }
.fc .fc-list-empty { background: transparent; color: var(--text-muted); font-size: .88rem; }

/* Bande de jour : c'est un en-tête, il doit se lire comme tel. */
.fc .fc-list-day-cushion {
  background: var(--surface2);
  padding: .5rem .85rem;
  font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted);
}
.fc .fc-list-day-cushion a { color: inherit; text-decoration: none; }
/* La date à droite reprend du poids : c'est elle qu'on cherche en parcourant. */
.fc .fc-list-day-side-text { color: var(--text); font-weight: 700; }

.fc .fc-list-table td { padding: .6rem .85rem; border-color: var(--border); }
.fc .fc-list-event:hover td { background: var(--surface2); }
/* L'heure ne doit jamais se replier : deux bornes sur deux lignes se lisent comme
   deux créneaux. Chiffres tabulaires pour que les lignes s'alignent. */
.fc .fc-list-event-time {
  white-space: nowrap; font-variant-numeric: tabular-nums;
  color: var(--text-muted); font-size: .8rem; vertical-align: top;
  width: 1%;
}
.fc .fc-list-event-title { color: var(--text); font-size: .9rem; }
.fc .fc-list-event-title a { color: inherit; text-decoration: none; }
.fc .fc-list-event-graphic { vertical-align: top; padding-top: .95rem; }
.fc .fc-list-event-dot { border-width: 5px; }

/* Planning VIGIE — créneaux d'absence (« en pause ») : rendu hachuré distinct des
   créneaux d'astreinte pleins. La couleur du cadre (background-color inline) reste
   visible sous les rayures pour identifier qui est concerné. */
.fc-event.fc-absence {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.45) 0,
    rgba(255, 255, 255, 0.45) 5px,
    rgba(255, 255, 255, 0) 5px,
    rgba(255, 255, 255, 0) 10px
  );
  border-style: dashed !important;
  opacity: 0.9;
}

/* Planning VIGIE — champs de la modale de créneau (select cadre + dates). La peau
   (fond, bordure, chevron, anneau de focus) vient de la base commune ; il ne reste
   ici que la largeur. */
.plan-field { width: 100%; }

/* ── MISE EN PAGE COMMUNE DES PAGES « TABLEAU DE BORD » ───────────────────────
   Un seul vocabulaire pour Statuts, Statistiques (PCM et VIGIE), Qualité réseau,
   Qui est d'astreinte et Paramètres PCM. Avant, chaque page posait ses titres et
   ses blocs avec des styles en ligne différents ; l'œil devait se réadapter à
   chaque onglet.
   - .page-head   : titre de page à gauche, commandes à droite (mêmes boutons partout) ;
   - .page-intro  : phrase d'explication sous le titre, en retrait de ton ;
   - .panel       : bloc de contenu encadré, avec son .panel-head (titre en capitales
                    + commandes) ; c'est le seul conteneur de section ;
   - .stats-kpis  : rangée de tuiles chiffrées (libellé, valeur, précision), la même
                    pour le trafic PCM, le trafic VIGIE et la qualité réseau. */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.page-head .section-title { margin: 0; }
.page-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-left: auto; }
.page-meta { font-size: .78rem; color: var(--text-muted); }
.page-intro {
  color: var(--text-muted); font-size: .85rem; line-height: 1.55;
  max-width: 760px; margin: -.35rem 0 1.25rem;
}
.page-intro strong { color: var(--text); font-weight: 600; }

/* Groupe de boutons-bascule précédé de son libellé (Période, Tranche, Fenêtre…). */
.seg { display: inline-flex; align-items: center; gap: .35rem; }
.seg-label { font-size: .75rem; color: var(--text-muted); margin-right: .15rem; }
/* Historique ⇄ Statistiques, en tête des deux pages d'un espace (app.js, VIEW_SWITCHES). */
.view-switch { margin-bottom: 1rem; }
.view-switch .btn-toggle { display: inline-flex; align-items: center; gap: .35rem; }

/* Déclinaisons de .btn utilisées dans les en-têtes et les pieds de panneau. */
.btn-sm { padding: .35rem .8rem; font-size: .8rem; border-radius: 7px; width: auto; }
.btn-ghost { background: var(--surface); }
.btn-success { background: var(--success-fill); border-color: var(--success-fill); color: #fff; }
.btn-success:hover {
  background: color-mix(in srgb, var(--green) 82%, #000);
  border-color: color-mix(in srgb, var(--green) 82%, #000); color: #fff;
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .9rem;
}
.panel-head:last-child { margin-bottom: 0; }
.panel-title {
  margin: 0; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
}
.panel-sub { margin: .2rem 0 0; font-size: .78rem; color: var(--text-muted); line-height: 1.45; }
.panel-note { font-size: .75rem; color: var(--text-muted); margin: .75rem 0 0; }
.panel-text { font-size: .85rem; color: var(--text-muted); line-height: 1.55; margin: 0 0 .9rem; max-width: 760px; }
.panel-empty { color: var(--text-muted); font-size: .85rem; text-align: center; padding: 2rem 0; }
.panel .table-wrap { border-radius: 8px; }
.panel-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-actions .btn { width: auto; }
.panel-hint { font-size: .8rem; color: var(--text-muted); }
/* Deux panneaux côte à côte quand la place le permet (graphiques de la qualité réseau). */
.panel-grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 1rem; margin-bottom: 1rem;
}
.panel-grid-2 > .panel { margin-bottom: 0; min-width: 0; }

/* Tuiles chiffrées : la précision sous la valeur garde toujours le même retrait ;
   l'unité (« ms ») ou le dénominateur (« /3 ») s'écrit plus petit et en retrait. */
.stats-kpis .stats-value + .card-sub { margin-top: .35rem; }
.stats-value small { font-size: .5em; font-weight: 500; color: var(--text-muted); margin-left: .1rem; }
/* Résultat de contrôle vide : le panneau se referme sur son en-tête. */
.panel-result:empty { display: none; }
.panel-head:has(+ .panel-result:empty) { margin-bottom: 0; }

/* ── Statuts : l'arbre d'acheminement vit dans un panneau, ses commandes dans
   l'en-tête de page (au lieu de flotter au-dessus de l'arbre). */
.topo-panel { padding-bottom: 1.5rem; }
#topo-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
#topo-actions .topo-me-bar { margin: 0; align-self: auto; }
#topo-actions .btn-pcm-defaults { height: 100%; }

/* ── Statuts : le graphe d'acheminement (modules/status.js, _renderTree) ──
   Numéros → opérateur téléphonique → standard → lignes → postes. Les traits sont un
   SVG posé par-dessus (_drawWires), calculé sur la position réelle des cartes : animés
   en couleur sur le chemin qu'un appel prend en ce moment (vert = normal, orange =
   bascule ou débordement, rouge = PCM désactivé), pointillé gris sur les chemins
   possibles. Trop étroit, le graphe défile latéralement plutôt que de se replier :
   replié, les traits ne relieraient plus rien de lisible. */
#topo-wrap { overflow-x: auto; }
.tg { position: relative; min-width: min-content; padding: .2rem .2rem .4rem; }
.tg-wires { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.tg-wire { fill: none; stroke-width: 2; stroke-linejoin: round; }
.tg-wire.is-idle { stroke: color-mix(in srgb, var(--text-muted) 40%, transparent); stroke-dasharray: 4 5; }
.tg-wire.is-plain { stroke: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.tg-wire.is-live, .tg-wire.is-warn, .tg-wire.is-off {
  stroke-width: 2.5; stroke-dasharray: 7 6; animation: tg-flow 1.1s linear infinite;
}
.tg-wire.is-live { stroke: var(--green); }
.tg-wire.is-warn { stroke: var(--orange); }
.tg-wire.is-off  { stroke: var(--red); }
.tg-arrow.is-idle { fill: color-mix(in srgb, var(--text-muted) 45%, transparent); }
.tg-arrow.is-live { fill: var(--green); }
.tg-arrow.is-warn { fill: var(--orange); }
.tg-arrow.is-off  { fill: var(--red); }
@keyframes tg-flow { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) { .tg-wire { animation: none !important; } }
.tg-wire-lbl { font-size: 11.5px; fill: var(--text-muted); }
.tg-wire-lbl.is-warn { fill: var(--orange); font-weight: 600; }
.tg-wire-lbl.is-live { fill: var(--green); font-weight: 600; }

/* Phrase qui résume la situation affichée par les traits. */
.tg-situation {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .45rem;
  margin-bottom: .9rem; padding: .4rem .75rem; border-radius: 8px; font-size: .84rem;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.tg-situation > svg { color: var(--accent-text); flex: none; }
.tg-situation.is-warn { background: color-mix(in srgb, var(--orange) 10%, var(--surface)); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.tg-situation.is-warn > svg { color: var(--orange); }
.tg-situation.is-off { background: color-mix(in srgb, var(--red) 10%, var(--surface)); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tg-situation.is-off > svg { color: var(--red); }

.tg-node, .tg-line, .tg-card { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tg .card-badge { margin-top: 0; font-size: .72rem; padding: .1rem .5rem; white-space: nowrap; }
.tg-empty { color: var(--text-muted); font-size: .8rem; text-align: center; }
.tg-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* En-tête : numéro PCM — opérateur(s) — numéro moyens. */
.tg-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3.5rem; }
.tg-line { padding: .55rem .85rem; justify-self: start; max-width: 19rem; display: flex; flex-direction: column; }
.tg-line.is-bilan { justify-self: end; text-align: right; }
.tg-line-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tg-line strong { font-size: 1.3rem; font-weight: 700; letter-spacing: .4px; white-space: nowrap; color: var(--accent-text); line-height: 1.3; }
.tg-line.is-bilan strong { color: var(--blue); }
.tg-line-sub { font-size: .72rem; color: var(--text-muted); line-height: 1.35; }
.tg-trunks { display: flex; gap: .6rem; justify-content: center; }
.tg-trunk { padding: .55rem .9rem; text-align: center; min-width: 13rem; }
.tg-node-title { font-weight: 650; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.tg-node-sub { font-size: .75rem; color: var(--text-muted); }
.tg-node-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin-top: .3rem; }
.tg-node-hint { font-size: .72rem; color: var(--text-muted); margin-top: .3rem; line-height: 1.35; }

/* Standard téléphonique et son interrupteur Normal / Renvoi mobile. */
.tg-std-row { display: flex; justify-content: center; margin-top: 2rem; }
.tg-std { display: flex; align-items: center; gap: .8rem; padding: .5rem .6rem .5rem .9rem;
  border-width: 1.5px; border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.tg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.tg-seg button { border: 0; background: none; font: inherit; font-size: .78rem; padding: .35rem .7rem;
  display: inline-flex; align-items: center; gap: .35rem; color: var(--text-muted); cursor: default; }
.tg-seg button + button { border-left: 1px solid var(--border); }
.tg-seg button.is-on { background: var(--text); color: var(--surface); font-weight: 600; }
.can-daynight .tg-seg button:not(.is-on):not(:disabled) { cursor: pointer; }
.can-daynight .tg-seg button:not(.is-on):not(:disabled):hover { background: var(--surface2); color: var(--text); }
.tg-seg.is-disabled { opacity: .45; }

/* Les lignes : [astreinte VIGIE] mobiles · principale · moyens. Les écarts laissent la
   place aux traits entre colonnes et à leurs étiquettes. */
.tg-branches { display: flex; justify-content: center; align-items: flex-start; margin-top: 2.9rem; }
.tg-branch { flex: none; width: 14rem; display: flex; flex-direction: column; align-items: stretch; gap: 1.35rem; }
#tg-b-vig { margin-right: 2.5rem; }
#tg-b-mob { margin-right: 6.5rem; }
#tg-b-moy { margin-left: 10.5rem; }
.tg.is-pcm-off .tg-branch { width: 13rem; }
.tg.is-pcm-off #tg-b-moy { margin-left: 5.5rem; }
.tg-branch.is-dim { opacity: .5; }
.tg-qnode { padding: .5rem .7rem; text-align: center; border-width: 1.5px; }
.tg-branch.is-live .tg-qnode { border-color: color-mix(in srgb, var(--green) 60%, transparent); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.tg-branch.is-warn .tg-qnode { border-color: color-mix(in srgb, var(--orange) 60%, transparent); background: color-mix(in srgb, var(--orange) 7%, var(--surface)); }
.tg-branch.is-off .tg-qnode  { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 7%, var(--surface)); }
.tg-flow-tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center; gap: .25rem; margin-bottom: .15rem; }
.tg-branch.is-live .tg-flow-tag { color: var(--green); }
.tg-branch.is-warn .tg-flow-tag { color: var(--orange); }
.tg-branch.is-off .tg-flow-tag { color: var(--red); }
.tg-badge-line { background: none; border: 1px solid var(--border); color: var(--text-muted); gap: .2rem; }
.tg-cards { display: flex; flex-direction: column; gap: .5rem; }

/* Cartes de postes : deux lignes, actions en barre au coin, au survol (toujours sur un
   écran tactile, qui n'a pas de survol). */
.tg-card { padding: .45rem .6rem; min-width: 0; }
.tg-card.is-mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.tg-card-l1 { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.tg-card-l1 .status-dot { margin: 0; flex: none; }
.tg-card-ext { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-card-lbl { color: var(--text-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tg-card-l2 { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.tg-card-l2 small { font-size: .72rem; color: var(--text-muted); }
.tg-card-l2 small.is-warn { color: var(--orange); }
.tg-card-mobile .tg-card-l1 > svg { color: var(--text-muted); }
.tg-card-acts { position: absolute; top: .3rem; right: .3rem; display: flex; gap: 1px; padding: 1px;
  background: var(--surface); border-radius: 6px; box-shadow: 0 0 0 1px var(--border);
  opacity: 0; transition: opacity .12s; }
.tg-card:hover .tg-card-acts, .tg-card:focus-within .tg-card-acts { opacity: 1; }
@media (hover: none) { .tg-card-acts { opacity: 1; } }
.tg-act { border: 0; background: none; padding: .2rem; line-height: 0; border-radius: 5px; color: var(--text-muted); cursor: pointer; }
.tg-act:hover { background: var(--surface2); color: var(--text); }
.tg-act.is-ok { color: var(--green); }
.tg-act.is-danger { color: var(--red); }
.tg-card-add { display: flex; align-items: center; justify-content: center; gap: .35rem; cursor: pointer;
  border-style: dashed; background: none; color: var(--text-muted); font: inherit; font-size: .8rem; }
.tg-card-add:hover { border-color: var(--accent); color: var(--text); }

/* Postes internes : sous l'arbre, hors des traits. */
.tg-internes { position: relative; z-index: 1; margin-top: 1.6rem; padding-top: .9rem; border-top: 1px dashed var(--border); }
.tg-internes-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.tg-internes-head b { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.tg-internes-head span { font-size: .75rem; color: var(--text-muted); }
.tg-internes-groups { display: flex; flex-wrap: wrap; gap: .9rem 1.6rem; }
.tg-internes-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .35rem; }
.tg-internes-cards { display: flex; flex-wrap: wrap; gap: .5rem; }
.tg-internes-cards .tg-card { width: 13rem; }

/* ── Paramètres PCM : tuiles alignées, état du mode dans une bande, boutons de
   même gabarit d'une carte à l'autre. */
.admin-state {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  background: var(--surface2); border-radius: 8px; padding: .55rem .8rem;
  font-size: .85rem; line-height: 1.4;
}
.admin-state .card-badge { margin-top: 0; }
.admin-card-tag { font-weight: 400; color: var(--text-muted); font-size: .8em; }

/* Liste de réglages (Paramètres PCM) : une ligne par interrupteur — icône, titre et
   explication, état courant, action. Les deux interrupteurs d'acheminement (mode PCM,
   renvoi mobile) se lisent d'un coup d'œil, l'un sous l'autre, avec leur état. */
.setting-list { display: flex; flex-direction: column; }
.setting-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: .6rem 1.1rem; padding: .95rem 0;
  border-top: 1px solid var(--border);
}
.setting-row:first-child { border-top: none; padding-top: .15rem; }
.setting-row:last-child { padding-bottom: .15rem; }
.setting-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; align-self: start;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text);
}
.setting-title { font-weight: 600; font-size: .95rem; }
.setting-desc { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; line-height: 1.45; max-width: 640px; }
.setting-state {
  display: flex; flex-direction: column; align-items: flex-end; gap: .3rem;
  font-size: .8rem; color: var(--text-muted); text-align: right; max-width: 260px;
}
.setting-state .card-badge { margin-top: 0; white-space: nowrap; }
.setting-state:empty { display: none; }
.setting-action .btn { width: auto; padding: .55rem 1.1rem; font-size: .875rem; white-space: nowrap; }
/* Les trois cas d'un réglage, énumérés sous sa description (délais de débordement de
   la ligne principale) : une puce discrète, pas une liste à part entière. */
.setting-notes { margin: .45rem 0 0; padding-left: 1.05rem; list-style: disc; }
.setting-notes li { margin-top: .2rem; }
/* Réglage consulté sans droit de le changer (délais de débordement, opérateur PC). */
.setting-readonly { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
/* Résultat d'un contrôle : sous la ligne, aligné sur son texte. */
.setting-result { margin: .2rem 0 .3rem calc(38px + 1.1rem); font-size: .875rem; line-height: 1.5; }
.setting-result:empty { display: none; }
.btn-warning { background: var(--warning-fill); border-color: var(--warning-fill); color: #fff; }
.btn-warning:hover {
  background: color-mix(in srgb, var(--warning-fill) 82%, #000);
  border-color: color-mix(in srgb, var(--warning-fill) 82%, #000); color: #fff;
}
@media (max-width: 760px) {
  .setting-row { grid-template-columns: auto minmax(0, 1fr); }
  .setting-state, .setting-action { grid-column: 2; justify-self: start; align-items: flex-start; text-align: left; max-width: none; }
  .setting-result { margin-left: 0; }
}

/* ── Utilisateurs : recherche et filtres par profil au-dessus du tableau, comptes
   rangés sous un intertitre par profil. Le nom passe devant l'identifiant (on cherche
   une personne), dates et numéros ne se coupent plus en deux lignes. */
.users-toolbar { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.users-toolbar #users-search { flex: 1 1 260px; max-width: 360px; font-size: .85rem; padding: .45rem .65rem; }
.users-table tbody td { padding-top: .55rem; padding-bottom: .55rem; vertical-align: middle; }
.users-who { white-space: nowrap; }
.users-who strong { display: block; font-weight: 600; }
.users-table .acces-pills { min-width: 14rem; }
.users-table th, .users-table tbody td { padding-left: .75rem; padding-right: .75rem; }
.users-login { display: block; font-size: .78rem; color: var(--text-muted); margin-top: .05rem; }
.users-tel { display: block; font-size: .82rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.users-none { color: var(--text-muted); }
.users-date { white-space: nowrap; font-size: .82rem; font-variant-numeric: tabular-nums; }
.users-date .card-badge { margin-top: 0; }
.users-table .col-poste .card-badge { margin-top: 0; }
/* Les actions restent à l'écran quand le tableau défile en largeur. */
.users-table .col-act { width: 1%; white-space: nowrap; position: sticky; right: 0; background: var(--surface); }
.users-table tbody tr:hover .col-act { background: var(--surface2); }
@media (max-width: 1400px) {
  .users-table .col-cree { display: none; }
  .users-table .acces-pills { min-width: 0; }
}
.users-table tr.users-group th {
  background: var(--surface2); padding-top: .45rem; padding-bottom: .45rem; text-align: left;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-top: 1px solid var(--border);
}
.users-table tr.users-group:hover { background: none; }
.users-table tr.users-group .tab-count { margin-left: .35rem; }

/* ── Personnalisation : champs sur deux colonnes dans leur panneau, aperçu du logo
   dans un cadre fixe à côté de ses boutons. */
.perso-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0 1.25rem; }
.perso-grid .form-group:last-child { margin-bottom: .1rem; }
.perso-wide { grid-column: 1 / -1; }
.perso-grid > .form-group { max-width: 640px; }
.field-hint { margin: .35rem 0 0; font-size: .76rem; color: var(--text-muted); }
.perso-logo { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.perso-logo-box {
  display: flex; align-items: center; justify-content: center;
  width: 140px; height: 64px; border-radius: 8px; padding: .4rem;
  background: var(--surface2); border: 1px dashed var(--border);
}
.perso-logo-box:empty::before { content: 'Aucun logo'; font-size: .75rem; color: var(--text-muted); }
.perso-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.perso-logo-side .field-hint { margin-top: .45rem; }
.form-group label.perso-file-btn { position: relative; cursor: pointer; text-transform: none; letter-spacing: 0;
  font-weight: 500; color: var(--text); margin: 0; display: inline-flex; }
.perso-file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.perso-file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Champ fichier d'un bouton « Déposer / Remplacer » (sons, musiques, COT, groupes, SVI) :
   masqué à l'œil mais pas au clavier — avec l'attribut hidden, Tab ne l'atteignait pas
   et l'on ne pouvait rien téléverser sans souris. Le contour se pose sur le bouton. */
.file-input-sr {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
label:has(> .file-input-sr) { position: relative; }
label:has(> .file-input-sr:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.perso-sep { margin: 1.1rem 0 .9rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.perso-save { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.perso-save .btn { width: auto; padding: .55rem 1.4rem; }
.perso-save .error-msg { margin: 0; }
.jr-panel .jr-json { background: var(--bg); }

/* ── Qui est d'astreinte : chaque zone (cadres, 690, 695) est un panneau ; la zone
   de dépôt garde un fond léger pour qu'on voie où lâcher une carte. */
.panel .vigie-dropzone {
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
  border-radius: 8px; padding: .6rem; margin: 0;
  display: flex; flex-wrap: wrap; gap: .6rem;
}
.panel .vigie-roster { display: flex; flex-wrap: wrap; gap: .6rem; }
.vigie-zone-empty { color: var(--text-muted); font-size: .85rem; align-self: center; padding: .3rem .4rem; }

/* ── Statistiques VIGIE : la heat map et le classement par cadre sont des panneaux ;
   la légende passe sous la grille, comme la note sous la heat map du PCM. */
.panel .vh-months { margin-top: .2rem; }
.vh-foot { display: flex; align-items: center; gap: .35rem; margin-top: .9rem; }
.vh-foot .vh-legend { margin-left: 0; }

/* ── Qualité réseau : graphiques pleine largeur de leur panneau. */
.q-chart { min-height: 160px; }
.q-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.q-chart .panel-empty { padding: 3rem 0; }

@media (max-width: 640px) {
  .page-actions { margin-left: 0; width: 100%; }
  .panel { padding: .85rem .9rem; }
  .panel-grid-2 { grid-template-columns: 1fr; }
}

/* ── Liaison Internet du PCM (routeur RUTX50, modules/routerlink.js) ─────────────
   Les liaisons en cartes côte à côte, le modem à droite ; en dessous, la courbe de
   débit et la carte. La liaison en service est soulignée d'un liseré accent. */
.router-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.router-link { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.router-link-active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.router-link-stale { opacity: .6; }
.router-link-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.router-link-name { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .9rem; min-width: 0; }
.router-link-name svg { color: var(--text-muted); flex: none; }
.router-link-meta { line-height: 1.5; }
.router-kv { border-collapse: collapse; width: 100%; font-size: .85rem; margin-bottom: .5rem; }
.router-kv td { padding: .25rem 0; vertical-align: middle; }
.router-kv td:first-child { color: var(--text-muted); width: 1%; white-space: nowrap; padding-right: 1.25rem; }
.router-kv td + td { overflow-wrap: anywhere; }
/* Barres de signal, façon téléphone : 4 traits de hauteur croissante. */
.router-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; vertical-align: middle; margin-right: .3rem; }
.router-bars i { display: block; width: 4px; background: var(--border); border-radius: 1px; }
.router-bars i:nth-child(1) { height: 5px; } .router-bars i:nth-child(2) { height: 8px; }
.router-bars i:nth-child(3) { height: 11px; } .router-bars i:nth-child(4) { height: 14px; }
.router-bars i.on { background: var(--green); }
.router-bars.warn i.on { background: var(--yellow); }
.router-bars.bad i.on { background: var(--red); }
.router-gps-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .9rem; margin-top: .4rem; }
.router-map { height: 280px; border-radius: 8px; margin-top: .6rem; overflow: hidden; border: 1px solid var(--border); }
.router-map .leaflet-tooltip { font-weight: 600; }
/* Leaflet 1.9 pose `mix-blend-mode: plus-lighter` sur chaque tuile pour masquer les
   coutures entre elles. Sous un parent filtré (notre inversion du thème sombre, juste
   en dessous), Chrome mélange alors la tuile avec un fond qui n'existe pas : le cadre
   reste gris, sans la moindre erreur en console. Les coutures ne se voient pas à ce
   zoom ; la carte absente, si. */
.router-map img.leaflet-tile { mix-blend-mode: normal; }
/* Message affiché quand le fond de carte ne se charge pas (routerlink.js). */
#router-map-note:not(:empty) { margin-top: .4rem; }
/* Thème sombre : les tuiles OSM sont claires, on les inverse pour ne pas éblouir. */
[data-theme="dark"] .router-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
[data-theme="dark"] .router-map .leaflet-control-attribution,
[data-theme="dark"] .router-map .leaflet-control-zoom a { background: var(--surface); color: var(--text); }
[data-theme="dark"] .router-map .leaflet-control-attribution a { color: var(--accent); }
/* Jauge de charge de l'onduleur (routerlink.js) */
.router-charge { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--border); vertical-align: middle; overflow: hidden; margin-right: .3rem; }
.router-charge i { display: block; height: 100%; background: var(--green); }
.router-charge.warn i { background: var(--yellow); }
.router-charge.bad i { background: var(--red); }
.router-ups-chart:not(:empty) { margin-top: .75rem; }
/* Page Liaison Internet : tuiles à valeur textuelle (nom de liaison, « secteur »…) */
.router-tile-value { font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
#router-kpis .card { min-width: 0; }
#router-kpis .card-sub { overflow-wrap: anywhere; }
.router-tile-value .router-bars { height: 16px; }
.router-tile-value small { font-size: .6em; }
/* Carte « Lien fixe » (routerlink.js, renderFixed) : grand format, les quatre contrôles
   (câble, adresse, Internet, WireGuard) se partagent toute la largeur. */
.router-fixed-checks { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.router-row-active { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.router-row-active:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface2)); }
.router-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.router-num small { font-size: .75em; color: var(--text-muted); }
/* Barres de signal compactes dans l'en-tête, à côté du nom de la liaison mobile */
.router-bars.sm { height: 10px; gap: 1.5px; margin: 0 0 0 .1rem; }
.router-bars.sm i { width: 3px; }
.router-bars.sm i:nth-child(1) { height: 4px; } .router-bars.sm i:nth-child(2) { height: 6px; }
.router-bars.sm i:nth-child(3) { height: 8px; } .router-bars.sm i:nth-child(4) { height: 10px; }
.link-stat-value .router-bars { vertical-align: baseline; }

/* Rubriques de la page Liaison Internet (routerlink.js, showSub) : onglets à gauche,
   période des courbes à droite (Voix et Qualité seulement). */
.router-subnav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.router-subtabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.router-subtabs .btn-toggle { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; font-size: .82rem; }
.router-subtabs .btn-toggle.active .tab-count { background: color-mix(in srgb, #fff 25%, transparent); color: #fff; }
.router-subnav .seg { flex-wrap: wrap; }
.router-subnav .seg[hidden] { display: none; }
/* Choix de la liaison : une rangée de boutons par usage, la liaison en place dessous. */
.router-mode-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .9rem 1.25rem; align-items: start; }
.router-mode-use { font-size: .85rem; font-weight: 600; padding-top: .45rem; }
.router-mode-row { min-width: 0; }
.router-mode-opts { display: flex; flex-wrap: wrap; gap: .35rem; }
.router-mode-opts .btn-toggle { display: inline-flex; align-items: center; gap: .1rem; padding: .4rem .75rem; font-size: .82rem; color: var(--text); }
.router-mode-opts .btn-toggle small { color: var(--text-muted); font-size: .85em; margin-left: .25rem; }
.router-mode-opts .btn-toggle.active { color: #fff; }
.router-mode-opts .btn-toggle.active small { color: inherit; opacity: .8; }
.router-mode-opts .btn-toggle .status-dot { margin-right: .35rem; }
.router-mode-opts .btn-toggle.is-inplace { box-shadow: inset 0 -3px 0 var(--success); }
.router-mode-opts .btn-toggle:disabled { cursor: default; opacity: .75; }
.router-mode-opts .btn-toggle:disabled:hover { border-color: var(--border); color: var(--text); }
.router-mode-opts .btn-toggle.active:disabled:hover { border-color: var(--accent-fill); color: #fff; }
.router-mode-place { font-size: .85rem; margin-top: .4rem; overflow-wrap: anywhere; }
.router-mode-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: 1rem; font-size: .85rem; }
.router-mode-foot .card-sub:empty { display: none; }
@media (max-width: 640px) {
  .router-mode-grid { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .router-mode-use { padding-top: .6rem; }
}
/* Légende des courbes, sous le SVG : elle passe à la ligne au lieu d'être coupée. */
.router-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: .5rem; font-size: .75rem; color: var(--text-muted); }
.router-legend span { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; overflow-wrap: anywhere; }
.router-legend i { flex: none; width: 10px; height: 10px; border-radius: 2px; }
/* Tableaux de la page : huit colonnes pour certains, qui débordaient dès 1280 px avec le
   retrait commun (1 rem) et des en-têtes en capitales sur une seule ligne. */
#tab-pcm-link .table-wrap th, #tab-pcm-link .table-wrap td { padding-left: .6rem; padding-right: .6rem; }
#tab-pcm-link .table-wrap th { white-space: normal; vertical-align: bottom; }
.router-ip { font-family: monospace; font-size: .8rem; white-space: nowrap; }
/* Volume reçu / envoyé : chaque sens d'un bloc, les deux passent l'un sous l'autre si la
   colonne manque de place (le tableau des liaisons débordait de sa dernière colonne). */
.router-vol { font-variant-numeric: tabular-nums; }
.router-vol span { display: inline-block; white-space: nowrap; margin-right: .5rem; }

/* ── Centre opérationnel (COT) — assets/modules/cot.js ─────────────────────── */
.cot-status {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .8rem 1rem; margin: 0 0 1.25rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
}
.cot-status.is-open { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }
.cot-status .status-dot { width: 12px; height: 12px; margin: 0; }
.cot-status-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 200px; }
.cot-status-text strong { font-size: 1rem; }
.cot-status-text span { font-size: .82rem; color: var(--text-muted); }
.cot-status .btn { width: auto; padding: .5rem 1rem; }
.cot-digit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; margin-right: .3rem;
  background: var(--accent-fill); color: #fff; font-size: .8rem; font-weight: 700;
}
/* Cellule hors menu (joignable par SDA direct seulement) : pas de pastille vide. */
.cot-digit:empty { display: none; }
/* Paramètres COT — menu, cellules, enregistrements. */
.cot-set-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; justify-content: flex-end; }
.cot-set-controls label { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.cot-set-controls input[type="number"] { width: 4.2rem; }
.cot-set-controls select { width: auto; }
.cot-sound-ok { color: var(--green); font-size: .8rem; }
.cot-sound-missing { color: var(--orange); font-size: .8rem; }
.cot-sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem; padding: .6rem .9rem; }
.cot-sound-cell { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  border: 1px solid var(--border); border-radius: 8px; padding: .35rem .5rem; font-size: .82rem; }
.cot-sound-cell .cot-set-controls { gap: .25rem; }
.cot-sound-cell .cot-set-controls { flex-wrap: nowrap; justify-content: flex-start; }
.setting-desc.cot-set-controls .btn { padding-top: .15rem; padding-bottom: .15rem; }
.cot-adv summary, .cot-sounds-fold > summary { cursor: pointer; }
.cot-sounds-fold > summary { list-style: none; }
.cot-sounds-fold > summary::-webkit-details-marker { display: none; }
.cot-set-note { padding: .6rem .9rem; font-size: .82rem; color: var(--text-muted); }
/* Paramètres COT — une ligne par choix du serveur vocal. En tête : touche, nom, qui
   sonne, place dans l'annonce, au menu ou non. Dessous, les deux réglages d'usage
   courant côte à côte ; enregistrements, nom et suppression dans un volet replié. */
.cot-heard { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem;
  padding: .55rem .75rem; margin-bottom: .6rem; border-radius: 9px; background: var(--surface2); font-size: .85rem; }
.cot-heard-label { color: var(--text-muted); font-size: .78rem; margin-right: .15rem; }
.cot-heard-item { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem .15rem .2rem;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.cot-heard-item b { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem;
  border-radius: 50%; background: var(--accent-fill); color: #fff; font-size: .72rem; }
.cot-cells { display: flex; flex-direction: column; }
.cot-cell { padding: .85rem 0; border-top: 1px solid var(--border); }
.cot-cell:first-child { border-top: none; padding-top: .3rem; }
.cot-cell-head { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto; align-items: center; gap: .3rem .85rem; }
.cot-cell-key { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem;
  border-radius: 50%; background: var(--accent-fill); color: #fff; font-weight: 700; font-size: .95rem; }
.cot-cell.is-off .cot-cell-key, .cot-cell-key.is-add { background: var(--surface2); color: var(--text-muted); }
.cot-cell-title { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-weight: 600; font-size: .95rem; }
.cot-cell.is-off .cot-cell-title > span:first-child { color: var(--text-muted); }
.cot-ivr-name { min-width: 0; }
.cot-cell-sub { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }
.cot-warn-text { color: var(--orange); }
.cot-cell-actions { display: flex; align-items: center; gap: .6rem; }
.cot-ivr-order { display: inline-flex; gap: .2rem; }
.cot-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: .3rem; min-width: 1.9rem; }
.cot-icon-btn:disabled { opacity: .35; cursor: default; }
.cot-tag { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; line-height: 1.4;
  padding: .05rem .5rem; border-radius: 999px; background: var(--surface2); color: var(--text-muted); white-space: nowrap; }
.cot-tag.ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.cot-tag.warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 13%, transparent); }
.cot-cell-body { margin-left: calc(2.1rem + .85rem); }
.cot-cell-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .6rem 1rem;
  margin-top: .65rem; max-width: 44rem; }
.cot-field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.cot-field-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.cot-field select { width: 100%; }
.cot-field-hint { font-size: .75rem; color: var(--orange); }
.cot-cell-more { margin-top: .55rem; }
.cot-cell-more > summary { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; list-style: none;
  font-size: .8rem; color: var(--text-muted); padding: .15rem 0; }
.cot-cell-more > summary::-webkit-details-marker { display: none; }
.cot-cell-more > summary:hover { color: var(--text); }
.cot-cell-more > summary svg { transition: transform .15s; }
.cot-cell-more[open] > summary svg { transform: rotate(90deg); }
.cot-more-body { display: flex; flex-direction: column; gap: .5rem; margin-top: .45rem; padding: .65rem .8rem;
  border: 1px solid var(--border); border-radius: 9px; max-width: 44rem; }
.cot-more-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; font-size: .82rem; }
.cot-more-what { min-width: 12rem; }
.cot-more-line .btn { width: auto; }
.cot-more-line .btn-sm:not(.cot-icon-btn) { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; }
.cot-more-manage { padding-top: .5rem; border-top: 1px solid var(--border); }
.cot-check { display: inline-flex; align-items: center; gap: .35rem; min-width: 12rem; }
.cot-danger { color: var(--red); }
.cot-cell-new { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; padding: .85rem 0 .3rem;
  border-top: 1px solid var(--border); }
.cot-cell-new input { flex: 0 1 16rem; width: auto; }
.cot-cell-new .btn { width: auto; }
.cot-cell-new-hint { flex-basis: 100%; margin-left: calc(2.1rem + .85rem); font-size: .78rem; color: var(--text-muted); }
@media (max-width: 640px) {
  .cot-cell-head { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .cot-cell-actions { grid-column: 2; }
  .cot-cell-body, .cot-cell-new-hint { margin-left: 0; }
}

.cot-set-note.warn { color: var(--orange); }
.cot-sub-title { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; margin: .8rem 0 .35rem; }
.cot-fixed { display: flex; flex-wrap: wrap; gap: .4rem; }
.cot-fixed-opt {
  display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; cursor: pointer;
  background: var(--surface);
}
.cot-fixed-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.cot-fixed-opt input { display: none; }
.cot-fixed-opt[hidden] { display: none; }
.cot-fixed-opt .status-dot { margin: 0; }
.cot-fixed-tag {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem;
  border-radius: 999px; background: var(--surface2); font-size: .82rem;
}
.cot-fixed-tag .status-dot { margin: 0; }
.cot-fixed-summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.cot-fixed-picker {
  margin-top: .6rem; padding: .7rem; border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; gap: .6rem;
}
.cot-fixed-picker input { max-width: 320px; }

/* ── Cellules du COT : tableau de composition (membres × cellules) ──
   En-tête, pied (« Sonnerait ») et colonne des noms restent visibles au défilement :
   à cinquante lignes, on ne perd ni la cellule ni le membre de vue. */
.cot-mx-tools { gap: .5rem .8rem; }
.cot-matrix-search { min-width: 200px; }
.cot-filter-n { opacity: .75; font-variant-numeric: tabular-nums; }
.cot-mx-wrap { max-height: min(62vh, 640px); overflow: auto; }
.cot-mx { border-collapse: separate; border-spacing: 0; }
.cot-mx thead th, .cot-mx tfoot th, .cot-mx tfoot td { position: sticky; z-index: 2; background: var(--surface); }
.cot-mx thead th { top: 0; padding: .45rem .5rem; vertical-align: bottom; }
.cot-mx tfoot th, .cot-mx tfoot td {
  bottom: 0; border-top: 1px solid var(--border); padding: .5rem;
  font-size: .75rem; font-weight: 600; color: var(--text-muted);
}
.cot-mx tbody th, .cot-mx tbody td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.cot-mx tbody tr { border-bottom: none; }
.cot-mx tbody tr:last-child th, .cot-mx tbody tr:last-child td { border-bottom: none; }
.cot-mx .cot-mx-who { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 190px; }
.cot-mx thead .cot-mx-who, .cot-mx tfoot .cot-mx-who { z-index: 3; }
.cot-mx tbody tr:hover .cot-mx-who { background: var(--surface2); }
.cot-mx tfoot .cot-mx-who { text-transform: uppercase; letter-spacing: .05em; }
.cot-mx-col, .cot-mx-cell { text-align: center; width: 1%; }
.cot-mx-name { display: block; font-weight: 600; font-size: .875rem; }
.cot-mx-meta { display: block; font-size: .75rem; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cot-mx-head {
  display: inline-flex; flex-direction: column; align-items: center; gap: .25rem;
  background: none; border: none; border-radius: 6px; padding: .2rem .45rem .3rem; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
}
.cot-mx-head:hover { color: var(--accent); }
.cot-mx-head:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.cot-mx-head .cot-digit { margin: 0; }
.cot-mx-col.is-sel .cot-mx-head { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.cot-mx-toggle {
  position: relative; width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 0;
  border: 1px solid var(--border); background: var(--surface); color: #fff;
  transition: background .12s, border-color .12s;
}
.cot-mx-toggle:hover { border-color: var(--accent); }
.cot-mx-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.cot-mx-toggle.is-on { background: var(--success-fill); border-color: var(--success-fill); }
/* Affecté mais inactif : la case est « réservée » — contour plein et fond teinté, sans coche. */
.cot-mx-toggle.is-assigned { border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cot-mx-toggle.is-none { border-style: dashed; }
.cot-mx-toggle[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--ring); }
.cot-mx-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0 0 .6rem; font-size: .78rem; color: var(--text-muted); }
.cot-mx-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.cot-mx-key {
  width: 1rem; height: 1rem; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); background: var(--surface); color: #fff; line-height: 0;
}
.cot-mx-key.is-assigned { border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cot-mx-key.is-on { border: 1px solid var(--success-fill); background: var(--success-fill); }
.cot-mx-person {
  display: block; width: 100%; text-align: left; background: none; border: none; padding: .15rem .3rem;
  margin: -.15rem -.3rem; border-radius: 6px; cursor: pointer; font: inherit; color: inherit;
}
.cot-mx-person:hover { background: var(--surface2); }
.cot-mx-person:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.cot-mx-tally {
  display: inline-block; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; vertical-align: 1px;
  font-size: .68rem; font-weight: 600; color: var(--text-muted); background: var(--surface2); font-variant-numeric: tabular-nums;
}
.cot-mx-tally.is-on { color: #fff; background: var(--success-fill); }

/* Popover du tableau : détail d'un membre dans une cellule, ou partout. */
.cot-pop {
  position: fixed; z-index: 300; width: min(300px, calc(100vw - 16px)); padding: .8rem .9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.cot-pop-title { margin: 0; font-weight: 600; font-size: .9rem; }
.cot-pop-sub { margin: .15rem 0 .6rem; font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.cot-pop-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .35rem 0; border-top: 1px solid var(--border); }
.cot-pop-label { display: block; font-size: .82rem; font-weight: 500; }
.cot-pop-num { display: block; font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cot-pop-cells { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; }
.cot-pop-cells li { display: flex; align-items: center; gap: .1rem; }
.cot-pop-cells li span:last-child { margin-left: auto; font-size: .75rem; color: var(--text-muted); }
.cot-pop-cells li.is-on span:last-child { color: var(--green); font-weight: 600; }
.cot-pop-cells .cot-digit { width: 1.2rem; height: 1.2rem; font-size: .7rem; }
.cot-pop-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.btn-link-danger { background: none; border: none; padding: .2rem 0; cursor: pointer; font: inherit; font-size: .8rem; color: var(--danger); }
.btn-link-danger:hover { text-decoration: underline; }

/* Interrupteur (bureau) : activer un mobile dans une cellule. */
.cot-switch {
  position: relative; flex: none; width: 2.4rem; height: 1.35rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface2); padding: 0; transition: background .15s, border-color .15s;
}
.cot-switch-knob {
  position: absolute; top: 50%; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transform: translateY(-50%); transition: left .15s;
}
.cot-switch.on { background: var(--success-fill); border-color: var(--success-fill); }
.cot-switch.on .cot-switch-knob { left: calc(100% - 1.15rem); }
.cot-switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.cot-switch.pending { opacity: .5; pointer-events: none; }
.cot-switch:disabled { opacity: .4; cursor: not-allowed; }
.cot-mx-toggle[aria-busy="true"] { opacity: .5; cursor: progress; }
.cot-mx-slot {
  position: absolute; top: -.45rem; right: -.55rem; padding: .1rem .25rem; border-radius: 999px;
  font-size: .6rem; font-weight: 700; line-height: 1; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
}
.cot-mx-ready { white-space: nowrap; }
.cot-mx-ready.is-empty { color: var(--red); }
.cot-mx-count { font-size: .78rem; color: var(--text-muted); margin: .5rem 0 0; }

/* Détail d'une cellule : une à la fois, choisie par les boutons ou l'en-tête du tableau. */
.cot-cell-tabs { display: flex; flex-wrap: wrap; gap: .35rem; }
.cot-cell-tabs .btn-toggle { display: inline-flex; align-items: center; gap: .35rem; }
.cot-cell-tabs .btn-toggle.is-empty:not(.active) { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }
.cot-mode-tabs { padding: .6rem .9rem 0; }
.cot-mode-tabs .btn-toggle.active .cot-tab-count { color: inherit; opacity: .85; }
#cot-modes .setting-action label { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; font-size: .85rem; }
.cot-tab-count, .tab-count {
  font-size: .72rem; padding: 0 .4rem; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
/* Pastille d'un onglet qui signale quelque chose (rubriques de la liaison Internet). */
.tab-count.is-warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.tab-count.is-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 18%, transparent); }
.cot-detail-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: 1rem; }
.cot-detail-title { margin: 0; display: flex; align-items: center; flex-wrap: wrap; font-weight: 600; }
.cot-detail-sub { margin-left: .5rem; font-size: .8rem; font-weight: 400; color: var(--text-muted); }
.cot-zone { border-radius: 8px; outline: 2px dashed transparent; outline-offset: 3px; transition: outline-color .15s; }
.cot-zone.drag-over { outline-color: var(--accent); }
.cot-order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; max-width: 720px; }
.cot-member {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .6rem;
  padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: grab;
}
.cot-member:active { cursor: grabbing; }
.cot-member.dragging { opacity: .45; }
.cot-grip { color: var(--text-muted); line-height: 0; }
.cot-order {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); font-size: .8rem; font-weight: 700; color: var(--text-muted);
}
.cot-member-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .8rem; min-width: 0; }
.cot-member-name { font-weight: 600; font-size: .875rem; }
.cot-member-name.is-external { color: var(--text-muted); font-weight: 500; }
.cot-member-num { font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cot-member-num.is-on { color: var(--text); }
.cot-member-acts { display: inline-flex; align-items: center; gap: .1rem; }
.cot-member-state { font-size: .75rem; color: var(--text-muted); margin-right: .3rem; min-width: 3.2rem; text-align: right; }
.cot-member.is-off { background: var(--surface2); }
.cot-member.is-off .cot-member-name, .cot-member.is-off .cot-order { opacity: .6; }
.cot-member:not(.is-off) .cot-member-state { color: var(--green); font-weight: 600; }
.cot-member-acts .cot-switch { margin-right: .35rem; }
.btn-cot-move, .btn-cot-remove {
  background: none; border: 1px solid transparent; border-radius: 6px; padding: .3rem;
  line-height: 0; cursor: pointer; color: var(--text-muted);
}
.btn-cot-move:hover:not(:disabled) { color: var(--accent); border-color: var(--border); }
.btn-cot-move:disabled { opacity: .3; cursor: default; }
.btn-cot-remove { color: var(--danger); }
.btn-cot-remove:hover { border-color: var(--border); }
.btn-cot-move:focus-visible, .btn-cot-remove:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-cot-add { margin-top: .6rem; gap: .3rem; }
@media (max-width: 600px) {
  .cot-grip { display: none; }
  .cot-member { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cot-mx .cot-mx-who { min-width: 140px; }
}
.cot-me-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .7rem; }
.cot-me-summary { margin: 0; font-size: .92rem; color: var(--text-muted); }
.cot-me-summary strong { color: var(--text); }
.cot-me-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
/* L'état désactivé des boutons pleins est traité plus haut (surface neutre plutôt
   qu'opacité) : ne reste ici que le cas des boutons sobres de la même barre. */
.cot-me-actions .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):disabled {
  opacity: .45; cursor: default;
}
.cot-me-list { list-style: none; margin: 0; padding: 0; }
.cot-me-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .2rem; border-top: 1px solid var(--border); }
.cot-me-row .cot-digit { margin: 0; flex: none; background: var(--surface2); color: var(--text-muted); }
.cot-me-row.is-active .cot-digit { background: var(--success-fill); color: #fff; }
.cot-me-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cot-me-label { font-weight: 600; font-size: .9rem; }
.cot-me-with { font-size: .78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cot-me-toggles { display: flex; gap: .9rem; flex: none; }
.cot-me-toggle { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--text-muted); }

/* ── Cartographie du routage (.dpm-*) ──
   Trois colonnes : points d'entrée, carte de la chaîne, détail du nœud. La carte
   n'affiche qu'une chaîne à la fois — jamais les 270 contextes — donc une simple
   rangée de colonnes flex suffit : ni zoom, ni moteur de placement, ni SVG.
   Aucune couleur en dur : tout passe par les jetons, les deux thèmes suivent. */
.dpm-layout {
  display: grid; gap: .9rem; align-items: start;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(300px, 380px);
}
@media (max-width: 1280px) { .dpm-layout { grid-template-columns: 260px minmax(0, 1fr); } }
@media (max-width: 900px)  { .dpm-layout { grid-template-columns: 1fr; } }

.dpm-rail, .dpm-center, .dpm-detail { padding: .8rem; }
.dpm-detail { position: sticky; top: .8rem; max-height: calc(100vh - 2rem); overflow: auto; }
.dpm-rail input[type="search"] { width: 100%; margin-bottom: .5rem; }

.dpm-group { border-top: 1px solid var(--border); }
.dpm-group:first-child { border-top: none; }
.dpm-group-head {
  display: flex; align-items: center; gap: .4rem; cursor: pointer;
  padding: .45rem .1rem; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
}
.dpm-group-head::-webkit-details-marker { display: none; }
.dpm-count {
  margin-left: auto; padding: 0 .35rem; border-radius: 8px;
  background: var(--surface2); font-size: .7rem; font-weight: 600;
}
.dpm-group-body { padding-bottom: .4rem; }

.dpm-entry {
  display: flex; flex-direction: column; gap: .1rem; width: 100%;
  padding: .4rem .5rem; margin-bottom: .2rem; text-align: left; cursor: pointer;
  border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--text); font: inherit;
}
.dpm-entry:hover { background: var(--surface2); }
.dpm-entry.is-active { background: var(--surface2); border-color: var(--accent); }
.dpm-entry-label { font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.dpm-entry-sub { font-size: .75rem; color: var(--text-muted); }
.dpm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex-shrink: 0; }

/* Bandeau des divergences : ce que FreePBX affiche ≠ ce qui sonne. C'est la raison
   d'être de la page, il ne se noie pas dans une liste. */
.dpm-banner {
  display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .8rem;
  padding: .7rem .9rem; border-radius: 8px;
  border: 1px solid var(--red); background: color-mix(in srgb, var(--red) 10%, transparent);
  font-size: .85rem;
}
.dpm-banner strong { display: block; margin-bottom: .15rem; }
.dpm-issue { display: flex; gap: .5rem; align-items: baseline; padding: .3rem .1rem; font-size: .82rem; }

.dpm-summary { font-weight: 600; margin-bottom: .8rem; }
.dpm-canvas {
  display: flex; align-items: stretch; gap: .5rem;
  overflow-x: auto; padding-bottom: .4rem;
}
.dpm-col { display: flex; flex-direction: column; gap: .5rem; min-width: 210px; flex: 1 1 210px; }
.dpm-col-head {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); font-weight: 600;
}
.dpm-arrow { align-self: center; color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0; }

.dpm-node {
  display: flex; flex-direction: column; gap: .3rem; width: 100%;
  padding: .55rem .65rem; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: 8px; background: var(--surface2); color: var(--text); font: inherit;
}
.dpm-node:hover { border-color: var(--accent); }
.dpm-node.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.dpm-node.is-taken { border-left-color: var(--green); }
.dpm-node.is-missing { border-left-color: var(--red); }
.dpm-node-head { display: flex; align-items: center; gap: .35rem; }
.dpm-node-title { font-size: .85rem; font-weight: 600; }
.dpm-node-why { font-size: .78rem; color: var(--text-muted); }
.dpm-node-rings { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: .25rem; }

.dpm-edges { list-style: none; margin: .15rem 0 0; padding: 0; }
.dpm-edge { font-size: .74rem; color: var(--text-muted); padding-left: .8rem; position: relative; }
.dpm-edge::before { content: "↳"; position: absolute; left: 0; }
.dpm-edge.is-taken { color: var(--green); }
.dpm-edge.is-skipped { opacity: .55; text-decoration: line-through; }

.dpm-audit { margin-top: 1rem; }
.dpm-pane { font-size: .85rem; }
.dpm-business { margin: 0 0 .7rem; }
.dpm-block-title {
  margin: .9rem 0 .35rem; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted);
}
.dpm-decides { list-style: none; margin: 0; padding: 0; }
.dpm-decides li { padding: .3rem 0; border-top: 1px solid var(--border); font-size: .8rem; }
.dpm-decides li:first-child { border-top: none; }
.dpm-src { color: var(--text-muted); font-size: .72rem; margin-left: .35rem; }
.dpm-note { color: var(--text-muted); font-size: .78rem; margin-top: .2rem; }

/* Volet technique : le rendu d'Asterisk, pas le contenu d'un fichier. */
.dpm-raw {
  margin: 0; padding: .6rem; border-radius: 6px; overflow-x: auto;
  background: var(--field-bg); border: 1px solid var(--border);
  font-size: .75rem; line-height: 1.5;
}
.dpm-line { display: flex; gap: .4rem; align-items: baseline; white-space: pre-wrap; word-break: break-word; }
.dpm-pri { flex-shrink: 0; min-width: 1.6rem; text-align: right; color: var(--text-muted); }
.dpm-label { color: var(--accent-text); }
.dpm-app { flex: 1; }
.dpm-values { padding-left: 2rem; color: var(--text-muted); font-size: .72rem; }

.dpm-index-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.dpm-check { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-muted); }

/* ── Tableau d'attente (assets/modules/waiting.js) ─────────────────────────────
   Une colonne par ligne, une carte par appelant, un compteur qui monte. Lu en
   diagonale depuis un poste voisin : la couleur porte l'information, le texte la
   précise. Les colonnes restent en place quand elles se vident — un tableau de bord
   qui change de forme oblige à le relire. */
.wait-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

/* Rien en attente : les colonnes s'effacent au lieu de prendre la place des appels
   en cours, mais ne disparaissent pas — « personne » est une information. */
.wait-board-idle { opacity: .62; }

.wait-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.wait-col-ok   { border-top-color: var(--accent); }
.wait-col-warn { border-top-color: var(--warning); }
.wait-col-crit { border-top-color: var(--danger); }

.wait-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .7rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.wait-col-name { font-size: .82rem; font-weight: 600; }
.wait-col-count {
  min-width: 1.5rem; padding: 0 .35rem;
  border-radius: 999px;
  background: var(--border); color: var(--text);
  font-size: .78rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.wait-col-warn .wait-col-count { background: var(--warning-fill); color: #fff; }
.wait-col-crit .wait-col-count { background: var(--danger-fill); color: #fff; }

.wait-col-body { display: flex; flex-direction: column; gap: .4rem; padding: .5rem; }
.wait-empty { margin: 0; padding: .9rem .2rem; text-align: center; color: var(--text-muted); font-size: .8rem; }

.wait-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .55rem;
  padding: .45rem .55rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--surface2);
}
.wait-warn { border-left-color: var(--warning); }
.wait-crit { border-left-color: var(--danger); }

/* Position dans la file : le seul chiffre qu'on lit avant le numéro. */
.wait-pos {
  display: flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--accent-fill); color: #fff;
  font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wait-warn .wait-pos { background: var(--warning-fill); }
.wait-crit .wait-pos { background: var(--danger-fill); }

/* Hors file, il n'y a pas de rang : la pastille reste en place pour que les cartes
   s'alignent, mais elle s'efface — un rang inventé se lirait comme un vrai. */
.wait-card .wait-pos-none,
.wait-warn .wait-pos-none,
.wait-crit .wait-pos-none {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-weight: 400;
}

.wait-who { display: flex; flex-direction: column; min-width: 0; }
.wait-num { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.wait-name {
  font-size: .72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wait-timer {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.wait-warn .wait-timer { color: var(--warning); }
/* Au-delà d'une minute, le compteur bat : c'est ce qui accroche l'œil de loin, et
   rien d'autre ne clignote sur cet écran. */
.wait-crit .wait-timer { color: var(--danger); animation: wait-pulse 1.6s ease-in-out infinite; }

@keyframes wait-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .wait-crit .wait-timer { animation: none; }
}

/* ── Appels pris en charge sur une ligne (modules/waiting.js) ─────────────────
   Même carte que l'attente, en vert et sans rang : ce n'est plus une file d'attente,
   c'est ce qui se passe. Elles vivent SOUS les appelants qui patientent — l'attente
   est ce qui se dégrade, elle garde le haut de la colonne. */
.wait-live-head {
  margin: .35rem 0 0;
  font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}
.wait-card.wait-live, .wait-row.wait-live { border-left-color: var(--green); }
.wait-card.wait-live .wait-pos-live {
  background: color-mix(in srgb, var(--green) 22%, transparent);
  color: var(--success);
}
/* Deux durées côte à côte : la conversation (ce qui court) et l'attente qu'a subie
   l'appelant (figée au décroché, en plus petit — c'est un constat, pas une alerte). */
.wait-live-times { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.wait-talk {
  font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--success);
}
.wait-waited {
  display: inline-flex; align-items: center; gap: .15rem;
  font-size: .68rem; font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.wait-waited.wait-warn { color: var(--warning); }
.wait-waited.wait-crit { color: var(--danger); }
.wait-col-live {
  display: inline-flex; align-items: center; gap: .2rem; margin-left: auto;
  padding: 0 .35rem; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--success);
  font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ── Sens de l'appel dans les tableaux « appels en cours » (modules/calls.js) ──
   Une étiquette avant le numéro plutôt qu'une colonne : le même rendu sert la pleine
   page et les cartes étroites de la page Poste, où une colonne de plus imposerait un
   défilement horizontal. */
.call-dir {
  display: inline-flex; align-items: center; gap: .2rem;
  margin-right: .4rem; padding: .05rem .3rem;
  border-radius: 4px;
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  vertical-align: 1px;
}
tr.call-in  .call-dir { background: color-mix(in srgb, var(--accent) 20%, transparent);  color: var(--accent-text); }
tr.call-out .call-dir { background: color-mix(in srgb, var(--green) 20%, transparent);   color: var(--success); }
tr.call-int .call-dir { background: var(--surface2); color: var(--text-muted); }

/* Nom derrière le numéro, dans les deux colonnes du tableau : « 201 » ne dit rien à
   qui lit de loin, le nom du poste qui a décroché dit tout. Sur sa propre ligne pour
   ne pas élargir la colonne. */
.call-party-name {
  display: block;
  font-size: .72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Ligne de l'appel (Administration › Appels en cours) : PCM, VIGIE, COT, groupe. Une
   étiquette par ligne traversée, l'une sous l'autre, sobres pour ne pas se confondre
   avec la pastille de statut. */
.call-line-tag {
  display: block; width: max-content; max-width: 100%;
  padding: 0 .4rem; border-radius: 4px; margin: 1px 0;
  background: var(--surface2); color: var(--text);
  font-size: .75rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Appel prioritaire : le requérant de la ligne moyens a tapé ★ (demande de secours).
   Même rouge que les appels vers les numéros d'urgence de l'historique, et une
   étiquette sous le numéro (modules/calls.js). */
tbody tr.call-urgent {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--red);
}
tbody tr.call-urgent:hover { background: color-mix(in srgb, var(--red) 20%, var(--surface2)); }
.call-urgent-tag, .wait-urgent-tag {
  display: inline-block; margin-right: .35rem; padding: 0 .35rem; border-radius: 4px;
  background: var(--danger-fill); color: #fff;
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap; vertical-align: 1px;
}
.call-urgent-tag { display: block; width: max-content; margin-top: .15rem; }

/* Cartes étroites de la page Poste : la flèche seule, le mot en infobulle. Elle suffit
   à distinguer les deux sens, et le numéro reste la première chose qu'on lit. */
.poste-card .call-dir-label { display: none; }
.poste-card .call-dir { margin-right: .3rem; padding: .05rem .18rem; }

/* ── Attente en version liste (carte « Ligne PCM » de la page Poste) ───────────
   Un tiers d'écran ne tient pas deux colonnes : une ligne par appelant, le sablier en
   tête parce que c'est la valeur qu'on vient chercher, la ligne d'arrivée en bout. */
.poste-sub-title {
  margin: .9rem 0 .35rem;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}
.poste-card-head + .poste-sub-title { margin-top: 0; }

.wait-board-compact { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 0; }

.wait-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface2);
}
.wait-row.wait-warn { border-left-color: var(--warning); }
.wait-row.wait-crit { border-left-color: var(--danger); }

/* Appel prioritaire (touche ★ de la ligne moyens, modules/waiting.js) : rouge plein dès
   l'entrée en file, quelle que soit l'attente — et encore une fois décroché. */
.wait-card.wait-urgent, .wait-row.wait-urgent {
  border-color: var(--danger); border-left-color: var(--danger);
  background: color-mix(in srgb, var(--red) 16%, var(--surface2));
}
.wait-urgent .wait-num { color: var(--red); }
.wait-urgent .wait-pos { background: var(--danger-fill); }
.wait-urgent .wait-timer { color: var(--danger); }
.wait-urgent .wait-name { color: var(--text); }
.wait-sec .wait-row { grid-template-columns: 4.3rem minmax(0, 1fr) auto auto; }
.wait-talk-cell { display: inline-flex; align-items: center; gap: .25rem; color: var(--success); }

/* Une ligne (principale, moyens…) dans la carte étroite : titre, appelants en attente,
   puis appels pris. Celle de l'opérateur est encadrée et teintée ; l'autre s'efface un
   peu sans disparaître — il doit encore voir si ses collègues sont débordés. */
.wait-sec {
  display: flex; flex-direction: column; gap: .3rem;
  padding: .4rem .45rem .45rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 8px;
}
.wait-sec-ok   { border-top-color: var(--accent); }
.wait-sec-warn { border-top-color: var(--warning); }
.wait-sec-crit { border-top-color: var(--danger); }
.wait-sec-warn .wait-col-count { background: var(--warning-fill); color: #fff; }
.wait-sec-crit .wait-col-count { background: var(--danger-fill); color: #fff; }
.wait-sec-mine {
  /* Le haut garde le ton de l'attente : seuls les trois autres côtés disent « à vous ». */
  border-left-color: var(--accent); border-right-color: var(--accent); border-bottom-color: var(--accent);
  border-width: 3px 2px 2px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.wait-board-compact:has(.wait-sec-mine) .wait-sec:not(.wait-sec-mine) { opacity: .78; }
.wait-sec-head { display: flex; align-items: center; gap: .45rem; }
.wait-sec-head .wait-col-count { margin-left: auto; }
.wait-sec-head .wait-col-live { margin-left: 0; }
.wait-sec-name { font-size: .8rem; font-weight: 600; }
.wait-sec-mine .wait-sec-name { font-size: .88rem; font-weight: 700; color: var(--accent-text); }
.wait-sec-tag {
  padding: .05rem .4rem; border-radius: 999px;
  background: var(--accent-fill); color: #fff;
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.wait-sec .wait-empty { padding: .35rem .2rem; text-align: left; }

/* Pastille de ligne : dire « Moyens » ou « Principale » suffit, le numéro de file reste
   en infobulle pour qui dépanne. */
.wait-line {
  padding: .05rem .35rem; border-radius: 4px;
  background: var(--border); color: var(--text-muted);
  font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap;
}

/* ── Administration › Numéros : schéma « numéro → destination » (modules/numeros.js) ──
   Une ligne par SDA, regroupées par destination ; la couleur de la barre de gauche dit
   la destination (PCM bleu, COT vert, VIGIE orange, en attente gris pointillé), pas l'état. */
.num-flow { display: flex; flex-direction: column; gap: 1rem; }
.num-group { --num-c: var(--text-muted); border-left: 3px solid var(--num-c); padding-left: .85rem; }
.num-group.num-pcm   { --num-c: var(--blue); }
.num-group.num-cot   { --num-c: var(--green); }
.num-group.num-vigie { --num-c: var(--orange); }
.num-group.num-groupe { --num-c: var(--purple, #8b5cf6); }
/* En attente d'affectation : pas encore une destination, d'où le trait en pointillé. */
.num-group.num-attente { border-left-style: dashed; }
.num-recent { margin-top: .15rem; font-size: .75rem; color: var(--text-muted); }
.num-group-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--num-c); margin-bottom: .3rem; }
.num-row {
  display: grid; grid-template-columns: minmax(11rem, 15rem) 1.5rem minmax(0, 1fr) auto;
  align-items: center; gap: .4rem .8rem; padding: .55rem 0; border-top: 1px solid var(--border);
}
.num-group-head + .num-row { border-top: none; }
.num-number { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: .3rem; }
.num-locked .num-number svg { color: var(--text-muted); }
.num-label, .num-alias { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.num-label-input { margin-top: .2rem; width: 100%; font-size: .78rem; padding: .2rem .4rem; }
.num-arrow { color: var(--num-c); font-size: 1.2rem; text-align: center; }
.num-dest-title { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.num-dest-title .card-badge { margin-top: 0; }
.num-dest-detail { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.num-action { display: flex; gap: .4rem; align-items: center; }
.num-action .btn { width: auto; }
.num-action .num-lock-on { color: var(--blue); }
.num-warn { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; margin: 0 0 .8rem; padding: .55rem .75rem; border-radius: 8px; background: color-mix(in srgb, var(--orange) 12%, transparent); }
.num-warn svg { color: var(--orange); flex: none; margin-top: .1rem; }
.num-add { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.num-add .setting-text { flex: 1 1 16rem; }
.num-add-fields { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.num-add-fields input[type=tel] { width: 9.5rem; }
.num-add-fields input[type=text] { width: 12rem; }
.num-add-fields .btn { width: auto; }
@media (max-width: 720px) {
  .num-row { grid-template-columns: 1fr; }
  .num-arrow { display: none; }
}

/* ── Administration › Urgences (modules/urgences.js) ──
   Le bloc « Aujourd'hui » est bordé de vert quand tout est constaté, de rouge sinon : un
   rappel des secours qui n'arriverait pas au PCM doit se voir de loin. */
.urg-now { border-left: 4px solid var(--green); }
.urg-now-ko { border-left-color: var(--red); }
.urg-big { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; margin: .2rem 0 .5rem; }
.urg-line { display: flex; gap: .5rem; align-items: flex-start; margin: .35rem 0; font-size: .9rem; }
.urg-line svg { flex: none; margin-top: .15rem; }
.urg-good svg { color: var(--green); }
.urg-bad { color: var(--red); }
.urg-postes-head { font-size: .78rem; color: var(--text-muted); margin-top: .8rem; }
.urg-postes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.urg-poste { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--border); }
.urg-poste span { color: var(--text-muted); }
.urg-ok svg { color: var(--green); }
.urg-ko { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.urg-cands { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.urg-cand { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.urg-cand input { margin-top: .3rem; width: auto; }
.urg-cand-sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.urg-cand-off { cursor: not-allowed; opacity: .65; }
.urg-cand-num { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.urg-cand-num .card-badge { margin-top: 0; }
.urg-cand-label { font-size: .82rem; color: var(--text-muted); }
.urg-cand-arr { font-size: .82rem; margin-top: .25rem; }
.urg-cand-why { font-size: .78rem; color: var(--orange); margin-top: .25rem; display: flex; gap: .3rem; align-items: center; }
.urg-actions { margin-top: .9rem; }
.urg-actions .btn { width: auto; }

/* ── Accès par fonctionnalité (modules/acces-editeur.js) ─────────────────────────
   Une couleur par domaine, reprise partout : pastilles de la liste des comptes,
   icônes de l'éditeur. */
.acces-pills { display: flex; flex-wrap: wrap; gap: .25rem; }
.acces-pill { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; font-weight: 500;
  padding: .1rem .5rem; border-radius: 999px; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.acces-pill b { font-weight: 700; }
.p-cot    { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, transparent); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.p-pcm    { color: var(--blue);   border-color: color-mix(in srgb, var(--blue) 45%, transparent);   background: color-mix(in srgb, var(--blue) 10%, transparent); }
/* Contacts confidentiels : couleur de la Vigie, qui les voit d'office. */
.p-vigie, .p-confidentiel { color: #a78bfa;       border-color: color-mix(in srgb, #a78bfa 45%, transparent);       background: color-mix(in srgb, #a78bfa 10%, transparent); }
.p-users, .p-groupes { color: #2dd4bf; border-color: color-mix(in srgb, #2dd4bf 45%, transparent); background: color-mix(in srgb, #2dd4bf 10%, transparent); }
.p-groupe { color: var(--green);  border-color: color-mix(in srgb, var(--green) 45%, transparent);  background: color-mix(in srgb, var(--green) 10%, transparent); }
.p-admin  { color: var(--red);    border-color: color-mix(in srgb, var(--red) 55%, transparent);    background: color-mix(in srgb, var(--red) 12%, transparent); }
.p-ecran  { color: var(--text-muted); border-color: var(--border); }
[data-theme="light"] .p-vigie, [data-theme="light"] .p-confidentiel { color: #6d28d9; }
[data-theme="light"] .p-users, [data-theme="light"] .p-groupes { color: #0f766e; }

.acces-editeur { margin: .25rem 0 1rem; }
.acces-lbl { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: .9rem 0 .4rem; }
.acces-lbl:first-child { margin-top: 0; }
.acces-modeles { display: flex; flex-wrap: wrap; gap: .35rem; }
.acces-chip { border: 1px solid var(--field-border); background: var(--field-bg); color: var(--text-muted);
  border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; cursor: pointer; }
.acces-chip:hover { color: var(--text); border-color: var(--accent); }
.acces-chip.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.acces-hint { font-size: .76rem; color: var(--text-muted); margin: .35rem 0 0; }
.acces-note { font-size: .82rem; color: var(--text-muted); background: var(--field-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .75rem; margin: .6rem 0; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.acces-seg { display: inline-flex; border: 1px solid var(--field-border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.acces-seg button { border: 0; border-right: 1px solid var(--field-border); background: var(--field-bg); color: var(--text-muted);
  padding: .32rem .7rem; font-size: .8rem; cursor: pointer; }
.acces-seg button:last-child { border-right: 0; }
.acces-seg button:hover { color: var(--text); }
.acces-seg button.on { background: var(--accent-fill); color: #fff; font-weight: 600; }
.acces-type { margin-bottom: .2rem; }
.acces-ligne { border: 1px solid var(--border); border-radius: 10px; margin-top: .55rem; overflow: hidden; }
.acces-tete { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; }
.acces-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; border: 1px solid; }
.acces-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acces-tt b { font-size: .9rem; }
.acces-tt span { font-size: .76rem; color: var(--text-muted); }
.acces-detail { font-size: .8rem; color: var(--text-muted); padding: .5rem .75rem .6rem calc(.75rem + 30px + .7rem);
  border-top: 1px dashed var(--border); background: color-mix(in srgb, var(--field-bg) 60%, transparent); }
/* Éteint : rail gris franc et pastille blanche ombrée. Un rail en --field-border avec
   une pastille gris clair disparaissait en thème clair (deux gris quasi identiques). */
.acces-switch { width: 40px; height: 23px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
  position: relative; flex-shrink: 0; cursor: pointer; padding: 0; }
.acces-switch span { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.acces-switch.on { background: var(--accent-fill); }
.acces-switch.on span { left: 20px; background: #fff; }
/* Téléphone : les sélecteurs passent sous le titre, pleine largeur, faciles à toucher. */
@media (max-width: 640px) {
  .acces-tete { flex-wrap: wrap; }
  .acces-tete .acces-seg { width: 100%; }
  .acces-tete .acces-seg button { flex: 1; padding: .55rem .3rem; }
  .acces-detail { padding-left: .75rem; }
}

/* ── Groupes d'appels (modules/groupes.js) ─────────────────────────────────────
   Une page par groupe : un en-tête (nom, jour/nuit, quatre chiffres), « Ma participation »
   en grand, puis des cartes (membres, sonnerie, horaires, annonces) sur deux colonnes
   quand la place le permet. « Gestion des groupes » : une tuile par groupe. Aplats seulement
   (pas de dégradé ni d'ombre portée, demandé le 20/11/2026), tirés des variables du thème :
   clair et sombre suivent. */
.gp-page { display: flex; flex-direction: column; gap: 1rem; max-width: 1180px; }
.gp-muted { color: var(--text-muted); }
.gp-warn { color: var(--orange); }
.gp-eyebrow { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); }

/* En-tête du groupe */
.gp-hero { border-radius: 14px; padding: 1.25rem 1.35rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); }
.gp-hero-top { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.gp-hero-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; color: #fff; background: var(--accent-fill); }
.gp-hero-icon.is-sm { width: 36px; height: 36px; border-radius: 10px; }
.gp-hero-id { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: .2rem; }
.gp-hero-id h2 { margin: 0; font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.gp-hero-id .gp-muted { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; }
.gp-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; margin-left: auto; }
.gp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .65rem; margin-top: 1.1rem; }
.gp-kpi { background: var(--surface2); border: 1px solid transparent;
  border-radius: 10px; padding: .7rem .85rem; min-width: 0; }
.gp-kpi-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.gp-kpi-value { margin-top: .3rem; font-size: 1.15rem; font-weight: 700; display: flex; flex-wrap: wrap;
  gap: .3rem; align-items: baseline; font-variant-numeric: tabular-nums; }
.gp-kpi-value small { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.gp-kpi-sub { font-size: .74rem; color: var(--text-muted); margin-top: .15rem; }
.gp-num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.gp-link { display: inline-flex; align-items: center; gap: .3rem; padding: 0; border: none; background: none;
  font: inherit; font-size: .78rem; font-weight: 600; color: var(--accent-text); cursor: pointer; }
.gp-link:hover { text-decoration: underline; }

/* Jour / nuit */
.gp-mode { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px;
  font-size: .78rem; white-space: nowrap; }
.gp-mode > span { display: flex; flex-direction: column; line-height: 1.2; }
.gp-mode small { font-size: .7rem; opacity: .85; font-weight: 400; }
.gp-mode.is-big { padding: .45rem .9rem .45rem .7rem; border-radius: 12px; font-size: .9rem; }
.gp-mode.is-day { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.gp-mode.is-night { color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, transparent); }

/* Ma participation */
.gp-me { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); }
.gp-me-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--surface2); color: var(--text-muted); }
.gp-me-text { flex: 1; min-width: 220px; }
.gp-me-text strong { display: block; font-size: 1.05rem; margin-top: .15rem; }
.gp-me-text p { margin: .2rem 0 0; font-size: .84rem; color: var(--text-muted); }
.gp-me-btn { width: auto; display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.1rem; font-weight: 600; }
.gp-me.is-on { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.gp-me.is-on .gp-me-icon { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.gp-me.is-warn { border-color: color-mix(in srgb, var(--orange) 45%, var(--border)); }
.gp-me.is-warn .gp-me-icon { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }

/* Cartes */
.gp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.gp-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 1100px) { .gp-cols { grid-template-columns: minmax(0, 1fr); } }
.gp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.gp-card-head h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.gp-card-head p { margin: .25rem 0 0; font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.gp-empty { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-radius: 10px;
  background: var(--surface2); color: var(--text-muted); font-size: .85rem; }
.gp-empty.is-big { justify-content: center; flex-direction: column; padding: 2.5rem 1rem; text-align: center; }
.gp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-muted); cursor: pointer; }
.gp-icon-btn:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.gp-icon-btn.is-danger:hover:not(:disabled) { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.gp-icon-btn:disabled { opacity: .3; cursor: default; }
.gp-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 600; white-space: nowrap;
  padding: .15rem .6rem; border-radius: 999px; background: var(--surface2); color: var(--text-muted); }
.gp-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.gp-status.is-on { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.gp-status.is-miss { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.gp-status.is-def { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.gp-sound > small { font-size: .76rem; line-height: 1.4; }
.gp-sound .gp-link { font-size: .76rem; }
.gp-defaults { margin-top: 1rem; }
.gp-pending { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .8rem; border-radius: 10px; font-size: .8rem;
  color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.gp-pending span { color: var(--text); }

/* Membres */
.gp-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.gp-member { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 10px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface2) 35%, var(--surface)); }
.gp-member.is-on { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.gp-order { flex: none; width: 1.3rem; text-align: center; font-size: .75rem; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums; }
.gp-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--accent-text); font-weight: 700; font-size: .78rem;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border); }
.gp-member.is-on .gp-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--green); }
.gp-avatar.is-sm { width: 22px; height: 22px; font-size: .6rem; box-shadow: none; }
.gp-member-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gp-member-id strong { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.gp-member-id small { font-size: .75rem; color: var(--text-muted); }
.gp-you { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .05rem .4rem;
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); vertical-align: 1px; }
.gp-member-tools { display: flex; align-items: center; gap: .15rem; }
.gp-member-tools .cot-switch { margin-left: .45rem; }
.gp-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding-top: .2rem; }
.gp-add select { flex: 1; min-width: 12rem; width: auto; }
.gp-add .btn, .gp-add-line { width: auto; display: inline-flex; align-items: center; gap: .3rem; }

/* Sonnerie */
.gp-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.gp-choice { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left; cursor: pointer;
  padding: .75rem .8rem; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.gp-choice:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.gp-choice strong { font-size: .88rem; }
.gp-choice small { font-size: .74rem; color: var(--text-muted); line-height: 1.35; }
.gp-choice-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-muted); }
.gp-choice.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent); }
.gp-choice.is-on .gp-choice-icon { background: var(--accent-fill); color: #fff; }
.gp-choice:disabled { opacity: .5; cursor: not-allowed; }
.gp-durations { display: flex; flex-direction: column; gap: .4rem; }
.gp-inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .84rem; color: var(--text-muted); }
.gp-inline input[type="number"] { width: 4.6rem; text-align: center; }
.gp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.gp-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.gp-field > label, .gp-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.gp-field > small { font-size: .74rem; color: var(--text-muted); }
.gp-field-row { display: flex; flex-direction: column; gap: .35rem; }

/* Horaires */
.gp-hour { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .5rem .6rem; border-radius: 10px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface2) 35%, var(--surface)); }
.gp-hour select { flex: 1; min-width: 11rem; width: auto; }
.gp-hour-times { display: inline-flex; align-items: center; gap: .4rem; }
.gp-hour input[type="time"] { width: 8.5rem; }
.gp-add-line { align-self: flex-start; }
.gp-force { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
  padding: .75rem .85rem; border-radius: 10px; background: var(--surface2); }
.gp-force strong { display: block; font-size: .85rem; }
.gp-force small { font-size: .75rem; color: var(--text-muted); }
.gp-force-ctl { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.gp-force-ctl select { width: auto; }
.gp-force-ctl .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }

/* Annonces */
.gp-sounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .65rem; }
.gp-sound { display: flex; flex-direction: column; gap: .5rem; padding: .85rem; border-radius: 12px;
  border: 1px dashed var(--border); background: color-mix(in srgb, var(--surface2) 30%, var(--surface)); }
.gp-sound.is-ok { border-style: solid; }
.gp-sound strong { font-size: .86rem; line-height: 1.35; }
.gp-sound-head { display: flex; align-items: center; justify-content: space-between; }
.gp-sound-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-muted); }
.gp-sound.is-ok .gp-sound-icon { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.gp-sound-actions { display: flex; align-items: center; gap: .3rem; margin-top: auto; }
.gp-sound-actions .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }

/* Gestion des groupes */
.gp-modal-form { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0 .4rem; }
.gp-modal-form input { width: 100%; }
.gp-modal-form small { font-size: .75rem; color: var(--text-muted); }
.gp-modal-form select { width: 100%; }
.gp-modal-note { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .75rem; border-radius: 10px;
  font-size: .8rem; line-height: 1.45; color: var(--text-muted); background: var(--surface2); }
.gp-modal-note svg { flex: none; margin-top: .1rem; }
.gp-modal-note.is-warn { color: var(--text); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.gp-modal-note.is-warn svg { color: var(--orange); }
.gp-modal-error { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .82rem; color: var(--red); }
.gp-empty.is-big .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
#tab-groupes-gestion .page-actions .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
.gp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 1rem; }
.gp-tile { display: flex; flex-direction: column; gap: .8rem; padding: 1rem 1.1rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.gp-tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.gp-tile-head { display: flex; align-items: center; gap: .7rem; }
.gp-tile-id { flex: 1; min-width: 0; }
.gp-tile-id h3 { margin: 0; font-size: 1.02rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-tile-id small { font-size: .72rem; color: var(--text-muted); font-family: ui-monospace, monospace; }
.gp-tile-stats { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--text-muted); }
.gp-tile-stats span { display: inline-flex; align-items: center; gap: .4rem; }
.gp-tile-block { display: flex; flex-direction: column; gap: .4rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.gp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.gp-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .3rem .15rem .2rem; border-radius: 999px;
  background: var(--surface2); font-size: .78rem; }
.gp-chip button { border: none; background: none; padding: 0 .1rem; cursor: pointer; color: var(--text-muted); display: inline-flex; }
.gp-chip button:hover { color: var(--red); }
.gp-chip-add { width: auto; font-size: .78rem; padding: .2rem 1.6rem .2rem .55rem; border-radius: 999px; }
.gp-ringall { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; }
.gp-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.gp-check input { width: auto; flex: 0 0 auto; margin: .2rem 0 0; }
.gp-check > span { flex: 1; }
.gp-check small { display: block; color: var(--text-muted); font-size: .78rem; }
.gp-tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.gp-tile-foot .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }

@media (max-width: 640px) {
  .gp-hero { padding: 1rem; }
  .gp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .gp-kpi { padding: .55rem .65rem; }
  .gp-kpi-value { font-size: 1rem; }
  .gp-hero-id h2 { font-size: 1.3rem; }
  .gp-hero-side { align-items: flex-start; margin-left: 0; }
  .gp-choices { grid-template-columns: 1fr; }
  .gp-me-btn { width: 100%; justify-content: center; }
}

/* Page d'un groupe : onglets (même vocabulaire que la liaison Internet), sous-pages. */
.gp-subtabs { margin-top: -.15rem; }
.gp-subtabs .btn-toggle { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem; font-size: .82rem; }
.gp-pane { display: flex; flex-direction: column; gap: 1rem; }
.gp-pane[hidden] { display: none; }
.gp-hero-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.gp-hero-actions .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
.gp-cdr-label { display: block; font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.gp-cdr-notice { padding: .5rem .75rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; font-size: .8rem; color: var(--text-muted); }
.gp-pane .filters .btn { width: auto; }

/* ── Administration › Enregistrements (modules/sons.js) ── */
.son-tools { margin: 0 0 .9rem; }
.son-tools input[type=search] { width: 100%; max-width: 30rem; }
.son-group > summary { cursor: pointer; }
.son-count { font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-left: .25rem; }
.son-list { display: flex; flex-direction: column; margin-top: .4rem; }
.son-row { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .6rem 0; border-top: 1px solid var(--border); }
.son-row:first-child { border-top: 0; }
.son-main { min-width: 0; flex: 1 1 auto; }
.son-title { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.son-plays { font-size: .84rem; margin-top: .15rem; }
.son-else, .son-meta { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.son-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: flex-end; flex: none; }
.son-actions .btn { width: auto; }
.son-prev { display: inline-flex; gap: .2rem; align-items: center; padding-left: .35rem; border-left: 1px solid var(--border); }
.son-why { display: inline-flex; gap: .25rem; align-items: center; font-size: .78rem; color: var(--text-muted); }
@media (max-width: 720px) {
  .son-row { flex-direction: column; align-items: stretch; }
  .son-actions { justify-content: flex-start; }
}
.son-sub { border: 1px solid var(--border); border-radius: 8px; margin-top: .6rem; padding: 0 .8rem; }
.son-sub > summary { cursor: pointer; padding: .55rem 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.son-sub[open] > summary { border-bottom: 1px solid var(--border); }
.son-sum-use { font-weight: 400; font-size: .78rem; color: var(--text-muted); flex-basis: 100%; }
.son-compo { background: color-mix(in srgb, var(--blue) 6%, transparent); border-radius: 8px; padding-left: .6rem; padding-right: .6rem; border-top: 0; margin-bottom: .3rem; }
.son-compo .son-title svg { color: var(--blue); }
.son-moh-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .55rem 0; }
.son-moh-head .btn { width: auto; }
.son-track { padding: .35rem 0; }
.son-track-name { font-size: .86rem; }
.son-actions .btn, .son-moh-head .btn { display: inline-flex; align-items: center; gap: .35rem; }
.son-cls { font-size: .72rem; font-weight: 400; color: var(--text-muted); }
/* Statistiques d'un groupe : mêmes histogrammes que le COT, trois issues. */
.gp-seg-taken { background: color-mix(in srgb, var(--green) 70%, transparent); }
.gp-seg-fwd { background: color-mix(in srgb, var(--blue) 65%, transparent); }
.gp-seg-missed { background: color-mix(in srgb, var(--red) 70%, transparent); }
.gp-val-ok { color: var(--green); }
.gp-val-bad { color: var(--red); }
.gp-pane .seg { align-self: flex-start; }
.gp-pane .seg .btn-toggle { padding: .35rem .75rem; font-size: .8rem; }
/* Vue mobile des groupes d'appels (modules/m/groupes.js). */
.mg-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; font-size: .82rem; }
.mg-head .gp-muted { display: inline-flex; align-items: center; gap: .3rem; }
.m-card .gp-me { margin: .7rem 0; padding: .85rem; gap: .7rem; }
.m-card .gp-me-icon { width: 40px; height: 40px; }
.m-card .gp-me-btn { width: 100%; justify-content: center; }
.mg-team { display: flex; align-items: flex-start; gap: .35rem; margin: .2rem 0 .6rem; font-size: .82rem; color: var(--text-muted); }
.mg-sub { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: .4rem 0 .3rem; }
.mg-calls { list-style: none; margin: 0 0 .6rem; padding: 0; }
.mg-call { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: .55rem;
  padding: .45rem 0; border-top: 1px solid var(--border); }
.mg-call:first-child { border-top: none; }
.mg-call-ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-muted); }
.mg-call.is-miss .mg-call-ic { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.mg-call-who { display: flex; flex-direction: column; min-width: 0; }
.mg-call-who strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-call-who small { font-size: .74rem; color: var(--text-muted); }
.mg-call-btn { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: .4rem; }
.mg-input { width: 100%; margin: .8rem 0; }

/* SMS des groupes d'appels (groupes_sms.js, sms_admin.js, 22/11/2026) : les conversations
   à gauche, la conversation ouverte au centre ; sous 900 px et sur le mobile, l'une OU
   l'autre (.is-side / .is-main). */

/* Bandeau du volet : numéro du groupe, consommation du mois */
.gp-page.is-sms .gp-kpis { display: none; }
.gp-sms-bar { margin-bottom: -.2rem; display: flex; align-items: center; gap: .6rem 1.2rem; flex-wrap: wrap; font-size: .84rem; }
.gp-sms-bar .gp-num { font-weight: 650; }
.gp-sms-quota { margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: .6rem; color: var(--text-muted); }
.gp-sms-gauge { width: 120px; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.gp-sms-gauge > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.gp-sms-gauge.is-warn > i { background: var(--orange); }

/* Disposition : fils à gauche, conversation au centre */
.gp-sms { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); height: max(520px, calc(100vh - 330px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.gp-sms.is-side, .gp-sms.is-main { grid-template-columns: minmax(0, 1fr); }
.gp-sms.is-side .gp-sms-main, .gp-sms.is-main .gp-sms-side { display: none; }
.gp-sms.is-side .gp-sms-side { border-right: none; }

.gp-sms-side { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-width: 0; min-height: 0; }
.gp-sms-side-head { display: flex; flex-direction: column; gap: .55rem; padding: .85rem; border-bottom: 1px solid var(--border); }
.gp-sms-side-head .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.gp-sms-filters { display: flex; gap: .3rem; }
.gp-sms-filters .btn-toggle { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.gp-sms-threads { list-style: none; margin: 0; padding: .35rem; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.gp-sms-thread { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .15rem .65rem; align-items: center;
  padding: .6rem .65rem; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.gp-sms-thread:hover { background: var(--surface2); }
.gp-sms-thread.is-current { background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.gp-sms-thread .gp-avatar { grid-row: span 3; }
.gp-sms-thread strong { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-sms-thread time { font-size: .72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gp-sms-thread .gp-sms-preview { grid-column: 2 / 4; font-size: .8rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-sms-thread .gp-sms-state { grid-column: 2 / 4; font-size: .72rem; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: .3rem; }
.gp-sms-thread.is-todo strong, .gp-sms-thread.is-todo .gp-sms-preview { color: var(--text); font-weight: 650; }
.gp-sms-thread.is-todo .gp-sms-state { color: var(--orange); font-weight: 600; }
.gp-sms-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }

/* Conversation */
.gp-sms-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.gp-sms-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.gp-sms-head-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gp-sms-head-id strong { font-size: 1rem; }
.gp-sms-head-id small { font-size: .76rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .3rem; }
.gp-sms-head .btn { display: inline-flex; align-items: center; gap: .35rem; }

.gp-sms-flow { flex: 1; overflow: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem;
  background: color-mix(in srgb, var(--surface2) 30%, var(--surface)); }
.gp-sms-day { align-self: center; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: .15rem .6rem; border-radius: 999px; background: var(--surface2); }
.gp-sms-msg { max-width: min(520px, 78%); display: flex; flex-direction: column; gap: .25rem; }
.gp-sms-msg.is-in { align-self: flex-start; }
.gp-sms-msg.is-out { align-self: flex-end; align-items: flex-end; }
.gp-sms-bubble { padding: .6rem .8rem; border-radius: 14px; font-size: .9rem; line-height: 1.45; white-space: pre-wrap;
  overflow-wrap: anywhere; }
.gp-sms-msg.is-in .gp-sms-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.gp-sms-msg.is-out .gp-sms-bubble { background: var(--accent-fill); color: #fff; border-bottom-right-radius: 4px; }
.gp-sms-meta { font-size: .72rem; color: var(--text-muted); line-height: 1.5; }
.gp-sms-msg.is-out .gp-sms-meta { text-align: right; }
.gp-sms-meta .lucide { vertical-align: -2px; }
.gp-sms-meta .is-ok { color: var(--green); }
.gp-sms-meta .is-ko { color: var(--red); }
.gp-sms-msg.is-failed .gp-sms-bubble { background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border)); }
.gp-sms-event { align-self: center; font-size: .74rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .3rem; }

/* Saisie */
.gp-sms-compose { border-top: 1px solid var(--border); padding: .8rem 1rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.gp-sms-compose-row { display: flex; gap: .6rem; align-items: flex-end; }
.gp-sms-compose textarea { flex: 1; min-height: 64px; resize: vertical; font: inherit; font-size: .9rem; }
.gp-sms-compose .btn { width: auto; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.1rem; font-weight: 600; }
.gp-sms-count { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .8rem; font-size: .76rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums; }
.gp-sms-count .is-uni { color: var(--orange); display: inline-flex; align-items: center; gap: .3rem; }
.gp-sms-count mark { background: color-mix(in srgb, var(--orange) 22%, transparent); color: inherit; padding: 0 .2rem; border-radius: 3px; font-weight: 700; }
.gp-sms-count .gp-link { font-size: .76rem; }
.gp-sms-blocked { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 10px; font-size: .8rem;
  color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.gp-sms-blocked span { color: var(--text); }

/* Administration › SMS */
.sms-admin { display: flex; flex-direction: column; gap: 1rem; max-width: 1180px; }
.sms-admin .gp-cols { gap: 1rem; }
.sms-hook { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .4rem .6rem; align-items: center; font-size: .82rem; }
.sms-hook code { font-size: .78rem; padding: .3rem .5rem; border-radius: 6px; background: var(--surface2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-prices { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: .5rem .8rem; align-items: center; font-size: .84rem; }
.sms-prices > .gp-eyebrow { padding-bottom: .1rem; }
.sms-prices input { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.sms-unit { position: relative; }
.sms-unit::after { content: '€'; position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .8rem; pointer-events: none; }
.sms-unit input { padding-right: 1.6rem; }
.sms-quotas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.sms-quotas label { display: block; margin-bottom: .35rem; font-size: .74rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; }
.sms-table { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.sms-table th { text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: .45rem .6rem; border-bottom: 1px solid var(--border); }
.sms-table td { padding: .55rem .6rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: middle; }
.sms-table td.n, .sms-table th.n { text-align: right; }
.sms-table tfoot td { font-weight: 700; border-bottom: none; border-top: 1px solid var(--border); }
.sms-table small { color: var(--text-muted); font-weight: 400; }
.sms-quota-cell { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.sms-quota-cell .gp-sms-gauge { width: 70px; }
.sms-tag { font-size: .7rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: var(--surface2); color: var(--text-muted); }
.sms-tag.is-own { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.sms-numbers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.sms-numbers li { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 10px; border: 1px solid var(--border); }
.sms-numbers li .gp-num { font-weight: 650; min-width: 9rem; }
.sms-numbers li select { width: auto; min-width: 12rem; margin-left: auto; }
.sms-head-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.sms-head-row select { width: auto; margin-left: auto; }

.gp-sms-threads .gp-empty { margin: .5rem; }
.gp-sms-foot { margin: 0; padding: .6rem .85rem; font-size: .76rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.gp-sms-older { align-self: center; font-size: .76rem; }
.gp-sms-none { align-items: stretch; justify-content: center; }
.gp-sms-new { justify-content: flex-start; }
.gp-sms-new input { max-width: 20rem; }
.sms-prov { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; }
.sms-small { font-size: .78rem; }
.sms-sim { display: flex; flex-direction: column; gap: .4rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.sms-sim input[type="text"] { flex: 2; min-width: 10rem; }
.sms-sim input[type="tel"], .sms-sim select { flex: 1; min-width: 8rem; width: auto; }
.sms-actions { display: flex; justify-content: flex-end; }
.sms-numbers li select { flex: none; }
.sms-numbers li .sms-small { flex: none; }
.gp-add input[type="tel"], .gp-add input[type="text"] { flex: 1; min-width: 9rem; width: auto; }

/* Mobile : la boîte en plein écran (m/groupes.js), au-dessus de la barre d'onglets. */
.msms-overlay { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom); }
.msms-top { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border); }
.msms-top h2 { margin: 0; font-size: 1.02rem; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msms-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msms-body .gp-sms { flex: 1; height: auto; min-height: 0; border: none; border-radius: 0; }
.msms-body .gp-sms-msg { max-width: 86%; }
.msms-body .gp-sms-compose textarea { min-height: 44px; font-size: 1rem; }
.msms-body .gp-sms-compose .btn { padding: .6rem .8rem; }
.msms-body .gp-sms-thread { border-radius: 0; border-bottom: 1px solid var(--border); padding: .8rem .7rem; }
.msms-body .gp-sms-threads { padding: 0; gap: 0; }
.msms-body .gp-sms-side-head .gp-sms-filters .btn-toggle { padding: .45rem .6rem; font-size: .85rem; }
/* Musiques d'attente (modules/musiques.js) */
.mus-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.mus-add select { width: auto; max-width: 26rem; }
.mus-add .btn { width: auto; display: inline-flex; align-items: center; gap: .3rem; }
.mus-annonce .son-track-name { color: var(--text-muted); display: flex; align-items: center; gap: .3rem; }
.mus-pos { display: inline-block; min-width: 1.4rem; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.mus-save { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; padding: .6rem 0; border-top: 1px solid var(--border); }
.mus-save .btn { width: auto; }
.mus-err { color: var(--red); font-size: .82rem; display: inline-flex; gap: .3rem; align-items: center; margin-right: auto; }
.mus-rename { display: flex; gap: .35rem; align-items: center; }
.mus-rename input { max-width: 20rem; }
.mus-rename .btn { width: auto; }
.num-warn .btn { width: auto; margin-left: .4rem; }
/* Enregistrements, version allégée (21/11/2026) : onglets, titres de blocs lisibles,
   métadonnées sur la ligne du titre. */
.son-tabs { display: flex; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); }
.son-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted);
  padding: .55rem .9rem; font-size: .95rem; font-weight: 600; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center; margin-bottom: -1px; }
.son-tabs button:hover { color: var(--text); }
.son-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.son-group-title { margin: 0 0 .15rem; font-size: 1.02rem; font-weight: 700; color: var(--text);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; text-transform: none; letter-spacing: 0; }
summary.son-group-title { cursor: pointer; }
.son-group-title .cot-tag { margin-left: auto; }
.son-meta-inline { font-size: .76rem; font-weight: 400; color: var(--text-muted); }
.son-plays .son-else { font-size: .78rem; color: var(--text-muted); }
.son-row { padding: .5rem 0; }

/* Administration › Postes : réglages à saisir dans un téléphone créé (montrés une fois). */
.poste-reglages { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 1rem 0; }
.poste-reglages dt { color: var(--text-muted); font-size: .85rem; }
.poste-reglages dd { margin: 0; word-break: break-all; }
#familles-list .setting-action { display: flex; gap: .3rem; align-items: center; }

/* Administration › Trunk : tableaux « intitulé | valeur » (lecture seule). */
.trunk-table th[scope=row] { text-align: left; font-weight: 600; width: 60%; padding: .6rem .9rem; vertical-align: middle; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.trunk-table th[scope=row] .panel-hint { font-weight: 400; margin-top: .15rem; }
.trunk-table td { white-space: nowrap; }
/* Numéros sortants : un numéro ne se coupe pas. */
#numeros-sortants-root td:nth-child(2), #numeros-sortants-root td:nth-child(3) { white-space: nowrap; }
/* Compteur « à enregistrer » sur le bouton actif du sélecteur (fond plein). */
.view-switch .btn-toggle.active .son-manque { background: #fff; color: #b45309; }
.view-switch .son-manque { margin-left: .35rem; }
/* Administration › Postes › Familles : deux numéros par famille créée, chacun titré. */
.fam-champ { display: inline-flex; flex-direction: column; gap: .15rem; font-size: .72rem; color: var(--text-muted); }
