<?php
session_start();
include '../config.php';

// Simple admin auth
if(!isset($_SESSION['admin'])) {
    header("Location: admin/login.php");
    exit;
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>Reckon Store - Admin Panel</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
    <style>
        body { background: #111; color: #0f0; font-family: 'Press Start 2P', cursive; }
        .navbar { background: #000 !important; border-bottom: 3px solid #0f0; }
        .nav-link { color: #0f0 !important; }
        .nav-link:hover { color: #fff !important; }
        .card { background: #1a1a1a; border: 2px solid #0f0; }
        .btn-success { background: #0f0; color: #000; border: none; }
        .btn-success:hover { background: #0c0; }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
    <div class="container">
        <a class="navbar-brand" href="#">RECKON ADMIN</a>
        <div>
            <a href="logout.php" class="btn btn-danger btn-sm">Logout</a>
        </div>
    </div>
</nav>

<div class="container mt-4">
    <div class="row">
        <div class="col-md-3">
            <div class="list-group">
                <a href="?page=dashboard" class="list-group-item bg-dark text-success">Dashboard</a>
                <a href="?page=packages" class="list-group-item bg-dark text-success">Packages</a>
                <a href="?page=categories" class="list-group-item bg-dark text-success">Categories</a>
                <a href="?page=settings" class="list-group-item bg-dark text-success">Site Settings</a>
                <a href="?page=orders" class="list-group-item bg-dark text-success">Orders</a>
            </div>
        </div>
        <div class="col-md-9">
            <?php
            $page = $_GET['page'] ?? 'dashboard';
            switch($page) {
                case 'packages': include 'admin/packages.php'; break;
                case 'categories': include 'admin/categories.php'; break;
                case 'settings': include 'admin/settings.php'; break;
                case 'orders': include 'admin/orders.php'; break;
                default: include 'admin/dashboard.php'; break;
            }
            ?>
        </div>
    </div>
</div>
</body>
</html>