<?php
if (!defined('APP_NAME')) require_once __DIR__ . '/../config/functions.php';
$csrf = generateCsrfToken();
$currentPage = basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="ms">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="description" content="S.P.M Dashboard - Portal Rasmi Sektor Pembangunan Murid">
<title><?= isset($pageTitle) ? $pageTitle.' | ' : '' ?>S.P.M Dashboard</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.10/index.global.min.css">
<link rel="stylesheet" href="<?= BASE_URL ?>assets/css/style.css?v=<?= filemtime(__DIR__.'/../assets/css/style.css') ?>">
</head>
<body>
<?php if (!empty($_SESSION['just_logged_in'])): ?>
<div class="loading-screen" id="loadingScreen">
  <div class="loading-logo" style="display:flex;align-items:center;justify-content:center;min-height:80px"><?=getSektorLogo('loading')?></div>
  <div style="color:#555;font-size:.85rem;letter-spacing:2px;margin-top:.5rem"><?=htmlspecialchars(getSektorData()['nama_sektor']??'SEKTOR PEMBANGUNAN MURID')?></div>
  <div class="loading-bar"><div class="loading-bar-fill"></div></div>
</div>
<?php unset($_SESSION['just_logged_in']); endif; ?>
<div class="dark-overlay" id="darkOverlay" onclick="closeSidebar()"></div>
