@extends('layouts.admin')

@section('title', 'Pegawai Belum Assessment')

@section('content')
<div class="content-header mb-4">
    <div class="d-flex justify-content-between align-items-center">
        <div>
            <h4 class="mb-1">Pegawai Belum Melakukan Assessment ({{ $assessmentYear }})</h4>
        </div>
        <div>
            <a href="{{ route('admin.dashboard') }}" class="btn btn-outline-secondary">
                <i class="fas fa-arrow-left me-1"></i> Kembali ke Dashboard
            </a>
        </div>
    </div>
</div>

<div class="card border-0 shadow-sm rounded-4">
    <div class="card-body p-0">
        @if ($pegawai->isNotEmpty())
            <div class="table-responsive">
                <table class="table table-hover align-middle mb-0">
                    <thead class="bg-light">
                        <tr>
                            <th class="border-0 px-4 py-3" style="width: 5%">No</th>
                            <th class="border-0 px-4 py-3" style="width: 35%">Informasi Pegawai</th>
                            <th class="border-0 px-4 py-3" style="width: 30%">Jabatan</th>
                            <th class="border-0 px-4 py-3" style="width: 30%">Unit Kerja</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($pegawai as $index => $item)
                            <tr>
                                <td class="px-4 py-3">{{ $pegawai->firstItem() + $index }}</td>
                                <td class="px-4 py-3">
                                    <div class="fw-bold text-dark mb-1">{{ $item->nama_lengkap }}</div>
                                    <div class="text-muted small">
                                        <i class="fas fa-id-card me-1"></i> NIP: {{ $item->nip }}
                                    </div>
                                    <div class="text-muted small">
                                        <i class="fas fa-layer-group me-1"></i> Gol: {{ $item->golongan ?? '-' }}
                                    </div>
                                </td>
                                <td class="px-4 py-3">
                                    <div class="fw-medium text-dark mb-1">{{ $item->jabatan?->nama_jabatan ?? '-' }}</div>
                                    <div class="text-muted small">
                                        <i class="fas fa-tag me-1"></i> {{ $item->jabatan?->jenjang_label ?? '-' }}
                                    </div>
                                </td>
                                <td class="px-4 py-3">
                                    <div class="text-dark">{{ $item->unit_kerja ?? '-' }}</div>
                                </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
            
            <div class="d-flex justify-content-center p-4 border-top">
                {{ $pegawai->links() }}
            </div>
        @else
            <div class="text-center py-5">
                <div class="mb-3">
                    <i class="fas fa-check-circle text-success" style="font-size: 3rem;"></i>
                </div>
                <h5 class="text-dark fw-bold">Semua Pegawai Sudah Assessment</h5>
                <p class="text-muted">Tidak ada pegawai valid yang belum melakukan assessment kompetensi tahun {{ $assessmentYear }}.</p>
            </div>
        @endif
    </div>
</div>
@endsection
