<?php
require_once __DIR__ . '/../includes/functions.php';
requireRole('admin');
$currentPage = basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $pageTitle ?? 'Admin Panel - ShadiHall'; ?></title>
    <link rel="stylesheet" href="<?php echo BASE_URL; ?>/assets/css/style.css">
</head>
<body>
<div class="dashboard">
    <aside class="sidebar">
        <div class="brand">
            <h3>❦ ShadiHall</h3>
            <p>Admin Panel</p>
            <p style="font-size:12px; color:rgba(255,255,255,0.6); margin-top:8px;">
                <?php echo htmlspecialchars($_SESSION['name']); ?>
            </p>
        </div>
        <ul>
            <li><a href="<?php echo BASE_URL; ?>/admin/dashboard.php" class="<?php echo $currentPage=='dashboard.php'?'active':''; ?>">
                <span>◆</span> Dashboard
            </a></li>
            <li><a href="<?php echo BASE_URL; ?>/admin/vendors.php" class="<?php echo $currentPage=='vendors.php'?'active':''; ?>">
                <span>◆</span> Vendors
            </a></li>
            <li><a href="<?php echo BASE_URL; ?>/admin/users.php" class="<?php echo $currentPage=='users.php'?'active':''; ?>">
                <span>◆</span> Users
            </a></li>
            <li><a href="<?php echo BASE_URL; ?>/admin/halls.php" class="<?php echo $currentPage=='halls.php'?'active':''; ?>">
                <span>◆</span> All Halls
            </a></li>
            <li><a href="<?php echo BASE_URL; ?>/admin/bookings.php" class="<?php echo $currentPage=='bookings.php'?'active':''; ?>">
                <span>◆</span> Bookings
            </a></li>
            <li><a href="<?php echo BASE_URL; ?>/admin/messages.php" class="<?php echo $currentPage=='messages.php'?'active':''; ?>">
                <span>◆</span> Messages
            </a></li>
            <li style="margin-top:20px; border-top:1px solid rgba(255,255,255,0.15); padding-top:15px;">
                <a href="<?php echo BASE_URL; ?>/index.php"><span>◇</span> View Site</a>
            </li>
            <li><a href="<?php echo BASE_URL; ?>/logout.php"><span>◇</span> Logout</a></li>
        </ul>
    </aside>
    <main class="main-content">
