@extends('layouts.app')

@section('title', 'Deposit Categories')
@section('heading', 'Deposit Categories')

@section('content')
@include('finance.top-submenu')
@include('settings.partials.back-to-home')
    <x-card>
        <div class="mb-4 flex justify-between items-center">
            <p class="text-slate-600">Categories for classifying deposits.</p>
            <a href="{{ route('deposit-categories.create') }}" class="inline-flex items-center rounded-lg bg-slate-800 px-4 py-2 text-sm font-medium text-white hover:bg-slate-700"><i class="bi bi-plus-lg me-1"></i>Add Category</a>
        </div>
        <x-table>
            <x-slot name="head">
                <tr>
                    <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Name</th>
                    <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Description</th>
                    <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Actions</th>
                </tr>
            </x-slot>
            @forelse($categories as $c)
                <tr>
                    <td class="px-4 py-3 text-sm text-slate-900">{{ $c->name }}</td>
                    <td class="px-4 py-3 text-sm text-slate-600">{{ $c->description ?? '—' }}</td>
                    <td class="whitespace-nowrap px-4 py-3 text-sm space-x-2">
                        <a href="{{ route('deposit-categories.edit', $c) }}" class="btn-icon-action btn-icon-action--edit" title="Edit" aria-label="Edit"><i class="bi bi-pencil-square"></i></a>
                        @include('partials.delete-form', ['action' => route('deposit-categories.destroy', $c)])
                    </td>
                </tr>
            @empty
                <tr><td colspan="3" class="px-4 py-8 text-center text-sm text-slate-500">No deposit categories yet.</td></tr>
            @endforelse
        </x-table>
        @if($categories->hasPages())<div class="mt-4">{{ $categories->links() }}</div>@endif
    </x-card>
@endsection
