@extends('layouts.main')

@section('breadcrumbs')
    {{ Breadcrumbs::render('admin-kredit.laporan-slik.show', $laporanSlik) }}
@endsection

@section('content')
    <div class="grid">
        <div class="w-full">
            <!-- Header -->
            <div class="flex flex-wrap gap-4 justify-between items-center mb-6">
                <div>
                    <h3 class="text-xl font-semibold text-gray-900">Detail Laporan SLIK</h3>
                    <p class="mt-1 text-sm text-gray-600">Informasi lengkap laporan SLIK {{ $laporanSlik->nama_debitur }}
                    </p>
                </div>
                <div class="flex gap-2">
                    <a href="{{ route('admin-kredit.laporan-slik.index') }}" class="btn btn-sm btn-light">
                        <i class="ki-filled ki-arrow-left"></i>
                        Kembali
                    </a>
                </div>
            </div>

            <!-- Card Detail -->
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Informasi Laporan SLIK</h3>
                </div>
                <div class="card-body">
                    <div class="grid grid-cols-1 gap-6 md:grid-cols-2">
                        <!-- Informasi Debitur -->
                        <div class="space-y-4">
                            <h4 class="mb-3 text-base font-semibold text-gray-800">Data Debitur</h4>

                            <div class="space-y-3">
                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Nama Debitur:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->nama_debitur ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">No. Rekening:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->no_rekening ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">CIF:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->cif ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">NPWP:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->npwp ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">No. KTP:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->no_ktp ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">No. Telp:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->no_telp ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Alamat:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->alamat ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Kode Pos:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->kode_pos ?? '-' }}</span>
                                </div>
                            </div>
                        </div>

                        <!-- Informasi Fasilitas -->
                        <div class="space-y-4">
                            <h4 class="mb-3 text-base font-semibold text-gray-800">Data Fasilitas</h4>

                            <div class="space-y-3">
                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Fasilitas:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->fasilitas ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Kolektibilitas:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->kolektibilitas ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Jenis Agunan:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->jenis_agunan ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Nilai Agunan:</span>
                                    <span class="text-sm text-gray-900">Rp
                                        {{ number_format($laporanSlik->nilai_agunan ?? 0, 0, ',', '.') }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Baki Debet:</span>
                                    <span class="text-sm text-gray-900">Rp
                                        {{ number_format($laporanSlik->baki_debet ?? 0, 0, ',', '.') }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Sandi Bank:</span>
                                    <span class="text-sm text-gray-900">{{ $laporanSlik->sandi_bank ?? '-' }}</span>
                                </div>

                                <div class="flex justify-between">
                                    <span class="text-sm font-medium text-gray-600">Status:</span>
                                    <span class="text-sm text-gray-900">
                                        <span
                                            class="badge badge-light-{{ $laporanSlik->status == 'aktif' ? 'success' : 'danger' }}">
                                            {{ $laporanSlik->status ?? 'aktif' }}
                                        </span>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="mt-4 row">
                        <div class="col-12">
                            <h5 class="mb-3">Detail Lainnya</h5>
                            <table class="table table-borderless">
                                <tr>
                                    <td width="20%"><strong>Kolektibilitas</strong></td>
                                    <td width="5%">:</td>
                                    <td>{{ $laporanSlik->kolektibilitas }}</td>
                                    <td width="20%"><strong>Tanggal Mulai</strong></td>
                                    <td width="5%">:</td>
                                    <td>{{ $laporanSlik->tanggal_mulai ?? '-' }}</td>
                                </tr>
                                <tr>
                                    <td><strong>Tanggal Jatuh Tempo</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->tanggal_jatuh_tempo ?? '-' }}</td>
                                    <td><strong>Tanggal Selesai</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->tanggal_selesai ?? '-' }}</td>
                                </tr>
                                <tr>
                                    <td><strong>Jenis Agunan</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->jenis_agunan ?? '-' }}</td>
                                    <td><strong>Fasilitas</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->fasilitas ?? '-' }}</td>
                                </tr>
                                <tr>
                                    <td><strong>Tanggal Lapor</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->tanggal_lapor ?? '-' }}</td>
                                    <td><strong>Tanggal Dibuat</strong></td>
                                    <td>:</td>
                                    <td>{{ $laporanSlik->created_at->format('d/m/Y H:i') }}</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
