<?php $__env->startSection('title', 'NBR Customs & Tariff Configuration – Admin CRM'); ?>
<?php $__env->startSection('page_title', 'NBR Customs Tariffs & Import Charges'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-8 max-w-7xl">
    
    <div>
        <h2 class="text-lg font-bold text-white font-heading">Bangladesh Customs Tariff Simulator Rules</h2>
        <p class="text-xs text-slate-400">Configure NBR duty rates (CD, RD, SD, VAT, AIT, AT) and standard clearing charges powering the Landed Cost Calculator.</p>
    </div>

    <!-- Standard Import Charges (Freight, C&F, Port, Registration) -->
    <div class="bg-slate-900 border border-white/10 rounded-2xl p-6 shadow-xl space-y-4">
        <h3 class="text-sm font-bold text-white uppercase tracking-wider border-b border-white/10 pb-3 flex items-center gap-2">
            <i class="fa-solid fa-coins text-amber-400"></i> Standard Import Surcharges & Fees
        </h3>

        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
            <?php $__currentLoopData = $charges; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $charge): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <form method="POST" action="<?php echo e(route('admin.calculator.charge', $charge->id)); ?>" class="p-4 rounded-xl bg-slate-950 border border-white/5 space-y-2 text-xs">
                    <?php echo csrf_field(); ?>
                    <div class="flex justify-between items-baseline">
                        <span class="font-bold text-white"><?php echo e($charge->name); ?></span>
                        <span class="text-[10px] text-slate-500 uppercase font-mono"><?php echo e($charge->currency); ?></span>
                    </div>
                    <div class="flex items-center gap-2">
                        <input type="number" step="any" name="amount" value="<?php echo e($charge->amount); ?>" class="w-full bg-slate-900 border border-white/10 rounded-lg px-3 py-1.5 text-white font-mono text-xs focus:border-red-500 focus:outline-none">
                        <button type="submit" class="px-3 py-1.5 rounded-lg bg-red-600 hover:bg-red-700 text-white font-bold transition shrink-0">
                            Save
                        </button>
                    </div>
                    <span class="text-[10px] text-slate-500 block"><?php echo e($charge->description ?? 'Applied to calculator totals'); ?></span>
                </form>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>

    <!-- NBR Customs Tax Brackets -->
    <div class="bg-slate-900 border border-white/10 rounded-2xl overflow-hidden shadow-xl space-y-4 p-6">
        <h3 class="text-sm font-bold text-white uppercase tracking-wider border-b border-white/10 pb-3 flex items-center gap-2">
            <i class="fa-solid fa-scale-balanced text-red-500"></i> NBR Engine CC & Fuel Type Duty Brackets
        </h3>

        <div class="overflow-x-auto">
            <table class="w-full text-left text-xs">
                <thead class="bg-slate-950 text-slate-400 uppercase tracking-wider text-[10px] border-b border-white/10">
                    <tr>
                        <th class="p-3">Bracket Name</th>
                        <th class="p-3">Engine CC</th>
                        <th class="p-3">Fuel / Hybrid</th>
                        <th class="p-3">Customs (CD%)</th>
                        <th class="p-3">Regulatory (RD%)</th>
                        <th class="p-3">Supplementary (SD%)</th>
                        <th class="p-3">VAT %</th>
                        <th class="p-3">AIT %</th>
                        <th class="p-3">AT %</th>
                        <th class="p-3 text-right">Update</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-white/5 text-slate-300">
                    <?php $__currentLoopData = $taxRules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rule): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <form method="POST" action="<?php echo e(route('admin.calculator.tax-rule', $rule->id)); ?>">
                                <?php echo csrf_field(); ?>
                                <td class="p-3 font-bold text-white">
                                    <?php echo e($rule->name); ?>

                                </td>
                                <td class="p-3 font-mono text-[11px] text-slate-400">
                                    <?php echo e($rule->cc_min); ?> – <?php echo e($rule->cc_max); ?>cc
                                </td>
                                <td class="p-3">
                                    <span class="px-2 py-0.5 rounded text-[10px] font-bold uppercase <?php echo e($rule->is_hybrid ? 'bg-emerald-500/20 text-emerald-400' : 'bg-slate-800 text-slate-300'); ?>">
                                        <?php echo e($rule->fuel_type ?? ($rule->is_hybrid ? 'Hybrid' : 'Non-Hybrid')); ?>

                                    </span>
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="customs_duty_rate" value="<?php echo e($rule->customs_duty_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs">
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="regulatory_duty_rate" value="<?php echo e($rule->regulatory_duty_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs">
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="supplementary_duty_rate" value="<?php echo e($rule->supplementary_duty_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs font-bold text-amber-400">
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="vat_rate" value="<?php echo e($rule->vat_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs">
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="advance_income_tax_rate" value="<?php echo e($rule->advance_income_tax_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs">
                                </td>
                                <td class="p-3">
                                    <input type="number" step="0.1" name="advance_tax_rate" value="<?php echo e($rule->advance_tax_rate); ?>" class="w-16 bg-slate-950 border border-white/10 rounded px-2 py-1 text-white font-mono text-xs">
                                </td>
                                <td class="p-3 text-right">
                                    <button type="submit" class="px-3 py-1 rounded bg-blue-600 hover:bg-blue-500 text-white font-bold text-[11px] transition">
                                        Update
                                    </button>
                                </td>
                            </form>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>

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

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/redwoneferdous/Desktop/MotoSolution/resources/views/admin/calculator/index.blade.php ENDPATH**/ ?>