<!-- Purchase Manager Sidebar Navigation -->
<aside class="pm-sidebar">
    <div class="pm-sidebar-header">
        <div class="pm-logo">
            <i class="fas fa-boxes-stacked"></i>
        </div>
        <div class="pm-logo-text">
            <div class="pm-logo-title">Purchase Manager</div>
            <div class="pm-logo-subtitle">Procurement</div>
        </div>
    </div>

    <!-- Main Navigation -->
    <div class="pm-sidebar-section">
        <div class="pm-sidebar-section-title">Main</div>
        <ul class="pm-sidebar-nav">
            <li>
                <a href="dashboard.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'dashboard.php') ? 'active' : ''; ?>">
                    <i class="fas fa-home"></i>
                    <span>Dashboard</span>
                </a>
            </li>
        </ul>
    </div>

    <!-- Procurement Section -->
    <div class="pm-sidebar-section">
        <div class="pm-sidebar-section-title">Procurement</div>
        <ul class="pm-sidebar-nav">
            <li>
                <a href="requisitions.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'requisitions.php') ? 'active' : ''; ?>">
                    <i class="fas fa-file-circle-check"></i>
                    <span>Requisitions</span>
                </a>
            </li>
            <li>
                <a href="purchase_orders.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'purchase_orders.php') ? 'active' : ''; ?>">
                    <i class="fas fa-receipt"></i>
                    <span>Purchase Orders</span>
                </a>
            </li>
            <li>
                <a href="suppliers.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'suppliers.php') ? 'active' : ''; ?>">
                    <i class="fas fa-building"></i>
                    <span>Suppliers</span>
                </a>
            </li>
            <li>
                <a href="cost_comparison.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'cost_comparison.php') ? 'active' : ''; ?>">
                    <i class="fas fa-chart-line"></i>
                    <span>Cost Analysis</span>
                </a>
            </li>
        </ul>
    </div>

    <!-- Inventory Section -->
    <div class="pm-sidebar-section">
        <div class="pm-sidebar-section-title">Inventory</div>
        <ul class="pm-sidebar-nav">
            <li>
                <a href="ingredients.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'ingredients.php') ? 'active' : ''; ?>">
                    <i class="fas fa-list"></i>
                    <span>Ingredients</span>
                </a>
            </li>
            <li>
                <a href="low_stock.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'low_stock.php') ? 'active' : ''; ?>">
                    <i class="fas fa-triangle-exclamation"></i>
                    <span>Low Stock</span>
                    <span class="pm-badge" id="lowStockBadge" style="display: none;">0</span>
                </a>
            </li>
            <li>
                <a href="new_ingredients.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'new_ingredients.php') ? 'active' : ''; ?>">
                    <i class="fas fa-plus-circle"></i>
                    <span>New Ingredients</span>
                    <span class="pm-badge" id="newIngredientsCount" style="display: none;">0</span>
                </a>
            </li>
        </ul>
    </div>

    <!-- Reports Section -->
    <div class="pm-sidebar-section">
        <div class="pm-sidebar-section-title">Reports</div>
        <ul class="pm-sidebar-nav">
            <li>
                <a href="reports.php" class="pm-nav-link <?php echo (basename($_SERVER['PHP_SELF']) == 'reports.php') ? 'active' : ''; ?>">
                    <i class="fas fa-chart-bar"></i>
                    <span>Reports</span>
                </a>
            </li>
        </ul>
    </div>

    <!-- Account Section -->
    <div class="pm-sidebar-section">
        <div class="pm-sidebar-section-title">Account</div>
        <ul class="pm-sidebar-nav pm-sidebar-account">
            <li>
                <a href="javascript:void(0)" onclick="handleLogout()" class="pm-nav-link">
                    <i class="fas fa-sign-out-alt"></i>
                    <span>Logout</span>
                </a>
            </li>
        </ul>
    </div>

    <!-- User Info Footer -->
    <div class="pm-sidebar-footer">
        <div class="pm-user-avatar" id="userAvatarSidebar">PM</div>
        <div class="pm-user-info">
            <div id="userNameSidebar" class="pm-user-name">Purchase Manager</div>
            <div class="pm-user-role">Manager</div>
        </div>
    </div>
</aside>

<!-- Hamburger Menu Button for Mobile -->
<button class="pm-hamburger" id="pmSidebarToggle" aria-label="Toggle sidebar">
    <span></span>
    <span></span>
    <span></span>
</button>

<!-- Sidebar Overlay for Mobile -->
<div class="pm-sidebar-overlay" id="pmSidebarOverlay"></div>
