<?php
        include 'config.php';
?>

<!DOCTYPE html>
<html>
<head>
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
  background-color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .brand {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.hamburger-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
}

.nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 78%;
  max-width: 320px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  z-index: 2000;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-drawer.open { display: block; }

.nav-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.2rem 1rem 1.2rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.5rem;
}

.nav-drawer-header span { font-weight: 700; font-size: 1.1rem; color: #333; }
.nav-drawer-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }

.nav-group-title {
  padding: 0.8rem 1.2rem 0.3rem 1.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  font-weight: 700;
}

.nav-drawer a {
  display: block;
  padding: 0.8rem 1.2rem;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid #f5f5f5;
}

.nav-drawer a:active { background-color: #f0f8f0; }

.nav-drawer a.primary {
  background: linear-gradient(135deg, #04AA6D, #45a049);
  color: white;
  margin: 0.5rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  border-bottom: none;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1500;
}
.nav-overlay.open { display: block; }
</style>
</head>
<body>

<div class="navbar">
  <span class="brand">🍞 IniSpikoe</span>
  <button class="hamburger-btn" onclick="document.getElementById('navDrawer').classList.add('open'); document.getElementById('navOverlay').classList.add('open');">
    &#9776;
  </button>
</div>

<div class="nav-overlay" id="navOverlay" onclick="document.getElementById('navDrawer').classList.remove('open'); this.classList.remove('open');"></div>

<div class="nav-drawer" id="navDrawer">
  <div class="nav-drawer-header">
    <span>Menu</span>
    <button class="nav-drawer-close" onclick="document.getElementById('navDrawer').classList.remove('open'); document.getElementById('navOverlay').classList.remove('open');">&times;</button>
  </div>

  <a href="order.php" class="primary">➕ Input Pesanan Baru</a>

  <div class="nav-group-title">Pesanan</div>
  <a href="orderlist.php">Daftar Pesanan</a>
  <a href="orderlistall.php">Daftar Semua Pesanan</a>
  <a href="orderlisttanggal.php">Daftar Pesanan by Tanggal</a>
  <a href="productionlist.php">Daftar Produksi</a>
  <a href="productionlist_update.php">Daftar Produksi Update</a>
  <a href="productionlist_update_all.php">Daftar Produksi Update All</a>
  <a href="cetak_pesanan.php">Cetak Pesanan</a>

  <div class="nav-group-title">Produk</div>
  <a href="produklist.php">Lihat Produk</a>
  <a href="master_produk.php">Tambah Produk</a>
  <a href="jenislist.php">Lihat Jenis</a>
  <a href="master_jenis.php">Tambah Jenis</a>

  <div class="nav-group-title">Stok</div>
  <a href="master_terima.php">Terima Barang</a>
  <a href="stok_list.php">Stok List</a>
</div>

</body>
</html>
