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

<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:16px;">
    <div class="form-group">
        <label class="form-label" for="title">Title</label>
        <input class="input" type="text" id="title" name="title" value="{{ old('title', $book?->title) }}" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="author">Author</label>
        <input class="input" type="text" id="author" name="author" value="{{ old('author', $book?->author) }}">
    </div>
    <div class="form-group">
        <label class="form-label" for="isbn">ISBN</label>
        <input class="input" type="text" id="isbn" name="isbn" value="{{ old('isbn', $book?->isbn) }}">
    </div>
    <div class="form-group">
        <label class="form-label" for="category">Category</label>
        <input class="input" type="text" id="category" name="category" value="{{ old('category', $book?->category) }}">
    </div>
    <div class="form-group">
        <label class="form-label" for="copies_total">Total Copies</label>
        <input class="input" type="number" id="copies_total" name="copies_total" min="1" value="{{ old('copies_total', $book?->copies_total ?? 1) }}" required>
    </div>
    <div class="form-group">
        <label class="form-label" for="shelf_location">Shelf Location</label>
        <input class="input" type="text" id="shelf_location" name="shelf_location" value="{{ old('shelf_location', $book?->shelf_location) }}">
    </div>
</div>
