/* Console de Younes (postule + lead) : le kit `admin-console` (~/.claude/skills/admin-console/template/) sans React.
 *
 * Mêmes jetons `--cx-*` que admin.css du kit ; seules les familles accent et bot changent d'un projet à l'autre.
 * Accent : le bleu ciel du logo K-DEV. Famille bot : ici, ce que KDEV AI fait seul (aucune audience mesurée, un seul
 * visiteur), pour qu'un coup d'œil sépare ce qui attend Younes de ce qui tourne sans lui.
 *
 * Préfixe `cx`, jamais `ad` : les bloqueurs de pub masquent `.ad-card` et consorts (règle du kit, 27/10/2026).
 * CSP stricte : aucun style en ligne dans le HTML ; les largeurs calculées passent par element.style (CSSOM). */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #0b1220;
  -webkit-text-size-adjust: 100%;
}
html[data-theme="light"] body { background: #f4f6fa; }

.admin {
  color-scheme: dark;
  --cx-bg: #0b1220;
  --cx-raised: #131c2f;
  --cx-panel: rgb(255 255 255 / 0.035);
  --cx-sunken: rgb(0 0 0 / 0.22);
  --cx-hover: rgb(255 255 255 / 0.07);
  --cx-line: rgb(255 255 255 / 0.1);
  --cx-shadow: none;
  --cx-text: #f1f5f9;
  --cx-dim: rgb(241 245 249 / 0.66);
  --cx-faint: rgb(241 245 249 / 0.55);
  --cx-scrim: rgb(0 0 0 / 0.5);

  --cx-accent: #38bdf8;
  --cx-accent-fg: #062033;
  --cx-accent-text: #7dd3fc;
  --cx-accent-line: rgb(56 189 248 / 0.45);
  --cx-accent-soft: rgb(56 189 248 / 0.15);
  --cx-bar: rgb(56 189 248 / 0.42);

  --cx-bot: #a78bfa;
  --cx-bot-text: #c4b5fd;
  --cx-bot-line: rgb(167 139 250 / 0.28);
  --cx-bot-soft: rgb(167 139 250 / 0.07);
  --cx-bot-bar: rgb(167 139 250 / 0.5);

  --cx-ok: #4ade80;
  --cx-ok-soft: rgb(74 222 128 / 0.14);
  --cx-warn: #fbbf24;
  --cx-warn-soft: rgb(251 191 36 / 0.13);
  --cx-danger: #f87171;
  --cx-danger-soft: rgb(248 113 113 / 0.12);
  --cx-danger-line: rgb(248 113 113 / 0.4);

  background-color: var(--cx-bg);
  color: var(--cx-text);
}

.admin.light, html[data-theme="light"] .admin {
  color-scheme: light;
  --cx-bg: #f4f6fa;
  --cx-raised: #ffffff;
  --cx-panel: #ffffff;
  --cx-sunken: #eceff5;
  --cx-hover: #eceff5;
  --cx-line: #e1e6ee;
  --cx-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 1px 1px rgb(15 23 42 / 0.03);
  --cx-text: #0f172a;
  --cx-dim: #475569;
  --cx-faint: #66758c;
  --cx-scrim: rgb(15 23 42 / 0.35);

  --cx-accent: #0369a1;
  --cx-accent-fg: #ffffff;
  --cx-accent-text: #075985;
  --cx-accent-line: rgb(3 105 161 / 0.4);
  --cx-accent-soft: rgb(3 105 161 / 0.09);
  --cx-bar: rgb(3 105 161 / 0.42);

  --cx-bot: #7c3aed;
  --cx-bot-text: #6d28d9;
  --cx-bot-line: rgb(124 58 237 / 0.22);
  --cx-bot-soft: rgb(124 58 237 / 0.04);
  --cx-bot-bar: rgb(124 58 237 / 0.38);

  --cx-ok: #15803d;
  --cx-ok-soft: rgb(22 163 74 / 0.1);
  --cx-warn: #a16207;
  --cx-warn-soft: rgb(202 138 4 / 0.1);
  --cx-danger: #dc2626;
  --cx-danger-soft: rgb(220 38 38 / 0.07);
  --cx-danger-line: rgb(220 38 38 / 0.3);
}


/* --- Coque ------------------------------------------------------------------ */

.admin { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.cx-main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px; }
.cx-main.plein { overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 640px) { .cx-main { padding: 16px; } }
a { color: var(--cx-accent-text); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 2px; }
.cx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cx-card { border: 1px solid var(--cx-line); background: var(--cx-panel); border-radius: 0.75rem; box-shadow: var(--cx-shadow); }
.cx-card.cx-card--bot { border-color: var(--cx-bot-line); background: var(--cx-bot-soft); }
.cx-num { font-variant-numeric: tabular-nums; }
.cx-stale { opacity: 0.55; transition: opacity 120ms ease-out; }
.cx-sticky-tools { position: sticky; top: 0; z-index: 20; }

/* Barre collante */
.cx-header { flex-shrink: 0; position: relative; z-index: 30; border-bottom: 1px solid var(--cx-line); background: var(--cx-bg); }
.cx-header-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; }
@media (min-width: 640px) { .cx-header-in { padding: 8px 16px; } }
.cx-titre { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.cx-titre img { width: 22px; height: 22px; border-radius: 5px; }
.cx-tabs { order: 3; display: flex; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.cx-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) { .cx-tabs { order: 0; width: auto; } }
.cx-tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; flex-shrink: 0; padding: 0 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--cx-dim); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 120ms, color 120ms;
}
@media (min-width: 640px) { .cx-tab { min-height: 34px; } }
.cx-tab:hover { background: var(--cx-hover); color: var(--cx-text); }
.cx-tab[aria-current="page"] { background: var(--cx-accent-soft); color: var(--cx-accent-text); }
.cx-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.cx-count { border-radius: 4px; padding: 0 4px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--cx-faint); }
.cx-count.alerte { background: var(--cx-accent); color: var(--cx-accent-fg); font-weight: 700; }
.cx-count:empty { display: none; }
.cx-outils { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cx-mesure { font-size: 12px; color: var(--cx-faint); white-space: nowrap; }
.cx-mesure.vieux { color: var(--cx-warn); }
@media (max-width: 480px) { .cx-mesure { display: none; } }
.cx-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 12px;
  border: 1px solid var(--cx-line); border-radius: 6px; background: transparent; color: var(--cx-dim); font-size: 12px; font-weight: 500; cursor: pointer;
}
@media (min-width: 640px) { .cx-tool { min-height: 32px; min-width: 32px; } }
.cx-tool:hover { background: var(--cx-hover); color: var(--cx-text); }
.cx-tool:disabled { opacity: 0.5; cursor: default; }
.cx-tool svg { width: 15px; height: 15px; }
.cx-tool.tourne svg { animation: cx-tourne 0.9s linear infinite; }
@keyframes cx-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cx-tool.tourne svg, .tourne svg { animation: none; } }

/* Écran du token */
.cx-login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cx-login form { width: 100%; max-width: 24rem; padding: 24px; }
.cx-login h1 { margin: 0; font-size: 18px; }
.cx-login p { margin: 4px 0 0; font-size: 14px; color: var(--cx-dim); }
.cx-login .ligne-champ { display: flex; gap: 8px; margin-top: 20px; }
.cx-login input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-sunken);
  color: var(--cx-text); font: 16px ui-monospace, SFMono-Regular, Menlo, monospace; outline: none;
}
.cx-login input:focus { border-color: var(--cx-accent-line); }
.cx-login .erreur { color: var(--cx-danger); }

/* Boutons */
.cx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--cx-line); background: transparent; color: var(--cx-dim); font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background-color 120ms, color 120ms;
}
@media (min-width: 640px) { .cx-btn { min-height: 32px; font-size: 12px; } }
.cx-btn:hover { background: var(--cx-hover); color: var(--cx-text); }
.cx-btn:disabled { opacity: 0.5; cursor: default; }
.cx-btn.accent { border-color: transparent; background: var(--cx-accent); color: var(--cx-accent-fg); }
.cx-btn.accent:hover { opacity: 0.9; background: var(--cx-accent); color: var(--cx-accent-fg); }
.cx-btn.danger { border-color: var(--cx-danger-line); color: var(--cx-danger); }
.cx-btn.danger:hover { background: var(--cx-danger-soft); }
.cx-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.cx-btn.primaire-lg { min-height: 44px; font-size: 14px; }
.cx-inline { padding: 0; border: 0; background: none; color: var(--cx-text); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.cx-inline:hover { color: var(--cx-accent-text); }

/* Segments */
.cx-seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 2px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-sunken); scrollbar-width: none; }
.cx-seg button {
  min-height: 36px; flex-shrink: 0; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--cx-dim);
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
@media (min-width: 640px) { .cx-seg button { min-height: 28px; } }
.cx-seg button:hover { color: var(--cx-text); }
.cx-seg button[aria-pressed="true"] { background: var(--cx-raised); color: var(--cx-accent-text); box-shadow: 0 0 0 1px var(--cx-line), 0 1px 2px rgb(0 0 0 / 0.12); }

/* Surfaces */
.cx-carte { padding: 16px; min-width: 0; }
.cx-carte-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cx-carte-titre { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-dim); }
.cx-carte-titre svg { width: 15px; height: 15px; color: var(--cx-accent-text); flex-shrink: 0; }
.cx-card--bot .cx-carte-titre { color: var(--cx-bot-text); }
.cx-card--bot .cx-carte-titre svg { color: var(--cx-bot-text); }
.cx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1024px) { .cx-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cx-stat { min-width: 0; padding: 12px 16px; }
.cx-stat-l { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-dim); }
.cx-stat-l svg { width: 15px; height: 15px; color: var(--cx-accent-text); flex-shrink: 0; }
.cx-stat-v { margin: 4px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-stat-v small { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--cx-faint); }
.cx-stat-h { margin: 2px 0 0; font-size: 12px; color: var(--cx-faint); }
.cx-empty { margin: 0; padding: 12px 0; font-size: 14px; color: var(--cx-faint); }
.cx-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; padding: 8px 12px; border: 1px solid var(--cx-accent-line); border-radius: 8px; background: var(--cx-accent-soft); font-size: 14px; }
.cx-banner.danger { border-color: var(--cx-danger-line); background: var(--cx-danger-soft); color: var(--cx-danger); }
.cx-toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; width: fit-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 8px 16px;
  border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-raised); color: var(--cx-text); font-size: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.3);
}
.cx-crash { padding: 16px; border-color: var(--cx-danger-line); font-size: 14px; }
.cx-crash h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-danger); }
.cx-crash p { margin: 8px 0 0; color: var(--cx-dim); }
.cx-crash pre { margin: 12px 0 0; padding: 8px 12px; border-radius: 6px; background: var(--cx-sunken); font: 12px ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-crash .cx-actions { margin-top: 12px; }
.cx-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Classement à barres (TopList) */
.cx-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cx-top li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow: hidden; border-radius: 4px; font-size: 14px; }
.cx-top .barre { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--cx-accent-soft); }
.cx-top .lib { position: relative; padding: 4px 0 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-top .val { position: relative; flex-shrink: 0; padding-right: 8px; font-size: 12px; color: var(--cx-dim); font-variant-numeric: tabular-nums; }

/* Mise en page des vues */
.cx-pile { display: flex; flex-direction: column; gap: 16px; }
.cx-grille2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .cx-grille2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cx-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--cx-faint); }
.cx-h2 { margin: 0; font-size: 16px; font-weight: 700; }

/* Onglets en deux colonnes : la liste des filtres colle à gauche (cx-sticky-rail du kit), la vue à droite tient dans
 * la hauteur de l'écran (les listes reprises de postule et lead se paginent à la hauteur disponible). */
.cx-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
@media (min-width: 1000px) { .cx-split { grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; } }
.cx-rail { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 1000px) { .cx-rail { overflow-y: auto; padding-right: 2px; } }
.cx-recherche { position: relative; display: flex; align-items: center; }
.cx-recherche svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--cx-faint); pointer-events: none; }
.cx-recherche input {
  width: 100%; min-height: 40px; padding: 0 10px 0 34px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-sunken);
  color: var(--cx-text); font: inherit; font-size: 16px; outline: none;
}
@media (min-width: 640px) { .cx-recherche input { font-size: 14px; } }
.cx-recherche input:focus { border-color: var(--cx-accent-line); }
.cx-filtres { display: flex; flex-direction: column; gap: 2px; }
.cx-filtres a, .cx-filtres button {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--cx-dim); font-size: 14px; font-weight: 500; text-decoration: none; text-align: left; cursor: pointer;
}
.cx-filtres a:hover, .cx-filtres button:hover { background: var(--cx-hover); color: var(--cx-text); }
.cx-filtres a[aria-current="page"], .cx-filtres button[aria-pressed="true"] { background: var(--cx-accent-soft); color: var(--cx-accent-text); font-weight: 600; }
.cx-filtres svg { width: 17px; height: 17px; flex-shrink: 0; }
.cx-filtres .lib { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-filtres .nb { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cx-text); }
.cx-rail-titre { margin: 6px 0 2px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-faint); }
.cx-rail-carte { display: block; padding: 10px 12px; color: var(--cx-text); text-decoration: none; }
.cx-rail-carte:hover { background: var(--cx-hover); }
.cx-rail-carte[aria-current="page"] { border-color: var(--cx-accent-line); }
.cx-rail-carte .l { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-dim); }
.cx-rail-carte .v { margin-top: 2px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-rail-carte .v small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--cx-faint); }
.cx-rail-carte .s { margin-top: 2px; font-size: 12px; color: var(--cx-faint); }
.cx-rail-carte .s.ko { color: var(--cx-warn); }
.cx-jauge { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--cx-sunken); overflow: hidden; }
.cx-jauge span { display: block; height: 100%; border-radius: 2px; background: var(--cx-accent); }
.cx-jauge.attention span { background: var(--cx-warn); }
.cx-jauge.critique span { background: var(--cx-danger); }
.cx-rail select {
  width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-sunken); color: var(--cx-text); font: inherit;
}
.cx-rail .case { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; font-size: 13px; color: var(--cx-dim); cursor: pointer; }
.cx-rail .case input { width: 16px; height: 16px; accent-color: var(--cx-accent); }

/* Téléphone et tablette : la colonne devient un bandeau ; filtres en une ligne qui défile, sans défilement de page. */
@media (max-width: 999px) {
  .cx-rail { gap: 8px; }
  .cx-rail .rail-replie { display: none; }
  .cx-filtres { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .cx-filtres::-webkit-scrollbar { display: none; }
  .cx-filtres a, .cx-filtres button { flex-shrink: 0; min-height: 40px; border: 1px solid var(--cx-line); }
  .cx-filtres a .lib, .cx-filtres button .lib { overflow: visible; }
  .cx-rail-titre { display: none; }
  .cx-rail-ligne { display: flex; gap: 8px; }
  .cx-rail-ligne > * { flex: 1; min-width: 0; }
}

.seul-mobile { display: none !important; } @media (max-width: 999px) { .cx-filtres a.seul-mobile { display: flex !important; } }

/* Téléphone : les six onglets visibles d'un coup (trois par ligne), filtres et pages sur un seul bandeau qui défile */
@media (max-width: 639px) {
  .cx-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; }
  .cx-tab { justify-content: center; padding: 0 6px; font-size: 13px; min-width: 0; }
  .cx-tab span:not(.cx-count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-tool span { display: none; }
}
.cx-filtres-groupe { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 999px) {
  .cx-filtres-groupe { flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .cx-filtres-groupe::-webkit-scrollbar { display: none; }
  .cx-filtres-groupe > .cx-filtres { display: contents; }
  .cx-filtres-groupe > .cx-filtres[hidden] { display: none; }
}

/* ========================================================================================================
 * Propre à la console de Younes (le reste de ce fichier est le kit, template/vanilla/kit.css du skill)
 * ======================================================================================================== */

/* Pont vers le contenu repris des deux tableaux (contenu.css) : leurs variables pointent sur les jetons du kit,
 * leurs couleurs de statut (--st-*) restent les leurs, déjà validées jour et nuit. */
.admin {
  --fond: var(--cx-bg);
  --carte: var(--cx-raised);
  --surface: var(--cx-raised);
  --texte: var(--cx-text);
  --texte-2: var(--cx-text);
  --discret: var(--cx-dim);
  --muet: var(--cx-faint);
  --ligne: var(--cx-line);
  --bord: var(--cx-line);
  --accent: var(--cx-accent);
  --accent-texte: var(--cx-accent-text);
  --accent-doux: var(--cx-accent-soft);
  --accent-bouton: var(--cx-accent-soft);
  --accent-sombre: var(--cx-accent-text);
  --champ: var(--cx-sunken);
  --bloc: var(--cx-sunken);
  --jeton: var(--cx-sunken);
  --jeton-bord: var(--cx-line);
  --lu: transparent;
  --a-voir: var(--cx-hover);
  --survol: var(--cx-hover);
  --survol-2: var(--cx-hover);
  --choisie: var(--cx-accent-soft);
  --sur-accent: var(--cx-accent-fg);
  --d-avatar: var(--cx-accent-soft);
  --avatar: var(--cx-accent);
  --avatar-texte: var(--cx-accent-fg);
  --icone: var(--cx-dim);
  --icone-2: var(--cx-dim);
  --btn-bord: var(--cx-line);
  --survol-bord: var(--cx-line);
}

/* La vue reprise (liste, fiche, pages) : le panneau `principal` de postule et lead, à l'allure d'une carte du kit. */
.admin .principal {
  margin: 0; min-height: 0; height: 100%; border: 1px solid var(--cx-line); border-radius: 0.75rem; background: var(--cx-panel);
  box-shadow: var(--cx-shadow); overflow: hidden; display: flex; flex-direction: column;
}
.admin.light .principal, html[data-theme="light"] .admin .principal { background: var(--cx-raised); }
.admin .principal .outils { border-bottom-color: var(--cx-line); }
.admin .principal .titre-vue { font-weight: 700; }
.admin .principal .detail, .admin .principal .l-page { flex: 1; min-height: 0; overflow-y: auto; }
.admin .btn { border-color: var(--cx-line); border-radius: 6px; }
.admin .btn.primaire { background: var(--cx-accent); color: var(--cx-accent-fg); border-color: transparent; }
.admin .pastille, .admin .jeton { border-radius: 5px; }
.admin dialog.resume { background: var(--cx-raised); color: var(--cx-text); border: 1px solid var(--cx-line); }
.admin dialog.resume::backdrop { background: var(--cx-scrim); }

/* --- À faire --------------------------------------------------------------- */
.af-liste { list-style: none; margin: 0; padding: 0; }
.af-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--cx-line); }
.af-ligne:first-child { border-top: 0; padding-top: 0; }
.af-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.af-type { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 5px; background: var(--cx-sunken); color: var(--cx-dim); font-size: 12px; font-weight: 600; white-space: nowrap; }
.af-type.v5 { background: var(--cx-accent); color: var(--cx-accent-fg); }
.af-type.v4 { background: var(--cx-accent-soft); color: var(--cx-accent-text); }
.af-qui { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.af-quoi { margin: 4px 0 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.af-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--cx-faint); font-variant-numeric: tabular-nums; }
.af-meta .retard { color: var(--cx-danger); font-weight: 600; }
.af-meta .bientot { color: var(--cx-warn); font-weight: 600; }
.af-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 720px) {
  .af-ligne { grid-template-columns: minmax(0, 1fr); }
  .af-actions { justify-content: flex-start; }
}
.af-auto { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .af-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .af-auto { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.af-auto li { padding: 10px 12px; border-radius: 8px; background: var(--cx-bot-soft); border: 1px solid var(--cx-bot-line); }
.af-auto b { display: block; font-size: 14px; }
.af-auto span { display: block; margin-top: 2px; font-size: 13px; color: var(--cx-dim); overflow-wrap: anywhere; }
.af-faits summary { cursor: pointer; font-size: 13px; color: var(--cx-dim); min-height: 36px; display: flex; align-items: center; }
.af-faits li { opacity: 0.7; }

/* --- Rendement --------------------------------------------------------------- */
.rd-entonnoir { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rd-entonnoir li { display: grid; grid-template-columns: minmax(96px, 9.5rem) minmax(0, 1fr) 3.5rem 3.5rem; align-items: center; gap: 10px; font-size: 14px; }
.rd-entonnoir .piste { height: 22px; border-radius: 4px; background: var(--cx-sunken); overflow: hidden; }
.rd-entonnoir .piste i { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--cx-bar); }
.rd-entonnoir li.fort .piste i { background: var(--cx-accent); }
.rd-entonnoir li.refus .piste i { background: var(--cx-danger-line); }
.rd-entonnoir .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-entonnoir .t { text-align: right; font-size: 12px; color: var(--cx-faint); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .rd-entonnoir li { grid-template-columns: minmax(80px, 7rem) minmax(0, 1fr) 2.8rem 2.8rem; gap: 6px; font-size: 13px; } }
.rd-table-boite { overflow-x: auto; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.rd-table th, .rd-table td { padding: 7px 8px; border-bottom: 1px solid var(--cx-line); text-align: right; white-space: nowrap; }
.rd-table th:first-child, .rd-table td:first-child { text-align: left; white-space: normal; min-width: 7rem; }
.rd-table thead th { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--cx-dim); }
.rd-table td.zero { color: var(--cx-faint); }
.rd-table td.bon { color: var(--cx-ok); font-weight: 700; }
.rd-table tfoot td, .rd-table tfoot th { font-weight: 700; border-bottom: 0; }
.rd-semaines { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 18px; border-bottom: 1px solid var(--cx-line); }
.rd-semaine { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 2px; cursor: default; }
.rd-semaine .b { border-radius: 4px 4px 0 0; background: var(--cx-bar); min-height: 0; }
.rd-semaine .r { border-radius: 4px 4px 0 0; background: var(--cx-accent); }
.rd-semaine:hover .b, .rd-semaine:focus-visible .b { background: var(--cx-accent-line); }
.rd-axe { display: flex; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--cx-faint); }
.rd-axe span { flex: 1; min-width: 0; text-align: center; overflow: hidden; white-space: nowrap; }
.rd-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12px; color: var(--cx-dim); }
.rd-legende i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.rd-legende i.b { background: var(--cx-bar); }
.rd-legende i.r { background: var(--cx-accent); }
.rd-bulle { position: absolute; z-index: 5; top: 0; padding: 8px 10px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-raised); font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); pointer-events: none; }
.rd-bulle b { display: block; margin-bottom: 2px; }

/* --- Nouveau lead ------------------------------------------------------------ */
.nl { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.nl textarea, .nl input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-sunken); color: var(--cx-text);
  font: inherit; font-size: 16px; line-height: 1.5;
}
@media (min-width: 640px) { .nl textarea, .nl input { font-size: 14px; } }
.nl textarea { min-height: 180px; resize: vertical; }
.nl label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--cx-dim); }
.nl-etapes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nl-etapes li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--cx-line); font-size: 12px; color: var(--cx-faint); }
.nl-etapes li[aria-current="step"] { border-color: var(--cx-accent-line); background: var(--cx-accent-soft); color: var(--cx-accent-text); font-weight: 600; }
.nl-etapes li.fait { color: var(--cx-dim); }
.nl-brouillon { padding: 14px 16px; border-radius: 10px; background: var(--cx-sunken); white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }

/* Moteur en service (Coûts) */
.mt-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.mt-nom { font-size: 20px; font-weight: 700; }
.mt-raison { margin: 6px 0 0; font-size: 14px; color: var(--cx-dim); }
.af-intro { margin-bottom: 12px; }
/* Pays (Prospection) : un point de couleur par pays, comme dans lead */
.pays-seg button { display: inline-flex; align-items: center; gap: 6px; }
.pays-seg .pays-point { width: 8px; height: 8px; border-radius: 50%; background: var(--pays-X, var(--cx-faint)); }
.pays-seg .pays-FR .pays-point, .pays-seg button.pays-FR .pays-point { background: var(--pays-FR); }
.pays-seg button.pays-BE .pays-point { background: var(--pays-BE); }
.pays-seg button.pays-CH .pays-point { background: var(--pays-CH); }
.pays-seg .pays-n { color: var(--cx-faint); font-weight: 500; }
#pays-filtre .cx-seg { width: 100%; }
#pays-filtre .cx-seg button { flex: 1; justify-content: center; }
/* Coûts : la page reprise de postule et le bloc de lead dans des cartes à hauteur naturelle */
.admin .principal.couts-postule { height: auto; overflow: visible; }
.admin .principal.couts-postule .detail { overflow: visible; }
.couts-lead { padding: 0; overflow: visible; }
.nl-ok { color: var(--cx-ok); }
.rd-outils { display: flex; padding: 4px 0 8px; background: var(--cx-bg); }
.rd-note { margin-top: 12px; }
@media (min-width: 1000px) { .cx-rail-ligne { display: flex; flex-direction: column; gap: 8px; } .cx-rail-ligne > .cx-btn { width: 100%; } }
#pays-filtre .cx-seg { flex-wrap: wrap; overflow: visible; }
#pays-filtre .cx-seg button { flex: 1 1 calc(50% - 4px); }
.cx-lien { color: var(--cx-accent-text); overflow-wrap: anywhere; text-underline-offset: 2px; }
@media (max-width: 999px) { #pays-filtre .cx-seg { flex-wrap: nowrap; } #pays-filtre .cx-seg button { flex: 1 1 0; padding: 0 6px; } }
@media (max-width: 639px) { .pays-seg .pays-n { display: none; } }
.rd-basse { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--cx-warn-soft); color: var(--cx-warn); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.cx-banner.danger svg { flex-shrink: 0; }
.cx-banner .af-alerte { flex: 1 1 18rem; min-width: 0; color: var(--cx-text); overflow-wrap: anywhere; }
.cx-pile > .cx-banner { margin-bottom: 0; }
.mt-ko { color: var(--cx-danger); font-weight: 600; }
.admin .f-suite { margin: 4px 0 0; font-size: 13px; color: var(--cx-dim); }
/* Téléphone : le champ de recherche prend la ligne, le bouton voisin n'en garde que l'icône */
@media (max-width: 639px) {
  .cx-rail-ligne > .cx-btn { flex: 0 0 auto; min-width: 44px; padding: 0 12px; }
  .cx-rail-ligne > .cx-btn .lib-btn { display: none; }
}
.nl-deux { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .nl-deux { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.nl .nl-case { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--cx-text); }
.nl .nl-case input { width: 18px; height: 18px; accent-color: var(--cx-accent); flex-shrink: 0; }
.nl-titre { margin: 0; font-size: 20px; }
.nl-depart { font-size: 14px; color: var(--cx-text); }
.nl-essai { margin-left: 6px; }
.admin tr.nl-courant td { background: var(--cx-accent-soft); }
.nl input[readonly], .nl textarea[readonly] { opacity: 0.75; }

/* --- Envois par jour (accueil, 11/11/2026) : js/onglets/envois-jour.js -------------------------------------- */
/* Candidatures : famille froide (bleu, sarcelle, indigo) plus l'ambre des relances et le vert des réponses ;
   prospection : la famille violette « bot » et un rose. Chaque couleur garde un contraste lisible dans les deux modes. */
.admin {
  --ej-c1: #38bdf8; --ej-c2: #2dd4bf; --ej-c3: #818cf8; --ej-c4: #fbbf24; --ej-c5: #4ade80;
  --ej-p1: #a78bfa; --ej-p2: #f472b6;
}
.admin.light, html[data-theme="light"] .admin {
  --ej-c1: #0369a1; --ej-c2: #0f766e; --ej-c3: #4f46e5; --ej-c4: #b45309; --ej-c5: #15803d;
  --ej-p1: #7c3aed; --ej-p2: #be185d;
}
.ej-c1 { fill: var(--ej-c1); background: var(--ej-c1); } .ej-c2 { fill: var(--ej-c2); background: var(--ej-c2); }
.ej-c3 { fill: var(--ej-c3); background: var(--ej-c3); } .ej-c4 { fill: var(--ej-c4); background: var(--ej-c4); }
.ej-c5 { fill: var(--ej-c5); background: var(--ej-c5); } .ej-p1 { fill: var(--ej-p1); background: var(--ej-p1); }
.ej-p2 { fill: var(--ej-p2); background: var(--ej-p2); }
.ej .cx-stats { margin-top: 12px; }
.ej-epitech { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--cx-line);
  border-radius: 8px; background: var(--cx-ok-soft); font-size: 13px; line-height: 1.45; color: var(--cx-text); }
.ej-epitech svg { flex-shrink: 0; margin-top: 1px; color: var(--cx-ok); }
.ej .cx-banner { margin-bottom: 0; }
.ej-legendes { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 16px 0 4px; }
.ej-legende { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--cx-dim); }
.ej-legende li { display: inline-flex; align-items: center; gap: 6px; }
.ej-legende i, .ej-bl i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ej-graphe { position: relative; margin-top: 4px; min-height: 120px; touch-action: pan-y; border-radius: 6px; }
.ej-svg { display: block; overflow: visible; }
.ej-titre { font-size: 12px; font-weight: 600; fill: var(--cx-dim); }
.ej-max, .ej-date { font-size: 11px; fill: var(--cx-faint); font-variant-numeric: tabular-nums; }
.ej-base { stroke: var(--cx-line); stroke-width: 1; }
.ej-survol { fill: var(--cx-hover); transition: opacity 80ms; }
.ej-bulle { position: absolute; z-index: 5; min-width: 13rem; max-width: min(19rem, 100%); padding: 8px 10px; border: 1px solid var(--cx-line);
  border-radius: 8px; background: var(--cx-raised); box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); font-size: 12px; line-height: 1.5; pointer-events: none; }
.ej-bulle b { display: block; margin-bottom: 2px; font-size: 13px; }
.ej-bl { display: flex; align-items: center; gap: 6px; }
.ej-boites { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--cx-line); color: var(--cx-dim); }
.ej-boites.alerte { color: var(--cx-danger); font-weight: 600; }
.ej-etat { margin-top: 12px; }
.ej-etat b { color: var(--cx-text); font-weight: 600; }
.ej-detail { margin-top: 12px; }
.ej-detail summary { display: flex; align-items: center; min-height: 36px; cursor: pointer; font-size: 13px; color: var(--cx-dim); }
.ej-detail summary:hover { color: var(--cx-text); }
.ej-table-boite { overflow-x: auto; border: 1px solid var(--cx-line); border-radius: 8px; }
.ej-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ej-table th, .ej-table td { padding: 6px 8px; border-bottom: 1px solid var(--cx-line); text-align: right; white-space: nowrap; }
.ej-table thead th { position: sticky; top: 0; background: var(--cx-sunken); color: var(--cx-dim); font-weight: 600; }
.ej-table th[scope="row"], .ej-table thead th:first-child { text-align: left; font-weight: 500; color: var(--cx-text); }
.ej-table td.zero { color: var(--cx-faint); }
.ej-table tr.alerte td, .ej-table tr.alerte th { background: var(--cx-danger-soft); color: var(--cx-danger); }
.ej-table tr.ancien td:last-child { color: var(--cx-warn); font-weight: 600; }
.ej-table tbody tr:last-child th, .ej-table tbody tr:last-child td { border-bottom: 0; }
.ej-fuseau { margin-top: 10px; font-size: 12px; }
