<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Jadwal Penggunaan Ruang Praktik</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            font-size: 12px;
        }
        @page {
            size: A4 landscape;
            margin: 1mm;
        }
        .header-container {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            flex-wrap: wrap;
        }
        .header-logo {
            max-width: 35%;
            height: auto;
        }
        .title {
            text-align: center;
            font-weight: bold;
        }
        .title-last {
            margin-bottom: 15px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        table, th, td {
            border: 1px solid black;
        }
        th, td {
            padding: 3px;
            text-align: center;
        }
        .signature-container {
            margin-top: 50px;
            width: 100%;
            page-break-inside: avoid;
        }
        .signature-table {
            width: 100%;
            border: none;
            border-collapse: collapse;
        }
        .signature-col {
            width: 50%;
            vertical-align: top;
            text-align: left;
            border: none;
        }
        .signature-col-left {
            padding-left: 5px;
        }
        .signature-col-right {
            padding-left: 172px;
        }
        .signature-title {
            margin-bottom: 5px;
        }
        .signature-department {
            font-weight: bold;
            margin-bottom: 80px;
        }
        .signature-date {
            margin-bottom: 5px;
        }
        .signature-position {
            font-weight: bold;
            margin-bottom: 80px;
        }
        .signature-name {
            margin-top: 40px;
            font-weight: bold;
            text-decoration: none;
        }
        .signature-nip {
            margin-top: 0;
        }
        .footer {
            width: 28%;
            text-align: left;
        }
        .footer p {
            margin: 5px 0;
        }
        hr {
            border: 0.5px solid black;
            margin: 5px 0;
        }
        .no { width: 3%; }
        .kode { width: 10%; }
        .nama { width: 20%; }
        .merk { width: 35%; }
        .tahun { width: 8%; }
        .asal { width: 15%; }
        .kondisi { width: 20%; }
        .jumlah { width: 8%; }
        .satuan { width: 8%; }
        .keterangan { width: 40%; }
    </style>
</head>
<body>
    <div class="title">DAFTAR INVENTARIS</div>

    <hr>

    <div class="header-container">
        <img class="header-logo" src="{{ public_path('images/top-provinsi-2.jpg') }}" alt="Logo SMKN 1 Bondowoso">
    </div>

    <hr>
    <br>

    <table>
        <thead>
            <tr>
                <th class="no" rowspan="2">No</th>
                <th class="kode" rowspan="2">Kode Barang</th>
                <th class="nama" rowspan="2">Nama Barang</th>
                <th class="merk" rowspan="2">Merk</th>
                <th class="tahun" rowspan="2">Tahun Beli/Perolehan</th>
                <th class="asal" rowspan="2">Asal Usul</th>
                <th class="kondisi" colspan="2">Kondisi</th>
                <th class="jumlah" rowspan="2">Jumlah</th>
                <th class="satuan" rowspan="2">Satuan</th>
                <th class="keterangan" rowspan="2">Keterangan</th>
            </tr>
            <tr>
                <th>Baik</th>
                <th>Rusak</th>
            </tr>
        </thead>
        <tbody>
            @foreach($inventaries as $index => $inventaris)
            <tr>
                <td>{{ $index + 1 }}</td>
                <td>{{ $inventaris->kode_barang }}</td>
                <td>{{ $inventaris->nama_barang }}</td>
                <td>{{ $inventaris->merk }}</td>
                <td>{{ $inventaris->tahun_beli_perolehan }}</td>
                <td>{{ $inventaris->asal_usul ?? '-' }}</td>
                <td>{{ $inventaris->jumlah_baik }}</td>
                <td>{{ $inventaris->jumlah_rusak }}</td>
                <td>{{ $inventaris->jumlah_total }}</td>
                <td>{{ $inventaris->satuan }}</td>
                <td>{{ $inventaris->keterangan ?? '-' }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>

    <div class="signature-container">
        <table class="signature-table">
            <tr>
                <td class="signature-col siganture-col-left">
                    <div class="signature-title">KETUA PAKET KEAHLIAN</div>
                    <div class="signature-department">Akuntansi dan Keuangan Lembaga</div>
                    <div class="signature-name">SRI HASTUTI, S.E</div>
                    <div class="signature-nip">NIP. 19770727 201001 2 008</div>
                </td>
                <td class="signature-col signature-col-right">
                    <div class="signature-date">Bondowoso, {{ now()->translatedFormat('d F Y') }}</div>
                    <div class="signature-position">Laboran RPS Akuntansi</div>
                    <div class="signature-name">ABDUL MUID</div>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>