// Toggle tema
document.getElementById('themeToggle')?.addEventListener('click', () => {
    const html = document.documentElement;
    html.classList.toggle('dark');
    const nuevo = html.classList.contains('dark') ? 'dark' : 'light';
    fetch(window.BASE_URL + '/assets/set_tema.php?tema=' + nuevo);
});

// Selector moneda (cambia cookie y recarga)
document.getElementById('moneda')?.addEventListener('change', e => {
    document.cookie = 'moneda=' + e.target.value + ';path=/;max-age=31536000';
    location.reload();
});