<?php
/**
 * index.php — Portal root entry point
 * Redirects to dashboard if logged in, otherwise to login.
 */
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/includes/db.php';
require_once __DIR__ . '/includes/functions.php';
require_once __DIR__ . '/includes/auth.php';

if (is_logged_in()) {
    header('Location: pages/dashboard.php');
} else {
    header('Location: login.php');
}
exit;
