@extends('layouts.admin')
@section('title', 'Marcas')
@section('content')
<div class="flex items-center justify-between mb-6">
    <h1 class="text-2xl font-semibold">Marcas</h1>
    <a href="{{ route('admin.brands.create') }}" class="bg-olive text-beige px-4 py-2 rounded-lg text-sm">+ Nueva</a>
</div>
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
    <table class="w-full text-sm">
        <thead class="bg-gray-50 text-left text-gray-500"><tr><th class="p-3">Nombre</th><th class="p-3">Activa</th><th class="p-3"></th></tr></thead>
        <tbody>
        @forelse($brands as $b)
            <tr class="border-t">
                <td class="p-3">{{ $b->name }}</td>
                <td class="p-3">{{ $b->is_active ? 'Sí' : 'No' }}</td>
                <td class="p-3 text-right">
                    <a href="{{ route('admin.brands.edit', $b) }}" class="text-olive">Editar</a>
                    <form method="POST" action="{{ route('admin.brands.destroy', $b) }}" class="inline" onsubmit="return confirm('¿Eliminar?')">@csrf @method('DELETE')<button class="text-red-600 ml-2">Eliminar</button></form>
                </td>
            </tr>
        @empty
            <tr><td colspan="3" class="p-6 text-center text-gray-400">Sin marcas.</td></tr>
        @endforelse
        </tbody>
    </table>
</div>
<div class="mt-4">{{ $brands->links() }}</div>
@endsection
