<x-app-layout>
    <x-slot name="header">{{ __('Add Customer') }}</x-slot>

    <div class="card shadow-sm">
        <div class="card-body">
            <form action="{{ route('customers.store') }}" method="POST">
                @csrf
                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label" for="name">{{ __('Name') }}</label>
                        <input id="name" type="text" name="name" class="form-control" value="{{ old('name') }}" required>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="phone">{{ __('Phone') }}</label>
                        <input id="phone" type="text" name="phone" class="form-control" value="{{ old('phone') }}">
                    </div>
                </div>

                <div class="row g-3 mt-3">
                    <div class="col-md-12">
                        <label class="form-label" for="address">{{ __('Address') }}</label>
                        <input id="address" type="text" name="address" class="form-control" value="{{ old('address') }}">
                    </div>
                </div>

                <div class="row g-3 mt-3">
                    <div class="col-md-6">
                        <label class="form-label" for="credit_limit">{{ __('Credit Limit') }}</label>
                        <input id="credit_limit" type="number" step="0.01" name="credit_limit" class="form-control" value="{{ old('credit_limit') }}">
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="status">{{ __('Status') }} *</label>
                        <select id="status" name="status" class="form-select" required>
                            <option value="active" {{ old('status', 'active') == 'active' ? 'selected' : '' }}>{{ __('Active') }}</option>
                            <option value="inactive" {{ old('status') == 'inactive' ? 'selected' : '' }}>{{ __('Inactive') }}</option>
                        </select>
                    </div>
                </div>

                <div class="mt-3">
                    <button type="submit" class="btn btn-primary">{{ __('Save Customer') }}</button>
                    <a href="{{ route('customers.index') }}" class="btn btn-secondary">{{ __('Cancel') }}</a>
                </div>
            </form>
        </div>
    </div>
</x-app-layout>
