/* ==============================================================================
   NEXUS // ORCHESTRATOR - DESIGN DNA: IMPECCABLE HIGH-TECH (AGENTIC ERA)
   Palette: Deep Space Neutrals (#030303), Primary (#5c5cfc), Cyan, Emerald, Ruby
   Bento Grids with 30px+ Glassmorphism & 1px Hardware Borders
   ============================================================================== */

:root {
  --bg-space: #030303;
  --bg-deep: #07070a;
  --bg-surface: rgba(12, 12, 17, 0.72);
  --bg-surface-hover: rgba(20, 20, 30, 0.88);
  --bg-surface-elevated: rgba(26, 26, 38, 0.95);
  
  /* High-Chroma Accents */
  --accent-primary: #5c5cfc;
  --accent-glow: rgba(92, 92, 252, 0.45);
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.4);
  --accent-emerald: #00ff88;
  --accent-emerald-glow: rgba(0, 255, 136, 0.35);
  --accent-warn: #ffb020;
  --accent-warn-glow: rgba(255, 176, 32, 0.35);
  --accent-ruby: #ff3366;
  --accent-ruby-glow: rgba(255, 51, 102, 0.4);
  --accent-purple: #a855f7;

  /* Hardware Sharp Borders */
  --border-hardware: 1px solid rgba(255, 255, 255, 0.08);
  --border-hardware-hover: 1px solid rgba(92, 92, 252, 0.4);
  --border-hardware-active: 1px solid rgba(0, 240, 255, 0.5);

  /* Typography */
  --font-display: 'Syne', -apple-system, sans-serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.18s var(--ease-spring);
  --transition-normal: 0.3s var(--ease-spring);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-space);
  color: #e4e4e9;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Portals & Futuristic Glow Effects */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  opacity: 0.28;
}

.glow-1 {
  width: 600px;
  height: 600px;
  top: -150px;
  right: -100px;
  background: radial-gradient(circle, #5c5cfc 0%, transparent 70%);
}

.glow-2 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, #00f0ff 0%, transparent 70%);
  opacity: 0.18;
}

.glow-3 {
  width: 700px;
  height: 700px;
  top: 40%;
  right: 15%;
  background: radial-gradient(circle, #4f46e5 0%, transparent 75%);
  opacity: 0.12;
}

.space-scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(rgba(18, 16, 26, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
  background-size: 100% 3px, 6px 100%;
  opacity: 0.6;
}

/* Glassmorphism Master Utility */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(34px) saturate(190%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  border: var(--border-hardware);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  position: relative;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(92, 92, 252, 0.25);
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.85), 0 0 24px -6px rgba(92, 92, 252, 0.15);
}

/* Main Layout */
.app-layout {
  position: relative;
  z-index: 2;
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 24px 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==============================================================================
   TOP COMMAND BAR
   ============================================================================== */
.command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 24px;
  flex-wrap: wrap;
}

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

.brand-radar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(92, 92, 252, 0.12);
  border: 1px solid rgba(92, 92, 252, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-primary);
}

.radar-ping {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-cyan);
  animation: radarPulse 2.4s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
}

@keyframes radarPulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-tag {
  color: var(--accent-primary);
  text-shadow: 0 0 12px var(--accent-glow);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: #8b8b9e;
}

/* Fleet Status Pill */
.fleet-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 176, 32, 0.08);
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #ffc453;
}

.status-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-orb.status-warn {
  background: var(--accent-warn);
  box-shadow: 0 0 10px var(--accent-warn);
  animation: pulseBlink 1.8s infinite;
}

.status-orb.status-online {
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

@keyframes pulseBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Quick Metrics Ribbon */
.quick-metrics-ribbon {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #79798c;
  letter-spacing: 0.8px;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.metric-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.08);
}

/* Buttons & Magnetic Styles */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: var(--border-hardware);
  color: #d1d1dc;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.action-primary {
  background: linear-gradient(135deg, #5c5cfc 0%, #4338ca 100%);
  border: 1px solid rgba(138, 138, 255, 0.4);
  color: #fff;
  box-shadow: 0 4px 16px -2px rgba(92, 92, 252, 0.5);
}

.action-primary:hover {
  background: linear-gradient(135deg, #6c6cff 0%, #4f46e5 100%);
  box-shadow: 0 6px 22px 0 rgba(92, 92, 252, 0.7);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1.5px);
}

/* User Identity Cluster in Top Bar */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 5px;
  background: rgba(12, 12, 20, 0.75);
  border: 1px solid rgba(92, 92, 252, 0.3);
  border-radius: 100px;
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-emerald);
  object-fit: cover;
  background: rgba(92, 92, 252, 0.2);
}

.user-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5c5cfc 0%, #00f0ff 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(92, 92, 252, 0.4);
}

.user-email-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.user-role-label {
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--accent-emerald);
  letter-spacing: 0.8px;
  font-weight: 700;
}

.user-email {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #e0e0ea;
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 51, 102, 0.1);
  border: 1px solid rgba(255, 51, 102, 0.28);
  color: #ff6b8b;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.logout-btn:hover {
  background: rgba(255, 51, 102, 0.35);
  color: #fff;
  border-color: #ff3366;
  box-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
  transform: scale(1.08);
}

/* ==============================================================================
   HERO 3D ORBITAL TOPOLOGY SECTION
   ============================================================================== */
.orbital-section {
  display: flex;
  flex-direction: column;
  height: 520px;
  position: relative;
  overflow: hidden;
}

.orbital-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
}

.badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

.badge-accent {
  background: rgba(92, 92, 252, 0.15);
  color: #8c8cff;
  border: 1px solid rgba(92, 92, 252, 0.35);
}

.badge-online {
  background: rgba(0, 255, 136, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-warn {
  background: rgba(255, 176, 32, 0.12);
  color: var(--accent-warn);
  border: 1px solid rgba(255, 176, 32, 0.35);
}

.badge-danger {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-ruby);
  border: 1px solid rgba(255, 51, 102, 0.4);
}

/* Node Jumper Buttons */
.node-jumpers {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.node-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: #9d9db0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.node-pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.node-pill-btn.active {
  background: rgba(92, 92, 252, 0.18);
  border-color: rgba(92, 92, 252, 0.45);
  color: #fff;
  box-shadow: 0 0 12px rgba(92, 92, 252, 0.25);
}

.node-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot-all { background: #fff; }
.dot-laptop { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }
.dot-oracle-uae { background: var(--accent-primary); box-shadow: 0 0 6px var(--accent-primary); }
.dot-oracle-us { background: var(--accent-warn); box-shadow: 0 0 6px var(--accent-warn); }
.dot-hostinger { background: var(--accent-emerald); box-shadow: 0 0 6px var(--accent-emerald); }

.orbital-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a4a4b8;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hud-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* 3D Canvas Viewport */
.canvas-viewport {
  flex: 1;
  width: 100%;
  position: relative;
  background: radial-gradient(circle at center, #0a0a14 0%, #030305 85%);
  cursor: grab;
}

.canvas-viewport:active {
  cursor: grabbing;
}

#threeCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* HUD Overlay on 3D View */
.globe-hud-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.25s ease;
  opacity: 0;
}

.globe-hud-overlay.visible {
  opacity: 1;
}

.hud-info-card {
  position: absolute;
  bottom: 20px;
  left: 20px;
  min-width: 260px;
  background: rgba(7, 7, 12, 0.88);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(92, 92, 252, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 18px rgba(92, 92, 252, 0.2);
}

.hud-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-node-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.hud-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.hud-metric-row {
  display: flex;
  justify-content: space-between;
  color: #9292a4;
}

.hud-metric-row strong {
  color: #fff;
}

.canvas-legend {
  position: absolute;
  bottom: 14px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8c8c9e;
  pointer-events: none;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.chip-ae { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }
.chip-us { background: var(--accent-primary); box-shadow: 0 0 6px var(--accent-primary); }
.chip-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulseBlink 1s infinite;
}

/* ==============================================================================
   BENTO SECTION: 4 INFRASTRUCTURE NODES
   ============================================================================== */
.section-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #6a6a7c;
  letter-spacing: 0.8px;
}

.nodes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

.node-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  border-radius: 12px;
}

.node-card.focused {
  border-color: var(--accent-primary);
  box-shadow: 0 0 28px rgba(92, 92, 252, 0.35);
}

.node-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.node-info-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.node-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-country-flag {
  font-size: 15px;
}

.node-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.node-subtext {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #838398;
}

.node-ip-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #555566;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

/* Circular Metric Gauges */
.node-gauges-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gauge-circle-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}

.gauge-value-bar {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.gauge-val-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #7b7b90;
  letter-spacing: 0.5px;
}

/* Node Specs & Telemetry Footer */
.node-specs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #8b8b9e;
}

.node-ping-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ping-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.node-apps-badge {
  background: rgba(92, 92, 252, 0.12);
  color: #a5a5ff;
  border: 1px solid rgba(92, 92, 252, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

/* ==============================================================================
   BENTO SECTION: DISTRIBUTED APPLICATION WORKLOADS
   ============================================================================== */
.apps-toolbar {
  flex-wrap: wrap;
  gap: 14px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: var(--border-hardware);
  border-radius: 8px;
  padding: 6px 12px;
  color: #7c7c90;
  min-width: 240px;
  transition: border-color var(--transition-fast);
}

.search-input-wrap:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px rgba(92, 92, 252, 0.25);
  color: #fff;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  width: 100%;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-pill {
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #8b8b9e;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  color: #fff;
}

.filter-pill.active {
  background: rgba(92, 92, 252, 0.2);
  color: #fff;
  border: 1px solid rgba(92, 92, 252, 0.4);
}

/* Application Cards Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1400px) {
  .apps-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .apps-grid { grid-template-columns: 1fr; }
}

.app-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  background: var(--bg-surface);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(92, 92, 252, 0.35);
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.app-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.app-category {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: #7b7b90;
}

.app-node-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: #a4a4b8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: fit-content;
}

/* Sparkline Graph Canvas */
.sparkline-box {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.sparkline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.sparkline-label {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #555566;
  letter-spacing: 0.5px;
}

/* App Metrics Strip */
.app-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 6px;
}

.app-metric-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.am-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #69697c;
}

.am-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* App Card Footer Actions */
.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.app-port-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7b7b90;
}

.app-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-probe {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(92, 92, 252, 0.12);
  border: 1px solid rgba(92, 92, 252, 0.3);
  color: #9d9dff;
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-probe:hover {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(92, 92, 252, 0.5);
}

.btn-diagnose {
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a4a4b8;
  font-size: 11px;
  cursor: pointer;
}

.btn-diagnose:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ==============================================================================
   DUAL BENTO BOTTOM: LATENCY MATRIX & INCIDENT SENTINEL
   ============================================================================== */
.bottom-bento-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

@media (max-width: 1080px) {
  .bottom-bento-split { grid-template-columns: 1fr; }
}

.bento-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}

/* Latency Matrix Table */
.latency-table-wrap {
  overflow-x: auto;
}

.latency-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
}

.latency-matrix-table th {
  text-align: left;
  padding: 8px 10px;
  color: #7b7b90;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.latency-matrix-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.node-badge {
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 4px;
  color: #e0e0ea;
  font-weight: 600;
}

.interconnect-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8b8b9e;
}

.ic-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-fast { background: var(--accent-emerald); }
.dot-mid { background: var(--accent-cyan); }
.dot-trans { background: var(--accent-warn); }

/* Incident Sentinel Stream */
.incident-sentinel-card {
  max-height: 380px;
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888899;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.log-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.live-stream-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-emerald);
}

.pulsing-record {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseBlink 1.2s infinite;
}

.incident-stream-terminal {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.incident-log-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 2px solid var(--accent-primary);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.incident-log-row.severity-WARN {
  border-left-color: var(--accent-warn);
  background: rgba(255, 176, 32, 0.05);
}

.incident-log-row.severity-CRITICAL {
  border-left-color: var(--accent-ruby);
  background: rgba(255, 51, 102, 0.08);
}

.incident-log-row.severity-INFO {
  border-left-color: var(--accent-cyan);
}

.log-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  color: #7b7b90;
}

.log-title {
  font-weight: 700;
  color: #fff;
}

.log-desc {
  color: #9d9db0;
  font-size: 10.5px;
  line-height: 1.4;
}

/* ==============================================================================
   FOOTER
   ============================================================================== */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6d6d80;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.footer-badge {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.25);
  color: var(--accent-emerald);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 600;
}

/* ==============================================================================
   MODALS & DRAWERS
   ============================================================================== */
.modal-backdrop, .drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active, .drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background: #0d0d14;
  border: 1px solid rgba(92, 92, 252, 0.35);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(92, 92, 252, 0.2);
  transform: scale(0.96);
  transition: transform 0.25s var(--ease-spring);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-wide {
  max-width: 760px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap h3 {
  font-family: var(--font-display);
  font-size: 17px;
  color: #fff;
  font-weight: 700;
}

.modal-close-btn, .drawer-close-btn {
  background: transparent;
  border: none;
  color: #8b8b9e;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover, .drawer-close-btn:hover {
  color: #fff;
}

/* Modal Form Styles */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #a4a4b8;
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(0, 0, 0, 0.45);
  border: var(--border-hardware);
  border-radius: 7px;
  padding: 9px 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(92, 92, 252, 0.3);
}

.form-tip {
  font-size: 10px;
  color: #6a6a7c;
  font-family: var(--font-mono);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* VPS Agent Modal Elements */
.modal-desc {
  font-size: 13px;
  color: #b0b0c2;
  line-height: 1.6;
}

.code-terminal-box {
  background: #050508;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 14px 0;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8b8b9e;
}

.copy-code-btn {
  background: rgba(92, 92, 252, 0.2);
  border: 1px solid rgba(92, 92, 252, 0.4);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.copy-code-btn:hover {
  background: var(--accent-primary);
}

.code-terminal-box pre {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  overflow-x: auto;
}

.agent-instructions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.instruction-col h4 {
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  margin-bottom: 8px;
}

.instruction-col ol, .instruction-col ul {
  padding-left: 18px;
  font-size: 11.5px;
  color: #8f8fa0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.instruction-col code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  color: #e4e4ee;
}

/* Diagnostics Drawer */
.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

.drawer-panel {
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  border-radius: 0;
  border-left: 1px solid rgba(92, 92, 252, 0.35);
  background: #09090e;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-spring);
}

.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title-wrap h3 {
  font-family: var(--font-display);
  font-size: 17px;
  color: #fff;
  font-weight: 700;
}

/* Colors & Helpers */
.text-cyan { color: var(--accent-cyan) !important; }
.text-primary { color: var(--accent-primary) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-warn { color: var(--accent-warn) !important; }
.text-ruby { color: var(--accent-ruby) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-dim { color: #5a5a6e !important; }
.font-bold { font-weight: 700 !important; }

.trend-good { color: var(--accent-emerald); }
.trend-warn { color: var(--accent-warn); }

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}
