<div class="header">

    <div class="menu-btn" onclick="toggleMenu()">☰</div>

    <div class="header-title">
        LuminaCare - Admin
    </div>

    <div class="nav">
        <a href="dashboard.php">Dashboard</a>
        <a href="kamar.php">Kamar</a>
        <a href="laporan.php">Laporan</a>
        <a href="penghuni.php">Penghuni</a>
        <a href="riwayat_kamar.php">Riwayat Kamar</a>
        <a href="riwayat_laporan.php">Riwayat Laporan</a>
        <a href="admin.php">Kelola Admin</a>
        <a href="ganti_password.php">Ganti Password</a>
        <a href="../logout.php">Logout</a>
    </div>

</div>

<!-- SIDEBAR -->
<div id="sidebar" class="sidebar">

    <a href="dashboard.php">Dashboard</a>
    <a href="kamar.php">Kamar</a>
    <a href="laporan.php">Laporan</a>
    <a href="penghuni.php">Penghuni</a>
    <a href="riwayat_kamar.php">Riwayat Kamar</a>
    <a href="riwayat_laporan.php">Riwayat Laporan</a>
    <a href="admin.php">Kelola Admin</a>
    <a href="ganti_password.php">Ganti Password</a>
    <a href="../logout.php">Logout</a>

</div>

<div id="overlay" class="overlay" onclick="toggleMenu()"></div>

<style>

/* HEADER */
.header {
    background:#1e3a8a;
    color:white;
    padding:15px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

/* TITLE */
.header-title {
    font-size:18px;
    font-weight:bold;
}

/* NAV DESKTOP */
.nav {
    display:flex;
    gap:10px;
}

.nav a {
    color:white;
    text-decoration:none;
    font-size:13px;
    padding:6px 10px;
    border-radius:5px;
}

.nav a:hover {
    background:rgba(255,255,255,0.2);
}

/* MENU BUTTON */
.menu-btn {
    display:none;
    font-size:22px;
    cursor:pointer;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: #1e3a8a;
    padding: 20px;
    transition: 0.3s;
    z-index: 1000;
}

.sidebar.active {
    left: 0;
}

.sidebar a {
    display: block;
    color: white;
    text-decoration: none;
    margin: 12px 0;
    font-size:14px;
}

/* OVERLAY */
.overlay {
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.5);
    display:none;
    z-index: 999;
}

.overlay.active {
    display:block;
}

/* RESPONSIVE */
@media(max-width:768px){

    .nav {
        display:none; /* 🔥 sembunyikan navbar atas */
    }

    .menu-btn {
        display:block;
    }

}

</style>

<script>
function toggleMenu(){
    let sidebar = document.getElementById("sidebar");
    let overlay = document.getElementById("overlay");

    sidebar.classList.toggle("active");
    overlay.classList.toggle("active");
}
</script>