            <?php
            if (!empty($GLOBALS['_admin_shell_open'])) {
                require_once __DIR__ . '/admin_layout.php';
                admin_page_shell_close();
            }
            ?>
        </main>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // نمایش پیام‌ها
        <?php 
        $msg = getMessage();
        if ($msg): 
        ?>
            // استفاده از toast یا alert
            const alertDiv = document.createElement('div');
            alertDiv.className = 'alert alert-<?= $msg['type'] === 'success' ? 'success' : 'danger' ?> alert-dismissible fade show position-fixed top-0 start-50 translate-middle-x mt-3';
            alertDiv.style.zIndex = '9999';
            alertDiv.style.minWidth = '300px';
            alertDiv.innerHTML = `
                <?= htmlspecialchars($msg['message'], ENT_QUOTES) ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            `;
            document.body.appendChild(alertDiv);
            setTimeout(() => alertDiv.remove(), 5000);
        <?php endif; ?>
    </script>
</body>
</html>
