export default defineNuxtRouteMiddleware((to, from) => {
  const { isAuthenticated, isBoard, isAdmin } = useAuth();
  
  if (!isAuthenticated.value) {
    return navigateTo('/login');
  }
  
  if (!isBoard.value && !isAdmin.value) {
    throw createError({
      statusCode: 403,
      statusMessage: 'Access denied. Board membership required.'
    });
  }
});
