/* Contraste de texto según el tema, en todas las páginas con tema claro/oscuro:
   claro = texto negro, oscuro = texto blanco (el secundario, casi negro/blanco).
   La carga scriptTemaSegunConfiguracion() (includes/settings_helpers.php) en el
   <head>, ANTES que Bootstrap/portal.css: por eso los selectores llevan
   html[...]:root, más específicos que los de esas hojas. */

html[data-bs-theme="light"]:root,
html[data-bs-theme="light"] [data-bs-theme="light"] {
    --tx-1: #000000;
    --tx-2: #1f2937;
    --tx-3: #374151;

    --bs-body-color: #000000;
    --bs-body-color-rgb: 0, 0, 0;
    --bs-emphasis-color: #000000;
    --bs-emphasis-color-rgb: 0, 0, 0;
    --bs-secondary-color: #1f2937;
    --bs-tertiary-color: #374151;

    /* Portal / jugador / socios / fichas (portal.css y copias de sus variables) */
    --p-text: #000000;
    --p-muted: #1f2937;
    --p-subtle: #374151;
}

html[data-bs-theme="dark"]:root,
html [data-bs-theme="dark"]:not(html) {
    --tx-1: #ffffff;
    --tx-2: #e5e7eb;
    --tx-3: #cbd5e1;

    --bs-body-color: #ffffff;
    --bs-body-color-rgb: 255, 255, 255;
    --bs-emphasis-color: #ffffff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: #e5e7eb;
    --bs-tertiary-color: #cbd5e1;

    --p-text: #ffffff;
    --p-muted: #e5e7eb;
    --p-subtle: #cbd5e1;
}

/* Sidebar del panel admin: es oscuro en los dos temas, texto claro. */
html[data-bs-theme]:root {
    --app-sidebar-text: #e5e7eb;
    --app-sidebar-text-muted: #cbd5e1;
}

/* "text-secondary" se usa como texto gris en muchas pantallas. */
html[data-bs-theme] .text-secondary {
    color: var(--bs-secondary-color) !important;
}

/* Placeholders: más suaves que el texto real, para no confundirlos con un valor cargado. */
html[data-bs-theme="light"] ::placeholder { color: #6b7280; opacity: 1; }
html[data-bs-theme="dark"] ::placeholder { color: #9ca3af; opacity: 1; }
