@php($room = $room ?? null)

<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:16px;">
    <div class="form-group">
        <label class="form-label" for="name">Room Name</label>
        <input class="input" type="text" id="name" name="name" value="{{ old('name', $room?->name) }}" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="code">Code</label>
        <input class="input" type="text" id="code" name="code" value="{{ old('code', $room?->code) }}" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="block">Block</label>
        <input class="input" type="text" id="block" name="block" value="{{ old('block', $room?->block) }}">
    </div>
    <div class="form-group">
        <label class="form-label" for="capacity">Capacity</label>
        <input class="input" type="number" id="capacity" name="capacity" min="1" value="{{ old('capacity', $room?->capacity ?? 1) }}" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="fee_amount">Fee Amount</label>
        <input class="input" type="number" step="0.01" id="fee_amount" name="fee_amount" value="{{ old('fee_amount', $room?->fee_amount ?? 0) }}">
    </div>
    <div class="form-group">
        <label class="form-label" for="status">Status</label>
        <select class="input" id="status" name="status">
            @foreach (['available', 'occupied', 'maintenance'] as $status)
                <option value="{{ $status }}" @selected(old('status', $room?->status ?? 'available') === $status)>{{ ucfirst($status) }}</option>
            @endforeach
        </select>
    </div>
</div>
