

<?php $__env->startSection('title', 'Precio del día'); ?>
<?php $__env->startSection('subtitle', 'Lista de precios diarios por combustible'); ?>

<?php $__env->startSection('actions'); ?>
    <?php if(auth()->user()->rol === 'ADMIN'): ?>
        <a class="btn primary" href="<?php echo e(route('precios_dia.create')); ?>">Nuevo Precio</a>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <?php if($items->isNotEmpty()): ?>
        <div style="width:100%;max-width:720px;margin:0 auto 12px auto;padding:10px 12px;border:1px solid #e2e8f0;border-radius:12px;background:linear-gradient(135deg,#eff6ff,#f8fafc);box-shadow:0 6px 18px rgba(15,23,42,0.08)">
            <div style="display:flex;flex-direction:column;gap:8px">
                <div style="font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#2563eb;font-weight:700">Todos los registros de precios</div>
                <div style="overflow-x:auto;width:100%">
                    <table style="width:100%;border-collapse:collapse;background:#fff;border:1px solid #dbeafe;border-radius:12px;overflow:hidden">
                        <thead>
                            <tr style="background:#eff6ff;text-align:left">
                                <th style="padding:6px 8px;font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#1e3a8a">Tipo</th>
                                <th style="padding:6px 8px;font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#1e3a8a">TM</th>
                                <th style="padding:6px 8px;font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#1e3a8a">TT</th>
                                <th style="padding:6px 8px;font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#1e3a8a">TN</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr style="border-top:1px solid #e5eefb">
                                    <td style="padding:6px 8px;font-size:12px;font-weight:700;color:#111827"><?php echo e($item->tipoCombustible->nombre ?? 'N/A'); ?></td>
                                    <td style="padding:6px 8px;font-size:12px;color:#111827"><?php echo e(number_format($item->precio_turno_manana, 2)); ?></td>
                                    <td style="padding:6px 8px;font-size:12px;color:#111827"><?php echo e(number_format($item->precio_turno_tarde, 2)); ?></td>
                                    <td style="padding:6px 8px;font-size:12px;color:#111827"><?php echo e(number_format($item->precio_turno_noche, 2)); ?></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    <?php else: ?>
        <div style="margin-bottom:16px;padding:14px 16px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc;color:#475569">No hay registros de precios disponibles.</div>
    <?php endif; ?>

    <div style="overflow-x:auto">
        <table style="width:100%;border-collapse:collapse;margin-top:10px">
            <thead>
                <tr style="background:#f1f5f9;text-align:left">
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Fecha</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Combustible</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Mañana</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Tarde</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Noche</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Estado</th>
                    <th style="padding:12px;border-bottom:1px solid #e2e8f0">Acciones</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr style="border-bottom:1px solid #e2e8f0">
                    <td style="padding:12px"><?php echo e($item->fecha); ?></td>
                    <td style="padding:12px"><?php echo e($item->tipoCombustible->nombre ?? 'N/A'); ?></td>
                    <td style="padding:12px"><?php echo e(number_format($item->precio_turno_manana, 2)); ?></td>
                    <td style="padding:12px"><?php echo e(number_format($item->precio_turno_tarde, 2)); ?></td>
                    <td style="padding:12px"><?php echo e(number_format($item->precio_turno_noche, 2)); ?></td>
                    <td style="padding:12px">
                        <span style="padding:4px 8px;border-radius:6px;font-size:12px;background:<?php echo e($item->i_estado ? '#dcfce7' : '#fee2e2'); ?>;color:<?php echo e($item->i_estado ? '#166534' : '#991b1b'); ?>">
                            <?php echo e($item->i_estado ? 'Activo' : 'Inactivo'); ?>

                        </span>
                    </td>
                    <td style="padding:12px;display:flex;gap:8px">
                        <a class="btn" href="<?php echo e(route('precios_dia.edit', $item->id)); ?>" style="padding:6px 10px;font-size:13px">Editar</a>
                        <?php if(auth()->user()->rol === 'ADMIN'): ?>
                            <form action="<?php echo e(route('precios_dia.destroy', $item->id)); ?>" method="POST" onsubmit="return confirm('¿Eliminar registro?')">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn" style="padding:6px 10px;font-size:13px;background:#fee2e2;color:#991b1b;border-color:#fecaca">Eliminar</button>
                            </form>
                        <?php endif; ?>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if($items->isEmpty()): ?>
                <tr>
                    <td colspan="7" style="padding:24px;text-align:center;color:#64748b">No hay registros encontrados.</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('partials.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\grifo\resources\views/precios_dia/index.blade.php ENDPATH**/ ?>