<?php
// ambil nama file sekarang
$halaman = basename($_SERVER['PHP_SELF']);
?>

<style>
.navbar{
    background: linear-gradient(135deg,#0f172a,#134e4a);
    padding:14px 30px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    color:#fff;
}

.navbar .brand{
    font-size:20px;
    font-weight:bold;
}

.navbar ul{
    list-style:none;
    display:flex;
    gap:20px;
    margin:0;
    padding:0;
}

.navbar ul li a{
    color:#e5e7eb;
    text-decoration:none;
    font-weight:500;
    padding:6px 10px;
    border-radius:8px;
}

.navbar ul li a:hover{
    background:rgba(255,255,255,0.15);
}

.navbar ul li a.active{
    background:#14b8a6;
    color:#022c22;
}

.btn-logout{
    background:#ef4444;
    padding:6px 12px;
    border-radius:8px;
    color:white;
    text-decoration:none;
    font-weight:500;
}
</style>

<div class="navbar">
    <div class="brand">Admin Pesantren</div>

    <ul>
        <li><a href="dashboard.php" class="<?= $halaman=='dashboard.php'?'active':'' ?>">Dashboard</a></li>
        <li><a href="santri.php" class="<?= $halaman=='santri.php'?'active':'' ?>">Santri</a></li>
        <li><a href="ustadz.php" class="<?= $halaman=='ustadz.php'?'active':'' ?>">Ustadz</a></li>
        <li><a href="kelas.php" class="<?= $halaman=='kelas.php'?'active':'' ?>">Kelas</a></li>
        <li><a href="berita.php" class="<?= $halaman=='berita.php'?'active':'' ?>">Berita</a></li>
        <li><a href="kegiatan.php" class="<?= $halaman=='kegiatan.php'?'active':'' ?>">Kegiatan</a></li>
    </ul>

    <a href="../logout.php" class="btn-logout">Logout</a>
</div>
