/* Cognix Skills - composants d'habillage (transposés du design Claude Design).
   Tokens définis dans colors_and_type.css (+ alias). Chargé APRÈS app.css. */

/* ---- Barre supérieure institutionnelle ---- */
/* Gouttières alignées sur le DS : --space-4 (32px), pas --space-8 (96px).
   L'écart d'origine mangeait 192px de largeur utile, ce qui coupait les tables
   denses (cx-table fait 1080px d'intrinsèque) et gonflait l'air en haut de page. */
.cx-top { display:flex; align-items:center; gap:28px; height:64px; padding:0 var(--space-4);
  background: var(--surface-inst); color: var(--text-on-dark); }
.cx-logo { display:flex; align-items:center; gap:12px; text-decoration:none; }
.cx-logo img { height:26px; display:block; }
.cx-logo .divider { width:1px; height:22px; background: rgba(255,255,255,.22); }
.cx-logo .sk { font-family: var(--font-corps); font-weight:800; font-size:12px; letter-spacing:.24em;
  text-transform:uppercase; color: var(--color-or); }
.cx-nav { display:flex; gap:22px; margin-left:8px; align-self:stretch; align-items:stretch; }
.cx-nav a { display:flex; align-items:center; white-space:nowrap; color: rgba(255,255,255,.82); font-weight:600; font-size:14px;
  text-decoration:none; border-bottom:3px solid transparent; transition: color var(--transition), border-color var(--transition); }
.cx-nav a:hover { color:#fff; text-decoration:none; }
.cx-nav a.is-current { color:#fff; border-bottom-color: var(--color-or); }
.cx-top .cx-right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.cx-user { display:flex; align-items:center; gap:9px; font-size:13px; color: rgba(255,255,255,.9); }
.cx-avatar { width:30px; height:30px; border-radius: var(--radius-full); background: var(--color-or);
  color: var(--color-gris); display:grid; place-items:center; font-weight:800; font-size:13px; }
.cx-iconbtn { display:grid; place-items:center; width:34px; height:34px; border-radius: var(--radius-full);
  border:1px solid rgba(255,255,255,.18); background:transparent; color: rgba(255,255,255,.85);
  cursor:pointer; transition: background var(--transition), border-color var(--transition); }
.cx-iconbtn:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.32); }
.cx-iconbtn .sun { display:none; }
:root[data-theme="dark"] .cx-iconbtn .moon { display:none; }
:root[data-theme="dark"] .cx-iconbtn .sun { display:block; }
.cx-signout { color: rgba(255,255,255,.7); font-size:13px; font-weight:600; background:none; border:0; cursor:pointer; padding:0; }
.cx-signout:hover { color:#fff; }

/* ---- Page ---- */
.cx-main { max-width: var(--content-max); margin:0 auto; padding: var(--space-4) var(--space-4) 64px; }
.cx-page-head { margin-bottom: var(--space-6); }
.cx-label { font-family: var(--font-corps); font-weight:800; font-size: var(--fs-label);
  letter-spacing:.06em; text-transform:uppercase; color: var(--color-or); }
.cx-title { font-family: var(--font-titre); font-size: var(--fs-h2); font-weight:700; margin:6px 0 8px; color: var(--text-strong); }
.cx-sub { color: var(--text-muted); font-size: var(--fs-body); max-width:70ch; text-wrap:pretty; }

/* ---- Barre d'outils / filtres ---- */
.cx-toolbar { display:flex; flex-wrap:wrap; gap:var(--space-2); align-items:center; margin: var(--space-4) 0 0; }
/* Groupe des rangées de filtres : séparateur + respiration avant la 1re section (DS). */
.cx-filters { margin-top: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border); }
.cx-filters .cx-filter-row:last-child { margin-bottom: 0; }
.cx-search { flex:1; min-width:240px; display:flex; align-items:center; gap:8px; background: var(--surface-card);
  border:1px solid var(--border); border-radius: var(--radius-control); padding:10px 12px; color: var(--text-muted); }
.cx-search input { border:0; outline:0; font:inherit; flex:1; color: var(--text-primary); background:transparent; }
.cx-filter-row { display:flex; flex-wrap:wrap; align-items:baseline; gap:10px; margin-bottom:14px; }
.cx-filter-lab { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); min-width:96px; }
.cx-chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius: var(--radius-full);
  border:1px solid var(--border); background: var(--surface-card); color: var(--text-primary); font-size: var(--fs-sm);
  font-weight:600; cursor:pointer; text-decoration:none; transition: all var(--transition); }
.chip:hover { border-color: var(--text-primary); text-decoration:none; }
.chip.is-active { background: var(--color-gris); color:#fff; border-color: var(--color-gris); }
:root[data-theme="dark"] .chip.is-active { background: var(--color-or); color: var(--color-gris); border-color: var(--color-or); }
.chip .n { color: var(--text-muted); font-weight:700; }
.chip.is-active .n { color: rgba(255,255,255,.72); }
:root[data-theme="dark"] .chip.is-active .n { color: rgba(69,75,87,.7); }
.chip .swatch { width:8px; height:8px; border-radius:50%; }

/* ---- Section ---- */
.cx-section-title { display:flex; align-items:center; gap:12px; font-family: var(--font-titre);
  font-weight:700; font-size:19px; color: var(--text-strong); margin: 0 0 var(--space-3); }
.cx-section-title + .cx-grid { margin-bottom: var(--space-6); }
.cx-section-title .count { color: var(--text-muted); font-weight:600; font-family: var(--font-corps); font-size:14px; }
.cx-section-title .rule { flex:1; height:1px; background: var(--border); }

/* ---- Grille de cartes de skills ---- */
.cx-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(360px,1fr)); gap: var(--space-6); }
.skill-card { position:relative; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 28px 28px 22px;
  border-top:5px solid var(--pole-color, var(--color-bleu)); transition: box-shadow var(--transition), transform var(--transition); }
.skill-card:hover { box-shadow: var(--shadow-modal); transform: translateY(-2px); }
.skill-card h3 { font-family: var(--font-corps); font-size:17px; font-weight:800; margin:0 0 8px; color: var(--text-strong); }
.skill-card p { margin:0 0 18px; color: var(--text-muted); font-size: var(--fs-sm); line-height:1.55; text-wrap:pretty; }
.skill-card .row { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }

/* Couleurs de pôle (barre d'accent) */
.pole-prospection { --pole-color: var(--color-bleu); }
.pole-website     { --pole-color: var(--color-vert); }
.pole-marketing   { --pole-color: var(--color-orange); }
.pole-bni         { --pole-color: var(--color-bleu-fonce); }
.pole-assistant   { --pole-color: var(--color-violet); }
.pole-fidelisation{ --pole-color: var(--color-vert-medium); }
.pole-reference   { --pole-color: var(--color-or); }
.pole-securite    { --pole-color: var(--color-rouge); }
.pole-monitoring  { --pole-color: var(--color-orange-fonce); }
.pole-util        { --pole-color: var(--color-ink-soft); }

/* ---- Pills & badges ---- */
.pill { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius: var(--radius-full);
  font-size: var(--fs-label); font-weight:800; line-height:1.6; }
.pill .dot { width:7px; height:7px; border-radius:50%; background: currentColor; }
.pill.is-bon   { background: var(--ok-bg);   color: var(--ok-fg); }
.pill.is-moyen { background: var(--warn-bg); color: var(--warn-fg); }
.pill.is-faible{ background: var(--err-bg);  color: var(--err-fg); }
.pill.is-na    { background: var(--surface-inline); color: var(--text-muted); }
.badge { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius: var(--radius-full);
  font-size: var(--fs-label); font-weight:800; }
.badge-type-agent { background: var(--warn-bg); color: var(--warn-fg); }
.badge-type-skill { background: var(--ok-bg); color: var(--ok-fg); }
.badge-type-util  { background: var(--surface-inline); color: var(--text-primary); }
.badge-pole   { background:transparent; border:1px solid var(--border); color: var(--text-primary); font-weight:700; }
.badge-miroir { background: var(--surface-inline); border:1px solid var(--border); color: var(--text-muted); font-weight:700; }
.badge-commun { background: var(--commun-bg); color: var(--commun-fg); }
.badge-det { background: var(--surface-card); border:1px solid var(--border); color: var(--text-primary); font-weight:700; }
.badge-det .d { width:8px; height:8px; border-radius:50%; display:inline-block; }

/* ---- Boutons (skin Cognix) ---- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px;
  border-radius: var(--radius-control); font:inherit; font-weight:800; font-size:14px; cursor:pointer;
  border:1px solid transparent; text-decoration:none; transition: background var(--transition), border-color var(--transition); }
.btn--primary { background: var(--color-gris); color:#fff; }
.btn--primary:hover { background: var(--color-gris-fonce); }
:root[data-theme="dark"] .btn--primary { background: var(--color-or); color: var(--color-gris); }
:root[data-theme="dark"] .btn--primary:hover { background: #e8c874; }
.btn--cta { background: var(--color-orange); color:#fff; }
.btn--cta:hover { background: var(--color-orange-fonce); }
.btn--ghost { background: var(--surface-card); border-color: var(--border); color: var(--text-primary); }
.btn--ghost:hover { background: var(--surface-inline); }

/* ---- Carte générique ---- */
.card { background: var(--surface-card); border:1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card__head { padding:18px 24px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card__head h3 { margin:0; font-family: var(--font-corps); font-size:15px; font-weight:800; color: var(--text-strong); }
.card__body { padding:24px; }

/* ---- Fiche technique ---- */
.spec { display:grid; grid-template-columns: 150px 1fr; gap:12px 18px; font-size: var(--fs-sm); margin:0; }
.spec dt { color: var(--text-muted); font-weight:700; }
.spec dd { margin:0; color: var(--text-primary); }

/* ---- Login ---- */
.cx-login-wrap { min-height:100vh; display:grid; place-items:center; background: var(--surface-inst);
  position:relative; overflow:hidden; padding:24px; }
.cx-login-veil { position:absolute; width:560px; height:560px; border-radius:50%; background: var(--or-veil-12);
  top:-180px; right:-140px; pointer-events:none; }
.cx-login-veil.two { width:360px; height:360px; top:auto; right:auto; bottom:-160px; left:-120px; }
.cx-login { position:relative; width:410px; max-width:100%; background: var(--surface-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); padding: 40px 36px; border-top:5px solid var(--color-or); }
.cx-login .brandline { display:flex; align-items:center; gap:12px; margin-bottom:26px; }
.cx-login .brandline img { height:30px; }
.cx-login .brandline .sk { font-weight:800; font-size:12px; letter-spacing:.24em; text-transform:uppercase; color: var(--color-or); }
.cx-login .brandline .divider { width:1px; height:24px; background: var(--border); }
.cx-login h1 { font-family: var(--font-titre); font-size:24px; font-weight:700; margin:0 0 6px; }
.field { display:block; margin:16px 0; }
.field label { display:block; font-size: var(--fs-sm); font-weight:700; margin-bottom:6px; color: var(--text-primary); }
.field input { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); }
.field input::placeholder { color: var(--text-muted); }
.field input:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-or { display:flex; align-items:center; gap:10px; color: var(--text-muted); font-size:12px; font-weight:700; margin:18px 0; }
.cx-or span.line { flex:1; height:1px; background: var(--border); }

/* ---- Exploration 3D (re-teinte) ---- */
.cx-explore { position:relative; height: calc(100vh - 64px); background: var(--surface-inst); overflow:hidden; }
.cx-explore canvas { display:block; width:100%; height:100%; }
.cx-explore .legend { position:absolute; top:20px; left:20px; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-modal); padding:16px 18px; min-width:200px; }
.cx-explore .legend h4 { margin:0 0 12px; font-family: var(--font-corps); font-size:12px; font-weight:800;
  letter-spacing:.06em; text-transform:uppercase; color: var(--text-muted); }
.cx-explore .legend .lg-row { display:flex; align-items:center; gap:10px; font-size:13px; padding:4px 0; color: var(--text-primary); }
.cx-explore .legend .lg-row .swatch { width:12px; height:12px; border-radius:50%; }
.cx-explore .preview { position:absolute; top:20px; right:20px; width:300px; background: var(--surface-card);
  border:1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-modal);
  border-top:5px solid var(--pole-color, var(--color-bleu)); padding:22px; }

/* ---- Accueil (hero + cartes d'action) - transposé du DS ---- */
.cx-hero { padding: var(--space-5) 0 var(--space-4); }
.cx-hero h1 { font-family: var(--font-titre); font-size: var(--fs-h1); font-weight:700; margin:8px 0 12px;
  color: var(--text-strong); letter-spacing:-0.02em; }
.cx-hero p { color: var(--text-muted); font-size:17px; max-width:64ch; margin:0; text-wrap:pretty; }
.cx-actions { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: var(--space-3); }
.action-card { display:flex; flex-direction:column; gap:12px; background: var(--surface-card); border:1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding:28px; text-decoration:none;
  border-top:5px solid var(--pole-color, var(--color-bleu)); transition: box-shadow var(--transition), transform var(--transition); }
.action-card:hover { box-shadow: var(--shadow-modal); transform: translateY(-2px); }
.action-card .ico { width:40px; height:40px; display:grid; place-items:center; border-radius: var(--radius-control);
  background: var(--surface-inline); color: var(--pole-color, var(--color-bleu)); }
.action-card h3 { font-family: var(--font-corps); font-size:17px; font-weight:800; margin:0; color: var(--text-strong); }
.action-card p { margin:0; color: var(--text-muted); font-size: var(--fs-sm); line-height:1.55; text-wrap:pretty; flex:1; }
.action-card .go { font-weight:800; font-size:13px; color: var(--text-link); display:inline-flex; align-items:center; gap:6px; }
.action-card:hover .go { gap:9px; }

/* ---- Formulaire (grille équilibrée) - transposé du DS ---- */
.cx-form { display:grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-4); }
.cx-form .field { margin:0; }
.cx-form .field.full { grid-column: 1 / -1; }
.cx-form textarea { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); resize:vertical; min-height:110px; }
.cx-form textarea:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-form select { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; background: var(--surface-card); color: var(--text-primary); }
.cx-form select:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-cat-row { display:flex; gap:10px; align-items:stretch; }
.cx-cat-row select { flex:1; }

/* ---- Champ d'upload (charte Cognix) - transposé du DS ---- */
.cx-upload { display:block; }
.cx-upload input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.cx-dropzone { display:flex; align-items:center; gap:14px; padding:20px; border:1.5px dashed var(--border);
  border-radius: var(--radius-card); background: var(--surface-inline); cursor:pointer;
  transition: border-color var(--transition), background var(--transition); }
.cx-dropzone:hover, .cx-dropzone.is-drag { border-color: var(--color-or); background: var(--or-veil-12); }
.cx-dropzone .ico { flex:none; width:40px; height:40px; display:grid; place-items:center; border-radius: var(--radius-control);
  background: var(--surface-card); color: var(--color-bleu); border:1px solid var(--border); }
.cx-dropzone .txt { font-size:13px; color: var(--text-muted); line-height:1.5; }
.cx-dropzone .txt strong { color: var(--text-primary); font-weight:800; }
.cx-dropzone .pick { color: var(--text-link); font-weight:800; }
.cx-file { display:none; align-items:center; gap:10px; margin-top:10px; padding:10px 14px; border:1px solid var(--border);
  border-radius: var(--radius-control); background: var(--surface-card); font-size:13px; }
.cx-file.show { display:flex; }
.cx-file .name { font-weight:800; color: var(--text-primary); }
.cx-file .size { color: var(--text-muted); }
.cx-file .rm { margin-left:auto; background:none; border:0; color: var(--text-muted); cursor:pointer; font-weight:800; font-size:16px; line-height:1; }
.cx-file .rm:hover { color: var(--color-rouge); }

/* ---- Exploration 3D : bouton plein écran - transposé du DS ---- */
.cx-explore .fsbtn { position:absolute; bottom:20px; right:20px; display:inline-flex; align-items:center; gap:8px;
  padding:9px 14px; border-radius: var(--radius-control); border:1px solid var(--border); background: var(--surface-card);
  color: var(--text-primary); font:inherit; font-weight:800; font-size:13px; cursor:pointer; box-shadow: var(--shadow-card);
  transition: background var(--transition); }
.cx-explore .fsbtn:hover { background: var(--surface-inline); }
.cx-explore .fsbtn .exit { display:none; }
.cx-explore:fullscreen .fsbtn .exit, .cx-explore:-webkit-full-screen .fsbtn .exit { display:inline; }
.cx-explore:fullscreen .fsbtn .enter, .cx-explore:-webkit-full-screen .fsbtn .enter { display:none; }
.cx-explore:fullscreen, .cx-explore:-webkit-full-screen { height: 100vh !important; }

/* ============================================================
   SHELL D'ADMINISTRATION (TODO-127) - grammaire back-office
   Un seul niveau de navigation dans la section : la barre supérieure
   mène à « Administration », la colonne de gauche porte les 5 écrans.
   ============================================================ */
.cx-app { display:flex; align-items:stretch; }
.cx-side { flex:none; width:246px; background: var(--surface-card); border-right:1px solid var(--border);
  align-self:stretch; }
.cx-side__in { position:sticky; top:0; height:calc(100vh - 64px); overflow-y:auto; padding:18px 0 22px;
  display:flex; flex-direction:column; }
.cx-side__lab { padding:0 22px 12px; font-size: var(--fs-label); font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color: var(--accent); }
.cx-sidenav { display:flex; flex-direction:column; }
.cx-sidenav a { display:flex; align-items:center; gap:11px; padding:11px 22px; font-size:14px; font-weight:700;
  text-decoration:none; color: var(--text-primary); border-left:3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition); }
.cx-sidenav a svg { flex:none; color: var(--text-muted); }
.cx-sidenav a:hover { background: var(--surface-inline); color: var(--text-strong); text-decoration:none; }
.cx-sidenav a.is-current { background: var(--or-veil-12); border-left-color: var(--color-or); color: var(--text-strong); }
.cx-sidenav a.is-current svg { color: var(--color-or); }
.cx-sidenav .n { margin-left:auto; font-size:12px; font-weight:800; color: var(--text-muted);
  font-variant-numeric: tabular-nums; }
.cx-side__sep { height:1px; background: var(--border); margin:12px 22px; }
.cx-side__foot { margin:auto 0 0; padding:18px 22px 0; font-size:12px; line-height:1.5; color: var(--text-muted); }
.cx-work { flex:1; min-width:0; padding: var(--space-3) var(--space-4) var(--space-5); }

/* En-tête de page compact : titre + aide contextuelle + action principale */
.cx-head2 { display:flex; align-items:center; gap:10px; margin-bottom: var(--space-3); min-height:40px; }
.cx-head2 h1 { font-family: var(--font-titre); font-size:24px; font-weight:700; line-height:1.2; margin:0; }
.cx-head2__act { margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cx-help { position:relative; flex:none; display:grid; place-items:center; width:24px; height:24px; padding:0;
  border-radius: var(--radius-full); border:1px solid var(--border); background: var(--surface-card);
  color: var(--text-muted); cursor:help; }
.cx-help:hover { color: var(--text-link); border-color: var(--text-link); }
.cx-help__tip { position:absolute; z-index:40; top:calc(100% + 8px); left:-10px; width:340px; padding:12px 14px;
  background: var(--surface-inst); color: var(--text-on-dark); border-radius: var(--radius-control);
  font-size:13px; font-weight:600; line-height:1.5; text-align:left; text-wrap:pretty; cursor:default;
  box-shadow: var(--shadow-modal); opacity:0; visibility:hidden; transition: opacity var(--transition); }
.cx-help:hover .cx-help__tip, .cx-help:focus-visible .cx-help__tip { opacity:1; visibility:visible; }

/* Barre d'outils fondue dans l'en-tête de la carte de table */
.cx-tablecard__bar { display:flex; align-items:center; gap:12px 12px; row-gap:12px; flex-wrap:wrap; padding:13px 20px;
  border-bottom:1px solid var(--border); }
.cx-tablecard__bar .cx-search { flex:0 1 340px; min-width:200px; }
.cx-tablecard__bar .spacer { margin-left:auto; }
.cx-tablecard__chips { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:11px 20px;
  border-bottom:1px solid var(--border); background: var(--surface-inline); }
.cx-tablecard__chips .lab { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color: var(--text-muted); margin-right:2px; }
.cx-stats { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:700; color: var(--text-muted);
  font-variant-numeric: tabular-nums; white-space:nowrap; }
.cx-stats b { color: var(--text-strong); font-weight:800; }
.cx-stats .sep { width:1px; height:14px; background: var(--border); }

/* Table dense : défilement interne, en-tête figé, ombre de bord */
.cx-tablecard .cx-tablewrap { overflow:auto; max-height:calc(100vh - 210px); }
.cx-table thead th { position:sticky; top:0; z-index:2; }
.cx-tablewrap.is-edge { box-shadow: inset -16px 0 16px -16px rgba(69,75,87,.30); }
:root[data-theme="dark"] .cx-tablewrap.is-edge { box-shadow: inset -16px 0 16px -16px rgba(0,0,0,.45); }

/* Menu d'actions secondaires « … » (positionné en fixe : jamais rogné par la table) */
.cx-menu { position:relative; display:inline-block; vertical-align:middle; margin-left:12px; }
.cx-menu__btn { width:28px; height:28px; display:grid; place-items:center; border-radius: var(--radius-control);
  border:1px solid transparent; background:none; color: var(--text-muted); cursor:pointer; }
.cx-menu__btn:hover, .cx-menu.is-open .cx-menu__btn { background: var(--surface-inline);
  border-color: var(--border); color: var(--text-primary); }
.cx-menu__pop { display:none; position:fixed; z-index:70; min-width:236px; padding:5px 0; text-align:left;
  background: var(--surface-card); border:1px solid var(--border); border-radius: var(--radius-control);
  box-shadow: var(--shadow-modal); }
.cx-menu.is-open .cx-menu__pop { display:block; }
.cx-menu__pop button { display:block; width:100%; text-align:left; padding:9px 16px; background:none; border:0;
  font:inherit; font-size:13px; font-weight:700; color: var(--text-primary); cursor:pointer; white-space:nowrap; }
.cx-menu__pop button:hover { background: var(--or-veil-12); }
.cx-menu__pop button.is-danger { color: var(--err-fg); }

/* Dialogue de confirmation centré (états : neutre / destructif, motif facultatif) */
.cx-modal { position:fixed; inset:0; z-index:80; display:none; }
.cx-modal.is-open { display:grid; place-items:center; padding:24px; }
.cx-modal__scrim { position:absolute; inset:0; background: rgba(69,75,87,.44); }
.cx-modal__box { position:relative; width:520px; max-width:100%; max-height:calc(100vh - 48px); display:flex;
  flex-direction:column; background: var(--surface-card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); border-top:5px solid var(--color-or); }
.cx-modal--danger .cx-modal__box { border-top-color: var(--color-rouge); }
.cx-modal__head { display:flex; align-items:flex-start; gap:12px; padding:22px 26px 14px; }
.cx-modal__head h2 { font-family: var(--font-titre); font-size:20px; font-weight:700; margin:0; }
.cx-modal__body { padding:0 26px 6px; overflow-y:auto; }
.cx-modal__body > p { margin:0 0 16px; font-size:14px; line-height:1.55; color: var(--text-primary); text-wrap:pretty; }
.cx-modal__foot { display:flex; align-items:center; gap:12px; margin-top:16px; padding:18px 26px;
  border-top:1px solid var(--border); background: var(--surface-inline);
  border-radius:0 0 var(--radius-card) var(--radius-card); }
.cx-modal__foot .spacer { margin-left:auto; }
.btn--danger { background: var(--color-rouge); color:#fff; }
.btn--danger:hover { background:#bd3a3a; }
.cx-recap { display:grid; grid-template-columns:auto 1fr; gap:8px 18px; margin:0 0 18px; padding:14px 16px;
  background: var(--surface-inline); border-radius: var(--radius-control); font-size:13px; }
.cx-recap dt { color: var(--text-muted); font-weight:700; }
.cx-recap dd { margin:0; color: var(--text-strong); font-weight:700; }

@media (max-width: 1100px) {
  .cx-app { flex-direction:column; }
  .cx-side { width:auto; border-right:0; border-bottom:1px solid var(--border); }
  .cx-side__in { position:static; height:auto; padding:10px 0 0; }
  .cx-side__lab, .cx-side__foot { display:none; }
  .cx-sidenav { flex-direction:row; overflow-x:auto; }
  .cx-sidenav a { border-left:0; border-bottom:3px solid transparent; white-space:nowrap; padding:10px 16px; }
  .cx-sidenav a.is-current { border-left-color:transparent; border-bottom-color: var(--color-or); }
  .cx-side__sep { display:none; }
  .cx-tablecard .cx-tablewrap { max-height:none; }
}
@media (max-width: 860px) {
  .cx-work { padding: var(--space-3) var(--space-2) var(--space-4); }
  .cx-modal__box { width:100%; }
}

/* ============================================================
   GOUVERNANCE DES SKILLS (TODO-126) - transposé du DS Cognix
   ============================================================ */

/* ---- Sélection multiple en table ---- */
.cx-table .col-sel { width:46px; padding-right:0; }
.cx-table input[type="checkbox"] { width:16px; height:16px; accent-color: var(--color-or); cursor:pointer; margin:0; }
.cx-table tbody tr.is-picked { background: var(--or-veil-12); }
.cx-table tbody tr.is-picked:hover { background: var(--or-veil-20); }

/* ---- Barre d'actions groupées ---- */
.cx-bulkbar { display:none; align-items:center; gap:14px; flex-wrap:wrap; padding:14px 20px;
  background: var(--surface-inst); color: var(--text-on-dark); border-radius: var(--radius-control);
  box-shadow: var(--shadow-card); margin-bottom: var(--space-2); }
.cx-bulkbar.is-on { display:flex; }
.cx-bulkbar .cnt { font-weight:800; font-size:14px; }
.cx-bulkbar .cnt .n { color: var(--color-or); }
.cx-bulkbar .sep { width:1px; height:22px; background: rgba(255,255,255,.20); }
.cx-bulkbar .hint { font-size:12px; color: rgba(255,255,255,.62); margin-left:auto; }
.cx-bulkbar .btn--ghost { background: transparent; border-color: rgba(255,255,255,.28); color:#fff; }
.cx-bulkbar .btn--ghost:hover { background: rgba(255,255,255,.10); }

/* ---- Badges de gouvernance ---- */
.badge-masque { background: var(--err-bg); color: var(--err-fg); }
.badge-poles { background: var(--commun-bg); color: var(--commun-fg); }
.badge-nature { background: var(--surface-inline); border:1px solid var(--border); color: var(--text-primary); font-weight:700; }

/* ---- Statut de revue d'une version ---- */
.pill.is-servie    { background: var(--ok-bg); color: var(--ok-fg); }
.pill.is-soumise   { background: var(--warn-bg); color: var(--warn-fg); }
.pill.is-brouillon { background: var(--surface-inline); color: var(--text-muted); }
.pill.is-refusee   { background: var(--err-bg); color: var(--err-fg); }

/* ---- Liste de versions ---- */
.cx-versions { display:flex; flex-direction:column; }
.cx-version { display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); }
.cx-versions .cx-version:last-child { border-bottom:0; padding-bottom:0; }
.cx-version .v { font-weight:800; font-size:14px; color: var(--text-strong); min-width:34px; }
.cx-version .meta { font-size:12px; color: var(--text-muted); }
.cx-version .side { margin-left:auto; display:flex; align-items:center; gap:10px; }
.cx-version.is-served { background: var(--or-veil-12); margin:0 -24px; padding-left:24px; padding-right:24px; }

/* ---- Multi-sélection (pôles autorisés) ---- */
.cx-ms { position:relative; }
/* Le panneau est en position absolue : dans une carte à coins arrondis
   (`.card` porte overflow:hidden, app.css), il était rogné à la bordure -
   sélecteur « coincé » sur le bloc Gouvernance de la fiche. Quand un cx-ms
   est ouvert, la carte le laisse déborder. */
.card:has(.cx-ms[open]) { overflow: visible; }
.cx-ms > summary { list-style:none; display:flex; align-items:center; gap:10px; padding:10px 12px;
  border:1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-card);
  color: var(--text-primary); font-size:14px; cursor:pointer; }
.cx-ms > summary::-webkit-details-marker { display:none; }
.cx-ms > summary::after { content:"\25BE"; margin-left:auto; color: var(--text-muted); }
.cx-ms[open] > summary { border-color: var(--color-or); }
.cx-ms .ms-panel { position:absolute; z-index:20; top:calc(100% + 4px); left:0; right:0; max-height:260px; overflow-y:auto;
  background: var(--surface-card); border:1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal); }
.cx-ms .ms-all { border-bottom:1px solid var(--border); }
.cx-ms label { display:flex; align-items:center; gap:10px; padding:9px 14px; font-size:14px; cursor:pointer; }
.cx-ms label:hover { background: var(--or-veil-12); }
.cx-ms label input { width:16px; height:16px; accent-color: var(--color-or); margin:0; }
.cx-ms label .swatch { width:8px; height:8px; border-radius:50%; }

/* ---- Interrupteur ---- */
.cx-switch { display:inline-flex; align-items:center; gap:10px; font-size:13px; font-weight:700;
  color: var(--text-primary); cursor:pointer; }
.cx-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.cx-switch .track { width:38px; height:22px; border-radius: var(--radius-full); background: var(--border);
  position:relative; transition: background var(--transition); flex:none; }
.cx-switch .track::after { content:""; position:absolute; top:3px; left:3px; width:16px; height:16px;
  border-radius:50%; background: var(--surface-card); transition: transform var(--transition); }
.cx-switch input:checked + .track { background: var(--color-or); }
.cx-switch input:checked + .track::after { transform: translateX(16px); }
.cx-switch input:focus-visible + .track { outline:2px solid var(--color-or); outline-offset:2px; }

/* ---- Secret affiché une seule fois ---- */
.cx-secret { display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid var(--color-or);
  border-radius: var(--radius-control); background: var(--or-veil-12); }
.cx-secret code { flex:1; background:transparent; padding:0; font-size:13px; letter-spacing:.02em;
  word-break:break-all; color: var(--text-strong); }
.cx-secret .btn { flex:none; }

/* ---- Carte de skill masqué ---- */
.skill-card.is-masque { opacity:.72; border-style:dashed; box-shadow:none; }
.skill-card.is-masque:hover { opacity:1; }

/* ============================================================
   ADMINISTRATION (TODO-125) - transposé du DS Cognix
   ============================================================ */

/* ---- Sous-navigation de section (Administration) ---- */
.cx-subnav { display:flex; gap:2px; border-bottom:1px solid var(--border); margin: var(--space-3) 0 var(--space-5); }
.cx-subnav a { display:inline-flex; align-items:center; gap:8px; padding:11px 16px; font-size:14px; font-weight:700;
  text-decoration:none; color: var(--text-muted); border-bottom:3px solid transparent; margin-bottom:-1px;
  transition: color var(--transition), border-color var(--transition); }
.cx-subnav a:hover { color: var(--text-primary); text-decoration:none; }
.cx-subnav a.is-current { color: var(--text-strong); border-bottom-color: var(--color-or); }
.cx-subnav .n { font-weight:800; font-size:12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- Tuiles de compteurs ---- */
.cx-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: var(--space-3);
  margin-top: var(--space-4); }
.kpi { background: var(--surface-card); border:1px solid var(--border); border-top:5px solid var(--pole-color, var(--color-or));
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 22px 26px 20px; }
.kpi .k-val { font-family: var(--font-titre); font-size:30px; font-weight:700; color: var(--text-strong); line-height:1.1; }
.kpi .k-lab { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); margin-top:6px; }
.kpi .k-note { font-size:12px; color: var(--text-muted); margin-top:4px; }

/* ---- Table / liste de données ---- */
.cx-tablecard { background: var(--surface-card); border:1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); overflow:hidden; }
.cx-tablecard__head { display:flex; align-items:center; gap:12px; padding:18px 24px; border-bottom:1px solid var(--border); }
.cx-tablecard__head h2 { font-family: var(--font-corps); font-size:15px; font-weight:800; color: var(--text-strong); margin:0; }
.cx-tablecard__head .n { font-size:13px; color: var(--text-muted); font-weight:700; }
.cx-tablewrap { overflow-x:auto; }
.cx-table { width:100%; min-width:920px; border-collapse: collapse; font-size:14px; }
.cx-table th { text-align:left; font-size: var(--fs-label); font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color: var(--text-muted); background: var(--surface-inline);
  padding:12px 24px; border-bottom:1px solid var(--border); white-space:nowrap; }
.cx-table td { padding:16px 24px; border-bottom:1px solid var(--border); color: var(--text-primary); vertical-align:middle; }
.cx-table tbody tr:last-child td { border-bottom:0; }
.cx-table tbody tr.is-row { cursor:pointer; transition: background var(--transition); }
.cx-table tbody tr.is-row:hover { background: var(--or-veil-12); }
.cx-table tbody tr.is-off td { color: var(--text-muted); }
.cx-table tbody tr.is-off .cx-id strong { color: var(--text-muted); }
.cx-table .num { font-variant-numeric: tabular-nums; white-space:nowrap; }
.cx-table .col-act { text-align:right; white-space:nowrap; }
.cx-table .muted { color: var(--text-muted); }
.cx-id { display:flex; align-items:center; gap:12px; }
.cx-id strong { font-weight:800; color: var(--text-strong); display:block; }
.cx-id .mail { color: var(--text-muted); font-size:13px; white-space:nowrap; }
.cx-avatar-lg { flex:none; width:38px; height:38px; border-radius: var(--radius-full); display:grid; place-items:center;
  background: var(--surface-inline); border:1px solid var(--border); color: var(--text-primary);
  font-weight:800; font-size:13px; letter-spacing:.02em; }
.cx-avatar-lg.is-or { background: var(--or-veil-20); border-color: transparent; }
.tag-me { display:inline-block; margin-left:8px; padding:1px 8px; border-radius: var(--radius-full);
  background: var(--or-veil-20); color: var(--warn-fg); font-size:11px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase; vertical-align:2px; }
.cx-linkbtn { background:none; border:0; padding:0; font:inherit; font-weight:800; font-size:13px;
  color: var(--text-link); cursor:pointer; white-space:nowrap; }
.cx-linkbtn:hover { color: var(--color-bleu-fonce); }
.cx-linkbtn + .cx-linkbtn { margin-left:16px; }
.cx-linkbtn.is-danger { color: var(--err-fg); }
.cx-empty { padding:56px 24px; text-align:center; }
.cx-empty h3 { font-family: var(--font-corps); font-size:15px; font-weight:800; margin:0 0 6px; color: var(--text-strong); }
.cx-empty p { margin:0; font-size: var(--fs-sm); color: var(--text-muted); }

/* ---- Message d'alerte ---- */
.cx-alert { display:flex; align-items:flex-start; gap:12px; padding:14px 18px; border-radius: var(--radius-control);
  font-size: var(--fs-sm); font-weight:600; line-height:1.5; margin-bottom: var(--space-3); }
.cx-alert svg { flex:none; margin-top:1px; }
.cx-alert strong { font-weight:800; }
.cx-alert--ok  { background: var(--ok-bg);  color: var(--ok-fg); }
.cx-alert--err { background: var(--err-bg); color: var(--err-fg); }
.cx-alert--info{ background: var(--commun-bg); color: var(--commun-fg); }
.cx-alert--or  { background: var(--warn-bg); color: var(--warn-fg); }

/* ---- Champ de formulaire générique ---- */
.cx-lab { display:block; font-size: var(--fs-sm); font-weight:800; margin-bottom:6px; color: var(--text-primary); }
.cx-hint { font-size:12px; color: var(--text-muted); margin-top:6px; line-height:1.5; }
.cx-input { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  font:inherit; font-size:14px; background: var(--surface-card); color: var(--text-primary); }
.cx-input::placeholder { color: var(--text-muted); }
.cx-input:focus { outline:2px solid var(--color-or); outline-offset:2px; border-color: var(--color-or); }
.cx-input[readonly], .cx-input:disabled { background: var(--surface-inline); color: var(--text-muted); cursor:not-allowed; }
.cx-ro { display:flex; align-items:center; gap:8px; padding:11px 12px; border:1px solid var(--border);
  border-radius: var(--radius-control); background: var(--surface-inline); color: var(--text-muted); font-size:14px; }

/* ---- Sélecteur exclusif (segmenté / radios stylées) ----
   Seuil DS : jusqu'à 5 options, .cx-seg (les libellés passent à la ligne).
   Au-delà, .cx-seg--stack (liste verticale défilante). */
.cx-seg { display:flex; flex-wrap:wrap; gap:8px; }
.cx-seg label { display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border:1px solid var(--border);
  border-radius: var(--radius-control); background: var(--surface-card); font-size:13px; font-weight:700;
  color: var(--text-primary); cursor:pointer; transition: all var(--transition); }
.cx-seg label:hover { border-color: var(--text-primary); }
.cx-seg input { accent-color: var(--color-or); margin:0; }
.cx-seg label:has(input:checked) { border-color: var(--color-or); background: var(--or-veil-12); }
.cx-seg label:has(input:disabled) { opacity:.55; cursor:not-allowed; }
.cx-seg--stack { flex-direction:column; gap:0; border:1px solid var(--border); border-radius: var(--radius-control);
  max-height:216px; overflow-y:auto; }
.cx-seg--stack label { border:0; border-bottom:1px solid var(--border); border-radius:0; }
.cx-seg--stack label:last-child { border-bottom:0; }
.cx-seg--stack label:has(input:checked) { border-color: transparent; }

/* ---- Cases à cocher (matrice de permissions) ---- */
.cx-permgroup { border:1px solid var(--border); border-radius: var(--radius-card); overflow:hidden; margin-bottom: var(--space-3); }
.cx-permgroup__head { display:flex; align-items:center; gap:10px; padding:11px 16px; background: var(--surface-inline);
  border-bottom:1px solid var(--border); font-size: var(--fs-label); font-weight:800; letter-spacing:.06em;
  text-transform:uppercase; color: var(--text-muted); }
.cx-permgroup__head .n { margin-left:auto; letter-spacing:0; font-variant-numeric: tabular-nums; }
.cx-check { display:flex; align-items:flex-start; gap:11px; padding:12px 16px; cursor:pointer;
  border-bottom:1px solid var(--border); transition: background var(--transition); }
.cx-permgroup .cx-check:last-child { border-bottom:0; }
.cx-check:hover { background: var(--or-veil-12); }
.cx-check input { flex:none; width:16px; height:16px; margin-top:2px; accent-color: var(--color-or); }
.cx-check .t { font-size:14px; font-weight:600; color: var(--text-primary); }
.cx-check .d { font-size:12px; color: var(--text-muted); margin-top:2px; line-height:1.5; }
.cx-check .lk { display:inline-flex; align-items:center; gap:4px; margin-left:8px; color: var(--text-muted);
  font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; vertical-align:1px; }
.cx-check.is-locked { cursor:not-allowed; background: var(--surface-inline); }
.cx-check.is-locked:hover { background: var(--surface-inline); }
.cx-check.is-locked input { opacity:.6; }

/* ---- Matrice comparative (permissions × rôles) ---- */
.cx-matrix { width:100%; min-width:820px; border-collapse: collapse; font-size:13px; }
.cx-matrix th, .cx-matrix td { border-bottom:1px solid var(--border); padding:11px 14px; }
.cx-matrix thead th { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); background: var(--surface-inline); text-align:center; white-space:nowrap; }
.cx-matrix thead th:first-child, .cx-matrix tbody th { text-align:left; }
.cx-matrix tbody th { font-weight:600; color: var(--text-primary); }
.cx-matrix tbody tr.grp th { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); background: var(--surface-inline); }
.cx-matrix td { text-align:center; }
.cx-matrix .yes { color: var(--ok-fg); font-weight:800; }
.cx-matrix .no { color: var(--border); font-weight:800; }
.cx-matrix .lock { color: var(--warn-fg); font-weight:800; }

/* ---- Liste de rôles (colonne gauche) ---- */
.cx-split { display:grid; grid-template-columns: 320px 1fr; gap: var(--space-4); align-items:start; }
.cx-rolelist { display:flex; flex-direction:column; }
.cx-roleitem { display:block; width:100%; text-align:left; background:none; border:0; border-bottom:1px solid var(--border);
  padding:16px 20px; cursor:pointer; font:inherit; transition: background var(--transition); }
.cx-roleitem:last-child { border-bottom:0; }
.cx-roleitem:hover { background: var(--or-veil-12); }
.cx-roleitem.is-active { background: var(--or-veil-20); }
.cx-roleitem .rt { font-weight:800; font-size:14px; color: var(--text-strong); display:flex; align-items:center; gap:8px; }
.cx-roleitem .rs { font-size:12px; color: var(--text-muted); margin-top:3px; font-variant-numeric: tabular-nums; }
.badge-sys { background: var(--surface-inline); border:1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-full); font-size:11px; font-weight:800; padding:1px 8px; }

/* ---- Volet latéral d'édition ---- */
.cx-drawer { position:fixed; inset:0; z-index:60; display:none; }
.cx-drawer.is-open { display:block; }
.cx-drawer__scrim { position:absolute; inset:0; background: rgba(69,75,87,.44); }
.cx-drawer__panel { position:absolute; top:0; right:0; height:100%; width:480px; max-width:100%;
  background: var(--surface-card); box-shadow: var(--shadow-modal); display:flex; flex-direction:column;
  border-top:5px solid var(--color-or); }
.cx-drawer__head { display:flex; align-items:flex-start; gap:12px; padding:22px 28px 18px; border-bottom:1px solid var(--border); }
.cx-drawer__head h2 { font-family: var(--font-titre); font-size:21px; font-weight:700; margin:0; }
.cx-drawer__head .cx-label { margin-bottom:2px; }
.cx-drawer__close { margin-left:auto; background:none; border:0; cursor:pointer; color: var(--text-muted);
  width:32px; height:32px; display:grid; place-items:center; border-radius: var(--radius-full); }
.cx-drawer__close:hover { background: var(--surface-inline); color: var(--text-primary); }
.cx-drawer__body { padding:24px 28px; overflow-y:auto; flex:1; }
.cx-drawer__foot { display:flex; align-items:center; gap:12px; padding:18px 28px; border-top:1px solid var(--border);
  background: var(--surface-inline); }
.cx-drawer__foot .spacer { margin-left:auto; }
.cx-stack { display:flex; flex-direction:column; gap: var(--space-3); }
.cx-stack--2 { display:grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cx-sep { height:1px; background: var(--border); margin: var(--space-3) 0; }
.cx-mini-title { font-size: var(--fs-label); font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  color: var(--text-muted); margin-bottom:10px; }

/* ---- Détail technique repliable (journal) ---- */
.cx-details summary { cursor:pointer; font-size:12px; font-weight:800; color: var(--text-link);
  list-style:none; display:inline-flex; align-items:center; gap:6px; }
.cx-details summary::-webkit-details-marker { display:none; }
.cx-details summary::before { content:"+"; font-size:13px; }
.cx-details[open] summary::before { content:"\2212"; }
.cx-details pre { margin:10px 0 0; padding:14px 16px; background: var(--surface-inline); border:1px solid var(--border);
  border-radius: var(--radius-control); font-size:12px; line-height:1.6; overflow-x:auto; color: var(--text-primary); }

/* ---- Pagination ---- */
.cx-pager { display:flex; align-items:center; gap:8px; padding:16px 24px; border-top:1px solid var(--border); }
.cx-pager .info { font-size:13px; color: var(--text-muted); margin-right:auto; font-variant-numeric: tabular-nums; }
.cx-pager a, .cx-pager button { min-width:34px; height:34px; padding:0 10px; border:1px solid var(--border);
  background: var(--surface-card); border-radius: var(--radius-control); font:inherit; font-size:13px; font-weight:700;
  color: var(--text-primary); text-decoration:none; cursor:pointer; display:inline-flex; align-items:center;
  justify-content:center; transition: all var(--transition); }
.cx-pager a:hover, .cx-pager button:hover:not(:disabled) { border-color: var(--text-primary); text-decoration:none; }
.cx-pager .is-active { background: var(--color-gris); border-color: var(--color-gris); color:#fff; }
:root[data-theme="dark"] .cx-pager .is-active { background: var(--color-or); border-color: var(--color-or); color: var(--color-gris); }
.cx-pager button:disabled { opacity:.45; cursor:not-allowed; }

/* ---- Pills d'événements (journal) ---- */
.pill.is-auth    { background: var(--surface-inline); color: var(--text-muted); }
.pill.is-gov     { background: var(--warn-bg); color: var(--warn-fg); }
.pill.is-account { background: var(--commun-bg); color: var(--commun-fg); }
.pill.is-anomaly { background: var(--err-bg); color: var(--err-fg); }

/* ---- Responsive ---- */
@media (max-width: 1150px) {
  .cx-nav { gap:16px; }
  .cx-top { gap:20px; padding:0 var(--space-4); }
  .cx-user .nm { display:none; }
}
@media (max-width: 1080px) {
  .cx-split { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .cx-top { flex-wrap:wrap; height:auto; padding-top:10px; padding-bottom:0; }
  .cx-nav { order:3; width:100%; margin-left:0; overflow-x:auto; gap:18px; }
  .cx-nav a { padding-bottom:8px; }
}
@media (max-width: 860px) {
  .cx-drawer__panel { width:100%; }
  .cx-stack--2 { grid-template-columns: 1fr; }
  .cx-table th, .cx-table td { padding:12px 16px; }
  .cx-top { gap:16px; padding:8px var(--space-4); height:auto; flex-wrap:wrap; }
  .cx-nav { order:3; width:100%; margin-left:0; gap:16px; overflow-x:auto; }
  .cx-nav a { padding:8px 0; border-bottom-width:2px; }
  .cx-main { padding: var(--space-6) var(--space-4) 48px; }
  .cx-grid { grid-template-columns: 1fr; }
  .cx-form { grid-template-columns: 1fr; }
}

/* ============================================================
   TODO-128 - Pôles des collaborateurs, jetons personnels,
   gestion des catégories. Tokens du DS uniquement.
   (transposé de styles/cognix-skills.css du proto, verbatim)
   ============================================================ */

/* Grappe de pôles en table : 2 badges + « +N » (les libellés sont longs) */
.cx-poles { display:flex; flex-wrap:wrap; align-items:center; gap:6px; max-width:280px; }
.badge-pole { gap:6px; }
.badge-pole .swatch { width:7px; height:7px; border-radius:50%; flex:none;
  background: var(--pole-color, var(--color-bleu)); }
.badge-all  { background: var(--surface-inline); border:1px dashed var(--border);
  color: var(--text-muted); font-weight:700; }
.badge-more { background: var(--surface-inline); color: var(--text-muted); font-weight:800; cursor:default; }
.badge-off  { background: var(--err-bg); color: var(--err-fg); font-weight:800; }

/* Champ en lecture seule (éditeur ne portant pas la permission) */
.cx-rovalue { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-height:42px;
  padding:10px 12px; border:1px solid var(--border); border-radius: var(--radius-control);
  background: var(--surface-inline); color: var(--text-muted); font-size:14px; }
.cx-ms.is-ro > summary { background: var(--surface-inline); color: var(--text-muted); cursor:not-allowed; }
.cx-ms.is-ro > summary::after { content:none; }
.cx-lab .ro { font-weight:700; text-transform:none; letter-spacing:0; color: var(--text-muted);
  font-size:11px; margin-left:8px; }

/* Jetons personnels : identité de collaborateur répétée en table */
.cx-table .cx-id .mail { display:block; font-size:12.5px; color: var(--text-muted); }
.cx-tokdot { display:inline-block; width:6px; height:6px; border-radius:50%;
  background: var(--color-or); margin-right:7px; vertical-align:middle; }

/* ---- Référentiel des pôles (14-admin-poles) ---- */
.cx-poledot { flex:none; width:14px; height:14px; border-radius:50%; }
.cx-none { color: var(--text-muted); font-size:13px; }
.cx-resps { display:flex; flex-direction:column; gap:4px; }
.cx-resp { display:flex; align-items:center; gap:8px; font-size:13.5px; color: var(--text-primary); white-space:nowrap; }
.cx-avatar-sm { flex:none; width:24px; height:24px; border-radius: var(--radius-full); display:grid; place-items:center;
  background: var(--surface-inline); border:1px solid var(--border); color: var(--text-primary);
  font-weight:800; font-size:10.5px; letter-spacing:.02em; }
.cx-avatar-sm.is-off { opacity:.55; }
.badge-resp { background: var(--or-veil-20); color: var(--warn-fg); font-weight:800; }

/* Palette de couleurs de pôle (charte uniquement) */
.cx-swatches { display:flex; flex-wrap:wrap; gap:8px; }
.cx-swatches label { position:relative; cursor:pointer; line-height:0; }
.cx-swatches input { position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
.cx-swatches .sw { display:block; width:26px; height:26px; border-radius: var(--radius-control);
  border:1px solid var(--border); }
.cx-swatches input:checked + .sw { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--color-or); }
.cx-swatches input:focus-visible + .sw { outline:2px solid var(--color-or); outline-offset:2px; }
.cx-swatches input:disabled + .sw { opacity:.5; cursor:not-allowed; }

/* Liste des collaborateurs rattachés à un pôle */
.cx-memberlist { display:flex; flex-direction:column; border:1px solid var(--border);
  border-radius: var(--radius-card); overflow:hidden; }
.cx-memberlist .row { display:flex; align-items:center; gap:12px; padding:10px 14px;
  border-bottom:1px solid var(--border); transition: background var(--transition); }
.cx-memberlist .row:last-child { border-bottom:0; }
.cx-memberlist .row:hover { background: var(--or-veil-12); }
.cx-memberlist .nm { display:block; font-weight:800; font-size:14px; color: var(--text-strong); }
.cx-memberlist .mail { display:block; font-size:12.5px; color: var(--text-muted); }
.cx-memberlist .spacer { margin-left:auto; }
.cx-empty2 { padding:16px 14px; color: var(--text-muted); font-size:13.5px; line-height:1.55; }
.cx-addrow { display:flex; gap:10px; align-items:center; }
.cx-addrow .cx-input { flex:1; }
.cx-sub2 { display:block; font-size:12px; font-weight:600; color: var(--text-muted); margin-top:2px;
  font-variant-numeric: normal; white-space:nowrap; }

/* Actions de rangée empilées : colonne plus étroite, table moins large */
.cx-acts { display:flex; flex-direction:column; align-items:flex-start; gap:7px; }
.cx-acts .cx-linkbtn + .cx-linkbtn { margin-left:0; }
.cx-acts .cx-linkbtn { line-height:1.3; display:inline-flex; align-items:center; gap:7px; }
.cx-acts .cx-linkbtn svg { flex:none; opacity:.75; }
.cx-acts .cx-linkbtn:hover svg { opacity:1; }
.cx-acts a.cx-linkbtn { text-decoration:none; }
.cx-table .col-act:has(.cx-acts) { text-align:left; }

/* Badge de file d'attente dans la barre supérieure (retour du 05/08/2026) :
   même grammaire que le compteur `.n` de la colonne d'administration, adapté au
   fond institutionnel. À faire valider au prochain round de proto. */
.cx-navbadge { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px;
  margin-left:7px; border-radius: var(--radius-full); background: var(--color-or);
  color: var(--color-gris); font-size:11px; font-weight:800; line-height:1;
  font-variant-numeric: tabular-nums; vertical-align:1px; }
