/* ═══════════════════════════════════════════════════════════════
   NEXUS NOC — Cyberpunk / High-Tech Operations Center
   Palette: Deep Black, Matrix Green, Electric Cyan
   Typography: Monospace (Fira Code / Roboto Mono)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg-deep:       #050505;
  --bg-card:       #161b22;
  --bg-card-hover: #1c232d;
  
  /* Accents Néon */
  --neon-cyan:     #00d9ff;
  --neon-green:    #00ff41;
  --neon-yellow:   #ffcc00;
  --neon-cyan-dim: rgba(0, 217, 255, 0.15);
  --neon-green-dim:rgba(0, 255, 65, 0.15);
  --neon-yellow-dim:rgba(255, 204, 0, 0.15);
  
  /* Textes */
  --text-primary:  #00d9ff;
  --text-accent:   #00ff41;
  --text-muted:    #4a5a72;
  
  /* Layout & Typo */
  --font-mono:     'Fira Code', 'Roboto Mono', 'Courier New', monospace;
  --radius:        4px;
  --gap:           1.5rem;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Effet Scanline Rétro-Futuriste */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* Grille technique subtile en arrière-plan */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: 
    linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

/* Scrollbar Custom */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--neon-cyan-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* ─── Header NEXUS NOC ──────────────────────────────────────── */
.noc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.95) 0%, rgba(5, 5, 5, 0.98) 100%);
  border-bottom: 1px solid var(--neon-cyan);
  box-shadow: 0 4px 25px rgba(0, 217, 255, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.logo-pulse {
  width: 12px;
  height: 12px;
  background: var(--neon-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(0, 255, 65, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.noc-header h1 {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 217, 255, 0.8), 0 0 24px rgba(0, 217, 255, 0.4);
}

.noc-header h1 .accent {
  color: var(--neon-green);
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.8), 0 0 24px rgba(0, 255, 65, 0.4);
}

.header-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0.3em 0.8em;
  border: 1px solid var(--neon-cyan-dim);
  border-radius: 2px;
  background: rgba(0, 217, 255, 0.05);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.clock {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.6);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

/* ─── Badge Signal (LIVE / STALE / SIGNAL LOST) ─────────────── */
.signal-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35em 0.8em;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.4);
  transition: color 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

.signal-badge .signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.signal-badge[data-state="live"]  { color: var(--neon-green); }
.signal-badge[data-state="live"] .signal-dot { animation: pulse 2s ease-in-out infinite; }

.signal-badge[data-state="stale"] { color: var(--neon-yellow); }
.signal-badge[data-state="stale"] .signal-dot { animation: pulse 1s ease-in-out infinite; }

.signal-badge[data-state="lost"] {
  color: #ff003c;
  background: rgba(60, 0, 12, 0.6);
  animation: lost-flash 1.2s ease-in-out infinite;
}

.signal-badge[data-state="init"] { color: var(--text-muted); }

@keyframes lost-flash {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 60, 0.4); }
  50%      { box-shadow: 0 0 22px rgba(255, 0, 60, 0.9), 0 0 35px rgba(255, 0, 60, 0.4); }
}

.last-sync {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  border-left: 1px solid var(--neon-cyan-dim);
  padding-left: 1rem;
}
.last-sync::before {
  content: "SYNC ";
  color: var(--text-muted);
  opacity: 0.6;
  margin-right: 0.3em;
}

/* ─── Dashboard Layout & Sections ───────────────────────────── */
.dashboard-container {
  max-width: 1600px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.monitoring-section {
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
  border-bottom: 1px solid var(--neon-cyan-dim);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "▹";
  color: var(--neon-green);
}

.panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

/* ─── Cards (Panneaux Grafana / Métriques) ──────────────────── */
.grafana-card {
  background: var(--bg-card);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.1), inset 0 0 10px rgba(0, 217, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 0;
}

.grafana-card:hover {
  border-color: var(--neon-green);
  background: var(--bg-card-hover);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2), inset 0 0 15px rgba(0, 255, 65, 0.1);
  transform: translateY(-3px);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--neon-cyan-dim);
  margin: 0;
}

.card-content {
  position: relative;
  background: #000;
  width: 100%;
  height: 250px;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

/* ─── Styles Spécifiques Métriques & Jauges ─────────────────── */
.metric-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  padding: 1.5rem;
  gap: 1.5rem;
  background: radial-gradient(circle at center, rgba(0, 217, 255, 0.05) 0%, transparent 70%);
}

.metric-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.metric-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--neon-cyan-dim);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  box-shadow: 0 0 12px var(--neon-cyan);
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.5s ease, box-shadow 0.5s ease;
  border-radius: 4px;
  position: relative;
}

/* Effet de brillance sur la jauge */
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ─── Carte Réseau (RX / TX en MB/s) ────────────────────────── */
.net-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  align-items: center;
}

.net-row {
  display: grid;
  grid-template-columns: 1.2rem 2rem 1fr 3rem;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  max-width: 220px;
  font-variant-numeric: tabular-nums;
}

.net-arrow {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}
.net-arrow.net-rx { color: var(--neon-cyan);  text-shadow: 0 0 10px rgba(0, 217, 255, 0.7); }
.net-arrow.net-tx { color: var(--neon-green); text-shadow: 0 0 10px rgba(0, 255, 65, 0.7); }

.net-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.net-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
  text-align: right;
}

.net-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* En état warn/crit, recolore les chiffres pour cohérence */
.net-card.state-warn .net-num { color: var(--neon-yellow); text-shadow: 0 0 10px rgba(255, 204, 0, 0.6); }
.net-card.state-crit .net-num { color: #ff003c;            text-shadow: 0 0 10px rgba(255, 0, 60, 0.7); }

/* ─── États d'alerte (OK / WARN / CRIT) ─────────────────────── */

/* WARN : ambré, halo doux */
.metric-card.state-warn {
  border-color: var(--neon-yellow);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.25), inset 0 0 12px rgba(255, 204, 0, 0.08);
}
.metric-card.state-warn .metric-value {
  color: var(--neon-yellow);
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.7);
}
.metric-card.state-warn .progress-bar {
  background: linear-gradient(90deg, var(--neon-yellow), #ff8800);
  box-shadow: 0 0 12px var(--neon-yellow);
}
.metric-card.state-warn .card-title {
  color: var(--neon-yellow);
  border-bottom-color: rgba(255, 204, 0, 0.3);
}

/* CRIT : rouge néon, pulse complet de la carte + glitch RGB sur la valeur */
.metric-card.state-crit {
  border-color: #ff003c;
  background: rgba(40, 0, 8, 0.6);
  animation: card-crit-pulse 1.4s ease-in-out infinite;
}
.metric-card.state-crit .metric-value {
  color: #ff003c;
  text-shadow: 0 0 15px rgba(255, 0, 60, 0.8), 0 0 30px rgba(255, 0, 60, 0.4);
  animation: glitch-rgb 1.6s steps(2, end) infinite;
  position: relative;
}
.metric-card.state-crit .progress-bar {
  background: #ff003c;
  box-shadow: 0 0 18px #ff003c, 0 0 35px rgba(255, 0, 60, 0.5);
}
.metric-card.state-crit .card-title {
  color: #ff003c;
  border-bottom-color: rgba(255, 0, 60, 0.4);
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.6);
}
.metric-card.state-crit .card-title::before {
  content: "⚠ ";
  color: #ff003c;
}

@keyframes card-crit-pulse {
  0%, 100% {
    box-shadow: 0 0 18px rgba(255, 0, 60, 0.4), inset 0 0 15px rgba(255, 0, 60, 0.1);
    border-color: #ff003c;
  }
  50% {
    box-shadow: 0 0 38px rgba(255, 0, 60, 0.85), inset 0 0 25px rgba(255, 0, 60, 0.25);
    border-color: #ff5577;
  }
}

/* Glitch RGB-split sur la valeur critique (effet chromatic aberration) */
@keyframes glitch-rgb {
  0% {
    text-shadow:
      0 0 15px rgba(255, 0, 60, 0.8),
      2px 0 0 rgba(0, 217, 255, 0.7),
      -2px 0 0 rgba(255, 204, 0, 0.7);
  }
  20% {
    text-shadow:
      0 0 15px rgba(255, 0, 60, 0.8),
      -2px 0 0 rgba(0, 217, 255, 0.7),
      2px 0 0 rgba(255, 204, 0, 0.7);
  }
  40% {
    text-shadow:
      0 0 15px rgba(255, 0, 60, 0.8),
      3px 1px 0 rgba(0, 217, 255, 0.6),
      -3px -1px 0 rgba(255, 204, 0, 0.6);
  }
  60% {
    text-shadow:
      0 0 15px rgba(255, 0, 60, 0.8),
      -1px -2px 0 rgba(0, 217, 255, 0.7),
      1px 2px 0 rgba(255, 204, 0, 0.7);
  }
  80%, 100% {
    text-shadow:
      0 0 15px rgba(255, 0, 60, 0.8),
      2px 0 0 rgba(0, 217, 255, 0.7),
      -2px 0 0 rgba(255, 204, 0, 0.7);
  }
}

/* État OK explicite (au cas où surcharger une transition depuis crit) */
.metric-card.state-ok {
  /* Hérite des styles par défaut de .grafana-card */
}

/* ─── Bouton Deep Dive ──────────────────────────────────────── */
.deep-dive-btn {
  margin-top: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: transparent;
  border: 1px solid var(--neon-yellow);
  color: var(--neon-yellow);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.2);
}

.deep-dive-btn:hover {
  background: var(--neon-yellow);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
  transform: scale(1.05);
}

/* ─── Section Deep Dive (Iframe) ────────────────────────────── */
.cyber-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--neon-yellow);
  border-radius: var(--radius);
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.15), inset 0 0 15px rgba(255, 204, 0, 0.05);
}

.cyber-section .section-title {
  color: var(--neon-yellow);
  border-bottom-color: var(--neon-yellow-dim);
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
}

.cyber-section .section-title::before {
  color: var(--neon-yellow);
}

.iframe-container {
  width: 100%;
  background: #000;
  border: 1px solid var(--neon-yellow-dim);
  border-radius: 4px;
  overflow: hidden;
}

#grafana-viewer {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* ─── Section Services Status ───────────────────────────────── */
.services-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.services-section .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.services-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 400;
  text-shadow: none;
}

.service-category {
  margin-bottom: 1.5rem;
}

.service-cat-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--neon-green);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--neon-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--neon-cyan-dim);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  border-color: var(--neon-cyan);
  background: var(--bg-card-hover);
  transform: translateX(2px);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
}

.svc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
  box-shadow: 0 0 6px currentColor;
}

.service-card.status-up .svc-dot {
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green), 0 0 14px rgba(0, 255, 65, 0.5);
  animation: pulse 3s ease-in-out infinite;
}

.service-card.status-down {
  border-color: rgba(255, 0, 60, 0.4);
  background: rgba(40, 0, 8, 0.4);
}
.service-card.status-down .svc-dot {
  background: #ff003c;
  box-shadow: 0 0 8px #ff003c, 0 0 14px rgba(255, 0, 60, 0.5);
}
.service-card.status-down .svc-name {
  color: #ff6677;
  text-decoration: line-through;
  opacity: 0.85;
}

.svc-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-update-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--neon-yellow);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.6);
  animation: pulse 2.5s ease-in-out infinite;
}

.services-error {
  padding: 1rem;
  background: rgba(60, 0, 12, 0.4);
  border: 1px solid rgba(255, 0, 60, 0.5);
  color: #ff6677;
  font-size: 0.8rem;
  border-radius: var(--radius);
  text-align: center;
}

/* ─── Section Nexus AI (AnythingLLM iframe) ─────────────────── */
.ai-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.95) 0%, rgba(10, 12, 18, 0.98) 100%);
  border: 1px solid var(--neon-green);
  border-radius: var(--radius);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.18), inset 0 0 20px rgba(0, 255, 65, 0.05);
  position: relative;
}

.ai-section::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
  animation: ai-scan 4s ease-in-out infinite;
}

@keyframes ai-scan {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

.ai-section .section-title {
  color: var(--neon-green);
  border-bottom-color: rgba(0, 255, 65, 0.3);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-section .section-title::before {
  content: "◈";
  color: var(--neon-green);
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3em 0.7em;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.4);
  text-shadow: none;
}

.ai-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.ai-status[data-state="online"]     { color: var(--neon-green); }
.ai-status[data-state="online"] .ai-status-dot { animation: pulse 2s ease-in-out infinite; }
.ai-status[data-state="connecting"] { color: var(--neon-yellow); }
.ai-status[data-state="connecting"] .ai-status-dot { animation: pulse 0.8s ease-in-out infinite; }
.ai-status[data-state="offline"]    { color: #ff003c; }

.ai-iframe-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: 4px;
  overflow: hidden;
  min-height: 800px;
  /* Coins néon décoratifs */
  box-shadow:
    inset 0 0 25px rgba(0, 255, 65, 0.08),
    0 0 30px rgba(0, 255, 65, 0.1);
}

/* Coins lumineux décoratifs (pseudo-elements) */
.ai-iframe-wrapper::before,
.ai-iframe-wrapper::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 2;
}
.ai-iframe-wrapper::before {
  top: 0; left: 0;
  border-top: 2px solid var(--neon-green);
  border-left: 2px solid var(--neon-green);
  box-shadow: -2px -2px 12px rgba(0, 255, 65, 0.5);
}
.ai-iframe-wrapper::after {
  bottom: 0; right: 0;
  border-bottom: 2px solid var(--neon-green);
  border-right: 2px solid var(--neon-green);
  box-shadow: 2px 2px 12px rgba(0, 255, 65, 0.5);
}

#ai-iframe {
  width: 100%;
  height: 800px;
  border: none;
  display: block;
  background: #000;
}

@media (max-width: 1024px) {
  .ai-iframe-wrapper { min-height: 650px; }
  #ai-iframe         { height: 650px; }
}
@media (max-width: 768px) {
  .ai-iframe-wrapper { min-height: 500px; }
  #ai-iframe         { height: 500px; }
}

.ai-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.ai-overlay-inner {
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}

.ai-overlay-icon {
  font-size: 3rem;
  color: #ff003c;
  text-shadow: 0 0 20px rgba(255, 0, 60, 0.8);
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.ai-overlay-text {
  font-size: 1rem;
  font-weight: 700;
  color: #ff003c;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(255, 0, 60, 0.6);
  margin-bottom: 0.8rem;
}

.ai-overlay-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.ai-overlay-sub code {
  color: var(--neon-cyan);
  background: rgba(0, 217, 255, 0.1);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.ai-retry-btn {
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}
.ai-retry-btn:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.6);
  transform: scale(1.04);
}

/* ─── Footer ────────────────────────────────────────────────── */
.noc-footer {
  max-width: 1600px;
  margin: 2rem auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--neon-cyan-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Banner Incident (top of page) ─────────────────────────── */
.incident-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(90deg, rgba(60, 0, 12, 0.95), rgba(120, 0, 24, 0.95), rgba(60, 0, 12, 0.95));
  border-bottom: 2px solid #ff003c;
  box-shadow: 0 4px 30px rgba(255, 0, 60, 0.5);
  animation: incident-pulse 1.6s ease-in-out infinite;
}

@keyframes incident-pulse {
  0%, 100% { box-shadow: 0 4px 25px rgba(255, 0, 60, 0.4); }
  50%      { box-shadow: 0 4px 50px rgba(255, 0, 60, 0.9), 0 0 80px rgba(255, 0, 60, 0.3); }
}

.incident-banner-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.incident-icon {
  font-size: 1.4rem;
  animation: pulse 1s ease-in-out infinite;
}

.incident-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 0, 60, 0.8);
  text-transform: uppercase;
}

.incident-list {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffaabb;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.6);
}

.incident-fs-btn,
.incident-dismiss-btn {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.incident-fs-btn {
  padding: 0.45rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.incident-fs-btn:hover {
  background: #fff;
  color: #ff003c;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.7);
}

.incident-dismiss-btn {
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 2px;
  padding: 0;
}
.incident-dismiss-btn:hover {
  background: #fff;
  color: #ff003c;
}

/* ─── Mode Incident Fullscreen (vue mur NOC) ────────────────── */
.exit-fs-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  padding: 0.6rem 1.2rem;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
  transition: all 0.25s ease;
}
.exit-fs-btn:hover {
  background: var(--neon-cyan);
  color: #000;
}

body.incident-fullscreen {
  overflow: hidden;
}

/* En fullscreen : on cache tout sauf les métriques */
body.incident-fullscreen .noc-header,
body.incident-fullscreen .noc-footer,
body.incident-fullscreen #deep-dive,
body.incident-fullscreen #services,
body.incident-fullscreen #ai-assistant,
body.incident-fullscreen .incident-banner {
  display: none !important;
}

body.incident-fullscreen .dashboard-container {
  max-width: 100vw;
  margin: 0;
  padding: 2rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.incident-fullscreen #metrics-section {
  margin-bottom: 0;
}

body.incident-fullscreen .section-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  justify-content: center;
}

body.incident-fullscreen .panels-grid {
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

body.incident-fullscreen .card-content,
body.incident-fullscreen .metric-content {
  height: 320px;
}

body.incident-fullscreen .metric-value {
  font-size: 4.5rem;
}

body.incident-fullscreen .net-num {
  font-size: 2.4rem;
}

body.incident-fullscreen .card-title {
  font-size: 1rem;
  padding: 1rem 1.4rem;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .ai-section .section-title,
  .services-section .section-title { flex-wrap: wrap; gap: 0.5rem; }
}

@media (max-width: 1024px) {
  .panels-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .card-content, .metric-content { height: 220px; }
  #grafana-viewer { height: 400px; }
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
  /* Header passe en colonne et compact */
  .noc-header {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
  }
  .noc-header h1 { font-size: 1.4rem; }
  .header-tag { display: none; }
  .header-left { gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
  .header-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
  }
  .last-sync { padding-left: 0.7rem; font-size: 0.65rem; }
  .clock { font-size: 1.1rem; }

  /* Layout général */
  .dashboard-container { padding: 0 1rem; margin: 1rem auto; }
  .panels-grid { grid-template-columns: 1fr; gap: 1rem; }
  .card-content, .metric-content { height: 200px; }
  .metric-value { font-size: 2.4rem; }

  /* Sections */
  .section-title { font-size: 1rem; }
  .services-section .section-title,
  .ai-section .section-title { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .services-meta { font-size: 0.6rem; }

  /* Services en grille compacte */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .service-card { padding: 0.55rem 0.7rem; font-size: 0.72rem; }

  /* Deep dive iframe plus petit */
  #grafana-viewer { height: 280px; }

  /* AI section padding réduit */
  .ai-section { padding: 1rem; }

  /* Incident banner compact */
  .incident-banner-inner {
    padding: 0.6rem 1rem;
    gap: 0.6rem;
  }
  .incident-list { font-size: 0.72rem; flex-basis: 100%; order: 4; }
  .incident-fs-btn { padding: 0.35rem 0.7rem; font-size: 0.62rem; }

  /* Footer */
  .noc-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .metric-value { font-size: 2rem; }
}
