$(function () {
    // Mobile sidebar toggle
    $('.sidebar-toggle').on('click', function () {
        $('.admin-sidebar').toggleClass('open');
    });

    // Auto-dismiss alerts
    window.setTimeout(function () {
        $('.alert-dismissible').fadeOut(300);
    }, 5000);

    // Delete confirmation
    $('form[data-confirm]').on('submit', function (e) {
        var message = $(this).data('confirm') || 'Are you sure you want to delete this item?';
        if (!window.confirm(message)) {
            e.preventDefault();
        }
    });
});
