<section class="space-y-4">
    <?php if (isset($component)) { $__componentOriginal53747ceb358d30c0105769f8471417f6 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal53747ceb358d30c0105769f8471417f6 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.card','data' => ['class' => '!p-4']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => '!p-4']); ?>
        <div class="mb-3 flex items-center justify-between gap-2">
            <h2 class="text-base font-semibold text-slate-900">Monthly generation</h2>
            <span class="text-xs text-slate-500"><?php echo e($year); ?></span>
        </div>

        <div class="mb-3 rounded border border-slate-100 bg-slate-50 px-3 py-2 text-sm text-slate-700">
            Last monthly accrual:
            <strong>
                <?php echo e(! empty($monthlyGeneration['last_month']) ? $monthlyGeneration['last_month'] : 'not run yet'); ?>

            </strong>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! empty($monthlyGeneration['warning'])): ?>
            <div class="mb-3 rounded border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800">
                <?php echo e($monthlyGeneration['warning']); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! empty($monthlyGeneration['credited_months'])): ?>
            <div class="mb-4">
                <p class="mb-1.5 text-xs font-medium uppercase tracking-wide text-slate-500">Credited months</p>
                <div class="flex flex-wrap gap-1.5">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $monthlyGeneration['credited_months']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $monthKey): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span class="rounded bg-emerald-50 px-2 py-0.5 text-[11px] font-medium text-emerald-700"><?php echo e($monthKey); ?></span>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(empty($monthlyGeneration['types'])): ?>
            <p class="text-sm text-slate-500">No monthly-accrual leave types for your account.</p>
        <?php else: ?>
            <div class="space-y-3">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $monthlyGeneration['types']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div>
                        <div class="mb-1 flex items-center justify-between text-xs">
                            <span class="font-medium text-slate-800"><?php echo e($type['name']); ?></span>
                            <span class="text-slate-500">
                                <?php echo e(number_format($type['accrued'], 2)); ?> / <?php echo e(number_format($type['entitlement'], 2)); ?>

                            </span>
                        </div>
                        <div class="h-2 overflow-hidden rounded-full bg-slate-100">
                            <div class="h-full rounded-full bg-primary" style="width: <?php echo e($type['progress_pct']); ?>%"></div>
                        </div>
                        <p class="mt-1 text-[11px] text-slate-500">
                            Accrued so far <?php echo e(number_format($type['earned_to_date'], 2)); ?> day(s)
                        </p>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $attributes = $__attributesOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__attributesOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal53747ceb358d30c0105769f8471417f6)): ?>
<?php $component = $__componentOriginal53747ceb358d30c0105769f8471417f6; ?>
<?php unset($__componentOriginal53747ceb358d30c0105769f8471417f6); ?>
<?php endif; ?>

    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('leave_types_create')): ?>
        <details class="rounded border border-slate-200 bg-white shadow-sm open:shadow-sm">
            <summary class="cursor-pointer list-none px-4 py-3 text-sm font-semibold text-slate-900">
                Accrual settings
                <span class="ml-1 font-normal text-slate-500">(admins)</span>
            </summary>
            <div class="space-y-4 border-t border-slate-100 px-4 py-4">
                <form action="<?php echo e(route('leaves.policy.update')); ?>" method="POST" class="space-y-3">
                    <?php echo csrf_field(); ?>
                    <label class="flex items-start gap-2 text-sm text-slate-700">
                        <input type="checkbox" name="allow_advance_monthly" value="1" class="mt-0.5 rounded border-slate-300" <?php if(! empty($allowAdvanceMonthly)): echo 'checked'; endif; ?>>
                        <span>Allow advance monthly leave usage (employees can use future-month entitlement if total balance allows).</span>
                    </label>
                    <label class="flex items-start gap-2 text-sm text-slate-700">
                        <input type="checkbox" name="allow_monthly_opening_override" value="1" class="mt-0.5 rounded border-slate-300" <?php if(! empty($allowMonthlyOpeningOverride)): echo 'checked'; endif; ?>>
                        <span>Allow opening balance import to exceed annual entitlement for monthly accrual leave types.</span>
                    </label>
                    <button type="submit" class="inline-flex items-center rounded bg-slate-800 px-3 py-1.5 text-sm font-medium text-white hover:bg-slate-900">Save policy</button>
                </form>

                <div class="flex flex-wrap gap-2 border-t border-slate-100 pt-3">
                    <a href="<?php echo e(route('leaves.opening-balances.template')); ?>" class="inline-flex items-center rounded border border-slate-300 bg-white px-3 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">Download CSV template</a>
                    <a href="<?php echo e(route('leaves.opening-balances.import')); ?>" class="inline-flex items-center rounded bg-slate-800 px-3 py-2 text-sm font-medium text-white hover:bg-slate-900">Import opening balances</a>
                </div>
            </div>
        </details>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
</section>
<?php /**PATH /var/www/html/kiyohr/v2_version/resources/views/leaves/partials/monthly-generation.blade.php ENDPATH**/ ?>