:root {
  --bg: #050506;
  --panel: rgba(18, 18, 22, 0.78);
  --panel-strong: rgba(9, 9, 12, 0.92);
  --text: #f1f5f9;
  --muted: #97a3b8;
  --accent: #b72734;
  --gold: #d6b15f;
  --cyan: #75dfff;
  --good: #46c78b;
  --warn: #d69a4b;
  --error: #ff6479;
  --border: rgba(183, 39, 52, 0.32);
}
.hidden { display: none !important; }
* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Space Grotesk", "Montserrat", sans-serif;
  background:
    radial-gradient(circle at 14% 14%, rgba(183, 39, 52, 0.18), transparent 38%),
    radial-gradient(circle at 86% 86%, rgba(214, 177, 95, 0.10), transparent 42%),
    #050506;
  color: var(--text);
  position: relative;
}
#cc-bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#cc-loading-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(117, 223, 255, 0.26);
  background: rgba(6, 12, 26, 0.92);
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  box-shadow: 0 10px 30px rgba(0,0,0,.26);
}
.shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; min-width: 0; }
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(5, 5, 6, 0.94);
  backdrop-filter: blur(14px);
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 2;
}
.brand {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(183,39,52,.14), rgba(214,177,95,.08));
}
.brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: .06em;
  font-weight: 700;
}
.brand small { color: var(--muted); }
.nav { margin-top: 18px; display: grid; gap: 10px; }
.sidebar-section { margin-top: 14px; }
.nav-btn {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s ease;
  display: grid;
  gap: 4px;
}
.nav-btn small { color: var(--muted); font-size: .68rem; font-weight: 500; line-height: 1.35; }
.nav-btn:hover { border-color: rgba(214,177,95,.42); transform: translateY(-1px); }
.nav-btn.active {
  border-color: rgba(214,177,95,.75);
  background: linear-gradient(135deg, rgba(183,39,52,.24), rgba(214,177,95,.10));
  box-shadow: 0 0 24px rgba(183,39,52,.16);
}
.nav-btn.active small { color: #dfe9f6; }
.main { padding: 24px; min-width: 0; overflow-x: hidden; position: relative; z-index: 1; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow {
  color: var(--muted);
  margin: 0;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-family: "JetBrains Mono", monospace;
}
h1 { margin: 6px 0 0; font-size: clamp(1.5rem, 2vw, 2rem); }
h2 { margin: 0; }
.actions { display: flex; gap: 10px; align-items: center; }
.weather-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  gap: 1px;
  min-width: 140px;
}
.weather-chip span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; }
.weather-chip strong { color: var(--gold); font-size: .95rem; line-height: 1.1; }
.weather-chip small { color: #c6d2e2; font-size: .7rem; }
.hero-panel {
  background:
    radial-gradient(circle at top right, rgba(117, 223, 255, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(214, 177, 95, 0.10), transparent 24%),
    var(--panel);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 20px;
  align-items: start;
}
.hero-copy {
  margin-top: 12px;
  color: #dbe5f4;
  font-size: .96rem;
  line-height: 1.7;
  max-width: 64ch;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.status-pill--live {
  border-color: rgba(117, 223, 255, 0.32);
  color: var(--cyan);
}
.section-label {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: 10px;
}
.mode-stack {
  display: grid;
  gap: 8px;
}
.mode-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  display: grid;
  gap: 5px;
}
.mode-card b {
  font-size: .88rem;
}
.mode-card span {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.45;
}
.mode-card--active {
  border-color: rgba(214,177,95,.46);
  box-shadow: 0 0 0 1px rgba(214,177,95,.16) inset;
}
.rail-links {
  display: grid;
  gap: 8px;
}
.rail-links--grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.rail-links .soft {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.pill, .soft {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s ease;
}
.soft:hover, .pill:hover {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(183,39,52,.16);
}
.metrics {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
}
.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  padding: 14px;
  display: grid;
  gap: 6px;
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(214,177,95,.5); }
.card small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; }
.card strong { font-size: 1.15rem; }
.card span { color: #b8c4d5; font-size: .84rem; }
.panel-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.panel--compact {
  min-width: 320px;
}
.workspace-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: 16px;
  align-items: start;
}
.stack {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}
.panel {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  padding: 18px;
  min-width: 0;
}
.module-content { display: grid; gap: 10px; }
.fact-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); }
.fact {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.03);
}
.fact b {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.field-stack { display: grid; gap: 6px; margin-top: 8px; }
.field-stack span {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .15em;
}
.cc-select, .cc-textarea {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(6, 12, 26, .86);
  color: var(--text);
}
.cc-select { min-height: 42px; }
.cc-textarea {
  min-height: 84px;
  resize: vertical;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.ops-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ops-grid--lcode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ops-grid--agent { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agents-layout {
  margin-top: 10px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 380px) minmax(240px, 340px) 1fr;
  align-items: start;
}
.cc-select--tall {
  min-height: 260px;
  font-size: .9rem;
  line-height: 1.4;
}
.soft.slot-active {
  border-color: var(--good);
  background: rgba(37, 194, 131, 0.18);
}
.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: .82rem;
}
.help-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.help-list {
  margin: 0;
  padding-left: 18px;
  color: #d9e4f0;
  display: grid;
  gap: 6px;
}
.terminal-footer {
  margin-bottom: 24px;
}
.terminal-feed {
  min-height: 132px;
  max-height: 220px;
}
.slot-board {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.slot-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(6, 12, 26, .86);
  padding: 10px;
  min-height: 116px;
  display: grid;
  gap: 5px;
}
.slot-card.waiting { opacity: 0.74; }
.slot-card.reserved {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(214,177,95,.35) inset, 0 0 14px rgba(183,39,52,.20);
}
.slot-kicker {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.slot-gpu { font-size: .88rem; font-weight: 700; }
.slot-meta { font-size: .76rem; color: #b8c4d5; }
.json {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(6, 12, 26, .9);
  padding: 10px;
  overflow: auto;
  max-height: 280px;
  font-size: .79rem;
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", monospace;
}
.cluster-map-shell {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(8, 14, 22, 0.92);
  overflow: hidden;
}
.cluster-map-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.cluster-map-toolbar small { color: var(--muted); }
.cluster-map-toolbar .map-actions { display: inline-flex; gap: 6px; }
.cluster-map-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
}
.cluster-map-btn:hover { border-color: var(--accent); }
.cluster-map-viewport {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  touch-action: none;
}
.cluster-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: radial-gradient(circle at top right, rgba(47, 185, 255, 0.10), transparent 34%), rgba(9, 14, 22, 0.96);
}
.cluster-map-node circle {
  fill: #163148;
  stroke: #5cc8ff;
  stroke-width: 1.5px;
}
.cluster-map-node.offline circle {
  fill: #3a1f29;
  stroke: #f06272;
}
.cluster-map-node text {
  fill: var(--text);
  font-size: 11px;
  dominant-baseline: middle;
}
.cluster-map-link {
  stroke: rgba(143, 194, 225, 0.45);
  stroke-width: 1px;
}
.cluster-map-link.active {
  stroke: rgba(47, 185, 255, 0.9);
}
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  width: min(94vw, 460px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  padding: 20px;
  display: grid;
  gap: 10px;
}
.brand-kicker {
  color: var(--gold);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.field-stack { display: grid; gap: 4px; }
.field-stack input {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(6,12,26,.86);
  color: var(--text);
}
.action-button {
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(0,82,255,.3), rgba(212,175,55,.24));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.notice { border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.notice.error { background: #40222a; color: #ffcad1; }
.notice.ok { background: #173127; color: #c6f5dd; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-grid,
  .workspace-grid,
  .stack { grid-template-columns: 1fr; }
  .ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents-layout { grid-template-columns: 1fr; }
  .slot-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { flex-wrap: wrap; justify-content: flex-end; }
  .hero-pills { justify-content: flex-start; }
  .help-row { grid-template-columns: 1fr; }
}

/* ============================================================
   PHLP Command Center — Améliorations visuelles v2
   Ajouts : scrollbar stylisée, micro-animations, hover states
   enrichis, focus rings, indicateurs animés.
   ============================================================ */

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.55); }

/* Variables enrichies */
:root {
  --transition: 0.22s ease;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

/* Nav buttons hover enrichi */
.nav-btn {
  transition: all 0.22s ease;
}
.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 82, 255, 0.14);
}

/* Metric / stat cards hover */
.stat-card, .metric-card, [class*="glass"] {
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

/* Focus rings accessibles */
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.55);
  outline-offset: 2px;
}

/* Cluster map nodes hover */
.cluster-map-node circle {
  transition: fill 0.2s ease, stroke 0.2s ease;
}
.cluster-map-node:hover circle {
  fill: #1e4a6e;
  stroke: #7fe4ff;
}

/* Terminal feed scrollbar */
#terminal-feed::-webkit-scrollbar { width: 4px; }
#terminal-feed::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.25); border-radius: 4px; }

/* Sidebar brand hover */
.brand {
  transition: border-color 0.22s ease;
}
.brand:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

/* Action buttons hover */
button[class*="bg-white/10"]:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* Sidebar overflow */
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Animated status indicators */
.animate-pulse {
  animation: cc-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes cc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Glass cards subtle hover */
.glass-gold {
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}
.glass-gold:hover {
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.12);
}

/* Pre output styling */
pre[id] {
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* PHLP visual convergence — Orchestrator Gate tokens */
:root {
  --bg: #020a14;
  --panel: rgba(10, 26, 43, 0.80);
  --panel-strong: rgba(6, 17, 29, 0.94);
  --muted: #8aa4bd;
  --accent: #39d9ff;
  --gold: #ffb62e;
  --cyan: #39d9ff;
  --good: #73dc82;
  --warn: #ffb22a;
  --error: #ff5d62;
  --border: rgba(57, 217, 255, 0.30);
}
body {
  background:
    radial-gradient(circle at 14% 14%, rgba(57, 217, 255, 0.16), transparent 38%),
    radial-gradient(circle at 86% 86%, rgba(255, 182, 46, 0.10), transparent 42%),
    linear-gradient(180deg, #06111d 0%, #020a14 58%, #010711 100%);
}
.sidebar { background: rgba(6, 17, 28, 0.94); }
.brand { background: linear-gradient(135deg, rgba(57,217,255,.14), rgba(255,182,46,.08)); }
.nav-btn.active {
  border-color: rgba(57,217,255,.75);
  background: linear-gradient(135deg, rgba(57,217,255,.18), rgba(255,182,46,.08));
  box-shadow: 0 0 24px rgba(57,217,255,.14);
}
