<x-filament-panels::page>
    <x-filament::section icon="heroicon-o-funnel">
        <x-slot name="heading">Filter Laporan</x-slot>
        <x-slot name="description">Pilih periode dan gudang, lalu cetak logbook limbah B3.</x-slot>

        <form method="GET" action="{{ route('laporan.logbook-b3') }}" target="_blank" style="max-width: 32rem;">
            {{-- jarak antar field dijamin lewat inline gap --}}
            <div style="display: flex; flex-direction: column; gap: 1.25rem;">
                {{-- Dari Tanggal --}}
                <div>
                    <label for="start" class="text-sm font-medium text-gray-950 dark:text-white"
                           style="display: block; margin-bottom: 0.5rem;">
                        Dari Tanggal
                    </label>
                    <x-filament::input.wrapper>
                        <x-filament::input
                            type="date"
                            id="start"
                            name="start"
                            value="{{ now()->startOfMonth()->toDateString() }}"
                            required
                        />
                    </x-filament::input.wrapper>
                </div>

                {{-- Sampai Tanggal --}}
                <div>
                    <label for="end" class="text-sm font-medium text-gray-950 dark:text-white"
                           style="display: block; margin-bottom: 0.5rem;">
                        Sampai Tanggal
                    </label>
                    <x-filament::input.wrapper>
                        <x-filament::input
                            type="date"
                            id="end"
                            name="end"
                            value="{{ now()->endOfMonth()->toDateString() }}"
                            required
                        />
                    </x-filament::input.wrapper>
                </div>

                {{-- Gudang --}}
                <div>
                    <label for="gudang_id" class="text-sm font-medium text-gray-950 dark:text-white"
                           style="display: block; margin-bottom: 0.5rem;">
                        Gudang
                    </label>
                    <x-filament::input.wrapper>
                        <x-filament::input.select id="gudang_id" name="gudang_id">
                            <option value="">Semua Gudang</option>
                            @foreach ($this->getGudangOptions() as $id => $nama)
                                <option value="{{ $id }}">{{ $nama }}</option>
                            @endforeach
                        </x-filament::input.select>
                    </x-filament::input.wrapper>
                </div>
            </div>

            <input type="hidden" name="autoprint" value="1">

            {{-- ruang di atas tombol --}}
            <div style="margin-top: 2rem;">
                <x-filament::button type="submit" icon="heroicon-o-printer" size="lg">
                    Buka &amp; Cetak Laporan
                </x-filament::button>
            </div>
        </form>
    </x-filament::section>
</x-filament-panels::page>