/* =====================================================================
   ATELIER 360 — PAGE AGENTS
   Reprend fidèlement la capsule « Agent » du logiciel (page /equipe) :
   - Présentation · Comprendre : 3 onglets (En équipe / En solo / Léo veille)
   - L'organisation : Organigramme (avatars) + Constellation
   Grammaire glow identique à AgentsConstellation / AgentFamiliesExplain.
   ===================================================================== */

/* ---------- Encart type « TabbedCard » ---------- */
.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated-2);
  flex-wrap: wrap;
}
.panel__intro {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex: 1;
  min-width: 220px;
  line-height: 1.5;
  margin: 0;
}
.panel__intro strong { color: var(--text); font-weight: 600; }
.panel__intro .c-cyan { color: #67e8f9; }
.panel__intro .c-amber { color: #fcd34d; }
.panel__intro .c-em { color: #6ee7b7; }
.panel__intro .c-vi { color: #c4b5fd; }

/* Onglets : trait dessous (comme le logiciel) */
.tabs { display: inline-flex; align-items: center; gap: 1.4rem; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 2rem;
  padding: 0 .15rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text-body); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.tab svg { width: 14px; height: 14px; }

.panel__body { padding: 1.5rem; }
.view { display: none; }
.view.is-active { display: block; }

/* Légende sous schéma */
.sch-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  flex-wrap: wrap;
}
.sch-caption .c-em { color: #6ee7b7; }
.sch-caption .c-cyan { color: #67e8f9; }
.sch-caption .c-amber { color: #fcd34d; }
.sch-caption .c-slate { color: #cbd5e1; }
.sch-caption .c-red { color: #fca5a5; }
.sch-caption svg { width: 13px; height: 13px; color: #38bdf8; }

/* ---------- Scène schéma (glow, fond étoilé) ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 880px;
  aspect-ratio: 880 / 500;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: radial-gradient(60% 50% at 50% 40%, rgba(99,102,241,.10), transparent 70%);
}
.stage--wide { aspect-ratio: 900 / 520; max-width: 900px; }
.stars {
  position: absolute; inset: 0; opacity: .30; pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,.08) 1px, transparent 1px),
    radial-gradient(circle at 82% 58%, rgba(255,255,255,.06) 1px, transparent 1px),
    radial-gradient(circle at 48% 82%, rgba(255,255,255,.05) 1px, transparent 1px),
    radial-gradient(circle at 68% 18%, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 120px 120px, 90px 90px, 150px 150px, 100px 100px;
}
.stage > svg.edges { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Orbes */
.orb {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  width: 160px;
}
.orb__disc {
  position: relative;
  border-radius: 50%;
  border: 2px solid;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px -2px var(--oh);
  animation: orb-pulse 3s ease-in-out infinite;
}
@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 14px -3px var(--oh); }
  50% { box-shadow: 0 0 26px -2px var(--oh); }
}
@media (prefers-reduced-motion: reduce) { .orb__disc { animation: none; } }
.orb__disc::before {
  content: "";
  position: absolute; inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--oh3), transparent 70%);
  pointer-events: none; z-index: -1;
}
.orb__disc svg { width: 62%; height: 62%; }
.orb__name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.1; }
.orb__role { font-size: 11px; font-weight: 600; line-height: 1.1; }
.orb--mini .orb__disc { border-width: 1px; box-shadow: 0 0 10px -2px var(--oh); }
.orb--mini .orb__name { display: none; }
.tools-pill {
  margin-top: .3rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .55rem;
  border-radius: var(--r-pill);
  border: 1px solid;
}
.tools-pill svg { width: 12px; height: 12px; }

/* Label de lien */
.elabel {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: .15rem .45rem;
  height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  background: rgba(7, 7, 7, .78);
}

/* ---------- Organigramme ---------- */
.org { container-type: inline-size; }
.org-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 1.6rem 0 1.2rem;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
  color: var(--text-muted);
}
.org-hint svg { width: 13px; height: 13px; }
.org-sep { height: 1px; width: 85%; background: var(--border); margin: 1.5rem auto; }
.vline { width: 1px; background: rgba(255,255,255,.15); margin: 0 auto; }
.vline--md { height: 1.7rem; }

.org-center { display: flex; flex-direction: column; align-items: center; }
.org-bus {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-top: 1.4rem;
}
.org-bus::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.15); transform: translateX(-50%); }
.org-bus::after { content: ""; position: absolute; left: 25%; right: 25%; top: 0; height: 1px; background: rgba(255,255,255,.15); }
.org-cell { position: relative; }
.org-cell::before { content: ""; position: absolute; left: 50%; top: -1.4rem; width: 1px; height: 1.4rem; background: rgba(255,255,255,.15); transform: translateX(-50%); }

.division {
  border: 1px solid var(--border);
  border-top-width: 2px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.02);
  padding: 1rem;
}
.div-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .9rem; }
.div-ico { width: 36px; height: 36px; border-radius: 10px; border: 1px solid; display: grid; place-items: center; }
.div-ico svg { width: 18px; height: 18px; }
.div-title { font-size: 14px; font-weight: 600; color: var(--text); }
.div-count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.div-tag { font-size: 11px; font-weight: 600; }

.org-nodes { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.org-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  text-align: center;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .7rem .6rem;
  min-width: 108px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.org-node:hover { background: rgba(255,255,255,.07); border-color: var(--border-strong); }
.org-node--big { padding: 1rem 1.2rem; min-width: 170px; position: relative; }
.crown {
  position: absolute; top: -10px; right: -10px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(16,185,129,.20);
  border: 1px solid rgba(52,211,153,.5);
  display: grid; place-items: center;
}
.crown svg { width: 12px; height: 12px; color: #6ee7b7; }

/* Avatar */
.ava {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: #1a1d27;
  box-shadow: inset 0 -8px 16px -8px rgba(0,0,0,.35), var(--shadow-sm);
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava--eddy {
  width: clamp(50px, 6cqi, 58px); height: clamp(50px, 6cqi, 58px);
  display: grid; place-items: center;
  background: linear-gradient(135deg, #6ee7b7, #34d399);
  color: #06281c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.ava--node { width: clamp(40px, 5cqi, 50px); height: clamp(40px, 5cqi, 50px); }
.ava--metier { width: clamp(44px, 8cqi, 72px); height: clamp(44px, 8cqi, 72px); }
.pdot {
  position: absolute; bottom: -1px; right: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid #11141d;
}
.pdot--live { background: #34d399; animation: pdot 2s infinite; }
.pdot--dormant { background: #94a3b8; }
@keyframes pdot {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); }
  70% { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
@media (prefers-reduced-motion: reduce) { .pdot--live { animation: none; } }

.org-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--text-muted); }
.org-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.15; }
.org-name--big { font-size: 15px; }
.org-role { font-size: 11px; color: var(--text-muted); line-height: 1.25; max-width: 130px; }

/* Métier — sections */
.metier-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; }
.metier-sec { margin-bottom: 1.1rem; }
.metier-sec-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.metier-sec-head svg { width: 14px; height: 14px; }
.metier-sec-title { font-size: 12px; font-weight: 500; color: var(--text-body); }
.metier-sec-count { font-size: 11px; color: var(--text-muted); }
.metier-sec-rule { flex: 1; height: 1px; background: var(--border); margin-left: .4rem; }
.fluid-card {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  text-align: center; padding: .6rem .3rem;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: rgba(255,255,255,.03);
  transition: background var(--t-fast);
}
.fluid-card:hover { background: rgba(255,255,255,.06); }
.fluid-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.fluid-role {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ---------- Légende constellation ---------- */
.const-legend {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 12px; font-weight: 500;
}
.const-legend span { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .org-bus { grid-template-columns: 1fr; }
  .org-bus::before, .org-bus::after, .org-cell::before { display: none; }
  .metier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
