    </main>

    <footer class="footer-admin mt-auto py-4 border-top">
        <div class="container-fluid px-4">
            <div class="d-flex align-items-center justify-content-between small">
                <div class="text-muted">Copyright &copy; <?php echo htmlspecialchars(get_setting('site_name', 'APK ADMIN')); ?> <?php echo date('Y'); ?></div>
                <div>
                    <a href="#" class="text-muted text-decoration-none">Privacy Policy</a>
                    &middot;
                    <a href="#" class="text-muted text-decoration-none">Terms &amp; Conditions</a>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            const html = document.documentElement;

            const updateIcons = (theme) => {
                // Update all theme toggle icons
                const icons = document.querySelectorAll('#theme-toggle i, #theme-toggle-mobile i');
                icons.forEach(icon => {
                    if (theme === 'dark') {
                        icon.className = 'fa-solid fa-sun';
                    } else {
                        icon.className = 'fa-solid fa-moon';
                    }
                });

                // Update all theme status texts
                const textLabels = document.querySelectorAll('.theme-status-text');
                textLabels.forEach(label => {
                    label.textContent = theme === 'dark' ? 'Dark Mode' : 'Light Mode';
                });
            };

            // Theme Toggle Logic
            const initThemeToggle = (btnId) => {
                const themeToggle = document.getElementById(btnId);
                if (!themeToggle) return;

                themeToggle.addEventListener('click', () => {
                    const currentTheme = html.getAttribute('data-theme') || 'light';
                    const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
                    
                    // Update UI
                    html.setAttribute('data-theme', newTheme);
                    
                    // Update All Icons and Labels
                    updateIcons(newTheme);
                    
                    // Save preference
                    document.cookie = `theme=${newTheme}; path=/; max-age=${365 * 24 * 60 * 60}`;
                    localStorage.setItem('theme', newTheme);
                });
            };

            // Initial Sync
            const currentTheme = html.getAttribute('data-theme') || 'light';
            updateIcons(currentTheme);

            initThemeToggle('theme-toggle');
            initThemeToggle('theme-toggle-mobile');

            // Sidebar toggle logic if needed in future
            console.log('Admin Dashboard ready.');
        });
    </script>
</body>
</html>