<!DOCTYPE html>
<html lang="id">
<head>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <style>
    /* Font & Reset */
    body { font-family: 'Poppins', sans-serif; margin: 0; background-color: #fdfdfd; }
    .wrapper { display: flex; min-height: 100vh; }

    /* SIDEBAR - Pengaturan Presisi */
    .sidebar { 
        width: 220px; 
        background: #fff; 
        border-right: 1px solid #eeeeee; 
        display: flex; 
        flex-direction: column; 
        padding: 25px 0; 
        flex-shrink: 0; 
    }
    
    .brand { 
        font-weight: 700; 
        font-size: 18px; 
        padding: 0 25px 35px 25px; 
        color: #000; 
        letter-spacing: 0.5px;
    }
    
    .nav-list { list-style: none; padding: 0; flex-grow: 1; }
    
    .nav-item { padding: 4px 20px; }
    
    .nav-link { 
        color: #777777; 
        text-decoration: none; 
        display: block; 
        font-size: 13.5px; 
        font-weight: 500;
        padding: 10px 15px;
        border-radius: 8px;
        transition: all 0.2s;
    }
    
    /* Warna Hijau yang pas */
    .nav-link.active { 
        background-color: #e8f5e9; 
        color: #2e7d32 !important; 
        font-weight: 600; 
    }
    
    .nav-link i { margin-right: 12px; width: 18px; font-size: 14px; }
    
    .footer { padding: 0 25px; margin-top: auto; }
    
    .logout-btn { 
        background: none; border: none; color: #d32f2f; 
        font-size: 13.5px; padding: 10px 0; cursor: pointer; 
        display: flex; align-items: center;
    }
    
    .content { flex-grow: 1; padding: 30px; background: #fdfdfd; }
</style>
</head>
<body>
    <div class="wrapper">
        <div class="sidebar">
            <div class="brand">TEH TARIK 99</div>
            <ul class="nav-list">
                <li class="nav-item">
                <a href="/admin/dashboard" class="nav-link {{ request()->is('admin/dashboard') ? 'active' : '' }}">
                    <i class="fa fa-home"></i> Dashboard
                </a>
            </li>
                <li class="nav-item">
                <a href="/admin/produk" class="nav-link {{ request()->is('admin/produk') ? 'active' : '' }}">
                    <i class="fa fa-box"></i> Produk
                </a>
            </li>
            <li class="nav-item">
                <a href="/admin/resep" class="nav-link {{ request()->is('admin/resep') ? 'active' : '' }}">
                    <i class="fa fa-cubes"></i> Atur Resep
                </a>
            </li>
            <li class="nav-item">
                <a href="/admin/kontrol-stok" class="nav-link {{ request()->is('admin/kontrol-stok') ? 'active' : '' }}">
                    <i class="fa fa-list-check"></i> Kontrol Stok
                </a>
            </li>
            <li class="nav-item">
                <a href="/admin/laporan" class="nav-link {{ request()->is('admin/laporan') ? 'active' : '' }}">
                    <i class="fa fa-chart-line"></i> Laporan
                </a>
            </li>
            </ul>
            <div class="footer">
                <a href="#" class="nav-link"><i class="fa fa-user"></i> Profil</a>
                <form action="{{ route('logout') }}" method="POST">
                    @csrf
                    <button type="submit" class="nav-link" style="border:none; background:none; color:#dc3545;"><i class="fa fa-sign-out-alt"></i> Keluar</button>
                </form>
            </div>
        </div>
        <div class="content">@yield('content')</div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>