/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================================
   ROSTER — système visuel. Sombre, dense, un accent (iris). La vie vient de
   l'ÉTAT des agents (pastilles de statut), pas de la décoration.
   ============================================================================ */
@import url("https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* canvas & surfaces */
  --canvas: #0b0d10;
  --surface: #101318; /* rail, nav */
  --surface-2: #161a20; /* cartes, composer, contexte */
  --surface-3: #1c2129; /* hover, inputs */
  --line: #242a33;
  --line-soft: #1a1f27;

  /* texte */
  --text: #e8ebf1;
  --muted: #8b93a1;
  --faint: #5c6571;

  /* accent UNIQUE (iris) — parcimonie : actif, focus, envoi, login */
  --accent: #6e72f0;
  --accent-press: #595ee2;
  --accent-soft: rgba(110, 114, 240, 0.14);

  /* STATUTS (orthogonaux à l'accent — le code signature) */
  --st-work: #35c28b; /* au travail */
  --st-wait: #e5a23b; /* t'attend */
  --st-idle: #6b7280; /* dispo */
  --st-fail: #f26d6d; /* échec */

  /* alias pour la page pilotage (réutilise les mêmes tokens) */
  --bg: var(--canvas);
  --panel: var(--surface-2);
  --fg: var(--text);
  --ok: var(--st-work);
  --err: var(--st-fail);
  --accent-color: var(--accent);

  --font-sans: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 9px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--accent-soft);
}
button {
  font-family: inherit;
}
code,
.mono {
  font-family: var(--font-mono);
}

/* ============================================================================
   COQUILLE 3 colonnes + rail de contexte
   ============================================================================ */
/* cadre app : barre du haut (auth) + corps qui remplit le reste de l'écran */
.app-frame {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.app-body {
  flex: 1 1 auto;
  min-height: 0;
}
.app-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.app-topbar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.app-topbar .ent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.app-topbar .ent select {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
}
.app-topbar .topbar-spacer {
  flex: 1 1;
}
.app-topbar .who {
  color: var(--muted);
}
.app-topbar .topbar-logout {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font: inherit;
}
.app-topbar .topbar-logout:hover {
  background: var(--surface-2);
}

/* écran plein (chargement / redirection / login) */
.auth-screen {
  height: 100vh;
  display: grid;
  place-items: center;
  background: var(--canvas);
  color: var(--muted);
  padding: 24px;
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 340px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  color: var(--text);
}
/* Écran « entreprise en attente d'activation » / accueil sans entreprise (Lot D). */
.pending-screen {
  max-width: 520px;
  margin: 64px auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  color: var(--text);
  text-align: center;
}
.pending-screen h2 {
  margin: 0 0 10px;
}
.pending-screen p {
  color: var(--muted);
  line-height: 1.5;
}
.create-company {
  display: flex;
  align-items: center; /* jamais d'étirement vertical de l'input (align-items:stretch par défaut) */
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.create-company input {
  flex: 1 1 220px;
  max-width: 280px;
  height: 38px; /* hauteur EXPLICITE : robuste quel que soit le contexte flex parent */
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.create-company button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #4f46e5);
  color: #fff;
  cursor: pointer;
}
.create-company button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Tableau de bord « Mes entreprises » (Lot D redesign). */
.companies-home {
  max-width: 760px;
  margin: 52px auto;
  padding: 0 24px;
  color: var(--text);
}
.companies-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.companies-head p {
  color: var(--muted);
  margin: 0 0 22px;
}
.companies-grid {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.company-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.company-card.is-pending {
  opacity: 0.9;
}
.company-name {
  font-weight: 600;
  font-size: 15px;
}
.company-open {
  align-self: flex-start;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #4f46e5);
  color: #fff;
  cursor: pointer;
}
.company-badge {
  align-self: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}
.companies-add {
  height: 40px;
  padding: 0 18px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.companies-create {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.companies-create h2 {
  margin: 0 0 6px;
  font-size: 16px;
}
.companies-muted {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 13.5px;
}
.companies-create .create-company {
  justify-content: flex-start;
  margin-top: 4px;
}

/* Bouton « + nouvelle entreprise » dans la TopBar + modale de création. */
.ent-add {
  height: 28px;
  width: 28px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 24px;
}
.modal-card {
  width: 400px;
  max-width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  color: var(--text);
}
.modal-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.modal-close {
  margin-top: 14px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

/* Cellule centrale (bandeau clé LLM + vue) + page Paramètres (Mode A, M4). */
.center-cell {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.center-cell > *:last-child {
  flex: 1 1;
  min-height: 0;
}
.llm-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(190, 130, 30, 0.16);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13.5px;
}
.llm-banner button {
  margin-left: auto;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #4f46e5);
  color: #fff;
  cursor: pointer;
}
.settings-view {
  overflow: auto;
  padding: 28px 32px;
}
.settings-view h1 {
  margin: 0 0 18px;
  font-size: 20px;
}
.settings-card {
  max-width: 560px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
}
.settings-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.settings-muted {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.settings-badge-ok {
  color: #4ade80;
}
.settings-badge-warn {
  color: #fbbf24;
}
.settings-ok {
  color: #4ade80;
  font-size: 13px;
  margin: 0 0 10px;
}
.settings-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-form input {
  flex: 1 1 240px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.settings-form button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #4f46e5);
  color: #fff;
  cursor: pointer;
}
.settings-form button:disabled {
  opacity: 0.5;
  cursor: default;
}
.settings-hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 12px 0 0;
}
.settings-card + .settings-card {
  margin-top: 16px;
}
.settings-card > button {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #6e72f0);
  color: #fff;
  cursor: pointer;
}
.settings-activate {
  height: 32px !important;
  padding: 0 14px !important;
  margin: 0 0 12px;
  background: transparent !important;
  color: var(--accent, #6e72f0) !important;
  border: 1px solid var(--accent, #6e72f0) !important;
  font-size: 13px;
}
.settings-hint code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}

/* Modal-notice CGU (consentement Mode B) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-card {
  max-width: 460px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.modal-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.modal-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin: 14px 0 18px;
  cursor: pointer;
}
.modal-consent input {
  margin-top: 2px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-actions button {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #6e72f0);
  color: #fff;
  cursor: pointer;
}
.modal-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Magasin d'agents (Recruter) ─────────────────────────────────────────── */
.recruit-view {
  overflow: auto;
  padding: 28px 32px;
}
.recruit-view h1 {
  margin: 0 0 6px;
  font-size: 20px;
}
.recruit-muted {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}
.recruit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-gap: 14px;
  gap: 14px;
  max-width: 780px;
}
.recruit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}
.recruit-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recruit-card-name {
  font-size: 14.5px;
  font-weight: 600;
}
.recruit-card-role {
  color: var(--muted);
  font-size: 12.5px;
}
.recruit-btn {
  margin-top: 2px;
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #6e72f0);
  color: #fff;
  cursor: pointer;
}
.recruit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.recruit-form input {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.recruit-actions {
  display: flex;
  gap: 8px;
}
.recruit-actions button {
  flex: 1 1;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #6e72f0);
  color: #fff;
  cursor: pointer;
}
.recruit-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}
.recruit-cancel {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
}
.recruit-err {
  color: #f87171;
  font-size: 12px;
}
.recruit-done {
  color: #4ade80;
  font-size: 13px;
}

/* Empty-state : équipe vide → CTA magasin */
.empty-team {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
}
.empty-team-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent, #6e72f0);
  margin-bottom: 4px;
}
.empty-team h2 {
  margin: 0;
  font-size: 17px;
}
.empty-team p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.empty-team button {
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent, #6e72f0);
  color: #fff;
  cursor: pointer;
}
.login-card h1 {
  margin: 0;
  font-size: 22px;
}
.login-card .login-sub {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.login-card input {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}
.login-card button {
  margin-top: 4px;
  background: var(--iris, #6b7cff);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.login-card button:disabled {
  opacity: 0.6;
  cursor: default;
}
.login-card .login-err {
  background: #3a1d22;
  border: 1px solid #c0392b;
  color: #ffb4ad;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
}
.login-card .login-hint {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}
.login-card .login-hint code {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.app {
  display: grid;
  grid-template-columns: 60px 268px minmax(0, 1fr) 320px;
  /* le rang remplit l'écran ET autorise le scroll interne des colonnes (minmax(0,…)) */
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}
/* sans rail de contexte (vue Pilotage / canal) → 3 colonnes */
.app.no-ctx {
  grid-template-columns: 60px 268px minmax(0, 1fr);
}

/* board pilotage embarqué : corps scrollable sous l'en-tête .center */
.board {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 22px 28px;
}
.board .panel:first-of-type {
  margin-top: 14px;
}

/* vue centrale d'attente */
.placeholder {
  flex: 1 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 40px;
}

/* ── rail d'icônes (sections) ─────────────────────────────────────────────── */
.rail {
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
}
.rail-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--accent), #8b7bff);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
  box-shadow: 0 4px 14px rgba(110, 114, 240, 0.35);
}
.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rail-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.rail-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.rail-spacer {
  flex: 1 1;
}
.rail-me {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── colonne de navigation ────────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.nav-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav-head .chev {
  color: var(--faint);
}
.nav-section {
  padding: 14px 8px 4px;
}
.nav-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
}
.nav-item .ico {
  color: var(--faint);
  flex: none;
}
.nav-item.active .ico {
  color: var(--accent);
}
.nav-item .grow {
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item .role {
  color: var(--faint);
  font-size: 12px;
}

/* agent dans la nav : avatar + statut + badge */
.agent-row {
  gap: 10px;
}
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--st-wait);
  color: #1a1206;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ── pastilles de STATUT ──────────────────────────────────────────────────── */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.dot-work {
  background: var(--st-work);
  box-shadow: 0 0 0 3px rgba(53, 194, 139, 0.16);
}
.dot-wait {
  background: var(--st-wait);
  box-shadow: 0 0 0 3px rgba(229, 162, 59, 0.18);
}
.dot-idle {
  background: var(--st-idle);
}
.dot-fail {
  background: var(--st-fail);
  box-shadow: 0 0 0 3px rgba(242, 109, 109, 0.18);
}

/* avatar monogramme */
.avatar {
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  flex: none;
  border: 1px solid var(--line);
}
.avatar.accent {
  background: var(--accent-soft);
  color: #b9bbff;
  border-color: transparent;
}
.avatar-wrap {
  position: relative;
  flex: none;
}
.avatar-wrap .dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--surface);
  width: 11px;
  height: 11px;
}

/* ============================================================================
   ZONE CENTRALE — conversation
   ============================================================================ */
.center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%; /* remplit le rang (grille) OU le wrapper 100vh (/pilotage) */
  min-height: 0; /* autorise .thread/.board à scroller au lieu de pousser le composer hors champ */
  background: var(--canvas);
}
.conv-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.conv-head .who {
  font-weight: 600;
  font-size: 15px;
}
.conv-head .who .role {
  color: var(--faint);
  font-weight: 400;
  font-size: 13px;
  margin-left: 6px;
}
.conv-head .st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  margin-left: 2px;
}
.conv-head .spacer {
  flex: 1 1;
}
.conv-head .hbtn {
  color: var(--faint);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 7px;
}
.conv-head .hbtn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.thread {
  flex: 1 1;
  min-height: 0; /* clé du scroll : sans ça, le fil pousse le composer hors écran */
  overflow-y: auto;
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* ancrage BAS (convention chat) : conversation courte → collée au composer, vide en haut.
   Quand ça déborde, la marge auto retombe à 0 → scroll normal. */
.thread > :first-child {
  margin-top: auto;
}

.msg {
  display: flex;
  gap: 11px;
}
.msg-main {
  min-width: 0;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.msg-name {
  font-weight: 600;
  font-size: 14px;
}
.msg-time {
  color: var(--faint);
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.rebond-badge {
  font-size: 10.5px;
  color: var(--st-wait);
  border: 1px solid var(--st-wait);
  border-radius: 6px;
  padding: 0 5px;
  line-height: 15px;
}
.msg-body {
  color: #d6dae2;
  white-space: pre-wrap;
}
/* REBOND : RATTACHÉ à la discussion (réaction, pas nouveau sujet) → retrait + filet à gauche */
.msg-rebond {
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px solid var(--st-wait);
}
.rebond-context {
  color: var(--faint);
  font-size: 11.5px;
  font-style: italic;
  margin-bottom: 3px;
}

/* ligne d'événement système discrète dans le fil */
.sysline {
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
  margin: 2px 0;
}
/* ligne d'ÉCHEC — rouge + encadrée, pour qu'un échec (y compris async, poussé par SSE) soit VU, pas discret */
.errorline {
  color: var(--err);
  font-size: 12.5px;
  text-align: center;
  margin: 6px auto;
  max-width: 560px;
  padding: 6px 12px;
  border: 1px solid var(--st-fail);
  border-radius: var(--radius);
}
.nav-empty,
.ctx-empty {
  color: var(--faint);
  font-size: 12.5px;
  padding: 2px 8px;
}

/* carte d'action INLINE (la clarification) — accent ambre = "t'attend" */
.action-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-wait);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 13px 15px;
  max-width: 560px;
}
.action-card .ac-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--st-wait);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.action-card .ac-q {
  color: var(--text);
  margin-bottom: 12px;
}
.action-card .ac-q .quote {
  color: var(--muted);
}
.ac-reply {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ac-reply input {
  flex: 1 1;
}

/* carte de PROPOSITION (planning/provisioning) : issues + avis tech, validée au fil */
.action-card .prop-issues {
  margin: 2px 0 10px;
  padding-left: 18px;
  color: #d6dae2;
}
.action-card .prop-issues li {
  margin: 2px 0;
}
.action-card .prop-tech {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 12px;
}
.action-card .prop-tech-h {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.action-card .prop-obs {
  margin-top: 2px;
}

/* composer riche */
.composer {
  flex: none;
  padding: 12px 20px 18px;
}

/* chip projet (sélecteur /) — tu vois le NOM, l'id reste en coulisse */
.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 3px 8px;
  margin-bottom: 8px;
}
.proj-chip button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
}
.proj-chip button:hover {
  color: var(--text);
}

/* menu de complétion @ / / (au-dessus du composer) */
.composer-box {
  position: relative;
}
.mention-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.mention-item:hover,
.mention-item.active {
  background: var(--accent-soft);
}
.mi-sigil {
  color: var(--accent);
  font-family: var(--font-mono);
  width: 16px;
  text-align: center;
  flex: none;
}
.composer-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.12s;
}
.composer-box:focus-within {
  border-color: var(--accent);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
}
.ctool {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}
.ctool:hover {
  background: var(--surface-3);
  color: var(--text);
}
.ctool-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.ctool-chip b {
  color: var(--accent);
  font-weight: 600;
}
.composer-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 9px 11px;
}
.composer-input textarea {
  flex: 1 1;
  background: transparent;
  border: 0;
  color: var(--text);
  resize: none;
  font: inherit;
  outline: none;
  max-height: 160px;
}
.send {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: filter 0.12s, opacity 0.12s;
}
.send:hover {
  filter: brightness(1.08);
}
.send:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ============================================================================
   RAIL DE CONTEXTE (droite) — la spécificité Roster
   ============================================================================ */
.ctx {
  background: var(--surface);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 16px 24px;
}
.ctx h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
}
.ctx .ctx-sub {
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 16px;
}
.ctx-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 18px 0 8px;
}
.mission {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  margin-bottom: 7px;
}
.mission .mid {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.mission .mphase {
  color: var(--faint);
  font-size: 12px;
  margin-left: auto;
}
.ctx-wait {
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-wait);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 11px 12px;
}
.cw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}
.cw-hint {
  color: var(--faint);
  font-size: 12px;
  margin-top: 6px;
}

/* boutons partagés (utilisés ici ET dans la page pilotage) */
.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 13px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: filter 0.12s;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn-danger {
  background: transparent;
  border: 1px solid var(--st-fail);
  color: var(--st-fail);
}
.btn-ghost {
  background: var(--surface-3);
  color: var(--text);
}
.btn-small {
  padding: 4px 10px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}

/* inputs partagés */
input,
textarea,
select {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================================
   PAGE PILOTAGE (/pilotage) — mêmes tokens, look cohérent
   ============================================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  grid-gap: 14px;
  gap: 14px;
}
form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 18px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.cols form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
table.wf-list {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.wf-list th,
.wf-list td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.wf-list th {
  color: var(--muted);
  font-weight: 600;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field {
  display: flex;
  gap: 10px;
}
.field .k {
  color: var(--muted);
  min-width: 150px;
  font-size: 13px;
}
.field .v {
  flex: 1 1;
}
.field ul {
  margin: 4px 0;
  padding-left: 18px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.revise {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}
.status {
  margin: 12px 0;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.status.ok {
  background: rgba(53, 194, 139, 0.16);
  border: 1px solid var(--st-work);
}
.status.err {
  background: rgba(242, 109, 109, 0.16);
  border: 1px solid var(--st-fail);
}
.err-text {
  color: var(--st-fail);
  font-size: 14px;
}

/* Suivi de mission en direct (2b) — timeline des jalons (SSE) */
.mission-timeline { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.mission-timeline .mtl-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.mission-timeline ol { list-style: none; margin: 0; padding: 0; }
.mission-timeline li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-left: 2px solid var(--line); padding-left: 10px; }
.mission-timeline li.mtl-fin { border-left-color: var(--iris, #6b7cff); }
.mission-timeline .mtl-phase { font-weight: 600; min-width: 120px; }
.mission-timeline .mtl-detail { color: var(--muted); font-size: 13px; }

/* Bouton « Arrêter » (terminate) — intervention sur un workflow en cours (pilotage) */
.terminate-btn { margin-top: 12px; background: #3a1d22; color: #ffb4ad; border: 1px solid #c0392b;
  border-radius: 7px; padding: 7px 14px; cursor: pointer; font: inherit; }
.terminate-btn:hover { background: #4a242a; }

