// ── CONFIGURACIÓN — Perfil, metas y preferencias ──────────────── const ConfigScreen = () => { const [user, setUser] = React.useState(null); const [form, setForm] = React.useState({ name:'', business_name:'', business_type:'', email:'', whatsapp:'', country:'', currency:'USD', avatar_url:'' }); const [loading, setLoading] = React.useState(true); const [saving, setSaving] = React.useState(false); const load = () => { setLoading(true); API.get('/me').then(r => { if (r) { setUser(r); setForm({ name: r.name || '', business_name: r.business_name || '', business_type: r.business_type || '', email: r.email || '', whatsapp: r.whatsapp || '', country: r.country || '', currency: r.currency || 'USD', avatar_url: r.avatar_url || '' }); } setLoading(false); }); }; React.useEffect(() => { load(); }, []); const save = async () => { setSaving(true); const res = await API.put('/me', form); setSaving(false); if (res.ok) { showToast('Perfil actualizado ✓'); // Actualizar el objeto global window.USER para que el sidebar se actualice if (window.USER) { window.USER = { ...window.USER, ...form }; } } else { showToast('Error al guardar', 'error'); } }; if (loading) return