<?php
require __DIR__ . '/security_headers.php';
session_start();
if (empty($_SESSION['user'])) {
  header('Location: index.php');
  exit;
}
$user = $_SESSION['user'];
?>
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Dashboard</title>
  <link rel="stylesheet" href="public/css/styles.css">
</head>
<body>
  <header class="topbar">
    <div class="container">
      <div class="brand-inline">
        <img src="public/img/umis_logo.svg" alt="UMIS logo">
        <strong>UMIS</strong>
      </div>
      <nav>
        <span class="welcome">Welcome, <?php echo htmlspecialchars($user['name']); ?></span>
        <a class="btn-secondary" href="logout.php">Logout</a>
      </nav>
    </div>
  </header>
  <main class="container">
    <div class="card">
      <h1>Dashboard</h1>
      <p>This is a placeholder protected page. Put your app here.</p>
    </div>
  </main>
</body>
</html>
