/* DOMINUS43 - Tema claro/oscuro global */
:root { color-scheme: dark; }
html.light { color-scheme: light; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(15,23,42,.72); color: #e2e8f0;
  transition: .2s ease; box-shadow: 0 6px 20px rgba(2,6,23,.18);
}
.theme-toggle:hover { transform: translateY(-1px); background: rgba(30,41,59,.92); }
.theme-toggle .icon-sun { display:none; }
html.light .theme-toggle .icon-moon { display:none; }
html.light .theme-toggle .icon-sun { display:inline-block; }

html.light body { background:#f3f6fb !important; color:#172033 !important; }
html.light .glass { background:rgba(255,255,255,.94) !important; border-color:#dbe3ee !important; box-shadow:0 8px 28px rgba(15,23,42,.07); }
html.light #sidebar { background:#fff !important; border-color:#dbe3ee !important; }
html.light main { background:#f3f6fb !important; }

/* Fondos Tailwind oscuros */
html.light [class*="bg-slate-950"], html.light [class*="bg-dark-bg"] { background-color:#f3f6fb !important; }
html.light [class*="bg-slate-900"] { background-color:#ffffff !important; }
html.light [class*="bg-slate-800"] { background-color:#f1f5f9 !important; }
html.light [class*="bg-slate-700"] { background-color:#e8eef6 !important; }
html.light [class*="from-slate-950"], html.light [class*="via-slate-900"], html.light [class*="to-slate-950"] { --tw-gradient-from:#fff !important; --tw-gradient-via:#f8fafc !important; --tw-gradient-to:#eef3f9 !important; }

/* Textos */
html.light .text-white, html.light [class*="text-slate-100"], html.light [class*="text-gray-100"] { color:#111827 !important; }
html.light [class*="text-slate-200"], html.light [class*="text-gray-200"] { color:#263247 !important; }
html.light [class*="text-slate-300"], html.light [class*="text-gray-300"] { color:#475569 !important; }
html.light [class*="text-slate-400"], html.light [class*="text-gray-400"] { color:#64748b !important; }
html.light [class*="text-slate-500"], html.light [class*="text-gray-500"] { color:#64748b !important; }

/* Bordes y sombras */
html.light [class*="border-slate-800"], html.light [class*="border-slate-700"], html.light [class*="border-gray-700"] { border-color:#dbe3ee !important; }
html.light [class*="shadow-slate-900"] { --tw-shadow-color:rgba(15,23,42,.12) !important; }

/* Inputs, select, textarea */
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select, html.light textarea {
  background:#fff !important; color:#172033 !important; border-color:#cbd5e1 !important;
}
html.light input::placeholder, html.light textarea::placeholder { color:#94a3b8 !important; }

/* Tablas y tarjetas */
html.light table { color:#172033; }
html.light thead, html.light [class*="bg-slate-900\/"], html.light [class*="bg-slate-800\/"] { background:#f8fafc !important; }
html.light tbody tr { border-color:#e2e8f0 !important; }
html.light tbody tr:hover { background:#f8fafc !important; }
html.light .premium-card { box-shadow:0 8px 24px rgba(15,23,42,.07); }
html.light .premium-card:hover { box-shadow:0 16px 35px rgba(15,23,42,.12); }

/* Menú lateral */
html.light #sidebar nav a { color:#334155; }
html.light #sidebar nav a:hover { background:#eaf2ff !important; color:#2563eb !important; }
html.light #sidebar .text-yellow-500 { color:#b7791f !important; }

/* Login */
html.light .login-shell { border-color:#dbe3ee !important; box-shadow:0 24px 55px rgba(15,23,42,.13) !important; }
html.light .login-info { background:linear-gradient(135deg,#ffffff,#f5f8fc,#edf3fa) !important; }
html.light .login-form-side { background:#f8fafc !important; }
html.light .login-card { background:#fff !important; }
html.light .login-orb { opacity:.45; }

/* Mantener textos blancos dentro de botones de color */
html.light .bg-red-600, html.light .bg-blue-600, html.light [class*="from-blue-500"], html.light [class*="to-violet-500"] { color:#fff !important; }

@media (max-width: 767px) {
  .theme-toggle { width:38px; height:38px; border-radius:10px; }
}

/* ================================================================
   DOMINUS43 · MODO DÍA PROFESIONAL v2
   Solo se activa con html.light. El modo oscuro queda intacto.
   ================================================================ */
html.light body {
  background: #f4f7fb !important;
  color: #172033 !important;
}
html.light main {
  background:
    radial-gradient(circle at 92% 5%, rgba(59,130,246,.08), transparent 28%),
    radial-gradient(circle at 8% 92%, rgba(14,165,233,.06), transparent 24%),
    #f4f7fb !important;
}
html.light #sidebar,
html.light header.glass {
  background: rgba(255,255,255,.98) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 0 rgba(15,23,42,.04) !important;
}
html.light #sidebar {
  box-shadow: 8px 0 30px rgba(15,23,42,.045) !important;
}
html.light #sidebar nav a {
  color: #334155 !important;
  border-color: transparent;
}
html.light #sidebar nav a:hover {
  color: #0f56c9 !important;
  background: #eef5ff !important;
}
html.light #sidebar nav a.bg-slate-800\/50 {
  color: #9a6700 !important;
  background: #fff8e6 !important;
  border-color: #f6d88d !important;
}
html.light header .theme-toggle {
  background: #ffffff !important;
  color: #f59e0b !important;
  border-color: #dbe4ef !important;
  box-shadow: 0 5px 15px rgba(15,23,42,.10) !important;
}
html.light header .theme-toggle:hover {
  background: #fff8e6 !important;
  border-color: #f6cc68 !important;
}

/* Tipografía: títulos y textos siempre legibles */
html.light h1,
html.light h2,
html.light h3,
html.light h4,
html.light .text-white,
html.light [class*="from-white"] {
  color: #111827 !important;
  -webkit-text-fill-color: initial !important;
  background-image: none !important;
}
html.light [class*="text-gray-200"],
html.light [class*="text-slate-200"] { color: #334155 !important; }
html.light [class*="text-gray-300"],
html.light [class*="text-slate-300"] { color: #475569 !important; }
html.light [class*="text-gray-400"],
html.light [class*="text-slate-400"] { color: #64748b !important; }

/* Superficies generales */
html.light .glass,
html.light .premium-card,
html.light section,
html.light [class*="bg-slate-900\/"],
html.light [class*="bg-slate-800\/"] {
  border-color: #e1e7ef !important;
}
html.light .premium-card {
  background: #ffffff !important;
  box-shadow: 0 7px 22px rgba(15,23,42,.065) !important;
}
html.light .premium-card:hover {
  box-shadow: 0 14px 32px rgba(15,23,42,.105) !important;
  filter: none !important;
}
html.light .premium-card::before { display:none !important; }

/* Formularios */
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: #cfd9e6 !important;
  box-shadow: none !important;
}
html.light input:focus,
html.light select:focus,
html.light textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.13) !important;
}
html.light option { background:#fff !important; color:#172033 !important; }

/* Tablas limpias, sin tonalidad azul lavada */
html.light table {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: #dfe6ef !important;
}
html.light thead,
html.light thead tr,
html.light thead th {
  background: #f7f9fc !important;
  color: #344155 !important;
  border-color: #dfe6ef !important;
}
html.light tbody,
html.light tbody tr,
html.light tbody td {
  background: #ffffff !important;
  border-color: #e7ecf2 !important;
}
html.light tbody tr:nth-child(even) td { background:#fbfcfe !important; }
html.light tbody tr:hover td { background:#f3f7fd !important; }

/* Paneles y barras de filtros */
html.light [class*="bg-black\/40"],
html.light [class*="bg-black\/30"],
html.light [class*="bg-slate-950"],
html.light [class*="bg-dark-bg"] {
  background: #ffffff !important;
  color: #172033 !important;
}
html.light [class*="border-slate-700"],
html.light [class*="border-slate-800"] { border-color:#d8e1ec !important; }

/* Dashboard: tarjetas con color, contraste alto y texto negro */
html.light .neo-card {
  background: #ffffff !important;
  border: 1px solid #dde5ef !important;
  box-shadow: 0 9px 25px rgba(15,23,42,.075) !important;
  backdrop-filter: none !important;
}
html.light .neo-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 16px 34px rgba(15,23,42,.12) !important;
  filter: none !important;
}
html.light .neo-card.glow-green  { background: linear-gradient(135deg,#bbf7d0,#ecfdf5) !important; border-color:#86efac !important; }
html.light .neo-card.glow-red    { background: linear-gradient(135deg,#fecaca,#fff1f2) !important; border-color:#fda4af !important; }
html.light .neo-card.glow-blue   { background: linear-gradient(135deg,#bfdbfe,#eff6ff) !important; border-color:#93c5fd !important; }
html.light .neo-card.glow-purple { background: linear-gradient(135deg,#ddd6fe,#f5f3ff) !important; border-color:#c4b5fd !important; }
html.light .neo-card.glow-orange { background: linear-gradient(135deg,#fde68a,#fff7ed) !important; border-color:#fdba74 !important; }
html.light .neo-card.glow-cyan   { background: linear-gradient(135deg,#a5f3fc,#ecfeff) !important; border-color:#67e8f9 !important; }
html.light .neo-card.glow-slate  { background:#ffffff !important; border-color:#d8e1ec !important; }

/* En tarjetas de métricas, letras negras y secundarias oscuras */
html.light .neo-card:not(.glow-slate) h3,
html.light .neo-card:not(.glow-slate) .text-white,
html.light .neo-card:not(.glow-slate) .text-gray-200,
html.light .neo-card:not(.glow-slate) p,
html.light .neo-card:not(.glow-slate) div {
  color: #172033;
}
html.light .neo-card .text-green-400 { color:#086b42 !important; }
html.light .neo-card .text-red-400,
html.light .neo-card .text-red-500 { color:#a7192f !important; }
html.light .neo-card .text-blue-400,
html.light .neo-card .text-blue-300 { color:#1558a8 !important; }
html.light .neo-card .text-purple-400,
html.light .neo-card .text-purple-300,
html.light .neo-card .text-purple-500 { color:#6d32a8 !important; }
html.light .neo-card .text-orange-400,
html.light .neo-card .text-orange-300,
html.light .neo-card .text-orange-500 { color:#9a4c08 !important; }
html.light .neo-card .text-cyan-400,
html.light .neo-card .text-cyan-300 { color:#08758b !important; }
html.light .neo-card [class*="bg-green-500\/10"] { background:rgba(5,150,105,.14) !important; }
html.light .neo-card [class*="bg-red-500\/10"] { background:rgba(225,29,72,.12) !important; }
html.light .neo-card [class*="bg-slate-800"] { background:rgba(255,255,255,.65) !important; }

/* El formulario de filtros y los gráficos deben ser blancos, no coloridos */
html.light form.neo-card,
html.light .neo-card.glow-slate,
html.light .neo-card:has(canvas) {
  background: #ffffff !important;
  border-color: #dce4ee !important;
}
html.light form.neo-card [class*="bg-black\/40"] {
  background:#f7f9fc !important;
}
html.light form.neo-card a.bg-slate-800 {
  background:#eef2f7 !important;
  color:#243247 !important;
  border-color:#d7e0eb !important;
}
html.light form.neo-card a.bg-slate-800:hover {
  background:#e5ebf3 !important;
  color:#0f56c9 !important;
}

/* Noticias: conservar señalización clara */
html.light .neo-card[class*="bg-blue-500"] { background:#eaf3ff !important; border-color:#a8cdfd !important; }
html.light .neo-card[class*="bg-yellow-500"] { background:#fff7d6 !important; border-color:#efd071 !important; }
html.light .neo-card[class*="bg-red-500"] { background:#fff0f2 !important; border-color:#f1a7b2 !important; }

/* Botones de acción mantienen texto blanco */
html.light a.bg-red-600,
html.light button.bg-red-600,
html.light a.bg-blue-600,
html.light button.bg-blue-600,
html.light a.bg-green-600,
html.light button.bg-green-600 {
  color:#fff !important;
}

/* Móvil */
@media (max-width: 767px) {
  html.light main { padding-left:14px !important; padding-right:14px !important; }
  html.light .neo-card { box-shadow:0 6px 18px rgba(15,23,42,.07) !important; }
}
