<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Approval Summary - <?php echo e($token->title); ?></title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
            color: #333;
        }
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 20px;
        }
        .header {
            text-align: center;
            border-bottom: 2px solid #333;
            padding-bottom: 20px;
            margin-bottom: 30px;
        }
        .institution-name {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        .document-title {
            font-size: 16px;
            font-weight: bold;
            margin: 20px 0 10px 0;
        }
        .section {
            margin-bottom: 20px;
        }
        .section-title {
            font-size: 14px;
            font-weight: bold;
            background-color: #f0f0f0;
            padding: 10px;
            margin-bottom: 10px;
            border-left: 4px solid #333;
        }
        .info-row {
            display: flex;
            margin-bottom: 8px;
            padding: 0 10px;
        }
        .info-label {
            font-weight: bold;
            width: 200px;
            flex-shrink: 0;
        }
        .info-value {
            flex: 1;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }
        th {
            background-color: #333;
            color: white;
            padding: 12px;
            text-align: left;
            font-size: 13px;
            font-weight: bold;
        }
        td {
            padding: 10px 12px;
            border-bottom: 1px solid #ddd;
            font-size: 12px;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        .status-approved {
            color: green;
            font-weight: bold;
        }
        .status-rejected {
            color: red;
            font-weight: bold;
        }
        .status-pending {
            color: orange;
            font-weight: bold;
        }
        .footer {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            text-align: center;
            font-size: 11px;
            color: #666;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Header -->
        <div class="header">
            <div class="institution-name"><?php echo e(config('app.name', 'ApprovalDesk')); ?></div>
            <div class="document-title">APPROVAL SUMMARY REPORT</div>
        </div>

        <!-- Request Information -->
        <div class="section">
            <div class="section-title">REQUEST INFORMATION</div>
            <div class="info-row">
                <div class="info-label">Request ID:</div>
                <div class="info-value">#<?php echo e($token->id); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Title:</div>
                <div class="info-value"><?php echo e($token->title); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Category:</div>
                <div class="info-value"><?php echo e($token->category->name); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Requester:</div>
                <div class="info-value"><?php echo e($token->creator->name); ?> (<?php echo e($token->creator->email); ?>)</div>
            </div>
            <div class="info-row">
                <div class="info-label">Department:</div>
                <div class="info-value"><?php echo e($token->creator->department->name); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Date Submitted:</div>
                <div class="info-value"><?php echo e($token->created_at->format('F d, Y H:i')); ?></div>
            </div>
            <div class="info-row">
                <div class="info-label">Status:</div>
                <div class="info-value" style="text-transform: uppercase; font-weight: bold;"><?php echo e($token->status); ?></div>
            </div>
        </div>

        <!-- Description -->
        <?php if($token->description): ?>
            <div class="section">
                <div class="section-title">DESCRIPTION</div>
                <div style="padding: 10px;">
                    <?php echo strip_tags($token->description); ?>

                </div>
            </div>
        <?php endif; ?>

        <!-- Approval Chain -->
        <div class="section">
            <div class="section-title">APPROVAL CHAIN</div>
            <table>
                <thead>
                    <tr>
                        <th style="width: 8%;">Stage</th>
                        <th style="width: 20%;">Department</th>
                        <th style="width: 20%;">Position</th>
                        <th style="width: 18%;">Approver</th>
                        <th style="width: 12%;">Status</th>
                        <th style="width: 22%;">Date</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $token->tokenApprovals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $approval): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td style="text-align: center;"><?php echo e($approval->stage->stage_order); ?></td>
                            <td><?php echo e($approval->stage->department->name); ?></td>
                            <td><?php echo e($approval->stage->designation); ?></td>
                            <td><?php echo e($approval->approver ? $approval->approver->name : '-'); ?></td>
                            <td>
                                <span class="status-<?php echo e($approval->status); ?>">
                                    <?php echo e(ucfirst($approval->status)); ?>

                                </span>
                            </td>
                            <td><?php echo e($approval->acted_at ? $approval->acted_at->format('F d, Y H:i') : '-'); ?></td>
                        </tr>
                        <?php if($approval->remarks): ?>
                            <tr style="background-color: #fffacd;">
                                <td colspan="6" style="padding: 8px 12px; font-style: italic; border-bottom: none;">
                                    <strong>Remarks:</strong> <?php echo e($approval->remarks); ?>

                                </td>
                            </tr>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>

        <!-- Footer -->
        <div class="footer">
            <p>This is an automatically generated approval summary report.</p>
            <p>Generated on <?php echo e(now()->format('F d, Y H:i:s')); ?></p>
        </div>
    </div>
</body>
</html><?php /**PATH D:\My Works\approval\resources\views/pdf/token-summary.blade.php ENDPATH**/ ?>