<?php
include("../config.php");
session_start();
/*
if (!isset($_SESSION['username'])) {
    header("location:index.php");
}else{
    $value=$_SESSION['username'];
}
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>Admin Dashboard</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"/>
    <style>
        body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; font-family: 'Inter', sans-serif; overflow-x: hidden; }
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
        .loading-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: none; align-items: center; justify-content: center; }
        .loader { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid #1E40AF; border-radius: 50%; animation: spin 1s linear infinite; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
    </style>
</head>
<body class="bg-gray-100">

<div id="loading-modal" class="loading-modal"><div class="loader"></div></div>

<div class="flex min-h-screen">
    <?php include_once 'common/sidebar.php'; ?>

    <div class="flex-1 flex flex-col">
        <!-- Top Bar -->
        <header class="bg-white shadow-md p-4 flex justify-between items-center sticky top-0 z-30">
            <button id="admin-menu-btn" class="text-xl text-gray-700 lg:hidden">
                <i class="fas fa-bars"></i>
            </button>
            <h1 class="text-xl font-bold text-gray-800"><?php echo $page_title ?? 'Dashboard'; ?></h1>
            <a href="logout.php" class="text-gray-600 hover:text-red-500">
                <i class="fas fa-sign-out-alt text-lg"></i>
                
            </a>
        </header>

        <!-- Main Content -->
        <main class="flex-1 p-4 md:p-6">