<?php $__env->startSection('title', 'Assinaturas'); ?>
<?php $__env->startSection('page-title', 'Assinaturas digitais'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('partials.flash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
        <p class="text-sm text-slate-600">Envie documentos para assinatura com rastreio e lembretes automáticos.</p>
        <a href="<?php echo e(route('signatures.create')); ?>" class="rounded-lg bg-emerald-600 px-4 py-2 text-sm font-semibold text-white hover:bg-emerald-700">Nova assinatura</a>
    </div>

    <div class="mb-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-5">
        <?php $__currentLoopData = [
            'awaiting' => 'Aguardando',
            'pending_signers' => 'Signatários pendentes',
            'avg_hours' => 'Tempo médio (h)',
            'completed' => 'Concluídas',
            'expired' => 'Expiradas',
        ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm">
                <p class="text-xs uppercase tracking-wide text-slate-500"><?php echo e($label); ?></p>
                <p class="mt-1 text-xl font-semibold text-slate-900"><?php echo e($dashboard[$key] ?? '—'); ?></p>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <div class="overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">
        <table class="min-w-full divide-y divide-slate-200 text-sm">
            <thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
                <tr>
                    <th class="px-4 py-3">Título</th>
                    <th class="px-4 py-3">Documento</th>
                    <th class="px-4 py-3">Status</th>
                    <th class="px-4 py-3">Progresso</th>
                    <th class="px-4 py-3">Enviado</th>
                    <th class="px-4 py-3"></th>
                </tr>
            </thead>
            <tbody class="divide-y divide-slate-100">
                <?php $__empty_1 = true; $__currentLoopData = $requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td class="px-4 py-3 font-medium"><?php echo e($item->title); ?></td>
                        <td class="px-4 py-3 text-slate-600"><?php echo e($item->document?->number); ?> — <?php echo e($item->document?->title); ?></td>
                        <td class="px-4 py-3"><?php echo e($item->status->label()); ?></td>
                        <td class="px-4 py-3"><?php echo e($item->progressPercent()); ?>%</td>
                        <td class="px-4 py-3 text-slate-500"><?php echo e($item->sent_at?->format('d/m/Y H:i') ?? '—'); ?></td>
                        <td class="px-4 py-3 text-right">
                            <a href="<?php echo e(route('signatures.show', $item)); ?>" class="font-medium text-emerald-700">Abrir</a>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="6" class="px-4 py-8 text-center text-slate-500">Nenhuma solicitação de assinatura ainda.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <div class="mt-4"><?php echo e($requests->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/backend/resources/views/signatures/index.blade.php ENDPATH**/ ?>