<?php
$currentPage = $page ?? 'dashboard';
$titleMap = isset($pageTitles) && is_array($pageTitles) ? $pageTitles : [];
$pageTitle = $titleMap[$currentPage] ?? 'Dashboard';
?>
<?php if ($currentPage !== 'dashboard'): ?>
<div class="page-heading modern-page-heading">
    <div class="page-title">
        <div class="row">
            <div class="col-12 col-md-6 order-md-1 order-last">
                <h3><?php echo htmlspecialchars($pageTitle); ?></h3>
            </div>
            <div class="col-12 col-md-6 order-md-2 order-first">
                <nav aria-label="breadcrumb" class="breadcrumb-header float-start float-lg-end">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?= page_url('dashboard') ?>">Dashboard</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo htmlspecialchars($pageTitle); ?></li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</div>
<?php endif; ?>
