/** * auth.js — shared utilities loaded by every protected page. * * Provides: * authFetch(url, options) — fetch with Bearer token + auto-redirect on 401 * logoutUser() — clear storage and redirect to /login * guardAuth(requiredRoles) — redirect if token missing or role not in list * escapeHtml(str) — XSS-safe string for innerHTML insertion * reviewBadge(status) — returns safe HTML badge string * buildYearOptions(selectId, def) — populate a