<?php $__env->startSection('title', 'Quotations — HIGHRA CRM'); ?>
<?php $__env->startSection('header', 'Quotations'); ?>

<?php $__env->startSection('content'); ?>
<div class="row" style="margin-bottom: 20px;">
    <div>
        <h1 style="margin: 0 0 4px 0;">Quotations</h1>
        <p style="color: #8e9ab4; margin: 0;">Create, send and track customer quotations and estimates.</p>
    </div>
    <?php if(auth()->user()?->hasPermission('quotations.create')): ?>
        <a class="btn" href="<?php echo e(route('quotations.create')); ?>">
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
            + New Quotation
        </a>
    <?php endif; ?>
</div>

<div class="panel" style="margin-top: 0;">
    <div style="overflow-x: auto;">
        <table style="width: 100%;">
            <thead>
                <tr>
                    <th>Quote No.</th>
                    <th>Customer</th>
                    <th>Total (INR)</th>
                    <th>Status</th>
                    <th style="text-align: right;">Action</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $quotations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td>
                            <strong style="color: #ffffff; font-family: monospace;"><?php echo e($q->quote_no); ?></strong>
                        </td>
                        <td>
                            <span style="color: #e2e8f0; font-weight: 600;"><?php echo e($q->customer?->name ?? '—'); ?></span>
                            <?php if($q->customer?->phone): ?>
                                <small style="display: block; color: #8e9ab4;"><?php echo e($q->customer->phone); ?></small>
                            <?php endif; ?>
                        </td>
                        <td>
                            <strong style="color: #34d399; font-size: 13.5px;"><?php echo e(format_inr($q->total)); ?></strong>
                        </td>
                        <td>
                            <?php
                                $stClass = match(strtolower($q->status)) {
                                    'accepted', 'won' => 'badge-sales',
                                    'draft' => 'badge-inactive',
                                    'sent' => 'badge-support',
                                    'rejected', 'lost' => 'btn-danger',
                                    default => 'badge-manager'
                                };
                            ?>
                            <span class="badge <?php echo e($stClass); ?>"><?php echo e(ucfirst($q->status)); ?></span>
                        </td>
                        <td style="text-align: right;">
                            <a href="<?php echo e(route('quotations.show', $q)); ?>" class="btn btn-secondary btn-sm">View</a>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="5" style="padding: 40px; text-align: center; color: #64748b;">
                            No quotations found. Click <strong>+ New Quotation</strong> to create one.
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <div style="margin-top: 14px;">
        <?php echo e($quotations->links()); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/apple/Downloads/laravel/resources/views/quotations/index.blade.php ENDPATH**/ ?>