@php
    /** @var \Illuminate\Support\Collection|\App\Models\EventType[] $eventTypes */
    /** @var \Illuminate\Support\Collection|\App\Models\User[] $coordinators */
    $bookingModel = $booking ?? $linkedBooking ?? null;
    $sectionTitle = $sectionTitle ?? 'Document Information';
    $defaultGuests = old('guest_count', $bookingModel?->guest_count ?? $quotation?->guest_count ?? 1);
@endphp

{{-- Guest count hidden in Information; synced from space guest counts --}}
<input type="hidden" name="guest_count" id="document_guest_count" value="{{ $defaultGuests }}">

<div class="row">
    <div class="col-md-6">
        <x-form.select label="Customer" name="customer_id" :options="$customers->pluck('name', 'id')" :selected="old('customer_id', $bookingModel?->customer_id ?? $quotation?->customer_id ?? null)" required placeholder="Select customer" />
    </div>
    <div class="col-md-6">
        <x-form.input label="Event Name" name="event_name" :value="old('event_name', $bookingModel?->event_name)" required />
    </div>
    <div class="col-md-4">
        <x-form.select label="Event Type" name="event_type_id" :options="$eventTypes->pluck('name', 'id')" :selected="old('event_type_id', $bookingModel?->event_type_id)" placeholder="Select event type" />
    </div>
    <div class="col-md-4">
        <x-form.input label="Event Start" name="event_start" type="datetime-local" :value="old('event_start', $bookingModel?->event_start?->format('Y-m-d\TH:i'))" help="Filled from spaces when empty" />
    </div>
    <div class="col-md-4">
        <x-form.input label="Event End" name="event_end" type="datetime-local" :value="old('event_end', $bookingModel?->event_end?->format('Y-m-d\TH:i'))" help="Filled from spaces when empty" />
    </div>
    <div class="col-md-4">
        <x-form.select label="Coordinator" name="coordinator_id" :options="$coordinators->pluck('name', 'id')" :selected="old('coordinator_id', $bookingModel?->coordinator_id)" placeholder="Select coordinator" />
    </div>
    <div class="col-md-4">
        <x-form.input label="Contact Name" name="contact_name" :value="old('contact_name', $bookingModel?->contact_name)" />
    </div>
    <div class="col-md-4">
        <x-form.input label="Contact Phone" name="contact_phone" :value="old('contact_phone', $bookingModel?->contact_phone)" />
    </div>
    <div class="col-md-6">
        <x-form.input label="Contact Email" name="contact_email" type="email" :value="old('contact_email', $bookingModel?->contact_email)" />
    </div>
    <div class="col-md-6">
        <x-form.input label="Seating Arrangement" name="seating_arrangement" :value="old('seating_arrangement', $bookingModel?->seating_arrangement)" />
    </div>
    <div class="col-12">
        <x-form.textarea label="Description" name="description" :value="old('description', $bookingModel?->description)" rows="2" />
    </div>
    <div class="col-md-6">
        <x-form.textarea label="Customer Notes" name="customer_notes" :value="old('customer_notes', $bookingModel?->customer_notes)" rows="2" />
    </div>
    <div class="col-md-6">
        <x-form.textarea label="Internal Notes" name="internal_notes" :value="old('internal_notes', $bookingModel?->internal_notes)" rows="2" />
    </div>
</div>
