<!doctype html>
<html lang="id">
<head>
    <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
    <title><?= esc($title ?? 'Admin') ?> | Undangan Khitanan</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
    <link href="<?= base_url('assets/css/admin.css') ?>" rel="stylesheet">
</head>
<body>
<div class="d-flex">
    <aside class="sidebar p-3">
        <a class="brand text-decoration-none d-flex align-items-center gap-2 mb-4" href="<?= base_url('admin') ?>"><i class="bi bi-moon-stars-fill"></i><span>Khitanan</span></a>
        <?php $menu=[['dashboard','speedometer2','Dashboard'],['acara','calendar-event','Acara'],['tamu','people','Tamu'],['galeri','images','Galeri'],['rsvp','check2-circle','RSVP'],['ucapan','chat-heart','Ucapan']]; foreach($menu as $m): ?>
        <a class="nav-link" href="<?= base_url('admin/'.$m[0]) ?>"><i class="bi bi-<?= $m[1] ?>"></i><?= $m[2] ?></a>
        <?php endforeach ?>
        <a class="nav-link mt-4" href="<?= base_url() ?>" target="_blank"><i class="bi bi-box-arrow-up-right"></i>Lihat Undangan</a>
        <a class="nav-link" href="<?= base_url('logout') ?>"><i class="bi bi-box-arrow-left"></i>Logout</a>
    </aside>
    <main class="content flex-grow-1">
        <header class="d-flex justify-content-between align-items-center mb-4"><div><p class="text-secondary mb-1 small">Panel Administrator</p><h1 class="h3 mb-0"><?= esc($title ?? '') ?></h1></div><span class="badge text-bg-light p-2"><i class="bi bi-person-circle me-1"></i><?= esc(session('admin_name')) ?></span></header>
        <?php if(session('success')): ?><div class="alert alert-success"><?= esc(session('success')) ?></div><?php endif ?>
        <?php if(session('error')): ?><div class="alert alert-danger"><?= esc(session('error')) ?></div><?php endif ?>
        <?= $this->renderSection('content') ?>
    </main>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<?= $this->renderSection('scripts') ?>
</body></html>
