/** Normalize API role keys for comparisons (handles casing and spaces). */
export function normalizePortalRole(role: string): string {
  return role.trim().toLowerCase().replace(/\s+/g, '_')
}

export function isTeacherPortalRole(role: string): boolean {
  const r = normalizePortalRole(role)
  return r === 'teacher' || r === 'teacher_assistant'
}

export function isParentPortalRole(role: string): boolean {
  const r = normalizePortalRole(role)
  return r === 'parent' || r === 'guest'
}
