@extends('layouts.app')

@section('content')
    <div class="space-y-6">
        <div class="flex flex-wrap items-center justify-between gap-4">
            <div>
                <h2 class="text-2xl font-semibold text-slate-900">Tambah Item Gudang</h2>
                <p class="text-sm text-slate-500">Tambah bahan baku baru ke stok gudang.</p>
            </div>
            <x-button variant="ghost" href="{{ route('warehouse.items.index') }}">Kembali</x-button>
        </div>

        <x-card>
            <form method="post" action="{{ route('warehouse.items.store') }}" class="grid gap-4 md:grid-cols-2">
                @csrf
                <x-input name="nama" label="Nama Item" required />
                <x-input name="satuan" label="Satuan" required placeholder="kg / pcs / liter" />
                <x-input name="kategori" label="Kategori" placeholder="Opsional" />
                <x-input name="harga_beli" label="Harga Beli" type="number" step="0.01" min="0" />
                <x-input name="stok_awal" label="Stok Awal" type="number" step="0.01" min="0" />
                <x-input name="stok_minimum" label="Stok Minimum" type="number" step="0.01" min="0" />
                <div class="md:col-span-2">
                    <label class="inline-flex items-center gap-2 text-sm text-slate-700">
                        <input type="checkbox" name="is_active" value="1" checked class="rounded border-amber-200 text-amber-600">
                        Item aktif
                    </label>
                </div>
                <div class="md:col-span-2 flex justify-end gap-3">
                    <x-button variant="ghost" href="{{ route('warehouse.items.index') }}">Batal</x-button>
                    <x-button type="submit">Simpan</x-button>
                </div>
            </form>
        </x-card>
    </div>
@endsection
