@extends('layouts.admin')
@section('title', 'Configuración')
@section('content')
<h1 class="text-2xl font-semibold mb-6">Configuración</h1>
<form method="POST" action="{{ route('admin.settings.update') }}" class="bg-white rounded-xl p-6 shadow-sm max-w-2xl space-y-4">
    @csrf @method('PUT')
    <h2 class="font-semibold text-olive">Datos de la empresa (SUNAT)</h2>
    <div><label class="block text-sm font-medium">Razón social</label><input name="company_name" value="{{ old('company_name', $settings['company_name']) }}" class="w-full border rounded-lg p-2 mt-1"></div>
    <div><label class="block text-sm font-medium">Dirección fiscal</label><input name="company_address" value="{{ old('company_address', $settings['company_address']) }}" class="w-full border rounded-lg p-2 mt-1"></div>
    <div><label class="block text-sm font-medium">Ubigeo</label><input name="company_ubigeo" value="{{ old('company_ubigeo', $settings['company_ubigeo']) }}" class="w-full border rounded-lg p-2 mt-1"></div>

    <h2 class="font-semibold text-olive pt-4">Logística y envío</h2>
    <div><label class="block text-sm font-medium">Handling fee (empaque) S/</label><input type="number" step="0.01" name="handling_fee" value="{{ old('handling_fee', $settings['handling_fee']) }}" class="w-full border rounded-lg p-2 mt-1"></div>
    <div><label class="block text-sm font-medium">Delivery fee (envío) S/</label><input type="number" step="0.01" name="delivery_fee" value="{{ old('delivery_fee', $settings['delivery_fee']) }}" class="w-full border rounded-lg p-2 mt-1"></div>
    <div><label class="block text-sm font-medium">Umbral de envío gratis S/</label><input type="number" step="0.01" name="shipping_free_threshold" value="{{ old('shipping_free_threshold', $settings['shipping_free_threshold']) }}" class="w-full border rounded-lg p-2 mt-1"></div>

    <button class="mt-4 bg-olive text-beige px-6 py-2 rounded-lg">Guardar</button>
</form>
@endsection
