@extends('layouts.admin', [
    'title' => 'Create Invoice',
    'pageTitle' => 'Create Invoice',
    'active' => 'invoices',
])

@section('content')
    <div class="space-y-5">
        <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
            <p class="text-sm font-medium text-booklio-muted">Create a polished invoice and preview the customer-facing PDF layout.</p>
            <x-ui.button variant="secondary" href="{{ route('admin.invoices.index') }}">
                <x-ui.icon name="arrow-left" class="h-4 w-4" />
                Back to Invoices
            </x-ui.button>
        </div>

        <section class="grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(360px,0.8fr)]">
            <div>
                @include('admin.invoices.partials.form')
            </div>

            <div class="space-y-4 xl:sticky xl:top-24">
                <div>
                    <h2 class="text-lg font-extrabold">PDF Preview</h2>
                    <p class="mt-1 text-sm font-medium text-booklio-muted">Customer-facing invoice layout.</p>
                </div>
                @include('admin.invoices.partials.pdf-preview', ['invoice' => $invoice])
            </div>
        </section>
    </div>
@endsection
