document.addEventListener('DOMContentLoaded', function () {
    var current = window.location.pathname.split('/').pop() || 'admin.html';
    document.querySelectorAll('.nav-link').forEach(function (link) {
        var target = link.getAttribute('href');
        if (target === current) {
            link.classList.add('active');
        }
    });
});
