/* ============================================================
 * contraste_global.css — DC Eléctricos  (v2, conservador)
 * ------------------------------------------------------------
 * Arregla SOLO los problemas reales de contraste en tema oscuro
 * SIN romper los estilos propios de cada plataforma:
 *   - <option> del dropdown nativo invisible en dark
 *   - texto/flechas de los <select> (NO se fuerza appearance)
 *   - placeholders muy claros en dark
 *   - date/time pickers con esquema invertido
 *   - autofill de Chrome con texto negro sobre fondo claro
 *
 * Regla de oro: actuar únicamente cuando hay un tema oscuro
 * declarado con [data-theme="dark"] (inventario y remisiones).
 * Las plataformas claras NO se ven afectadas.
 * ============================================================ */

/* Informa al navegador el esquema → controles nativos (flecha del
   select, spinners, checkbox) se pintan en el color correcto. */
html[data-theme="dark"],  body[data-theme="dark"]  { color-scheme: dark; }
html[data-theme="light"], body[data-theme="light"] { color-scheme: light; }

/* ── OPTIONS del dropdown nativo en tema oscuro ──────────────
   Este es el problema principal: el panel desplegable usa los
   colores del SO y queda texto oscuro sobre fondo oscuro. */
[data-theme="dark"] select option,
[data-theme="dark"] select optgroup {
    background-color: #14223a;
    color: #e8eef7;
}
[data-theme="dark"] select option:checked {
    background-color: #1f3357;
    color: #ffffff;
}

/* ── Placeholders legibles en dark ─────────────────────────── */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: rgba(216, 229, 243, .50);
    opacity: 1; /* Firefox baja la opacidad por defecto */
}

/* ── Date/time pickers en dark ─────────────────────────────── */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="week"] {
    color-scheme: dark;
}
[data-theme="dark"] input::-webkit-calendar-picker-indicator {
    filter: invert(.85);
    cursor: pointer;
}

/* ── Autofill de Chrome en dark ────────────────────────────── */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill {
    -webkit-text-fill-color: #e8eef7 !important;
    -webkit-box-shadow: 0 0 0 1000px #14223a inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* ── Selección de texto ────────────────────────────────────── */
::selection { background: rgba(147, 193, 33, .35); }
