<?php
include '../config/koneksi.php';  // ← samakan dengan admin
include '../session.php';

if(!isset($_SESSION['id_user'])){
    header("Location: ../login.php");  // ← samakan juga
    exit;
}

$role = $_SESSION['role'];

if($role != 'direktur'){
    header("Location: ../login.php");
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
    <title><?= $judul ?? 'Dashboard' ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background: #f4f6f9;
        }
        .sidebar {
            width: 240px;
            height: 100vh;
            position: fixed;
            background: #111827;
            color: white;
            padding-top: 20px;
        }
        .sidebar a {
            display: block;
            padding: 12px 20px;
            color: white;
            text-decoration: none;
        }
        .sidebar a:hover {
            background: #1f2937;
        }
        .content {
            margin-left: 240px;
            padding: 20px;
        }
        .topbar {
            background: white;
            padding: 10px 20px;
            margin-bottom: 20px;
            border-radius: 8px;
        }
    </style>
</head>
<body>