/* ============================================================================
   TEMA CLARO para toda la app — <html class="tema-claro"> (25/11/2026)
   ----------------------------------------------------------------------------
   Los módulos dibujan sobre el tema oscuro (.tema-oscuro, tema-oscuro.css) y
   sus tokens --to-*. Aquí se cambian esos tokens por los del macOS claro y se
   corrige lo que el tema oscuro escribe con color fijo pensado para fondo
   negro (grises translúcidos blancos, el azul claro de los enlaces, las
   cabeceras azul noche con texto blanco). Es la generalización de lo que
   Gestión de equipos tenía solo para sus pantallas (equipos.css, eq-claro).

   Lo cambia el sol / luna del menú (js/tema.js). La barra lateral queda
   oscura en los dos temas.
   ============================================================================ */

html.tema-claro .tema-oscuro {
    --to-bg:      #ffffff;
    --to-card:    #f5f5f7;
    --to-card-2:  #ffffff;
    --to-field:   #ffffff;
    --to-line:    rgba(0, 0, 0, 0.08);
    --to-line-2:  rgba(0, 0, 0, 0.14);
    --to-text:    rgba(0, 0, 0, 0.85);
    --to-text-2:  rgba(0, 0, 0, 0.55);
    --to-text-3:  rgba(0, 0, 0, 0.35);
    --to-hover:   rgba(0, 0, 0, 0.035);
    --to-accent:  #007aff;
    --to-red:     #d70015;
    --to-green:   #248a3d;
    --to-amber:   #c93400;
    --to-purple:  #8944ab;
    --to-teal:    #0071a4;
    color-scheme: light;
}

/* El área de contenido: sin esto, un módulo claro quedaría sobre el fondo
   oscuro del panel. */
html.tema-claro .dashboard-main,
html.tema-claro #contentArea { background: #ffffff; }

/* Botones, pestañas y control segmentado */
html.tema-claro .tema-oscuro .to-btn:not(.pri),
html.tema-claro .tema-oscuro .btn-cancelar { background: rgba(0, 0, 0, 0.06) !important; color: var(--to-text) !important; }
html.tema-claro .tema-oscuro .to-btn:not(.pri):hover { background: rgba(0, 0, 0, 0.1) !important; }
html.tema-claro .tema-oscuro .to-btn.pri:hover { background: #0068d9 !important; }
html.tema-claro .tema-oscuro .to-segmento { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.06); }
html.tema-claro .tema-oscuro .to-segmento .to-tab:hover { background: rgba(0, 0, 0, 0.05); }
html.tema-claro .tema-oscuro .to-segmento .to-tab.active,
html.tema-claro .tema-oscuro .to-tab.active {
    background: #ffffff; color: rgba(0, 0, 0, 0.85);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

/* Campos */
html.tema-claro .tema-oscuro input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
html.tema-claro .tema-oscuro select,
html.tema-claro .tema-oscuro textarea { border-color: rgba(0, 0, 0, 0.14) !important; }

/* Overlays y modales que los módulos agregan a <body> */
html.tema-claro .tema-oscuro.proyecto-selector-overlay,
html.tema-claro .tema-oscuro.proceso-modal-overlay { background: rgba(0, 0, 0, 0.3) !important; }
html.tema-claro .tema-oscuro .proyecto-selector-modal,
html.tema-claro .tema-oscuro.proceso-modal-overlay > div,
html.tema-claro .tema-oscuro.proceso-modal-overlay > form { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important; }

/* Lo que el tema oscuro traduce a colores fijos para fondo negro */
html.tema-claro .tema-oscuro [style*="background:#f3f4f6"], html.tema-claro .tema-oscuro [style*="background: rgb(243, 244, 246)"],
html.tema-claro .tema-oscuro [style*="background:#e5e7eb"], html.tema-claro .tema-oscuro [style*="background:#e2e8f0"],
html.tema-claro .tema-oscuro [style*="background:#e9ecef"] { background: rgba(0, 0, 0, 0.05) !important; }
html.tema-claro .tema-oscuro [style*="color:#2563eb"], html.tema-claro .tema-oscuro [style*="color:#1d4ed8"],
html.tema-claro .tema-oscuro [style*="color:#1e40af"], html.tema-claro .tema-oscuro [style*="color:#3730a3"] { color: #0062cc !important; }
/* Cabeceras de modal azul noche con texto blanco: en claro, barra gris clara y texto oscuro */
html.tema-claro .tema-oscuro div[style*="background:#1a1a2e"],
html.tema-claro .tema-oscuro div[style*="background:#1e3a5f"] { background: var(--to-card) !important; border-bottom: 1px solid var(--to-line); }
html.tema-claro .tema-oscuro div[style*="background:#1a1a2e"] :is(h3, h4, span, div, i):not(.to-btn),
html.tema-claro .tema-oscuro div[style*="background:#1e3a5f"] :is(h3, h4, span, div, i):not(.to-btn) { color: var(--to-text) !important; }
html.tema-claro .tema-oscuro div[style*="background:#1a1a2e"] [style*="color:#93c5fd"] { color: var(--to-text-2) !important; }
html.tema-claro .tema-oscuro div[style*="background:#1a1a2e"] > button:not(.to-btn) { color: var(--to-text-2) !important; }

/* El sol / luna del menú usa el estilo del botón de cerrar sesión, sin su rojo. */
.sidebar-logout.tema-toggle:hover { color: var(--sb-text, #ffffff); }
