<?php
require_once __DIR__.'/_auth.php';$admin=afAdminApiUser($pdo);$items=$pdo->query("SELECT r.id,r.protocol,r.report_type,r.category,r.description,r.status,r.priority,r.risk_score,r.involves_minor,r.reported_user_id,r.partida_id,r.competition_id,r.created_at,u.nome target_name,u.aura_id target_aura FROM af_safety_reports r LEFT JOIN af_usuarios u ON u.id=r.reported_user_id WHERE r.status IN ('open','triage','in_review') ORDER BY FIELD(r.priority,'critical','high','medium','low'),r.id DESC LIMIT 100")->fetchAll()?:[];jsonResponse(['ok'=>true,'reports'=>$items,'moderation_version'=>defined('MODERATION_VERSION')?MODERATION_VERSION:'22.0']);
