<table>
    <thead>
        <tr>
            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                ID User
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Username
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                NRP
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Role
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Nama Karyawan
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Jabatan
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Departemen
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Email
            </th>

            <th style="background-color:#1F4E78;color:#FFFFFF;font-weight:bold;border:1px solid #000000;">
                Dibuat
            </th>
        </tr>
    </thead>

    <tbody>
        @foreach ($users as $user)
            <tr>
                <td style="border:1px solid #000000;">
                    {{ $loop->iteration }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->name }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->karyawan->nrp ?? '-' }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->role }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->karyawan->nama ?? '-' }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->karyawan->jabatan->jabatan ?? '-' }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->karyawan->departemen->departemen ?? '-' }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->email }}
                </td>

                <td style="border:1px solid #000000;">
                    {{ $user->created_at?->format('d-m-Y H:i') }}
                </td>
            </tr>
        @endforeach
    </tbody>
</table>
