/* NEXUS ENTERPRISE DASHBOARD THEME (NOC Environment) */
:root {
  --nx-bg: #0b0e14; /* Deep Data Center Black */
  --nx-surface: #131822; /* Widget Canvas */
  --nx-surface-hover: #1a202c;
  --nx-border: #1f2937;
  --nx-text: #e2e8f0;
  --nx-text-muted: #8b9eb7;
  --nx-brand: #0284c7; /* Enterprise Tech Blue */
  --nx-brand-glow: rgba(2, 132, 199, 0.4);
  --nx-healthy: #10b981;
  --nx-warning: #f59e0b;
  --nx-critical: #ef4444; 
  --nx-font: 'Inter', -apple-system, sans-serif;
  --nx-mono: 'Share Tech Mono', monospace;
}

body.nexus-theme {
  background: var(--nx-bg);
  color: var(--nx-text);
  font-family: var(--nx-font);
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =======================================
   NOC SIDEBAR (Network Operations)
   ======================================= */
.nx-sidebar {
  width: 260px;
  background: #080a0f;
  border-right: 1px solid var(--nx-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.nx-logo-container {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--nx-border);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.nx-logo-container span { color: var(--nx-brand); margin-left: 5px; }

.nx-nav {
  padding: 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nx-nav-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--nx-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nx-nav-item:hover, .nx-nav-item.active {
  background: rgba(255,255,255,0.03);
  color: white;
}
.nx-nav-item.active {
  border-left-color: var(--nx-brand);
  background: linear-gradient(90deg, rgba(2,132,199,0.1) 0%, transparent 100%);
}
.nx-nav-item svg { width: 18px; height: 18px; fill: currentColor; }

/* =======================================
   MAIN DASHBOARD AREA
   ======================================= */
.nx-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: radial-gradient(circle at top right, rgba(2,132,199,0.05) 0%, transparent 50%);
}

.nx-header {
  height: 60px;
  border-bottom: 1px solid var(--nx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: rgba(19, 24, 34, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nx-context-selector {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--nx-text-muted);
}
.nx-context-selector select {
  background: var(--nx-surface);
  color: white;
  border: 1px solid var(--nx-border);
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  font-family: var(--nx-font);
}

.nx-header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nx-search input {
  background: var(--nx-surface-hover);
  border: 1px solid var(--nx-border);
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  width: 250px;
  outline: none;
  font-size: 0.85rem;
}

/* =======================================
   DASHBOARD GRID (Widgets)
   ======================================= */
.nx-content {
  padding: 30px;
}

.nx-page-title {
  margin: 0 0 25px 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 15px;
}
.nx-sync-status {
  font-size: 0.75rem;
  color: var(--nx-healthy);
  background: rgba(16,185,129,0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16,185,129,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nx-sync-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nx-healthy);
  box-shadow: 0 0 8px var(--nx-healthy);
}

/* KPI CARDS */
.nx-grid-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.nx-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.nx-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: var(--nx-brand);
  opacity: 0.5;
}

.nx-card-title {
  font-size: 0.8rem;
  color: var(--nx-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px 0;
}
.nx-card-value {
  font-size: 2.2rem;
  font-family: var(--nx-mono);
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.nx-card-sub { font-size: 0.9rem; color: var(--nx-text-muted); }

/* SPECIFIC INDICATORS */
.nx-health-score .nx-card-value { color: var(--nx-healthy); text-shadow: 0 0 20px rgba(16,185,129,0.4); }
.nx-anomaly-score .nx-card-value { color: var(--nx-critical); text-shadow: 0 0 20px rgba(239,68,68,0.4); }

/* MAIN PANELS GRID */
.nx-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.nx-panel {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.nx-panel-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--nx-border);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.nx-panel-body {
  padding: 20px;
  flex: 1;
}

/* FAKE TELEMETRY CHART (CSS Art) */
.nx-telemetry-chart {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 2%;
  position: relative;
  border-bottom: 1px solid var(--nx-border);
  border-left: 1px solid var(--nx-border);
  padding-bottom: 10px;
  padding-left: 10px;
}
.nx-bar {
  flex: 1;
  background: linear-gradient(to top, var(--nx-brand), transparent);
  border-top: 2px solid var(--nx-brand);
  border-radius: 2px 2px 0 0;
  opacity: 0.8;
  position: relative;
  transition: opacity 0.3s;
}
.nx-bar:hover { opacity: 1; box-shadow: 0 0 15px var(--nx-brand-glow); }
.nx-bar-critical {
  background: linear-gradient(to top, var(--nx-critical), transparent);
  border-top-color: var(--nx-critical);
}

/* ANOMALY TABLE */
.nx-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.nx-table th { text-align: left; padding: 10px; color: var(--nx-text-muted); border-bottom: 1px solid var(--nx-border); font-weight: normal; }
.nx-table td { padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.02); font-family: var(--nx-mono); }
.nx-table tr:hover { background: rgba(255,255,255,0.02); }

.nx-badge { padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-family: var(--nx-font); font-weight: bold; }
.nx-badge.critical { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.5); }
.nx-badge.major { background: rgba(245,158,11,0.2); color: #fcd34d; border: 1px solid rgba(245,158,11,0.5); }
.nx-badge.cleared { background: rgba(16,185,129,0.2); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.5); }

/* PORTFOLIO BACK BUTTON */
.nx-back-portfolio {
  background: transparent;
  color: var(--nx-brand);
  border: 1px solid var(--nx-brand);
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.nx-back-portfolio:hover {
  background: var(--nx-brand);
  color: white;
  box-shadow: 0 0 15px var(--nx-brand-glow);
}
