<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cetak Instrumen Asesmen</title>
    <style>
        /* 1. SETUP HALAMAN */
        @page { 
            size: A4; 
            /* Margin Bawah 3.5cm: Area steril untuk Footer agar tidak ditabrak teks */
            margin: 1cm 1cm 1cm 1cm; 
        }

        body { 
            font-family: 'Times New Roman', serif; 
            font-size: 11pt; 
            line-height: 1.15; 
            color: #000; 
            -webkit-print-color-adjust: exact; 
        }
        
        * { box-sizing: border-box; }
        p { margin: 0 0 5px 0; } 

        /* 2. HEADER SUPER RAPAT (Hemat Kertas) */
        .header-doc { 
            text-align: center; 
            border-bottom: 3px double #000; 
            padding-bottom: 5px; 
            margin-bottom: 10px; 
        }
        .header-doc h3 { font-size: 14pt; margin: 0; font-weight: bold; text-transform: uppercase; line-height: 1; }
        .header-doc h4 { font-size: 12pt; margin: 2px 0; font-weight: bold; text-transform: uppercase; line-height: 1; }
        .header-doc p { margin: 0; font-size: 10pt; line-height: 1; }
        
        /* Judul Halaman */
        .page-title { text-align: center; margin-bottom: 10px; }
        .page-title h3 { margin: 0; text-decoration: underline; font-size: 12pt; line-height: 1.2; }

        /* Tabel Identitas & Info - Padding Diperkecil */
        .identity-box { width: 100%; margin-bottom: 5px; border-collapse: collapse; }
        .identity-box td { padding: 1px 0; vertical-align: bottom; }
        
        .dots { border-bottom: 1px dotted #000; width: 98%; display: inline-block; height: 14px; }
        
        .info-table { width: 100%; margin-bottom: 10px; border-collapse: collapse; font-size: 11pt; border: 1px solid #000; }
        .info-table td { padding: 3px 5px; vertical-align: middle; border: 1px solid #000; }
        
        /* Konten Soal */
        .content-section h4 { margin: 10px 0 5px 0; font-size: 11pt; text-decoration: underline; font-weight: bold; }
        /* Margin-left 0 agar rata kiri */
        .questions-text { text-align: justify; white-space: pre-line; margin: 0; padding: 0; }
        
        /* Utilities */
        .page-break { page-break-before: always; }
        .doc-separator { page-break-after: always; }

        .no-print { position: fixed; top: 20px; right: 20px; background: #333; color: #fff; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-family: sans-serif; z-index: 9999; }
        @media print { .no-print { display: none; } }
    </style>
</head>
<body>
    <a href="javascript:window.print()" class="no-print">🖨️ Cetak Dokumen</a>

    <?php
        if (!function_exists('cleanText')) {
            function cleanText($text) {
                if (!$text) return '-';
                $text = preg_replace('/^[ \t]+/m', '', $text); 
                $text = str_replace("\t", " ", $text);
                return trim($text);
            }
        }
        if (!function_exists('formatRubric')) {
            function formatRubric($text) {
                if (!$text) return '-';
                $text = cleanText($text);
                $text = preg_replace('/,\s*(\d+\.)/', "\n$1", $text);
                return $text;
            }
        }
    ?>

    <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <div class="<?php echo e($loop->last ? '' : 'doc-separator'); ?>">
        
        <div class="header-doc">
            <h3>PEMERINTAH PROVINSI SULAWESI SELATAN</h3>
            <h4>DINAS PENDIDIKAN - SMKN 10 MAKASSAR</h4>
            <p>Jl. Bonto Manai No. 14, Kota Makassar</p>
        </div>
        
        <div class="page-title">
            <h3>LEMBAR ASESMEN SISWA</h3>
        </div>
        
        <table class="info-table">
            <tr>
                <td width="130" style="background-color: #f0f0f0;"><strong>Mata Pelajaran</strong></td><td><?php echo e($item->subject->name); ?></td>
                <td width="100" style="background-color: #f0f0f0;"><strong>Bentuk</strong></td><td><?php echo e(ucfirst($item->technique)); ?></td>
            </tr>
            <tr>
                <td style="background-color: #f0f0f0;"><strong>Judul Asesmen</strong></td><td><?php echo e($item->title); ?></td>
                <td style="background-color: #f0f0f0;"><strong>Jenis</strong></td><td><?php echo e(ucfirst($item->type)); ?></td>
            </tr>
        </table>

        <table class="identity-box">
            <tr>
                <td width="60"><strong>Nama</strong></td><td width="10">:</td><td width="40%"><span class="dots"></span></td>
                <td width="60" style="padding-left: 15px;"><strong>Kelas</strong></td><td width="10">:</td><td><span class="dots"></span></td>
            </tr>
            <tr>
                <td><strong>NIS</strong></td><td>:</td><td><span class="dots"></span></td>
                <td style="padding-left: 15px;"><strong>Jurusan</strong></td><td>:</td><td><span class="dots"></span></td>
            </tr>
        </table>

        <div class="content-section">
            <h4>A. SOAL / INSTRUMEN</h4>
            <div class="questions-text"><?php echo e(cleanText($item->questions)); ?></div>
        </div>

        <div class="page-break"></div>
        <div class="header-doc">
            <h4>PEGANGAN GURU - KUNCI JAWABAN</h4>
            <p style="font-style:italic;">Dokumen Rahasia</p>
        </div>
        <table class="info-table" style="margin-bottom: 10px;">
            <tr><td width="150" style="background-color: #f0f0f0;"><strong>Judul Asesmen</strong></td><td><?php echo e($item->title); ?></td></tr>
        </table>
        <div class="content-section">
            <h4>B. RUBRIK / KUNCI JAWABAN</h4>
            <div class="questions-text" style="border: 1px solid #000; padding: 10px;"><?php echo e(formatRubric($item->rubric)); ?></div>
        </div>

        <div class="page-break"></div>
        <div class="header-doc"><h4>PROGRAM TINDAK LANJUT</h4></div>
        <table class="info-table" style="margin-bottom: 10px;">
            <tr><td width="150" style="background-color: #f0f0f0;"><strong>Judul Asesmen</strong></td><td><?php echo e($item->title); ?></td></tr>
        </table>
        <div class="content-section">
            <h4>C. REMEDIAL (Siswa < KKTP)</h4>
            <div class="questions-text" style="border: 1px solid #000; padding: 10px; margin-bottom: 15px;"><?php echo e(cleanText($item->remedial_plan)); ?></div>
        </div>
        <div class="content-section">
            <h4>D. PENGAYAAN (Siswa > KKTP)</h4>
            <div class="questions-text" style="border: 1px solid #000; padding: 10px;"><?php echo e(cleanText($item->enrichment)); ?></div>
        </div>
    </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</body>
</html><?php /**PATH /home/vol15_7/infinityfree.com/if0_40829333/htdocs/resources/views/pages/perangkat/asesmen/print.blade.php ENDPATH**/ ?>