/* ============================================================
   NEUROCHAIN VPTELEMETRIC — TRANSPARENT INTEGRATED SCADA STYLES
   ============================================================ */

:root {
  --bg-dark: #0B0F19;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  
  --primary: #06B6D4;
  --primary-hover: #0891B2;
  --accent: #3B82F6;
  
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --status-normal: #10B981;
  --status-warning: #F59E0B;
  --status-critical: #EF4444;
  --status-maintenance: #3B82F6;
  
  --color-hidrico: #06B6D4;
  --color-circular: #10B981;
  --color-gps: #3B82F6;
  --color-seguridad: #F59E0B;
  --color-core: #8B5CF6;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.2s ease;
}

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

html, body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Header */
.app-header {
  position: relative;
  z-index: 100;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 8px 24px;
}

.header-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-link {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.back-link:hover {
  color: var(--primary);
  background: rgba(6, 182, 212, 0.15);
}

.logo-group {
  display: flex;
  flex-direction: column;
}

.logo-badge {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #38BDF8;
}

.logo-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1.5px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--bg-card-border);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #FFFFFF;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.user-status-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator.live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--status-normal);
  letter-spacing: 0.5px;
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-normal);
}

.user-badge-hidden { display: none; }
.user-badge-visible {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.12);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 12px;
  font-weight: 500;
  color: #38BDF8;
}

/* Main Layout — FULL SCREEN MAXIMIZATION */
.main-content {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 54px);
  padding: 12px 20px;
  box-sizing: border-box;
}

.tab-panel {
  display: none;
  height: 100%;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Card Glass */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  padding: 14px;
}

/* SCADA Dashboard Layout */
.scada-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  height: 100%;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .scada-dashboard-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

/* Left P&ID Diagram Column */
.pid-diagram-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.header-alert-banner {
  width: 100%;
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: pulseBanner 2s infinite ease-in-out;
}

.header-alert-banner.hidden { display: none; }

.header-alert-banner.maintenance {
  background: rgba(30, 64, 175, 0.4);
  border: 1px solid #3B82F6;
  color: #60A5FA;
}

.header-alert-banner.critical {
  background: rgba(153, 27, 27, 0.4);
  border: 1px solid #EF4444;
  color: #FCA5A5;
}

@keyframes pulseBanner {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bg-card-border);
  flex-wrap: wrap;
  gap: 8px;
}

.diagram-tag {
  font-size: 10px;
  font-weight: 600;
  color: #38BDF8;
  letter-spacing: 1px;
}

.diagram-title-group h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.svg-pid-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.svg-container-official {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-container-official svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Pie de página SCADA Disclaimer & Marketing Links */
.scada-disclaimer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.disclaimer-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disclaimer-info strong {
  color: var(--status-normal);
  font-weight: 600;
}

.disclaimer-marketing {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disclaimer-link {
  color: #38BDF8;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.disclaimer-link:hover {
  color: #7DD3FC;
  text-decoration: underline;
}

.contact-hover-container {
  position: relative;
  display: inline-block;
}

.disclaimer-contact-btn {
  background: transparent;
  border: none;
  color: #10B981;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}

.disclaimer-contact-btn:hover {
  color: #FFFFFF;
  background: rgba(16, 185, 129, 0.25);
}

.contact-cta-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 290px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 0 18px rgba(16, 185, 129, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.contact-cta-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.contact-hover-container:hover .contact-cta-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.popover-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  color: #10B981;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.contact-cta-popover h4 {
  font-size: 12px;
  font-weight: 600;
  color: #F1F5F9;
  margin-bottom: 4px;
  line-height: 1.3;
}

.contact-cta-popover p {
  font-size: 10px;
  color: #94A3B8;
  line-height: 1.4;
  margin-bottom: 8px;
}

.popover-cta-action {
  font-size: 11px;
  color: #38BDF8;
  text-align: right;
}

.sep {
  color: var(--text-dim);
}

.disclaimer-timestamp strong {
  color: #38BDF8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

/* Right KPI Sidebar */
.scada-kpi-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 10px;
  overflow: visible !important;
  position: relative;
  z-index: 10;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.sidebar-header p {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Estado del Sistema Panel */
.status-panel {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.status-panel-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  display: block;
}

.status-panel-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}

.status-panel-value.green { color: var(--status-normal); }
.status-panel-value.yellow { color: var(--status-warning); }
.status-panel-value.red { color: var(--status-critical); }
.status-panel-value.blue { color: var(--status-maintenance); }

/* Hover Tooltip Popover Containers */
.hover-tooltip-container {
  position: relative;
  cursor: help;
  overflow: visible !important;
}

.info-badge {
  font-size: 10px;
  opacity: 0.8;
  margin-left: 2px;
}

.btn-hover-container {
  position: relative;
  width: 100%;
}

.kpi-info-popover {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  width: 290px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.7), 0 0 20px rgba(6, 182, 212, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2500;
}

.kpi-info-popover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(15, 23, 42, 0.96);
}

.hover-tooltip-container:hover .kpi-info-popover,
.btn-hover-container:hover .kpi-info-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.kpi-popover-title {
  font-size: 12px;
  font-weight: 700;
  color: #38BDF8;
  display: block;
  margin-bottom: 6px;
}

.kpi-info-popover p {
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.45;
  margin-bottom: 6px;
}

.kpi-info-popover code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  color: #38BDF8;
  font-family: monospace;
}

.popover-list {
  padding-left: 14px;
  font-size: 10px;
  color: #94A3B8;
  margin-bottom: 6px;
}

.popover-list li {
  margin-bottom: 3px;
}

/* Gauges Radiales */
.gauges-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow: visible !important;
}

.gauge-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.gauge-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.radial-gauge {
  position: relative;
  width: 80px;
  height: 60px;
  margin: 0 auto;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

.gauge-value {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

/* Performance Mini Chart */
.sidebar-chart-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 10px;
  overflow: visible !important;
  min-height: 110px;
}

.mini-canvas-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 80px;
  overflow: hidden;
  border-radius: 6px;
  background: #070A13;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 6px;
  position: relative;
}

.mini-canvas-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
}

/* Action Controls Box */
.action-controls-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: visible !important;
}

.action-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible !important;
}

.btn-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action.btn-warning { background: #D97706; color: #FFFFFF; }
.btn-action.btn-warning:hover { background: #B45309; }

.btn-action.btn-danger { background: #DC2626; color: #FFFFFF; }
.btn-action.btn-danger:hover { background: #B91C1C; }

.btn-action.btn-maintenance { background: #2563EB; color: #FFFFFF; }
.btn-action.btn-maintenance:hover { background: #1D4ED8; }

.btn-action.btn-success { background: #059669; color: #FFFFFF; }
.btn-action.btn-success:hover { background: #047857; }

.btn-separator {
  border: none;
  border-top: 1px dashed var(--bg-card-border);
  margin: 2px 0;
}

.action-feedback {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.action-feedback.hidden { display: none; }
.action-feedback.success { background: rgba(16, 185, 129, 0.15); color: var(--status-normal); border: 1px solid rgba(16, 185, 129, 0.3); }
.action-feedback.warning { background: rgba(245, 158, 11, 0.15); color: var(--status-warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* ============================================================
   TAB 2: RED NEURONAL — LAYOUT PERMANENTE SIDE-BY-SIDE (50% / 50%)
   ============================================================ */
.portal-hero {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.portal-hero-texto { max-width: none; }

.portal-hero-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #38BDF8;
}

.portal-hero-texto h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
  color: var(--text-main);
  margin-bottom: 6px;
}

.portal-hero-texto p {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.portal-hero-texto p strong { color: var(--text-main); font-weight: 600; }

.portal-hero-productos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-hero-productos-titulo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

@media (max-width: 700px) {
  .portal-hero {
    grid-template-columns: 1fr;
  }

  .portal-hero-cta { justify-content: flex-start; }
}

.btn-tour-guiado {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 22px 20px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(6, 182, 212, 0.28);
  border: 1px solid rgba(6, 182, 212, 0.65);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.3);
}

.btn-tour-guiado span { font-size: 20px; }

.btn-tour-guiado:hover {
  transform: translateY(-1px);
  background: rgba(6, 182, 212, 0.42);
  box-shadow: 0 6px 26px rgba(6, 182, 212, 0.5);
}

.neural-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
}

.legend-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.chip-hidrico { color: var(--color-hidrico); border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.1); }
.chip-circular { color: var(--color-circular); border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); }
.chip-gps { color: var(--color-gps); border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.1); }
.chip-seguridad { color: var(--color-seguridad); border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); }
.chip-bridge { color: #A855F7; border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.1); }

.filter-badges-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.neural-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.neural-filter-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.neural-filter-btn.active {
  background: rgba(6, 182, 212, 0.2);
  color: #FFFFFF;
  border-color: rgba(6, 182, 212, 0.5);
  font-weight: 600;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* ESTRUCTURA PERMANENTE 2/3 (GRAFO) VS 1/3 (DATOS) SIDE BY SIDE */
.neural-dashboard-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

@media (max-width: 1000px) {
  .neural-dashboard-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

/* LADO IZQUIERDO: RED NEURONAL CANVAS */
.neural-graph-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.canvas-header-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bg-card-border);
}

.canvas-header-filtros {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 260px;
}

.canvas-header-filtros-nota {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn-centrar-grafo {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.6);
  color: #67E8F9;
  font-weight: 700;
}

.btn-centrar-grafo:hover {
  background: rgba(6, 182, 212, 0.34);
  color: #FFFFFF;
}

.map-tag {
  font-size: 10px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 1px;
}

.canvas-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 550px;
  position: relative;
  background: #070A18;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#neuralCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#neuralCanvas:active {
  cursor: grabbing;
}

.neural-tooltip {
  position: absolute;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  color: #F1F5F9;
  font-size: 11px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: opacity 0.15s ease;
  max-width: 260px;
}

.neural-tooltip.hidden {
  opacity: 0;
}

/* LADO DERECHO: PANEL DE INFORMACIÓN Y TELEMETRÍA */
.neural-info-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

/* ESTADO INICIAL VACÍO (PLACEHOLDER) */
.neural-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 24px;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.5));
  animation: pulseBrain 3s infinite ease-in-out;
}

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

.neural-placeholder h3 {
  font-size: 17px;
  font-weight: 700;
  color: #F1F5F9;
  margin-bottom: 8px;
}

.neural-placeholder p {
  font-size: 12px;
  color: #94A3B8;
  max-width: 380px;
  line-height: 1.5;
}

/* CONTENIDO DETALLADO DEL NODO SELECCIONADO */
.neural-info-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.neural-info-content.hidden { display: none; }
.neural-placeholder.hidden { display: none; }

.info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-card-border);
}

.info-icon {
  font-size: 28px;
}

.info-category-tag {
  font-size: 9px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.info-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #38BDF8;
  letter-spacing: 0.8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.telemetry-body {
  margin-top: 4px;
}

.telemetry-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.telemetry-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.telemetry-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.telemetry-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #38BDF8;
}

.explanation-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--bg-card-border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.explanation-box h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.explanation-box p {
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.4;
}

.explanation-box.highlight-ai {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.05);
}

.explanation-box.highlight-ai h4 { color: #38BDF8; }

.explanation-box.highlight-roi {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.explanation-box.highlight-roi h4 { color: #10B981; }

.explanation-box.highlight-bridge {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}

.explanation-box.highlight-bridge h4 { color: #C084FC; }

.explanation-box.hidden { display: none; }

.info-action-bar {
  margin-top: 8px;
}

.btn-primary.btn-meeting-submit {
  width: 100%;
}

/* PURE OPACITY BLINK ANIMATION FOR SVG SENSOR CIRCLES */
@keyframes blinkSensor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.blink {
  animation: blinkSensor 1.0s infinite;
}

/* Modal Overlay & Gate */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(11, 15, 25, 0.88); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card { background: #0F172A; border: 1px solid var(--bg-card-border); border-radius: 16px; width: 100%; max-width: 480px; padding: 24px; }
.modal-badge.meeting { background: rgba(16, 185, 129, 0.15); color: #10B981; border-color: rgba(16, 185, 129, 0.3); }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group label { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 12px;
}
.form-group textarea { resize: vertical; }

.modal-buttons-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-primary { background: #0284C7; color: #FFFFFF; border: none; border-radius: 8px; padding: 10px 16px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-primary.btn-meeting-submit { background: #059669; }
.btn-primary.btn-meeting-submit:hover { background: #047857; }

.form-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

/* ============================================================
   RELATO COMERCIAL DEL NODO (PANEL DERECHO)
   Arco: problema -> costo -> solución -> resultados -> prueba
   ============================================================ */

.neural-info-content {
  gap: 0;
}

/* --- Portada del nodo --- */
.nodo-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #060912;
  border: 1px solid var(--bg-card-border);
  flex-shrink: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Unifica el tratamiento de color de renders de origen distinto */
  filter: saturate(0.85) brightness(0.78) contrast(1.05);
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--dominio) 26%, transparent), transparent 68%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 12px, transparent 12px 24px),
    #070A18;
}

.hero-placeholder-icon { font-size: 40px; opacity: 0.85; }

.hero-placeholder-text {
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 14px 12px;
  background: linear-gradient(to top, rgba(4, 6, 14, 0.96) 15%, rgba(4, 6, 14, 0.55) 60%, transparent);
}

.hero-categoria {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--dominio);
  margin-bottom: 3px;
}

.hero-titulo {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
}

/* --- Cuerpo del relato --- */
.relato-cuerpo {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 2px 4px;
}

.relato-bloque { display: flex; flex-direction: column; gap: 7px; }

.relato-etiqueta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.relato-problema .relato-etiqueta { color: #F87171; }
.relato-solucion .relato-etiqueta { color: #38BDF8; }
.relato-resultados .relato-etiqueta { color: #10B981; }
.relato-caso .relato-etiqueta { color: #C084FC; }
.relato-prueba .relato-etiqueta { color: #38BDF8; }
.relato-enlace .relato-etiqueta { color: #C084FC; }

.relato-titular {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text-main);
}

.relato-texto {
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--text-muted);
}

.relato-nota {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  opacity: 0.75;
}

/* --- Costo de no actuar --- */
.costo-statuquo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 3px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.07);
  border-left: 2px solid #F87171;
}

.costo-etiqueta {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #F87171;
}

.costo-valor { font-size: 13px; font-weight: 600; color: var(--text-main); }

.tech-tag {
  align-self: flex-start;
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  color: #7DD3FC;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* --- KPIs de negocio --- */
.kpi-grid { display: flex; flex-direction: column; gap: 8px; }

.kpi-card {
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.16);
}

.kpi-card.kpi-pendiente {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--bg-card-border);
  border-style: dashed;
}

.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.kpi-transicion {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.kpi-antes {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.65;
}

.kpi-flecha { color: #10B981; font-size: 13px; }

.kpi-despues { font-size: 20px; font-weight: 700; color: #10B981; }

.kpi-card.kpi-pendiente .kpi-despues { font-size: 14px; }

.kpi-unidad {
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.8;
}

.payback-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
}

.payback-etiqueta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #10B981;
}

.payback-valor { font-size: 15px; font-weight: 700; color: var(--text-main); }

/* --- Caso de implementación --- */
.caso-box {
  padding: 12px;
  border-radius: 8px;
  background: rgba(192, 132, 252, 0.06);
  border: 1px solid rgba(192, 132, 252, 0.18);
}

.caso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.caso-campo { display: flex; flex-direction: column; gap: 2px; }

.caso-etiqueta {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.caso-valor { font-size: 12.5px; font-weight: 600; color: var(--text-main); }

.caso-cita {
  margin-top: 11px;
  padding-left: 10px;
  border-left: 2px solid #C084FC;
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.55;
  color: var(--text-muted);
}

/* --- Marcador de contenido por completar --- */
.dato-pendiente {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  font-style: normal;
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px dashed rgba(251, 191, 36, 0.4);
  cursor: help;
}

.info-action-bar { padding: 16px 0 4px; }

/* ============================================================
   DEMOS EN VIVO A PANTALLA COMPLETA
   Reemplazan a las antiguas pestañas: se abren desde el nodo del
   grafo que las explica.
   ============================================================ */

.deep-dive {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: var(--bg-main, #05070F);
  flex-direction: column;
  animation: deepDiveIn 0.22s ease-out;
}

.deep-dive.active { display: flex; }

@keyframes deepDiveIn {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

body.deep-dive-abierto { overflow: hidden; }

.deep-dive-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 12px 20px;
  background: rgba(8, 12, 26, 0.96);
  border-bottom: 1px solid var(--bg-card-border);
}

.deep-dive-tag {
  display: inline-block;
  margin-bottom: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #10B981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.deep-dive-titulo h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.deep-dive-cerrar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.deep-dive-cerrar:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(56, 189, 248, 0.45);
}

.deep-dive-cuerpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 24px;
}

/* --- Lanzador de la demo desde el relato del nodo --- */
.demo-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 10px;
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.demo-launcher:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.16);
}

.demo-launcher-icono {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 12px;
  color: #05070F;
  background: #38BDF8;
}

.demo-launcher-texto { display: flex; flex-direction: column; gap: 2px; }
.demo-launcher-texto strong { font-size: 12.5px; font-weight: 700; }

.demo-launcher-texto span {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ============================================================
   DEMO DE FLOTA GPS
   Estos estilos no existían: la vista vivía detrás del muro de
   registro y nunca se había mirado. Al promoverla a demo comercial
   necesita el mismo acabado que el resto del portal.
   ============================================================ */

.deep-dive .panel-header {
  margin-bottom: 16px;
}

.deep-dive .panel-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.assets-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.asset-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
}

.asset-stat-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.14);
}

.asset-stat-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.asset-stat-label {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.table-container { padding: 0; overflow: hidden; }

.table-container .card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--bg-card-border);
}

.table-container .card-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(8, 12, 26, 0.96);
  border-bottom: 1px solid var(--bg-card-border);
}

.data-table tbody td {
  padding: 11px 14px;
  white-space: nowrap;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(56, 189, 248, 0.05); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.badge-success {
  color: #10B981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* --- Barra del recorrido guiado --- */
.tour-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.tour-bar.hidden { display: none; }

.tour-bar-info { flex: 1; min-width: 200px; }

.tour-bar-paso {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #C4B5FD;
  margin-bottom: 2px;
}

.tour-bar-nota {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-main);
}

.tour-bar-acciones {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-tour-siguiente {
  padding: 7px 14px;
  font-size: 12px;
  background: #8B5CF6;
}

.btn-tour-siguiente:hover { background: #7C3AED; }

.btn-tour-salir {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
}

.btn-tour-salir:hover { color: var(--text-main); border-color: rgba(255, 255, 255, 0.25); }

/* --- Señal de primera visita --- */
.onboarding-hint {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(10, 14, 28, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: onboardingFlota 2.2s ease-in-out infinite;
  pointer-events: none;
}

.onboarding-hint.hidden { display: none; }

.onboarding-hint-icono { font-size: 18px; flex-shrink: 0; }

.onboarding-hint-texto {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-main);
}

.onboarding-hint-texto strong { color: #7DD3FC; }

@keyframes onboardingFlota {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
