⚠ Configure as tabelas no Supabase (apenas uma vez)
Execute este SQL no Supabase SQL Editor:
create table if not exists produtos (id uuid default gen_random_uuid() primary key, user_id uuid references auth.users not null, nome text not null, ref text, preco numeric not null, unidade text, created_at timestamptz default now());
create table if not exists vendas (id uuid default gen_random_uuid() primary key, user_id uuid references auth.users not null, num integer not null, cliente text, nif text, morada text, itens jsonb, total numeric not null, data text, created_at timestamptz default now());
alter table produtos enable row level security; alter table vendas enable row level security; create policy "user produtos" on produtos for all using (auth.uid() = user_id); create policy "user vendas" on vendas for all using (auth.uid() = user_id);