<form action="{{ $client ? route('admin.clients.update', $client) : route('admin.clients.store') }}" method="POST" enctype="multipart/form-data">
    @csrf
    @if($client) @method('PUT') @endif
    <div class="mb-3">
        <label class="form-label">Name <span class="text-danger">*</span></label>
        <input type="text" name="name" class="form-control" value="{{ old('name', $client->name ?? '') }}" required>
    </div>
    <div class="mb-3">
        <label class="form-label">Logo</label>
        <input type="file" name="logo" class="form-control">
        @if($client && $client->logo)
            <img src="{{ \App\Services\FileUploadService::url($client->logo) }}" class="img-fluid mt-2 border rounded bg-white" style="max-height:70px">
        @endif
    </div>
    <div class="mb-3">
        <label class="form-label">Website</label>
        <input type="url" name="website" class="form-control" value="{{ old('website', $client->website ?? '') }}">
    </div>
    <div class="mb-3">
        <label class="form-label">Description</label>
        <textarea name="description" class="form-control" rows="3">{{ old('description', $client->description ?? '') }}</textarea>
    </div>
    <div class="mb-3">
        <label class="form-label">Sort Order</label>
        <input type="number" name="sort_order" class="form-control" value="{{ old('sort_order', $client->sort_order ?? 0) }}" min="0">
    </div>
    <div class="form-check mb-3">
        <input type="checkbox" class="form-check-input" id="status" name="status" value="1" {{ old('status', $client->status ?? true) ? 'checked' : '' }}>
        <label class="form-check-label" for="status">Active</label>
    </div>
    <button type="submit" class="btn btn-primary">{{ $client ? 'Update' : 'Create' }} Client</button>
    <a href="{{ route('admin.clients.index') }}" class="btn btn-outline-secondary">Cancel</a>
</form>
