    </div> <!-- end .main-content -->
</div> <!-- end .admin-wrapper -->

<?php
$is_localhost = in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']);
$is_super_admin = (isset($_SESSION['user_role']) && $_SESSION['user_role'] === 'super_admin') || (isset($_SESSION['admin_user_role']) && $_SESSION['admin_user_role'] === 'super_admin');

if ($is_localhost || $is_super_admin):
?>
<div style="position: fixed; bottom: 10px; right: 10px; background: white; padding: 10px; border: 1px solid #ccc; border-radius: 5px; z-index: 9999; box-shadow: 0 0 10px rgba(0,0,0,0.1); font-family: sans-serif;">
    <div style="font-size: 0.75rem; font-weight: bold; color: #e74c3c; margin-bottom: 5px;">DEV: USER SWITCHER</div>
    <form action="/smart_football/dev_switcher.php" method="POST" style="display: flex; gap: 5px;">
        <select name="role" required style="padding: 5px; font-size: 0.85rem; border: 1px solid #ddd; border-radius: 4px; width: 120px;">
            <option value="">Select Role</option>
            <option value="super_admin">Super Admin</option>
            <option value="admin">Admin</option>
            <option value="club_manager">Club Manager</option>
            <option value="team_manager">Team Manager</option>
            <option value="player">Player</option>
            <option value="referee">Referee</option>
            <option value="commissioner">Commissioner</option>
            <option value="league_manager">League Manager</option>
            <option value="fixtures_manager">Fixtures Manager</option>
            <option value="finance_manager">Finance Manager</option>
            <option value="super_fantasy_manager">Fantasy Admin</option>
            <option value="fantasy_manager">Fantasy Manager</option>
            <option value="fan">Fan</option>
        </select>
        <button type="submit" style="background: #333; color: white; border: none; padding: 5px 10px; border-radius: 4px; font-size: 0.85rem; cursor: pointer;">Go</button>
    </form>
</div>
<?php endif; ?>

</body>
</html>