
<!-- Sidebar -->
    <aside class="sidebar">
        <div class="sidebar-header">
            <h3><i class="fas fa-th-large"></i> rentidium</h3>
            <div style="font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 5px;">Admin Panel</div>
        </div>
        
        <nav class="sidebar-nav">
            <div class="nav-section-title">Main</div>
            <a <?php if($active_menu=="dashboard") echo "class='active'"; ?> href="index.php"><i class="fas fa-chart-line"></i> Dashboard</a>
            
            <div class="nav-section-title">Management</div>
            <a <?php if($active_menu=="vendors") echo "class='active'"; ?> href="vendors.php"><i class="fas fa-store"></i> Vendors</a>
            <a <?php if($active_menu=="vendor-analysis") echo "class='active'"; ?> href="vendor-analysis.php"><i class="fas fa-chart-bar"></i> Vendor Analysis</a>
            <a <?php if($active_menu=="customers") echo "class='active'"; ?> href="customers.php"><i class="fas fa-users"></i> Customers</a>
            <a <?php if($active_menu=="customer-analysis") echo "class='active'"; ?> href="customer-analysis.php"><i class="fas fa-chart-bar"></i> Customer Analysis</a>
            <a <?php if($active_menu=="items") echo "class='active'"; ?> href="items.php"><i class="fas fa-box"></i> Items</a>
            <a <?php if($active_menu=="updated_items") echo "class='active'"; ?> href="updated-items.php"><i class="fas fa-box"></i> Updated Items</a>
            <a <?php if($active_menu=="categories") echo "class='active'"; ?> href="categories.php"><i class="fas fa-tags"></i> Categories</a>
            <a <?php if($active_menu=="mails") echo "class='active'"; ?> href="mails.php"><i class="fas fa-envelope"></i> Mails</a>
            
            <div class="nav-section-title">Orders & Payments</div>
            <a <?php if($active_menu=="orders") echo "class='active'"; ?> href="orders.php"><i class="fas fa-shopping-cart"></i> Orders</a>
            <a <?php if($active_menu=="payments") echo "class='active'"; ?> href="payments.php"><i class="fas fa-credit-card"></i> Payments</a>
            <a <?php if($active_menu=="disputes") echo "class='active'"; ?> href="disputes.php"><i class="fas fa-exclamation-triangle"></i> Dispute</a>
            
            <div class="nav-section-title">Finance</div>
            <a <?php if($active_menu=="transactions") echo "class='active'"; ?> href="transactions.php"><i class="fas fa-wallet"></i> Transactions</a>
            <a <?php if($active_menu=="finance") echo "class='active'"; ?> href="finance.php"><i class="fas fa-wallet"></i> Finance Overview</a>
            <a <?php if($active_menu=="commissions") echo "class='active'"; ?> href="commissions.php"><i class="fas fa-percentage"></i> Commissions</a>
            <a <?php if($active_menu=="withdrawals") echo "class='active'"; ?> href="withdrawals.php"><i class="fas fa-exchange-al"></i> Withdrawals</a>
            
            <div class="nav-section-title">System</div>
            <a <?php if($active_menu=="settings") echo "class='active'"; ?> href="settings.php"><i class="fas fa-cog"></i> System Settings</a>
            <a <?php if($active_menu=="penalty-settings") echo "class='active'"; ?> href="penalty-settings.php"><i class="fas fa-exclamation-triangle"></i> Penalty Settings</a>
            <a <?php if($active_menu=="faqs") echo "class='active'"; ?> href="faqs.php"><i class="fas fa-question-circle"></i> FAQs</a>
            <a <?php if($active_menu=="") echo "class='active'"; ?> href="../auth/logout.php"><i class="fas fa-sign-out-alt"></i> Logout</a>
        </nav>
    </aside>
    
        <!-- Topbar -->
        <?php /*
        <div class="topbar">
            <div>
                <button class="btn btn-link d-md-none" id="sidebarToggle">
                    <i class="fas fa-bars"></i>
                </button>
            </div>
            
            <div class="d-flex align-items-center gap-3">
                <span class="text-muted">
                    <i class="fas fa-user-shield"></i> <?= esc(Auth::email()) ?>
                </span>
                <a href="../auth/logout.php" class="btn btn-sm btn-outline-danger" 
                   onclick="return confirm('Are you sure you want to logout?')">
                    <i class="fas fa-sign-out-alt"></i> Logout
                </a>
            </div>
        </div>
        */ ?>
        
        <!-- Flash Messages -->
        <?php if ($flash = flash('success')): ?>
            <div class="alert alert-<?= $flash['type'] ?> alert-dismissible fade show m-3" role="alert">
                <?= $flash['message'] ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>
        
        <?php if ($flash = flash('error')): ?>
            <div class="alert alert-<?= $flash['type'] ?> alert-dismissible fade show m-3" role="alert">
                <?= $flash['message'] ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>


    <!-- Top Bar -->
    <!-- <div class="top-bar" style="background: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 999;">
        <div style="display: flex; align-items: center; gap: 15px;">
            <button class="menu-toggle" id="menuToggle" style="background: none; border: none; font-size: 24px; color: var(--dark); cursor: pointer;">
                <i class="fas fa-bars"></i>
            </button>
        </div>
        
        <div style="display: flex; align-items: center; gap: 20px;">
            <button style="position: relative; background: none; border: none; font-size: 20px; color: var(--dark); cursor: pointer;">
                <i class="fas fa-bell"></i>
                <span style="position: absolute; top: 0; right: 0; background: var(--danger); color: white; font-size: 10px; padding: 2px 5px; border-radius: 10px;">5</span>
            </button>
            
            <div style="display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 12px; border-radius: 25px;">
                <div style="width: 35px; height: 35px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600;">AD</div>
                <div>
                    <div style="font-weight: 600; font-size: 14px;">Admin</div>
                    <div style="font-size: 12px; color: #666;">Administrator</div>
                </div>
            </div>
        </div>
    </div> -->

    <!-- Top Bar -->
        <div class="top-bar">
            <div class="top-bar-left">
                <button class="menu-toggle" id="menuToggle">
                    <i class="fas fa-bars"></i>
                </button>
                
                <div class="search-box">
                    <i class="fas fa-search"></i>
                    <input type="text" placeholder="Search anything...">
                </div>
            </div>
            
            <div class="top-bar-right">
                <button class="notification-btn">
                    <i class="fas fa-bell"></i>
                    <span class="notification-badge">5</span>
                </button>
                
                <div class="user-menu">
                    <div class="user-avatar">AD</div>
                    <div>
                        <div style="font-weight: 600; font-size: 14px;">Admin</div>
                        <div style="font-size: 12px; color: #666;">Administrator</div>
                    </div>
                    <i class="fas fa-chevron-down" style="font-size: 12px; color: #666;"></i>
                </div>
            </div>
        </div>
        