<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Laporan Audit - <?php echo e($audit->tema); ?></title>
    <style>
        body {
            font-family: "Times New Roman", Times, serif;
            font-size: 13px;
            color: #1F2937;
            padding: 20px 40px;
        }
        .kop {
            text-align: center;
            border-bottom: 2px solid #003366;
            padding-bottom: 8px;
            margin-bottom: 30px;
        }
        .kop h1 {
            font-size: 18px;
            font-weight: bold;
            color: #003366;
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .kop p {
            margin: 2px 0 0;
            font-size: 12px;
            color: #4B5563;
        }
        .section-title {
            background-color: #003366;
            color: white;
            padding: 6px 10px;
            margin-top: 22px;
            font-weight: bold;
            font-size: 14px;
        }
        .table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 6px;
        }
        .table th, .table td {
            border: 1px solid #D1D5DB;
            padding: 7px;
            vertical-align: top;
            text-align: left;
        }
        .photo {
            display: block;
            max-width: 100%;
            max-height: 160px;
            margin: 4px auto;
            object-fit: contain;
        }
        .footer {
            margin-top: 40px;
            text-align: center;
            font-size: 12px;
            color: #6B7280;
        }
    </style>
</head>
<body>

    <div class="kop">
        <h1>Laporan Audit 5S</h1>
        <p>Disusun oleh Sistem Audit Internal</p>
    </div>

    
    <div class="section-title">Informasi Audit</div>
    <table class="table">
        <tr>
            <th>Nama Auditor</th>
            <td><?php echo e($audit->auditor); ?></td>
            <th>Nama Auditee</th>
            <td><?php echo e($audit->auditi); ?></td>
        </tr>
        <tr>
            <th>Divisi Auditor</th>
            <td><?php echo e($audit->user->bagian->nama_bagian ?? '-'); ?></td>
            <th>Divisi yang diaudit</th>
            <td><?php echo e($audit->bagian->nama_bagian ?? '-'); ?></td>
        </tr>
        <tr>
            <th>Tema Audit</th>
            <td><?php echo e($audit->tema->nama ?? '-'); ?></td>
            <th>Kategori Audit</th>
            <td><?php echo e($audit->kategori); ?></td>
        </tr>
        <tr>
            <th>Tanggal Audit</th>
            <td><?php echo e(\Carbon\Carbon::parse($audit->tanggal_audit)->translatedFormat('d F Y')); ?></td>
            <th>Tanggal Verifikasi</th>
            <td><?php echo e($audit->tanggal_verifikasi ? \Carbon\Carbon::parse($audit->tanggal_verifikasi)->translatedFormat('d F Y') : '-'); ?></td>
        </tr>
    </table>

    
    <div class="section-title">PIC Perbaikan</div>
    <table class="table">
        <tr>
            <td><?php echo e($audit->pic_perbaikan ?? '-'); ?></td>
        </tr>
    </table>

    
    <div class="section-title">Area Temuan</div>
    <table class="table">
        <tr>
            <td><?php echo e($audit->lokasi); ?></td>
        </tr>
    </table>

    
    <div class="section-title">Keterangan Audit</div>
    <table class="table">
        <tr>
            <th style="width: 22%;">Sebelum</th>
            <td><?php echo e($audit->keterangan); ?></td>
        </tr>
        <tr>
            <th>Sesudah</th>
            <td><?php echo e($audit->keterangan_sesudah ?? '-'); ?></td>
        </tr>
    </table>

    
    <div class="section-title">Dokumentasi Foto</div>
    <table class="table">
        <tr>
            <th style="text-align: center;">Foto Sebelum</th>
            <th style="text-align: center;">Foto Sesudah</th>
        </tr>
        <tr>
            <td style="text-align: center;">
                <?php if($audit->foto_sebelum && file_exists(public_path('storage/' . $audit->foto_sebelum))): ?>
                    <img class="photo" src="<?php echo e(public_path('storage/' . $audit->foto_sebelum)); ?>" alt="Foto Sebelum">
                <?php else: ?>
                    <em>Tidak tersedia</em>
                <?php endif; ?>
            </td>
            <td style="text-align: center;">
                <?php if($audit->foto_sesudah && file_exists(public_path('storage/' . $audit->foto_sesudah))): ?>
                    <img class="photo" src="<?php echo e(public_path('storage/' . $audit->foto_sesudah)); ?>" alt="Foto Sesudah">
                <?php else: ?>
                    <em>Tidak tersedia</em>
                <?php endif; ?>
            </td>
        </tr>
    </table>

    
    <div class="footer">
        Dokumen ini dihasilkan otomatis melalui Sistem Audit 5S<br>
        &copy; <?php echo e(date('Y')); ?> E-Audit Systems
    </div>

</body>
</html>
<?php /**PATH C:\xampp\htdocs\ea-systems\resources\views/admin/exports/audit-pdf.blade.php ENDPATH**/ ?>