/* Vacris Day/Night System r41
   Capa final de tema. Se carga después de horizon-system.css y solo corrige
   contraste, coherencia día/noche y detalles visuales; no cambia estructura,
   datos ni comportamiento. Reversible quitando este archivo de las plantillas. */

/* ---------- Tokens ---------- */
html[data-theme="light"]{
  --bg:#f3f7fb;--panel:#ffffff;--raised:#f6f9fc;--line:#c9d6e3;--text:#0f1d2b;--muted:#4b5f71;
  --green:#08714a;--gold:#7d5a12;--red:#a42f2b;--nav:#0b2941;--nav-soft:#e7eef5;--chart:#1f6fae;
  --r41-accent:#0e7490;--r41-accent-strong:#0b5f77;--r41-on-accent:#ffffff;
  --r41-surface:#ffffff;--r41-surface-2:#f2f6fa;--r41-border:#cfdbe7;
  --r41-shadow:0 1px 2px rgba(15,29,43,.05),0 10px 30px rgba(15,29,43,.07);
  --hz-muted:#4a6072;--hz-red:#b42d2a;
  color-scheme:light;
}
html[data-theme="dark"]{
  --r41-accent:#3fd0e0;--r41-accent-strong:#67e8f9;--r41-on-accent:#04131f;
  --r41-surface:#0b1d2e;--r41-surface-2:#0f2538;--r41-border:#24405a;
  --r41-shadow:0 18px 50px rgba(0,6,14,.35);
  color-scheme:dark;
}

/* Transición suave al cambiar de fondo; se desactiva con reduce-motion */
html.r41-theme-switching,html.r41-theme-switching *{transition:background-color .35s ease,border-color .35s ease,color .25s ease,fill .35s ease!important}
@media (prefers-reduced-motion:reduce){html.r41-theme-switching,html.r41-theme-switching *{transition:none!important}}

/* ---------- Navegación (fondo día) ---------- */
/* Una regla heredada de extra.css (nav a:first-child) pintaba "Resumen" como activo
   en todas las pantallas. Solo la pestaña activa lleva el color sólido. */
html[data-theme="light"] .app-tabs a{color:#34495d}
html[data-theme="light"] .app-tabs a:first-child:not(.active){background:var(--nav-soft);color:#34495d}
html[data-theme="light"] .app-tabs a:hover:not(.active){background:#d9e5f0;color:#0f1d2b}
html[data-theme="light"] .app-tabs a.active{background:var(--nav);color:#fff}
html[data-theme="light"] header.app-header .brand-panel p{color:#0b6b84!important}
html[data-theme="light"] .header-actions .language button:not(.active){color:#2f4559!important}
html[data-theme="light"] .section-label,html[data-theme="light"] body>footer,html[data-theme="light"] body>footer b,html[data-theme="light"] body>footer span{color:#40566b}

/* ---------- Resumen: tarjeta de patrimonio ---------- */
html[data-theme="light"] .dashboard-overview .wealth-primary{
  background:radial-gradient(circle at 85% 18%,rgba(14,116,144,.12),transparent 16rem),linear-gradient(145deg,#ffffff,#eaf3f9)!important;
  box-shadow:var(--r41-shadow)}
html[data-theme="light"] .dashboard-overview .wealth-primary,
html[data-theme="light"] .dashboard-overview .wealth-primary span,
html[data-theme="light"] .dashboard-overview .wealth-primary small,
html[data-theme="light"] .dashboard-overview .wealth-primary strong{color:var(--text)}
html[data-theme="light"] .dashboard-overview .wealth-primary span,
html[data-theme="light"] .dashboard-overview .wealth-primary small{color:#40566b}

/* ---------- Mapa mundial (fondo día): tierra en azul petróleo, no rosa ---------- */
html[data-theme="light"] .natural-earth-map{opacity:.7;filter:brightness(0) saturate(100%) invert(39%) sepia(42%) saturate(640%) hue-rotate(155deg) brightness(92%) contrast(92%);mix-blend-mode:multiply}
html[data-theme="light"] .natural-earth-image{opacity:.7;filter:brightness(0) saturate(100%) invert(39%) sepia(42%) saturate(640%) hue-rotate(155deg) brightness(92%) contrast(92%)}

/* ---------- Encabezados de módulo oscuros dentro del fondo día ---------- */
html[data-theme="light"] .investment-page-head small,
html[data-theme="light"] .explorer-source-state small{color:#b7cad9}

/* ---------- Conexiones y estados ---------- */
html[data-theme="light"] .engine-card.unconfigured{opacity:.92}
html[data-theme="light"] .engine-card small{color:#2c4052}
html[data-theme="light"] .investment-page-head .status-indicator.off b{color:#ffaaa5}
html[data-theme="light"] .status-indicator.off b{color:#8f2622}
html[data-theme="light"] .status-indicator.locked b{color:#6b4a0e}
html[data-theme="dark"] .status-indicator.locked b{color:#ffd37a}
html[data-theme="light"] .broker-connect-action{color:#155a91}
html[data-theme="dark"] .engine-card small{color:#b9c9d6}

/* ---------- Administración ---------- */
html[data-theme="light"] .admin-kpis strong{color:var(--text)!important}
html[data-theme="light"] .button.danger{color:#9c1f1f;background:#fdecec;border-color:#e7a3a3}
html[data-theme="dark"] .user-manager>summary{color:#cfe6f5}

/* ---------- Botones deshabilitados: legibles y con razón visible ---------- */
.button:disabled,button.button[disabled]{opacity:.62;cursor:not-allowed;filter:saturate(.55)}
html[data-theme="light"] .button:disabled,html[data-theme="light"] button.button[disabled]{color:#123247}

/* ---------- Foco accesible coherente en ambos fondos ---------- */
:focus-visible{outline:2px solid var(--r41-accent);outline-offset:2px}

/* ---------- Interruptor de tema ---------- */
.theme-toggle .theme-icon{display:inline-block;transition:transform .45s cubic-bezier(.2,.8,.2,1)}
html[data-theme="light"] .theme-toggle .theme-icon{transform:rotate(90deg)}
@media (prefers-reduced-motion:reduce){.theme-toggle .theme-icon{transition:none}}

/* ---------- Enlaces de acción sobre fondo claro ---------- */
html[data-theme="light"] .featured-market-card>a,html[data-theme="light"] .explain-card>a,html[data-theme="light"] .radar-board>a,
html[data-theme="light"] .radar-board>.command-card-head>a,html[data-theme="light"] .radar-lanes header span,
html[data-theme="light"] .next-action-card li span{color:#0b6b84!important}

/* ---------- Estado real de cobertura ---------- */
.coverage-region.pending>i{background:#c58a1b;box-shadow:none}
.coverage-region.pending>strong{color:#c58a1b}
html[data-theme="light"] .coverage-region.pending>strong{color:#7d5a12}

/* ---------- Acceso: sin etiquetas superpuestas ni estados no verificados ----------
   Las etiquetas del globo repetían la fila inferior y se superponían con el titular.
   La fila "Datos verificables · Doble IA · Control humano" conserva el mensaje. */
.login-horizon .world-status{display:none}
html[data-theme="light"] .investment-page-head .status-indicator.locked b{color:#ffd37a}
