export default defineNuxtRouteMiddleware((to, from) => {
  const { isAuthenticated, isBoard, isAdmin } = useAuth();
  
  if (!isAuthenticated.value) {
    return navigateTo('/login');
  }
  
  // Only board members and admins can access board pages
  if (!isBoard.value && !isAdmin.value) {
    throw createError({
      statusCode: 403,
      statusMessage: 'Access denied. Board member privileges required.'
    });
  }
});