@extends('admin.layouts.app')

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

@section('content')
<div class="page-shell">
    <div class="page-head">
        <div>
            <h1 class="page-title">Add Supplier</h1>
            <div class="page-subtitle">Create a supplier profile for purchases, due tracking, and reporting.</div>
        </div>
        <a href="{{ route('admin.suppliers.index') }}" class="btn btn-light">Back to List</a>
    </div>

    <form method="POST" action="{{ route('admin.suppliers.store') }}">
        @csrf

        <div class="grid-3">
            <div class="card">
                <label for="name">Supplier Name</label>
                <input type="text" id="name" name="name" value="{{ old('name') }}" required>
            </div>

            <div class="card">
                <label for="phone">Phone</label>
                <input type="text" id="phone" name="phone" value="{{ old('phone') }}">
            </div>

            <div class="card">
                <label for="email">Email</label>
                <input type="email" id="email" name="email" value="{{ old('email') }}">
            </div>

            <div class="card">
                <label for="company">Company</label>
                <input type="text" id="company" name="company" value="{{ old('company') }}">
            </div>

            <div class="card">
                <label for="contact_person">Contact Person</label>
                <input type="text" id="contact_person" name="contact_person" value="{{ old('contact_person') }}">
            </div>

            <div class="card">
                <label for="opening_due">Opening Due</label>
                <input type="number" step="0.01" id="opening_due" name="opening_due" value="{{ old('opening_due', 0) }}">
            </div>
        </div>

        <div class="grid-2" style="margin-top:12px;">
            <div class="card">
                <label for="address">Address</label>
                <textarea id="address" name="address" rows="5">{{ old('address') }}</textarea>
            </div>

            <div class="card">
                <label for="notes">Notes</label>
                <textarea id="notes" name="notes" rows="5">{{ old('notes') }}</textarea>

                <div class="form-actions">
                    <button type="submit" class="btn primary">Save Supplier</button>
                    <a href="{{ route('admin.suppliers.index') }}" class="btn btn-light">Cancel</a>
                </div>
            </div>
        </div>
    </form>
</div>
@endsection