@extends('layouts.app')

@section('title', 'Add Supplier')

@section('content')
    <x-page-head title="Add Supplier" subtitle="Register a new supplier" />

    <x-panel>
        <form method="POST" action="{{ route('finance.suppliers.store') }}">
            @csrf
            <div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:16px;">
                <div class="form-group">
                    <label class="form-label" for="code">Code</label>
                    <input class="input" type="text" id="code" name="code" value="{{ old('code') }}" required>
                </div>
                <div class="form-group">
                    <label class="form-label" for="name">Name</label>
                    <input class="input" type="text" id="name" name="name" value="{{ old('name') }}" required>
                </div>
                <div class="form-group">
                    <label class="form-label" for="contact_person">Contact Person</label>
                    <input class="input" type="text" id="contact_person" name="contact_person" value="{{ old('contact_person') }}">
                </div>
                <div class="form-group">
                    <label class="form-label" for="email">Email</label>
                    <input class="input" type="email" id="email" name="email" value="{{ old('email') }}">
                </div>
                <div class="form-group">
                    <label class="form-label" for="phone">Phone</label>
                    <input class="input" type="text" id="phone" name="phone" value="{{ old('phone') }}">
                </div>
                <div class="form-group">
                    <label class="form-label" for="tax_number">Tax Number</label>
                    <input class="input" type="text" id="tax_number" name="tax_number" value="{{ old('tax_number') }}">
                </div>
                <div class="form-group" style="grid-column: span 2;">
                    <label class="form-label" for="address">Address</label>
                    <textarea class="input" id="address" name="address" rows="2">{{ old('address') }}</textarea>
                </div>
            </div>
            <div style="display:flex; gap:10px; margin-top:16px;">
                <button type="submit" class="btn btn-primary">Save Supplier</button>
                <a href="{{ route('finance.expenses.index') }}" class="btn btn-ghost">Cancel</a>
            </div>
        </form>
    </x-panel>
@endsection
