            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
    var BASE_URL = '<?php echo getBaseUrl(); ?>';
    var CSRF_TOKEN = '<?php echo $csrfToken; ?>';

    document.getElementById('sidebarToggle').addEventListener('click', function() {
        document.getElementById('sidebar').classList.toggle('collapsed');
        document.getElementById('content').classList.toggle('expanded');
    });

    function escapeHtml(text) {
        var div = document.createElement('div');
        div.textContent = text;
        return div.innerHTML;
    }

    function showToast(message, type) {
        type = type || 'info';
        var colors = {success:'#27ae60', error:'#e74c3c', warning:'#f39c12', info:'#3498db'};
        var icons = {success:'fa-check-circle', error:'fa-times-circle', warning:'fa-exclamation-circle', info:'fa-info-circle'};
        var toast = document.createElement('div');
        toast.style.cssText = 'position:fixed;top:80px;right:24px;z-index:9999;background:#fff;padding:14px 20px;border-left:4px solid ' + colors[type] + ';border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,0.15);font-size:14px;animation:toastSlideIn 0.3s ease;display:flex;align-items:center;gap:10px;max-width:400px;';
        toast.innerHTML = '<i class="fas ' + (icons[type]||icons.info) + '" style="color:' + colors[type] + '"></i><span>' + escapeHtml(message) + '</span>';
        document.body.appendChild(toast);
        setTimeout(function() {
            toast.style.opacity = '0';
            toast.style.transition = 'opacity 0.3s ease';
            setTimeout(function() { toast.remove(); }, 300);
        }, 3000);
    }

    function ajaxPost(url, data, callback) {
        fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
                'X-Requested-With': 'XMLHttpRequest'
            },
            body: data
        })
        .then(function(r) { return r.json(); })
        .then(function(result) { callback(result); })
        .catch(function(err) {
            callback({success: false, message: 'Network error occurred.'});
        });
    }

    function ajaxGet(url, callback) {
        fetch(url, {
            headers: {
                'X-Requested-With': 'XMLHttpRequest'
            }
        })
        .then(function(r) { return r.json(); })
        .then(function(result) { callback(result); })
        .catch(function(err) {
            callback({success: false, message: 'Network error occurred.'});
        });
    }
    </script>
</body>
</html>
