<!DOCTYPE html>
<html lang="id">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $__env->yieldContent('title'); ?> - Panel Manajemen Mega Mart</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="bg-gray-100 text-gray-900 flex h-screen overflow-hidden">

    <!-- 📊 SIDEBAR UTAMA -->
    <aside class="w-64 bg-slate-900 text-slate-300 flex flex-col shadow-xl flex-shrink-0">
        <div class="h-16 flex items-center px-6 bg-slate-950 border-b border-slate-800">
            <span class="text-xl font-bold text-white tracking-wider">MEGA MART</span>
            <span class="ml-2 px-2 py-0.5 text-[10px] bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-mono rounded">
                PANEL
            </span>
        </div>

        <nav class="flex-1 px-4 py-6 space-y-1.5 overflow-y-auto font-medium text-sm">

            <?php if(session()->has('admin_logged')): ?>
            <p class="px-2 pb-2 text-xs font-semibold text-slate-500 tracking-wider uppercase">Menu Utama Admin</p>

            <a href="<?php echo e(url('/admin/dashboard')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/dashboard') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                📊 Dashboard Utama
            </a>
            <a href="<?php echo e(url('/admin/barang')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/barang*') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                📦 Data Master Sembako
            </a>
            <a href="<?php echo e(url('/admin/kupon')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/kupon*') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                🎟️ Kelola Kupon Promo
            </a>
            <a href="<?php echo e(url('/admin/transaksi')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/transaksi*') || Request::is('admin/verifikasi*') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                💳 Verifikasi Bayar
            </a>
            <a href="<?php echo e(url('/admin/keluhan')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/keluhan*') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                📥 Aduan Keluhan
            </a>
            <a href="<?php echo e(url('/admin/live-chat')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::is('admin/live-chat*') ? 'bg-blue-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                💬 Live Chat CS
            </a>
            <?php endif; ?>

            <?php if(session()->has('admin_logged') || session()->has('owner_logged')): ?>
            <p class="px-2 pt-4 pb-2 text-xs font-semibold text-slate-500 tracking-wider uppercase border-t border-slate-800">Manajerial Owner & Admin</p>

            <a href="<?php echo e(route('admin.laporan.index')); ?>" class="flex items-center px-3 py-2.5 <?php echo e(Request::routeIs('admin.laporan.index') ? 'bg-amber-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                📈 Analisis Pelanggan Loyal
            </a>

            <a href="<?php echo e(route('admin.laporan.cetak')); ?>" target="_blank" class="flex items-center px-3 py-2.5 <?php echo e(Request::routeIs('admin.laporan.cetak') ? 'bg-amber-600 text-white font-bold' : 'hover:bg-slate-800 hover:text-white'); ?> rounded-lg transition gap-2 text-xs font-bold text-gray-400">
                🖨️ Cetak Laporan Penjualan
            </a>
            <?php endif; ?>
        </nav>

        <!-- STAFF DETAIL & LOGOUT FORM -->
        <div class="p-4 bg-slate-950 border-t border-slate-800 flex items-center justify-between">
            <div class="text-xs">
                <p class="font-semibold text-white"><?php echo e(session('admin_nama', 'Internal Staff')); ?></p>
                <p class="text-slate-500">Mega Mart Team</p>
            </div>
            <!-- Modifikasi tombol logout menggunakan POST form agar aman dari serangan pembajakan session -->
            <form action="<?php echo e(url('/logout')); ?>" method="POST" onsubmit="return confirm('Yakin ingin keluar aplikasi?')">
                <?php echo csrf_field(); ?>
                <a href="<?php echo e(route('logout')); ?>" class="flex items-center gap-2 px-3 py-2 text-xs font-bold text-red-500 hover:bg-red-50 hover:text-red-700 rounded-lg transition">
                    Logout
                </a>
            </form>
        </div>
    </aside>

    <!-- 📑 KONTEN KANAN -->
    <div class="flex-1 flex flex-col overflow-hidden">

        <header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-8 flex-shrink-0">
            <h1 class="text-lg font-bold text-gray-800"><?php echo $__env->yieldContent('page_heading', 'Dashboard Utama'); ?></h1>
            <div class="text-sm text-gray-500 font-medium">
                Sistem CRM Terintegrasi &bull; <?php echo e(date('d F Y')); ?>

            </div>
        </header>

        <main class="flex-1 overflow-x-hidden overflow-y-auto p-8">
            <?php echo $__env->yieldContent('content'); ?>
        </main>
    </div>

</body>

</html><?php /**PATH D:\SKRIPSI CRM 2026 II\PROGRAM CRM MEGA MART\megamart-crm\resources\views/layouts/backend.blade.php ENDPATH**/ ?>