/* Jessica AGI v3 - ULTIMATE Command Center with 500+ Agents */
/* Enhanced Theme: Neon Colors, Particle Systems, 3D Effects */

:root {
  /* Core Colors */
  --bg-primary: #0a0a0c;
  --bg-secondary: #121216;
  --bg-tertiary: #1a1a20;
  --bg-elevated: #22222a;

  /* Original Accents */
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;

  /* NEW: Neon Colors */
  --neon-purple: #b14aed;
  --neon-cyan: #00d4ff;
  --neon-pink: #ff2d95;
  --neon-green: #39ff14;
  --neon-orange: #ff6b35;
  --neon-blue: #4d9fff;
  --neon-yellow: #ffea00;
  --neon-red: #ff3366;

  /* NEW: Gradients */
  --gradient-aurora: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #ffa726 100%);
  --gradient-cosmic: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --gradient-neon: linear-gradient(135deg, #00f5a0 0%, #00d9f5 100%);
  --gradient-fire: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
  --gradient-royal: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #06b6d4 100%);
  --gradient-matrix: linear-gradient(180deg, #00ff00 0%, #003300 100%);
  --gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-ocean: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-rainbow: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);

  /* NEW: Glow Effects */
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.5), 0 0 40px rgba(6, 182, 212, 0.3), 0 0 60px rgba(6, 182, 212, 0.1);
  --glow-pink: 0 0 20px rgba(236, 72, 153, 0.5), 0 0 40px rgba(236, 72, 153, 0.3), 0 0 60px rgba(236, 72, 153, 0.1);
  --glow-neon: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Borders */
  --border-subtle: #27272a;
  --border-default: #3f3f46;
  --border-glow: rgba(139, 92, 246, 0.3);

  /* Commander Colors */
  --commander-jessica: #8b5cf6;
  --commander-candy: #ec4899;
  --commander-kimi: #06b6d4;
  --commander-nova: #f59e0b;
  --commander-sentinel: #ef4444;
  --commander-atlas: #10b981;
  --commander-mercury: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* ==========================================
   ANIMATED BACKGROUND - NEURAL PARTICLE SYSTEM
   ========================================== */

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cosmic-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 70%),
    var(--gradient-cosmic);
  z-index: 0;
  animation: cosmicShift 30s ease-in-out infinite;
}

@keyframes cosmicShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(30deg); }
}

/* Floating orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-purple);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-cyan);
  bottom: -50px;
  right: -50px;
  animation-delay: -7s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--accent-pink);
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, 30px) scale(1.1); }
  50% { transform: translate(20px, -40px) scale(0.9); }
  75% { transform: translate(-30px, 20px) scale(1.05); }
}

/* ==========================================
   HEADER - Glassmorphism with Neon Glow
   ========================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 0 50px rgba(139, 92, 246, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient-royal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--glow-purple);
  animation: logoGlow 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes logoGlow {
  0%, 100% { box-shadow: var(--glow-purple); transform: scale(1); }
  50% { box-shadow: var(--glow-cyan); transform: scale(1.05); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.logo-title {
  font-size: 1.375rem;
  font-weight: 700;
  background: var(--gradient-rainbow);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbowText 8s linear infinite;
}

@keyframes rainbowText {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Navigation Tabs */
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  max-width: 900px;
}

.nav-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-royal);
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-btn:hover {
  color: var(--text-primary);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.nav-btn:hover::before {
  opacity: 0.1;
}

.nav-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-purple);
  color: #a78bfa;
  box-shadow: var(--glow-purple), inset 0 0 20px rgba(139, 92, 246, 0.1);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gradient-royal);
  border-radius: 2px;
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 0.8125rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */

.main {
  margin-top: 70px;
  padding: 24px;
  padding-right: 460px; /* Space for chat sidebar */
  height: calc(100vh - 70px);
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.view {
  display: none;
  animation: viewEnter 0.5s ease;
}

.view.active {
  display: block;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   CARDS - 3D Glassmorphism with Glow
   ========================================== */

.card {
  background: rgba(18, 18, 22, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-royal);
  opacity: 0.5;
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   STATS GRID - Animated Counters
   ========================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(18, 18, 22, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-royal);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.2);
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 30px currentColor;
  animation: countUp 1s ease-out;
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sparkline mini chart */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
  margin-top: 12px;
  justify-content: center;
}

.sparkline-bar {
  width: 4px;
  background: var(--gradient-royal);
  border-radius: 2px;
  animation: sparklineGrow 0.5s ease-out forwards;
  transform-origin: bottom;
}

@keyframes sparklineGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ==========================================
   SWARM VISUALIZATION
   ========================================== */

.swarm-container {
  position: relative;
  height: calc(100vh - 200px);
  min-height: 500px;
  background: rgba(10, 10, 12, 0.5);
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  overflow: hidden;
}

#swarmCanvas {
  width: 100%;
  height: 100%;
}

.swarm-legend {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}

.swarm-stats {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swarm-stat {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.swarm-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.swarm-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Agent Node Styles (for CSS fallback) */
.agent-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.agent-node.idle {
  animation: agentIdle 3s ease-in-out infinite;
}

.agent-node.working {
  animation: agentWorking 1s ease-in-out infinite;
}

.agent-node.blocked {
  animation: agentBlocked 0.5s ease-in-out infinite;
}

@keyframes agentIdle {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes agentWorking {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px currentColor; }
  50% { transform: scale(1.3); box-shadow: 0 0 20px currentColor, 0 0 40px currentColor; }
}

@keyframes agentBlocked {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==========================================
   MISSION KANBAN BOARD
   ========================================== */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 400px;
}

.kanban-column {
  background: rgba(18, 18, 22, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 16px;
  padding: 16px;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.kanban-title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.kanban-count {
  background: rgba(139, 92, 246, 0.2);
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kanban-card {
  background: rgba(26, 26, 32, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: all 0.3s ease;
}

.kanban-card:hover {
  transform: translateY(-2px) rotate(1deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(139, 92, 246, 0.4);
}

.kanban-card:active {
  cursor: grabbing;
  transform: scale(1.02) rotate(2deg);
}

/* ==========================================
   PROGRESS BARS - Animated Gradients
   ========================================== */

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-royal);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  animation: progressShimmer 2s infinite linear;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressGlide 1.5s infinite;
}

@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes progressGlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================
   BADGES & TAGS
   ========================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.p0, .badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--neon-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge.p1, .badge.high {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.p2, .badge.medium {
  background: rgba(59, 130, 246, 0.15);
  color: var(--neon-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.agi {
  background: rgba(139, 92, 246, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 15px rgba(139, 92, 246, 0.5); }
}

.badge.feature {
  background: rgba(6, 182, 212, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================
   BUTTONS - Neon Glow Effects
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gradient-royal);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--glow-purple);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--text-secondary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-purple);
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
}

.btn-neon {
  background: transparent;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan), inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.btn-neon:hover {
  background: var(--neon-cyan);
  color: black;
  box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
}

/* ==========================================
   CHAT SIDEBAR
   ========================================== */

.chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 420px;
  height: calc(100vh - 110px);
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(139, 92, 246, 0.1);
  z-index: 200;
  overflow: hidden;
}

.chat-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: var(--gradient-royal);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}

.chat-header {
  padding: 20px;
  background: rgba(26, 26, 32, 0.8);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--gradient-royal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--glow-purple);
  animation: avatarGlow 3s ease-in-out infinite;
}

@keyframes avatarGlow {
  0%, 100% { box-shadow: var(--glow-purple); }
  50% { box-shadow: var(--glow-pink); }
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 85%;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.incoming {
  background: rgba(26, 26, 32, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.15);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message.outgoing {
  background: var(--gradient-royal);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  gap: 12px;
  background: rgba(10, 10, 12, 0.5);
}

.chat-input {
  flex: 1;
  background: rgba(26, 26, 32, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.3s;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.chat-send-btn {
  padding: 14px 24px;
  background: var(--gradient-royal);
  border: none;
  border-radius: 14px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--glow-purple);
}

/* ==========================================
   MODAL - 3D Depth Effect
   ========================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: rgba(18, 18, 22, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 28px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(139, 92, 246, 0.15);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px 28px;
  background: rgba(26, 26, 32, 0.8);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.5rem;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: rotate(90deg);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  max-height: calc(85vh - 90px);
}

/* ==========================================
   ANALYTICS CHARTS
   ========================================== */

.chart-container {
  position: relative;
  height: 250px;
  background: rgba(18, 18, 22, 0.5);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.area-chart {
  position: relative;
  height: 100%;
}

.chart-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-grid-line {
  height: 1px;
  background: rgba(139, 92, 246, 0.1);
}

/* Contribution Heatmap (GitHub-style) */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(52, 12px);
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
}

.heatmap-cell {
  border-radius: 3px;
  transition: all 0.2s;
}

.heatmap-cell:hover {
  transform: scale(1.5);
  z-index: 10;
}

.heatmap-0 { background: rgba(139, 92, 246, 0.1); }
.heatmap-1 { background: rgba(139, 92, 246, 0.3); }
.heatmap-2 { background: rgba(139, 92, 246, 0.5); }
.heatmap-3 { background: rgba(139, 92, 246, 0.7); }
.heatmap-4 { background: var(--accent-purple); box-shadow: 0 0 10px var(--accent-purple); }

/* ==========================================
   RESOURCE MONITOR
   ========================================== */

.resource-gauge {
  position: relative;
  width: 150px;
  height: 150px;
}

.gauge-bg {
  fill: none;
  stroke: rgba(139, 92, 246, 0.1);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 0.5s ease;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.75rem;
  font-weight: 700;
}

/* GPU Usage Bars */
.gpu-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(18, 18, 22, 0.6);
  border-radius: 12px;
  margin-bottom: 12px;
}

.gpu-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.gpu-info {
  flex: 1;
}

.gpu-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.gpu-model {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gpu-usage {
  width: 80px;
  text-align: right;
}

.gpu-percent {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   MEMORY NEXUS - Knowledge Graph
   ========================================== */

.knowledge-graph {
  position: relative;
  height: 500px;
  background: rgba(10, 10, 12, 0.5);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.memory-node {
  position: absolute;
  padding: 10px 16px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.memory-node:hover {
  background: rgba(139, 92, 246, 0.4);
  transform: scale(1.1);
  box-shadow: var(--glow-purple);
  z-index: 10;
}

.memory-connection {
  position: absolute;
  background: var(--gradient-royal);
  height: 2px;
  transform-origin: left center;
  opacity: 0.3;
}

/* ==========================================
   WORKFLOW AUTOMATOR - Visual Builder
   ========================================== */

.workflow-canvas {
  position: relative;
  min-height: 600px;
  background:
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
  border-radius: 20px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.workflow-node {
  position: absolute;
  min-width: 180px;
  background: rgba(26, 26, 32, 0.95);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 16px;
  cursor: move;
  transition: all 0.3s;
}

.workflow-node:hover {
  border-color: var(--accent-purple);
  box-shadow: var(--glow-purple);
  transform: translateY(-2px);
}

.workflow-node.trigger {
  border-color: var(--accent-green);
}

.workflow-node.action {
  border-color: var(--accent-cyan);
}

.workflow-node.condition {
  border-color: var(--accent-amber);
  border-radius: 8px;
  transform: rotate(45deg);
}

.workflow-connector {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-purple);
  border: 2px solid var(--bg-primary);
  cursor: crosshair;
  transition: all 0.2s;
}

.workflow-connector:hover {
  transform: scale(1.5);
  box-shadow: var(--glow-purple);
}

/* ==========================================
   VOICE CALL INTERFACE
   ========================================== */

.voice-call-container {
  position: relative;
  height: calc(100vh - 130px);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.voice-jessica-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.voice-jessica-img {
  position: absolute;
  width: 100%;
  height: auto;
  top: -5%;
  left: 50%;
  transform: translateX(-50%) scale(2.5);
  transform-origin: top center;
  transition: filter 0.5s ease, transform 0.5s ease;
  object-fit: cover;
}

.voice-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 40%, rgba(0,0,0,0.8) 100%);
  pointer-events: none;
}

.voice-ui {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

.voice-status-bar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
}

.voice-live-badge {
  background: #ef4444;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 1px;
  animation: pulse 2s infinite;
}

.voice-interim {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-style: italic;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  animation: pulse 1s ease-in-out infinite;
}

.voice-debug {
  padding: 8px 16px;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  font-size: 0.8rem;
  color: #0f0;
  font-family: 'Monaco', 'Consolas', monospace;
  text-align: center;
}

.voice-transcript {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

.voice-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.voice-call-btn {
  padding: 20px 40px;
  border: none;
  border-radius: 999px;
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.voice-call-btn.start {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.voice-call-btn.end {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.voice-call-btn:hover {
  transform: scale(1.05);
}

/* ==========================================
   CUSTOM VOICE UI - Circle Avatar + Waveform
   ========================================== */

.voice-custom-container {
  display: flex;
  height: calc(100vh - 200px);
  gap: 24px;
  padding: 20px;
}

/* LEFT PANEL - Circle Avatar & Waveform */
.voice-left-panel {
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.voice-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.voice-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(196, 167, 119, 0.3);
  box-shadow: 0 0 40px rgba(196, 167, 119, 0.2);
  transition: all 0.3s ease;
  position: relative;
}

.voice-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.voice-avatar.active {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.3);
}

.voice-avatar.speaking {
  border-color: rgba(236, 72, 153, 0.8);
  box-shadow: 0 0 80px rgba(236, 72, 153, 0.5);
  animation: avatarPulse 0.8s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Waveform Visualizer - RIGHT UNDER the circle */
.voice-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 60px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-visualizer .viz-bar {
  width: 6px;
  background: linear-gradient(to top, #06b6d4, #8b5cf6);
  border-radius: 3px;
  transition: height 0.1s ease;
  height: 10%;
}

.voice-visualizer.speaking .viz-bar {
  background: linear-gradient(to top, #ec4899, #8b5cf6);
  animation: vizBounce 0.3s ease-in-out infinite;
}

.voice-visualizer.listening .viz-bar {
  background: linear-gradient(to top, #06b6d4, #3b82f6);
  animation: vizWave 0.5s ease-in-out infinite;
}

.viz-bar:nth-child(1) { animation-delay: 0s; }
.viz-bar:nth-child(2) { animation-delay: 0.1s; }
.viz-bar:nth-child(3) { animation-delay: 0.2s; }
.viz-bar:nth-child(4) { animation-delay: 0.3s; }
.viz-bar:nth-child(5) { animation-delay: 0.4s; }
.viz-bar:nth-child(6) { animation-delay: 0.5s; }
.viz-bar:nth-child(7) { animation-delay: 0.6s; }
.viz-bar:nth-child(8) { animation-delay: 0.7s; }
.viz-bar:nth-child(9) { animation-delay: 0.8s; }
.viz-bar:nth-child(10) { animation-delay: 0.9s; }

@keyframes vizBounce {
  0%, 100% { height: 30%; }
  50% { height: 90%; }
}

@keyframes vizWave {
  0%, 100% { height: 20%; }
  50% { height: 70%; }
}

/* Status Panel */
.voice-status-panel {
  text-align: center;
}

.voice-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.voice-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #71717a;
  transition: all 0.3s;
}

.voice-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.voice-duration {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Monaco', monospace;
}

/* RIGHT PANEL - Transcript */
.voice-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.voice-transcript-panel {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-welcome {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.voice-welcome h4 {
  color: var(--accent-gold);
  margin-bottom: 8px;
}

/* BOTTOM CONTROLS */
.voice-bottom-controls {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px 32px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

.voice-call-btn {
  padding: 16px 40px;
  border: none;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  color: white;
}

.voice-call-btn.start {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.voice-call-btn.end {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.voice-call-btn:hover {
  transform: scale(1.05);
}

/* 24/7 Always Listening Toggle */
.voice-toggle {
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.voice-toggle.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.voice-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==========================================
   NOTIFICATION TOAST
   ========================================== */

.toast-container {
  position: fixed;
  top: 90px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1001;
  pointer-events: none;
}

.toast {
  padding: 16px 20px;
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlide 0.4s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

@keyframes toastSlide {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success {
  border-left: 4px solid var(--accent-green);
}

.toast.error {
  border-left: 4px solid var(--accent-red);
}

.toast.warning {
  border-left: 4px solid var(--accent-amber);
}

.toast.info {
  border-left: 4px solid var(--accent-cyan);
}

/* ==========================================
   LOADING SCREEN
   ========================================== */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-ring {
  width: 100px;
  height: 100px;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 30px;
  position: relative;
}

.loading-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 4px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.loading-progress {
  width: 350px;
  height: 6px;
  background: rgba(139, 92, 246, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.loading-bar {
  height: 100%;
  background: var(--gradient-royal);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
}

.loading-subtext {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(139, 92, 246, 0.05);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* ==========================================
   SELECTION STYLING
   ========================================== */

::selection {
  background: rgba(139, 92, 246, 0.4);
  color: var(--text-primary);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1400px) {
  .main {
    padding-right: 24px;
  }

  .chat-container {
    display: none;
  }

  .nav {
    max-width: 700px;
  }
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   WELCOME BOX - Hero Section
   ========================================== */

.welcome-box {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 50%, rgba(236, 72, 153, 0.1) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(139, 92, 246, 0.1), transparent, rgba(6, 182, 212, 0.1), transparent);
  animation: welcomeRotate 20s linear infinite;
}

@keyframes welcomeRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-box h3 {
  font-size: 1.75rem;
  margin-bottom: 12px;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
}

.welcome-box p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

/* ==========================================
   AGENT DETAILS PANEL
   ========================================== */

.agent-detail-panel {
  position: fixed;
  right: -400px;
  top: 70px;
  width: 380px;
  height: calc(100vh - 70px);
  background: rgba(18, 18, 22, 0.98);
  border-left: 1px solid rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(20px);
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 150;
  overflow-y: auto;
}

.agent-detail-panel.active {
  right: 0;
}

.agent-detail-header {
  padding: 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
}

.agent-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--glow-purple);
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 24px;
}

.agent-stat-item {
  background: rgba(26, 26, 32, 0.5);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.agent-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.agent-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================
   QUICK ACTIONS BAR
   ========================================== */

.quick-actions {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  background: rgba(10, 10, 12, 0.3);
}

.quick-btn {
  padding: 10px 18px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.quick-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-purple);
  color: #a78bfa;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

/* ==========================================
   CONFETTI CELEBRATION
   ========================================== */

.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==========================================
   VOICE AGENT EMBED
   ========================================== */

.voice-agent-embed {
  height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
}

.embed-header {
  padding: 20px 24px;
  background: rgba(18, 18, 22, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.embed-header h3 {
  font-size: 1.25rem;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.embed-header p {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.open-external-btn {
  padding: 10px 20px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s;
}

.open-external-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}

.voice-agent-iframe {
  flex: 1;
  width: 100%;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-top: none;
  border-radius: 0 0 16px 16px;
  background: var(--bg-primary);
}

/* ==========================================
   IDEA GRID
   ========================================== */

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.idea-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.idea-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), var(--glow-purple);
}

.idea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.idea-votes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ==========================================
   TEST AGENTS GRID
   ========================================== */

.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.test-agent {
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.75rem;
  transition: all 0.3s;
  cursor: pointer;
}

.test-agent:hover {
  transform: scale(1.1);
  z-index: 10;
}

.test-agent.passed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.test-agent.failed {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.test-agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 auto 10px;
}

.test-agent.passed .test-agent-dot {
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green);
}

.test-agent.failed .test-agent-dot {
  background: var(--accent-red);
  box-shadow: 0 0 12px var(--accent-red);
}

/* ==========================================
   AGI PROGRESS RING
   ========================================== */

.agi-progress-large {
  text-align: center;
  padding: 48px;
}

.agi-ring-large {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 30px;
}

.agi-ring-large svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.4));
}

.agi-percent-large {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  background: var(--gradient-royal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gap-item {
  margin-bottom: 24px;
}

.gap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* ==========================================
   MISSION LIST
   ========================================== */

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mission-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: rgba(26, 26, 32, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mission-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-royal);
  opacity: 0;
  transition: opacity 0.3s;
}

.mission-item:hover {
  background: rgba(26, 26, 32, 1);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.mission-item:hover::before {
  opacity: 1;
}

.mission-status {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mission-status.inprogress {
  background: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan);
  animation: pulse 2s infinite;
}

.mission-status.todo {
  background: var(--text-muted);
}

.mission-status.blocked {
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
}

.mission-status.complete {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

.mission-info {
  flex: 1;
}

.mission-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
}

.mission-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================
   DETAIL SECTIONS (Modal Content)
   ========================================== */

.detail-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.detail-value {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.detail-value.description {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-indicator.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-indicator.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.safety-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.safety-level.high {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.safety-level.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.safety-level.low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

/* ==========================================
   AGENT DOTS - Swarm Visualization
   ========================================== */

.agent-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.agent-dot:hover {
  transform: scale(2);
  z-index: 10;
  box-shadow: 0 0 15px currentColor;
}

.agent-dot.idle {
  opacity: 0.6;
  animation: agentIdle 3s ease-in-out infinite;
}

.agent-dot.working {
  animation: agentWorking 1s ease-in-out infinite;
  box-shadow: 0 0 10px currentColor;
}

.agent-dot.blocked {
  animation: agentBlocked 0.5s ease-in-out infinite;
  opacity: 0.8;
}

.agent-dot.offline {
  opacity: 0.2;
  filter: grayscale(1);
}

/* Clean Voice UI */
.voice-layout {
  display: flex;
  height: calc(100vh - 180px);
  gap: 20px;
  padding: 20px;
}

.voice-left {
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.voice-avatar-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(196, 167, 119, 0.4);
  box-shadow: 0 0 30px rgba(196, 167, 119, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  transition: all 0.3s ease;
}

.voice-avatar-circle.active {
  border-color: #10b981;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.voice-avatar-circle.speaking {
  border-color: #ec4899;
  box-shadow: 0 0 50px rgba(236, 72, 153, 0.5);
  animation: avatarPulse 1s ease-in-out infinite;
}

.voice-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.voice-waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
}

.wave-bar {
  width: 4px;
  background: linear-gradient(to top, #06b6d4, #8b5cf6);
  border-radius: 2px;
  height: 20%;
  transition: height 0.1s;
}

.voice-waveform.active .wave-bar {
  animation: wave 0.5s ease-in-out infinite;
}

.voice-waveform.speaking .wave-bar {
  background: linear-gradient(to top, #ec4899, #f59e0b);
  animation: wave 0.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }
.wave-bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes wave {
  0%, 100% { height: 20%; }
  50% { height: 80%; }
}

.voice-status-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #71717a;
}

.status-dot.active { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dot.speaking { background: #ec4899; box-shadow: 0 0 8px #ec4899; }

.voice-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
}

.voice-transcript {
  flex: 1;
  overflow-y: auto;
}

.voice-controls-bar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 24px;
  background: rgba(0,0,0,0.8);
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.1);
}

.call-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
}

.call-btn.start { background: linear-gradient(135deg, #10b981, #059669); }
.call-btn.end { background: linear-gradient(135deg, #ef4444, #dc2626); }

.toggle-btn {
  padding: 10px 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 0.85rem;
}

.toggle-btn.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.duration {
  font-family: monospace;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
}

.voice-debug {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.8);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #10b981;
}
