@extends('adminlte.layouts.app')

@section('content')
<div class="content-wrapper">
    <div class="content-header">
        <div class="container-fluid">
            <h1 class="fw-bold">📊 Detail Laporan Buku</h1>
        </div>
    </div>

    <section class="content">
        <div class="container-fluid">
            <div class="card shadow">
                <div class="card-header bg-primary text-white">
                    Rekap Peminjaman Buku
                </div>
                <div class="card-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead class="text-center">
                            <tr>
                                <th>No</th>
                                <th>Judul</th>
                                <th>Pengarang</th>
                                <th>Kategori</th>
                                <th>Transaksi</th>
                                <th>Total Dipinjam</th>
                                <th>Stok Sekarang</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach($laporan as $item)
                            <tr>
                                <td class="text-center">{{ $loop->iteration }}</td>
                                <td>{{ $item->judul }}</td>
                                <td>{{ $item->pengarang }}</td>
                                <td class="text-center">{{ $item->kategori }}</td>
                                <td class="text-center">{{ $item->total_transaksi }}</td>
                                <td class="text-center">{{ $item->total_dipinjam }}</td>
                                <td class="text-center">{{ $item->jumlah }}</td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>

            <a href="{{ route('laporan.buku.cetak') }}" class="btn btn-danger mt-3">
                Cetak PDF
            </a>
        </div>
    </section>
</div>
@endsection
