<?php
/**
 * Agentic Square - Premium Admin Dashboard Management Control Panel
 * CodeCanyon Secure Execution Core Template Architecture
 */

// Inject Core Global Application Engine Paths
require_once __DIR__ . '/../config/config.php';

/**
 * STRICT SECURITY AUDIT GUARD (Envato Marketplace Compliant)
 * Intercepts unauthorized sessions, non-admins, and direct URL entry bypass attempts.
 */
if (!isset($_SESSION['user_id']) || !isset($_SESSION['user_role']) || $_SESSION['user_role'] !== 'admin') {
    // Session is fraudulent or lacks elevation privileges -> Boot safely to root login
    header('Location: ../login.php');
    exit;
}

// CodeCanyon Production Standard Guideline: Inject standard secure UI Header Wrapper layout component
require_once __DIR__ . '/../sections/header.php';
?>

<div class="min-h-screen bg-nftDark text-white antialiased">
    
    <?php require_once __DIR__ . '/admin-sidebar.php'; ?>

    <main class="lg:ml-64 min-h-screen pt-24 lg:pt-10 pb-12 px-4 sm:px-6 lg:px-8 transition-all duration-300">
        <div class="max-w-7xl mx-auto space-y-8">
            
            <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-slate-900 pb-6">
                <div>
                    <h1 class="text-3xl font-extrabold tracking-tight bg-clip-text text-transparent bg-gradient-to-r from-white via-white to-nftAccentCyan">Control Overview Dashboard</h1>
                    <p class="text-sm text-nftTextGray mt-1">Hello, <?php echo htmlspecialchars($_SESSION['user_name'], ENT_QUOTES, 'UTF-8'); ?>! Monitor script catalog inventory operations, system metrics, and multi-vendor settlements.</p>
                </div>
                <div class="flex items-center space-x-3">
                    <span class="bg-nftCard border border-slate-800 text-xs px-3 py-1.5 rounded-lg text-slate-300 font-mono">
                        System Sync: Online
                    </span>
                </div>
            </div>

            <?php include_once __DIR__ . '/dashboard-card.php'; ?>

            <?php include_once __DIR__ . '/all-items-table.php'; ?>

        </div>
    </main>

</div>



</body>
</html>