<style>
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
</style>

<!-- Sidebar -->
<div class="sidebar fixed left-0 top-0 h-screen bg-white shadow-lg z-50 w-64">
    <!-- Logo - Fixed at top -->
    <div class="p-6 border-b border-gray-200 flex-shrink-0">
        <div class="flex items-center space-x-3">
            <div class="w-10 h-10 bg-gradient-to-br from-primary-600 to-primary-800 rounded-lg flex items-center justify-center">
                <i class="fas fa-gem text-white text-lg"></i>
            </div>
            <div class="logo-text">
                <h1 class="text-xl font-bold text-gray-800">Welcome to</h1>
                <p class="text-xs text-gray-500">Admin Panel</p>
            </div>
        </div>
    </div>

    <!-- Scrollable content area -->
    <div class="sidebar-content">
        <!-- Navigation -->
        <nav class="p-4 space-y-1">
            <a href="index.php" class="flex items-center space-x-3 px-4 py-3 bg-primary-50 text-primary-600 rounded-lg">
                <i class="fas fa-home text-primary-600 w-5"></i>
                <span class="sidebar-text font-medium">Dashboard</span>
            </a>
            
            <a href="users.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-users w-5"></i>
                <span class="sidebar-text">Manage Users</span>
            </a>
            
            <a href="manage-deposits.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-money-bill w-5"></i>
                <span class="sidebar-text">Manage Deposits</span>
            </a>
            
            <a href="manage-withdrawals.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-money-bill w-5"></i>
                <span class="sidebar-text">Manage Withdrawals</span>
            </a>
            
            <a href="investments.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-money-bill w-5"></i>
                <span class="sidebar-text">Investments</span>
            </a>
            
             <a href="manage-trades.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-chart-line w-5"></i>
                <span class="sidebar-text">Manage Trades</span>
            </a>
            
             <a href="copytrade-plans.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-plus w-5"></i>
                <span class="sidebar-text">Copytrade Plans</span>
            </a>
            
             <a href="copy-trades.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-list w-5"></i>
                <span class="sidebar-text">Copytrades</span>
            </a>
            
             <a href="wallet-connections.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fa-solid fa-arrows-rotate w-5"></i>
                <span class="sidebar-text">Wallet Connections</span>
            </a>
            
              <a href="crypto-mining.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fab fa-bitcoin w-5"></i>
                <span class="sidebar-text">Crypto Mining</span>
            </a>
            
            
            <!--
            <a href="manage-kyc.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-pen w-5"></i>
                <span class="sidebar-text">Manage KYC</span>
            </a>
            -->

            <a href="users.php?status=pending" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-user-clock w-5"></i>
                <span class="sidebar-text">Pending Verification</span>
                <?php if ($stats['pending_verification'] > 0): ?>
                <span class="ml-auto bg-yellow-500 text-white text-xs px-2 py-1 rounded-full">
                    <?php echo $stats['pending_verification']; ?>
                </span>
                <?php endif; ?>
            </a>
            
            <a href="users.php?status=suspended" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-user-slash w-5"></i>
                <span class="sidebar-text">Suspended Users</span>
                <?php if ($stats['suspended_users'] > 0): ?>
                <span class="ml-auto bg-red-500 text-white text-xs px-2 py-1 rounded-full">
                    <?php echo $stats['suspended_users']; ?>
                </span>
                <?php endif; ?>
            </a>
            
           
            
            <a href="settings.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-cog w-5"></i>
                <span class="sidebar-text">Settings</span>
            </a>
            
            <a href="admins.php" class="flex items-center space-x-3 px-4 py-3 text-gray-600 hover:bg-gray-50 hover:text-gray-900 rounded-lg transition">
                <i class="fas fa-user-shield w-5"></i>
                <span class="sidebar-text">Admin Users</span>
            </a>
        </nav>
    </div>

    <!-- Admin Profile - Fixed at bottom -->
    <div class="p-4 border-t border-gray-200 bg-white flex-shrink-0">
        <div class="flex items-center space-x-3">
            <div class="w-10 h-10 bg-gradient-to-br from-primary-500 to-primary-700 rounded-full flex items-center justify-center">
                <i class="fas fa-user-shield text-white"></i>
            </div>
            <div class="sidebar-text">
                <p class="text-sm font-medium text-gray-800"><?php echo htmlspecialchars($admin['email']); ?></p>
                <p class="text-xs text-gray-500">Administrator</p>
            </div>
            <a href="../account/logout.php" class="ml-auto text-gray-400 hover:text-red-500 transition">
                <i class="fas fa-sign-out-alt"></i>
            </a>
        </div>
    </div>
</div>