<?php
// Start session if not already started
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// If no login session exists, redirect to login page
if (!isset($_SESSION['team_id'])) {
    header("Location: login.php");
    exit();
}
?>