<?php if (function_exists('csrf_token')): ?><script>window.csrfToken='<?= htmlspecialchars(csrf_token(), ENT_QUOTES) ?>';</script><?php endif; ?>
<footer class="app-footer">
    <div class="container-fluid px-4 py-3">
        <div class="row align-items-center">
            <div class="col-md-6 text-center text-md-end">
                <span class="footer-text">نظام صيانة الأجهزة &copy; <?= date('Y') ?></span>
            </div>
            <div class="col-md-6 text-center text-md-start">
                <span class="footer-text">Maintenance Job Sheet</span>
            </div>
        </div>
    </div>
</footer>
<button type="button" class="btn-back-top" id="backToTop" aria-label="العودة للأعلى">
    <i class="bi bi-arrow-up"></i>
</button>
<script>
(function(){
    var btn = document.getElementById('backToTop');
    if(btn){
        btn.onclick = function(){ window.scrollTo({top:0,behavior:'smooth'}); };
        window.onscroll = function(){ btn.classList.toggle('show', window.scrollY > 300); };
    }
})();
</script>
