

<?php $__env->startSection('title', $employee->name); ?>
<?php $__env->startSection('heading', $employee->name); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('employees.top-submenu', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php
        $employeeSteps = [
            'profile' => ['label' => 'Profile', 'title' => 'Profile', 'subtitle' => 'Basic information', 'formSubtitle' => 'Personal and contact details', 'icon' => 'bi-person', 'theme' => 'teal'],
            'work' => ['label' => 'Work Info', 'title' => 'Work Information', 'subtitle' => 'Employment details', 'formSubtitle' => 'Work-related information', 'icon' => 'bi-briefcase', 'theme' => 'sky'],
            'attendance' => ['label' => 'Attendance', 'title' => 'Attendance', 'subtitle' => 'Recent punch history', 'formSubtitle' => 'Recent attendance (last 30 records)', 'icon' => 'bi-clock-history', 'theme' => 'sky'],
            'leaves' => ['label' => 'Leaves', 'title' => 'Leaves', 'subtitle' => 'Leave request history', 'formSubtitle' => 'Leave history', 'icon' => 'bi-calendar2-week', 'theme' => 'teal'],
        ];

        if (! empty($canViewCompensation)) {
            $employeeSteps['payroll'] = ['label' => 'Payroll', 'title' => 'Payroll', 'subtitle' => 'Payslip history', 'formSubtitle' => 'Payroll history', 'icon' => 'bi-cash-stack', 'theme' => 'rose'];
            $employeeSteps['salary'] = ['label' => 'Salary Details', 'title' => 'Salary Details', 'subtitle' => 'Compensation and pay group', 'formSubtitle' => 'Salary breakup and revisions', 'icon' => 'bi-wallet2', 'theme' => 'rose'];
        }

        if (! empty($canViewFullEmployeeProfile)) {
            $employeeSteps['bank'] = ['label' => 'Bank Account', 'title' => 'Bank Account Details', 'subtitle' => 'Bank, PF, ESI, Tax', 'formSubtitle' => 'Bank account information for salary payments', 'icon' => 'bi-bank', 'theme' => 'violet'];
            $employeeSteps['documents'] = ['label' => 'Documents', 'title' => 'Documents', 'subtitle' => 'Files and assigned assets', 'formSubtitle' => 'Employee documents and compliance', 'icon' => 'bi-folder2-open', 'theme' => 'violet'];
            $employeeSteps['assets'] = ['label' => 'Assets', 'title' => 'Assets', 'subtitle' => 'Company assets', 'formSubtitle' => 'Assets assigned to this employee', 'icon' => 'bi-laptop', 'theme' => 'sky'];
        }

        $tabKeys = array_keys($employeeSteps);
        $requestTab = request('tab');
        $initialTab = in_array($requestTab, $tabKeys, true) ? $requestTab : ($tabKeys[0] ?? 'profile');
    ?>

    <div class="employee-create employee-profile" x-data="{
        tab: <?php echo \Illuminate\Support\Js::from($initialTab)->toHtml() ?>,
        tabs: <?php echo \Illuminate\Support\Js::from($tabKeys)->toHtml() ?>,
        canScrollUp: false,
        canScrollDown: false,
        next() {
            const index = this.tabs.indexOf(this.tab);
            if (index < this.tabs.length - 1) {
                this.tab = this.tabs[index + 1];
            }
        },
        prev() {
            const index = this.tabs.indexOf(this.tab);
            if (index > 0) {
                this.tab = this.tabs[index - 1];
            }
        },
        isFirst() {
            return this.tab === this.tabs[0];
        },
        isLast() {
            return this.tab === this.tabs[this.tabs.length - 1];
        },
        isDone(key) {
            return this.tabs.indexOf(key) < this.tabs.indexOf(this.tab);
        },
        isActive(key) {
            return this.tab === key;
        },
        timelineNav() {
            return this.$refs.timelineNav || null;
        },
        updateTimelineScrollState() {
            const nav = this.timelineNav();
            if (!nav) {
                this.canScrollUp = false;
                this.canScrollDown = false;
                return;
            }
            const maxScroll = Math.max(0, nav.scrollHeight - nav.clientHeight);
            this.canScrollUp = nav.scrollTop > 2;
            this.canScrollDown = nav.scrollTop < maxScroll - 2;
        },
        scrollTimeline(direction) {
            const nav = this.timelineNav();
            if (!nav) {
                return;
            }
            const amount = Math.max(120, Math.round(nav.clientHeight * 0.45));
            nav.scrollBy({ top: direction * amount, behavior: 'smooth' });
            window.setTimeout(() => this.updateTimelineScrollState(), 280);
        },
        scrollActiveStepIntoView(smooth = true) {
            const nav = this.timelineNav();
            const active = nav ? nav.querySelector('.employee-create__step.is-active') : null;
            if (!nav || !active) {
                return;
            }
            const relativeTop = active.getBoundingClientRect().top - nav.getBoundingClientRect().top + nav.scrollTop;
            const target = relativeTop - ((nav.clientHeight - active.offsetHeight) / 2);
            const maxScroll = Math.max(0, nav.scrollHeight - nav.clientHeight);
            const top = Math.min(Math.max(0, target), maxScroll);
            nav.scrollTo({ top, behavior: smooth ? 'smooth' : 'auto' });
            window.setTimeout(() => this.updateTimelineScrollState(), smooth ? 280 : 0);
        },
        queueScrollActiveStep(smooth = true) {
            this.$nextTick(() => {
                requestAnimationFrame(() => this.scrollActiveStepIntoView(smooth));
            });
        },
        init() {
            this.$watch('tab', () => this.queueScrollActiveStep(true));
            this.$nextTick(() => {
                const nav = this.timelineNav();
                if (nav) {
                    nav.addEventListener('scroll', () => this.updateTimelineScrollState(), { passive: true });
                }
                this.scrollActiveStepIntoView(false);
                this.updateTimelineScrollState();
            });
        }
    }">
        <a href="<?php echo e(route('employees.index')); ?>" class="employee-view__back">
            <span class="employee-view__back-icon" aria-hidden="true">
                <i class="bi bi-chevron-left"></i>
            </span>
            Back to Employees
        </a>

        <div class="employee-create__layout employee-view__layout">
            <aside class="employee-view__card">
                <div class="employee-view__card-head">
                    <?php if (isset($component)) { $__componentOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.user-avatar','data' => ['user' => $employee,'size' => 'xl','class' => 'employee-view__avatar']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('user-avatar'); ?>
<?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(['user' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($employee),'size' => 'xl','class' => 'employee-view__avatar']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e)): ?>
<?php $attributes = $__attributesOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e; ?>
<?php unset($__attributesOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e)): ?>
<?php $component = $__componentOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e; ?>
<?php unset($__componentOriginalaa6ddd3b8ee0acee5a2d1d7ac5c7e40e); ?>
<?php endif; ?>
                    <h2 class="employee-view__name"><?php echo e($employee->name); ?></h2>
                    <p class="employee-view__meta">
                        <?php echo e($employee->employee_number ?? '—'); ?>

                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($employee->designation?->name): ?>
                            - <?php echo e($employee->designation->name); ?>

                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </p>
                    <div class="employee-view__status">
                        <?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $employee->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($employee->status)]); ?><?php echo e(ucfirst($employee->status)); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
                    </div>
                </div>

                <ul class="employee-view__facts">
                    <li>
                        <i class="bi bi-envelope" aria-hidden="true"></i>
                        <span><?php echo e($employee->email); ?></span>
                    </li>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewFullEmployeeProfile)): ?>
                        <li>
                            <i class="bi bi-telephone" aria-hidden="true"></i>
                            <span><?php echo e($employee->phone ? '+91 '.$employee->phone : '—'); ?></span>
                        </li>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <li>
                        <i class="bi bi-building" aria-hidden="true"></i>
                        <span><?php echo e($employee->department?->name ?? '—'); ?></span>
                    </li>
                    <li>
                        <i class="bi bi-calendar3" aria-hidden="true"></i>
                        <span>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($employee->joining_date): ?>
                                Joined on <?php echo e($employee->joining_date->format('d M Y')); ?>

                            <?php else: ?>
                                —
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </span>
                    </li>
                    <li>
                        <i class="bi bi-geo-alt" aria-hidden="true"></i>
                        <span><?php echo e($employee->location?->name ?? ($employee->work_state ?? '—')); ?></span>
                    </li>
                </ul>

                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('users_edit')): ?>
                    <a href="<?php echo e(route('employees.edit', $employee)); ?>"
                       x-bind:href="'<?php echo e(route('employees.edit', $employee)); ?>' + (['profile','work','salary','bank'].includes(tab) ? '?tab=' + ({ profile: 'basic', work: 'work', salary: 'salary', bank: 'bank' }[tab] || 'basic') : '')"
                       class="employee-create__btn employee-create__btn--soft employee-view__edit">
                        <i class="bi bi-pencil-square"></i>
                        Edit Profile
                    </a>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </aside>

            <aside class="employee-create__sidebar employee-view__timeline">
                <button
                    type="button"
                    class="employee-view__timeline-arrow"
                    :class="{ 'is-disabled': !canScrollUp }"
                    :disabled="!canScrollUp"
                    @click="scrollTimeline(-1)"
                    aria-label="Scroll timeline up"
                >
                    <i class="bi bi-chevron-up"></i>
                </button>
                <nav aria-label="Employee sections" x-ref="timelineNav">
                    <ol class="employee-create__steps employee-view__steps">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $employeeSteps; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $step): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li
                                class="employee-create__step employee-create__step--<?php echo e($step['theme']); ?>"
                                data-step-key="<?php echo e($key); ?>"
                                :class="{
                                    'is-active': isActive('<?php echo e($key); ?>'),
                                    'is-done': isDone('<?php echo e($key); ?>')
                                }"
                            >
                                <span class="employee-create__step-index" aria-hidden="true">
                                    <span x-show="!isDone('<?php echo e($key); ?>')"><?php echo e($loop->iteration); ?></span>
                                    <i class="bi bi-check-lg" x-show="isDone('<?php echo e($key); ?>')" x-cloak></i>
                                </span>
                                <button type="button" class="employee-create__step-card" @click="tab = '<?php echo e($key); ?>'">
                                    <span class="employee-create__step-icon">
                                        <i class="bi <?php echo e($step['icon']); ?>"></i>
                                    </span>
                                    <span class="employee-create__step-copy">
                                        <span class="employee-create__step-title"><?php echo e($step['label']); ?></span>
                                        <span class="employee-create__step-subtitle"><?php echo e($step['subtitle']); ?></span>
                                    </span>
                                </button>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </ol>
                </nav>
                <button
                    type="button"
                    class="employee-view__timeline-arrow"
                    :class="{ 'is-disabled': !canScrollDown }"
                    :disabled="!canScrollDown"
                    @click="scrollTimeline(1)"
                    aria-label="Scroll timeline down"
                >
                    <i class="bi bi-chevron-down"></i>
                </button>
            </aside>

            <div class="employee-create__panel">
                <div class="employee-view__panel-top">
                    <div class="employee-view__panel-titles">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $employeeSteps; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $step): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="employee-create__panel-head employee-create__panel-head--<?php echo e($step['theme']); ?>" x-show="tab === '<?php echo e($key); ?>'" <?php if (! ($key === $initialTab)): ?> x-cloak <?php endif; ?>>
                                <span class="employee-create__panel-icon">
                                    <i class="bi <?php echo e($step['icon']); ?>"></i>
                                </span>
                                <div>
                                    <h3><?php echo e($step['title']); ?></h3>
                                    <p><?php echo e($step['formSubtitle']); ?></p>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </div>
                    <div class="employee-create__actions employee-view__actions">
                        <button type="button" x-show="!isFirst()" @click="prev()" class="employee-create__btn employee-create__btn--soft">
                            <i class="bi bi-arrow-left"></i>
                            Back
                        </button>
                        <button type="button" x-show="!isLast()" @click="next()" class="employee-create__btn employee-create__btn--primary">
                            Next
                            <i class="bi bi-arrow-right"></i>
                        </button>
                    </div>
                </div>

                <div x-show="tab === 'profile'" <?php if (! ($initialTab === 'profile')): ?> x-cloak <?php endif; ?> class="employee-view__details">
                    <div>
                        <label class="employee-view__detail-label">Name</label>
                        <div class="employee-view__detail-value"><?php echo e($employee->name); ?></div>
                    </div>
                    <div>
                        <label class="employee-view__detail-label">Employee ID</label>
                        <div class="employee-view__detail-value"><?php echo e($employee->employee_number ?? '—'); ?></div>
                    </div>
                    <div>
                        <label class="employee-view__detail-label">Email</label>
                        <div class="employee-view__detail-value"><?php echo e($employee->email); ?></div>
                    </div>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewFullEmployeeProfile)): ?>
                        <div>
                            <label class="employee-view__detail-label">Phone</label>
                            <div class="employee-view__detail-value"><?php echo e($employee->phone ?? '—'); ?></div>
                        </div>
                        <div>
                            <label class="employee-view__detail-label">Gender</label>
                            <div class="employee-view__detail-value"><?php echo e($employee->gender ? ucfirst($employee->gender) : '—'); ?></div>
                        </div>
                        <div>
                            <label class="employee-view__detail-label">Date of Birth</label>
                            <div class="employee-view__detail-value"><?php echo e($employee->dob?->format('M d, Y') ?? '—'); ?></div>
                        </div>
                        <div>
                            <label class="employee-view__detail-label">Father Name</label>
                            <div class="employee-view__detail-value"><?php echo e($employee->father_name ?? '—'); ?></div>
                        </div>
                        <div>
                            <label class="employee-view__detail-label">PAN Number</label>
                            <div class="employee-view__detail-value"><?php echo e($employee->pan_number ?? '—'); ?></div>
                        </div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <div>
                        <label class="employee-view__detail-label">Status</label>
                        <div class="employee-view__detail-value">
                            <?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $employee->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($employee->status)]); ?><?php echo e($employee->status); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
                        </div>
                    </div>
                </div>

                <div x-show="tab === 'work'" <?php if (! ($initialTab === 'work')): ?> x-cloak <?php endif; ?> class="employee-create__sections">
                    <section>
                        <h4 class="employee-create__section-title">
                            <i class="bi bi-calendar3"></i>
                            Employment Dates
                        </h4>
                        <div class="employee-view__details">
                            <div>
                                <label class="employee-view__detail-label">Joining Date</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->joining_date?->format('M d, Y') ?? '—'); ?></div>
                            </div>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewFullEmployeeProfile)): ?>
                                <div>
                                    <label class="employee-view__detail-label">Registration Date</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->registration_date?->format('M d, Y') ?? $employee->created_at?->format('M d, Y') ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">Confirmation Date</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->confirmation_date?->format('M d, Y') ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">Probation End Date</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->probation_end_date?->format('M d, Y') ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">PF Join / Registration Date</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->pf_join_date?->format('M d, Y') ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">Last Working Day</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->last_working_date?->format('M d, Y') ?? '—'); ?></div>
                                </div>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>
                    </section>
                    <section>
                        <h4 class="employee-create__section-title">
                            <i class="bi bi-briefcase"></i>
                            Work Details
                        </h4>
                        <div class="employee-view__details">
                            <div>
                                <label class="employee-view__detail-label">Department</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->department?->name ?? '—'); ?></div>
                            </div>
                            <div>
                                <label class="employee-view__detail-label">Designation</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->designation?->name ?? '—'); ?></div>
                            </div>
                            <div>
                                <label class="employee-view__detail-label">Location</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->location?->name ?? '—'); ?></div>
                            </div>
                            <div>
                                <label class="employee-view__detail-label">Shift</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->shift?->name ?? '—'); ?></div>
                            </div>
                            <div>
                                <label class="employee-view__detail-label">Reporting Manager</label>
                                <div class="employee-view__detail-value"><?php echo e($employee->reportingManager?->name ?? '—'); ?></div>
                            </div>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewFullEmployeeProfile)): ?>
                                <div>
                                    <label class="employee-view__detail-label">Work State</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->work_state ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">Attendance mode</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->attendance_mode ? str_replace('_', ' ', $employee->attendance_mode) : 'Tenant default'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">PT Location</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->pt_location ?? '—'); ?></div>
                                </div>
                                <div>
                                    <label class="employee-view__detail-label">UAN Number</label>
                                    <div class="employee-view__detail-value"><?php echo e($employee->uan_number ?? '—'); ?></div>
                                </div>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>
                    </section>
                </div>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewCompensation)): ?>
        <div x-show="tab === 'salary'" <?php if (! ($initialTab === 'salary')): ?> x-cloak <?php endif; ?>>
            <div
                x-data="{
                    openRevise: false,
                    effectiveDate: '<?php echo e(now()->format('Y-m-d')); ?>',
                    currentCtcAnnual: <?php echo e(\Illuminate\Support\Js::from((float) ($salaryBreakup['ctc_annual'] ?? ($salaryStructure['annual_total'] ?? 0)))); ?>,
                    initialSalaryGroupId: <?php echo e(\Illuminate\Support\Js::from($employee->salary_group_id ? (int) $employee->salary_group_id : null)); ?>,
                    selectedSalaryGroup: <?php echo e(\Illuminate\Support\Js::from($employee->salary_group_id ? (int) $employee->salary_group_id : null)); ?>,
                    ctcAnnualInput: 0,
                    ctcPercentInput: 0,
                    ctcPercentDraft: '0.00',
                    isSyncing: false,
                    init() {
                        this.resetRevisionValues();
                    },
                    parseNumber(value) {
                        const parsed = parseFloat(value);
                        return Number.isFinite(parsed) ? parsed : 0;
                    },
                    round2(value) {
                        return Math.round(this.parseNumber(value) * 100) / 100;
                    },
                    formatInr(value) {
                        return new Intl.NumberFormat('en-IN', { maximumFractionDigits: 2 }).format(this.parseNumber(value));
                    },
                    revisionPct(current, revised) {
                        const c = this.parseNumber(current);
                        const r = this.parseNumber(revised);
                        if (c <= 0) return r > 0 ? 100 : 0;
                        return ((r - c) / c) * 100;
                    },
                    get canSaveRevision() {
                        const input = this.parseNumber(this.ctcAnnualInput);
                        const current = this.parseNumber(this.currentCtcAnnual);

                        if (input <= 0) return false;

                        const ctcChanged = Math.abs(input - current) > 0.0049;
                        const groupChanged = String(this.selectedSalaryGroup ?? '') !== String(this.initialSalaryGroupId ?? '');

                        return ctcChanged || groupChanged;
                    },
                    syncSalaryGroupSelect() {
                        const el = this.$root.querySelector('select[name=salary_group]');
                        if (!el || !window.jQuery || typeof window.initSelect2 !== 'function') return;
                        const value = this.selectedSalaryGroup == null || this.selectedSalaryGroup === '' ? '' : String(this.selectedSalaryGroup);
                        const $select = window.jQuery(el);
                        if ($select.data('select2')) {
                            $select.val(value).trigger('change.select2');
                            return;
                        }
                        el.value = value;
                        const dialog = el.closest('.revise-salary-dialog');
                        window.initSelect2(dialog || el.parentElement || el);
                    },
                    syncFromCtcInput() {
                        if (this.isSyncing) return;
                        this.isSyncing = true;
                        const revisedAnnual = Math.max(0, this.round2(this.ctcAnnualInput));
                        this.ctcAnnualInput = revisedAnnual;
                        this.ctcPercentInput = this.revisionPct(this.currentCtcAnnual, revisedAnnual);
                        this.ctcPercentDraft = this.ctcPercentInput.toFixed(2);
                        this.isSyncing = false;
                    },
                    syncFromPctInput() {
                        if (this.isSyncing) return;
                        this.isSyncing = true;
                        const pct = this.parseNumber(this.ctcPercentDraft);
                        this.ctcPercentInput = pct;
                        this.ctcPercentDraft = pct.toFixed(2);
                        const revisedAnnual = Math.max(0, this.round2(this.currentCtcAnnual * (1 + (pct / 100))));
                        this.ctcAnnualInput = revisedAnnual;
                        this.isSyncing = false;
                    },
                    resetRevisionValues() {
                        this.ctcAnnualInput = this.round2(this.currentCtcAnnual);
                        this.ctcPercentInput = 0;
                        this.ctcPercentDraft = '0.00';
                        this.selectedSalaryGroup = this.initialSalaryGroupId;
                    },
                    openReviseModal() {
                        this.effectiveDate = '<?php echo e(now()->format('Y-m-d')); ?>';
                        this.resetRevisionValues();
                        this.openRevise = true;
                        this.$nextTick(() => this.syncSalaryGroupSelect());
                    }
                }"
                class="rounded-lg p-4"
            >
                <h3 class="text-2xl font-semibold text-slate-900">Salary Breakup</h3>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($employee->latestEffectiveSalaryRevision() && $employee->latestEffectiveSalaryRevision()?->ctc_annual > 0): ?>
                    <div class="flex flex-wrap items-center justify-between gap-2">
                        <p class="text-base text-slate-800">Current Salary</p>
                        <p class="text-sm text-slate-700">Effective Date: <span class="font-semibold"><?php echo e($salaryStructure['effective_date'] ?? '—'); ?></span></p>
                    </div>                
                    <div class="mt-3 overflow-hidden rounded border border-slate-400 bg-white">
                        <table class="min-w-full divide-y divide-slate-200">
                            <thead class="bg-primary text-white">
                                <tr>
                                    <th class="px-3 py-2 text-left text-xs font-medium font-semibold uppercase tracking-wide">Earnings</th>
                                    <th class="px-3 py-2 text-right text-xs font-medium font-semibold uppercase tracking-wide">Monthly</th>
                                    <th class="px-3 py-2 text-right text-xs font-medium font-semibold uppercase tracking-wide">Annually</th>
                                </tr>
                            </thead>
                            <tbody class="divide-y divide-slate-200">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($componentDetails)): ?>
                                    <tr class="text-slate-700">
                                        <td class="px-3 py-2 text-sm">
                                            <span class="font-medium text-slate-700">Salary Group Components</span>
                                            <p class="text-xs text-slate-500"><?php echo e(implode(', ', $componentDetails)); ?></p>
                                        </td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['salary_group_monthly'], 2)); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['salary_group_annual'], 2)); ?></td>
                                    </tr>
                                <?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 $__empty_1 = true; $__currentLoopData = $salaryBreakup['earning_rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td class="px-3 py-2 text-sm text-slate-700"><?php echo e($row['name']); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums text-slate-900">₹<?php echo e(number_format($row['monthly'], 2)); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums text-slate-900">₹<?php echo e(number_format($row['annual'], 2)); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="3" class="px-3 py-4 text-center text-sm text-slate-500">No earning components in salary structure.</td>
                                    </tr>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                <tr class="font-medium text-slate-800 <?php echo e(!count($salaryBreakup['employer_rows']) > 0 ? 'bg-slate-300' : 'bg-slate-50/80'); ?>">
                                    <td class="px-3 py-2 text-sm"><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!count($salaryBreakup['employer_rows']) > 0): ?> Total Earnings (CTC) <?php else: ?> Sub Total <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?></td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['subtotal_monthly'], 2)); ?></td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['subtotal_annual'], 2)); ?></td>
                                </tr>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $salaryBreakup['employer_rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr class="text-slate-700">
                                        <td class="px-3 py-2 text-sm">
                                            <span><?php echo e($row['name']); ?></span>
                                        </td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($row['monthly'], 2)); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($row['annual'], 2)); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?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(count($salaryBreakup['employer_rows']) > 0): ?>
                                <tr class="font-medium text-slate-800 bg-primary-light">
                                    <td class="px-3 py-2 text-sm">Total Earnings (CTC)</td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['total_earnings_monthly'], 2)); ?></td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['total_earnings_annual'], 2)); ?></td>
                                </tr>
                                <?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(count($salaryBreakup['deduction_rows']) > 0): ?>
                                <tr class="bg-slate-50/80">
                                    <td class="px-3 py-2 text-xs font-semibold uppercase tracking-wide  text-slate-800">Deductions</td>
                                    <th class="px-3 py-2 text-right text-xs font-medium font-semibold uppercase tracking-wide text-slate-500">Monthly</th>
                                    <th class="px-3 py-2 text-right text-xs font-medium font-semibold uppercase tracking-wide text-slate-500">Annually</th>
                                </tr>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $salaryBreakup['deduction_rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td class="px-3 py-2 text-sm text-slate-700"><?php echo e($row['name']); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums text-slate-900">₹<?php echo e(number_format($row['monthly'], 2)); ?></td>
                                        <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums text-slate-900">₹<?php echo e(number_format($row['annual'], 2)); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="3" class="px-3 py-2 text-sm text-slate-500">No deductions.</td>
                                    </tr>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                <tr class="font-medium text-slate-800">
                                    <td class="px-3 py-2 text-sm">Total Deductions</td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['total_deductions_monthly'], 2)); ?></td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm tabular-nums">₹<?php echo e(number_format($salaryBreakup['total_deductions_annual'], 2)); ?></td>
                                </tr>
                              <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                <tr class="bg-primary-light">
                                    <td class="px-3 py-2 text-sm font-bold uppercase tracking-wide text-slate-800">Net Pay</td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm font-bold uppercase tracking-wide text-slate-800">₹<?php echo e(number_format($salaryBreakup['net_monthly'], 2)); ?></td>
                                    <td class="whitespace-nowrap px-3 py-2 text-right text-sm font-bold uppercase tracking-wide text-slate-800">₹<?php echo e(number_format($salaryBreakup['net_annual'], 2)); ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="mt-4 flex items-start gap-2 text-xs text-slate-500 bg-green-100 rounded p-3">
                        <svg class="mt-0.5 h-4 w-4 shrink-0 text-amber-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
                            <path stroke-linecap="round" stroke-linejoin="round" d="M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18" />
                        </svg>
                        <p><span class="font-medium text-slate-600">Note:</span> Figures are indicative for a full month (no attendance adjustments). Salary group components are shown first, followed by statutory PF/ESI/PT as per company settings. Net pay does not include income tax or other statutory/ad-hoc deductions that may apply at payroll.</p>
                    </div>
                <?php else: ?>
                    <div class="mt-3 overflow-hidden rounded border border-slate-300 bg-white">
                        <table class="min-w-full">
                            <tbody>
                                <tr class="border-t border-slate-200">
                                    <td colspan="3" class="px-3 py-4 text-center text-sm text-slate-500">No salary structure available.</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                <p class="mt-4 text-sm text-slate-600"><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($employee->salaryGroup?->name): ?> Salary Group: <span class="font-medium text-slate-800"><?php echo e($employee->salaryGroup?->name ?? '—'); ?></span> <?php else: ?> No Salary Group available. <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?></p>
                <p class="mt-1 text-xs text-slate-500">Effective date reflects the latest salary history entry applied to this employee.</p>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('users_edit')): ?>
                    <div class="flex justify-end">
                        <button type="button" @click="openReviseModal()" class="rounded bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700">Revise Salary</button>
                    </div>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                <div x-show="openRevise" x-cloak class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4">
                    <div class="revise-salary-dialog relative z-10 w-full max-w-4xl rounded bg-white shadow-xl">
                        <div class="flex items-center justify-between bg-slate-800 px-4 py-3 text-white">
                            <h4 class="text-xl font-semibold">Revise Salary</h4>
                            <button type="button" @click="openRevise = false" class="text-2xl leading-none">&times;</button>
                        </div>
                        <form action="<?php echo e(route('employees.salary-revisions.store', $employee)); ?>" method="POST" class="p-5">
                            <?php echo csrf_field(); ?>
                            <div class="mb-4 flex justify-end items-center gap-4">
                                <label class="text-lg text-slate-700">Effective Date:</label>
                                <input type="date" name="effective_date" x-model="effectiveDate" class="rounded border border-slate-300 px-2 py-1" style="width: 220px">
                                <label class="text-lg text-slate-700">Salary Group:</label>
                                <div style="width: 220px">
                                    <select x-model="selectedSalaryGroup" class="js-select2 rounded border border-slate-300 bg-white px-2 py-1" name="salary_group" required data-dropdown-parent=".revise-salary-dialog" style="width: 220px">
                                        <option value="">Select Salary Group</option>
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $salaryGroups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($group->id); ?>" <?php if((string) $employee->salary_group_id === (string) $group->id): echo 'selected'; endif; ?>>
                                                <?php echo e($group->name); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    </select>
                                </div>
                            </div>
                            <table class="w-full border border-slate-300 text-base">
                                <thead class="bg-slate-100">
                                    <tr>
                                        <th class="border border-slate-300 px-3 py-2 text-left">#</th>
                                        <th class="border border-slate-300 px-3 py-2 text-right">Current Annual</th>
                                        <th class="border border-slate-300 px-3 py-2 text-right">Revised Annual</th>
                                        <th class="border border-slate-300 px-3 py-2 text-right">Revision</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="font-semibold">
                                        <td class="border border-slate-300 px-3 py-2">CTC</td>
                                        <td class="border border-slate-300 px-3 py-2 text-right" x-text="formatInr(currentCtcAnnual)"></td>
                                        <td class="border border-slate-300 px-3 py-2 text-right">
                                            <input type="number" step="1" min="0" x-model.number="ctcAnnualInput" @input="syncFromCtcInput()" @wheel.prevent class="w-32 rounded border border-slate-300 px-2 py-1 text-right">
                                        </td>
                                        <td class="border border-slate-300 px-3 py-2 text-right">
                                            <div class="inline-flex items-center gap-1">
                                                <input type="number" step="0.01" x-model="ctcPercentDraft" @change="syncFromPctInput()" @keyup.enter="syncFromPctInput()" @wheel.prevent class="w-24 rounded border border-slate-300 px-2 py-1 text-right">
                                                <span>%</span>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <input type="hidden" name="ctc_annual" :value="parseNumber(ctcAnnualInput).toFixed(2)">
                            <div class="mt-5 flex justify-end gap-3">
                                <button type="button" @click="openRevise = false" class="rounded border border-slate-300 px-5 py-2 font-semibold text-slate-700">Cancel</button>
                                <button type="submit" :disabled="!canSaveRevision" class="rounded bg-blue-600 px-5 py-2 font-semibold text-white hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-slate-300 disabled:text-slate-600">Save</button>
                            </div>
                        </form>
                    </div>
                </div>
            </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($canViewFullEmployeeProfile)): ?>
        <div x-show="tab === 'bank'" <?php if (! ($initialTab === 'bank')): ?> x-cloak <?php endif; ?> class="employee-view__details">
            <div>
                <label class="employee-view__detail-label">Account Holder Name</label>
                <div class="employee-view__detail-value"><?php echo e($employee->account_holder_name ?? '—'); ?></div>
            </div>
            <div>
                <label class="employee-view__detail-label">Bank Name</label>
                <div class="employee-view__detail-value"><?php echo e($employee->bank_name ?? '—'); ?></div>
            </div>
            <div>
                <label class="employee-view__detail-label">Account Number</label>
                <div class="employee-view__detail-value"><?php echo e($employee->account_number ?? '—'); ?></div>
            </div>
            <div>
                <label class="employee-view__detail-label">Branch Name</label>
                <div class="employee-view__detail-value"><?php echo e($employee->branch_name ?? '—'); ?></div>
            </div>
            <div>
                <label class="employee-view__detail-label">City</label>
                <div class="employee-view__detail-value"><?php echo e($employee->city ?? '—'); ?></div>
            </div>
            <div>
                <label class="employee-view__detail-label">IFSC Code</label>
                <div class="employee-view__detail-value"><?php echo e($employee->ifsc_code ?? '—'); ?></div>
            </div>
        </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <div x-show="tab === 'attendance'" <?php if (! ($initialTab === 'attendance')): ?> x-cloak <?php endif; ?>>
            <p class="mb-4 text-sm text-slate-600">Recent attendance (last 30 records).</p>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($attendances->isEmpty()): ?>
                <p class="text-sm text-slate-500">No attendance records.</p>
            <?php else: ?>
                <div class="employee-view__scroll">
                    <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?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([]); ?>
                         <?php $__env->slot('head', null, []); ?> 
                            <tr>
                                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Date</th>
                                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Clock In</th>
                                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Clock Out</th>
                                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Duration</th>
                                <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Status</th>
                            </tr>
                         <?php $__env->endSlot(); ?>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $attendances; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-900"><?php echo e($a->date?->format('M d, Y') ?? '—'); ?></td>
                                <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($a->clock_in_date_time ? $a->clock_in_date_time->format('h:i A') : '—'); ?></td>
                                <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($a->clock_out_date_time ? $a->clock_out_date_time->format('h:i A') : '—'); ?></td>
                                <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($a->total_duration ? round($a->total_duration / 3600, 1) . ' h' : '—'); ?></td>
                                <td class="whitespace-nowrap px-4 py-3 text-sm"><?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $a->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($a->status)]); ?><?php echo e($a->status ?? '—'); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <div class="mt-4">
                <a href="<?php echo e(route('attendance.index')); ?>?search=<?php echo e(urlencode($employee->name)); ?>" class="inline-flex items-center gap-1 text-sm text-primary hover:underline">
                    View all attendance <i class="bi bi-chevron-right text-[10px]"></i>
                </a>
            </div>
        </div>

        <div x-show="tab === 'leaves'" <?php if (! ($initialTab === 'leaves')): ?> x-cloak <?php endif; ?>>
            <p class="mb-4 text-sm text-slate-600">Leave history.</p>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($leaves->isEmpty()): ?>
                <p class="text-sm text-slate-500">No leave requests.</p>
            <?php else: ?>
                <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?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([]); ?>
                     <?php $__env->slot('head', null, []); ?> 
                        <tr>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Leave Type</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Start</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">End</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Days</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Status</th>
                        </tr>
                     <?php $__env->endSlot(); ?>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $leaves; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $leave): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-900"><?php echo e($leave->leaveType?->name ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($leave->start_date?->format('M d, Y') ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($leave->end_date?->format('M d, Y') ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($leave->total_days ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm"><?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $leave->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($leave->status)]); ?><?php echo e($leave->status); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <div class="mt-4">
                <a href="<?php echo e(route('leaves.index')); ?>" class="inline-flex items-center gap-1 text-sm text-primary hover:underline">
                    View all leaves <i class="bi bi-chevron-right text-[10px]"></i>
                </a>
            </div>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewCompensation)): ?>
        <div x-show="tab === 'payroll'" <?php if (! ($initialTab === 'payroll')): ?> x-cloak <?php endif; ?>>
            <p class="mb-4 text-sm text-slate-600">Payroll history.</p>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($payrolls->isEmpty()): ?>
                <p class="text-sm text-slate-500">No payroll records.</p>
            <?php else: ?>
                <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?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([]); ?>
                     <?php $__env->slot('head', null, []); ?> 
                        <tr>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Period</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Basic Salary</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Net Salary</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Status</th>
                        </tr>
                     <?php $__env->endSlot(); ?>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $payrolls; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $cycle = $p->payrollCycle;
                            $period = $cycle ? sprintf('%04d-%02d', $cycle->year, $cycle->month) : '—';
                        ?>
                        <tr>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-900"><?php echo e($period); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e(number_format($p->gross_monthly ?? 0, 2)); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e(number_format($p->net_monthly ?? 0, 2)); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm"><?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $cycle?->status ?? ($p->status ?? null)]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($cycle?->status ?? ($p->status ?? null))]); ?><?php echo e($cycle?->status ?? ($p->status ?? '—')); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <div class="mt-4"><a href="<?php echo e(route('payroll.index')); ?>" class="text-sm text-primary hover:underline">View payroll →</a></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($canViewFullEmployeeProfile)): ?>
        <div x-show="tab === 'documents'" <?php if (! ($initialTab === 'documents')): ?> x-cloak <?php endif; ?>>
            <div class="mb-4 rounded-lg border border-slate-200 bg-slate-50 p-4">
                <div class="flex flex-wrap items-center justify-between gap-2">
                    <p class="text-sm font-medium text-slate-700">
                        Mandatory documents (India): <?php echo e($documentCompliance['completed_count']); ?>/<?php echo e($documentCompliance['total_required']); ?>

                    </p>
                    <?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['variant' => $documentCompliance['is_compliant'] ? 'success' : 'warning']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['variant' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($documentCompliance['is_compliant'] ? 'success' : 'warning')]); ?>
                        <?php echo e($documentCompliance['is_compliant'] ? 'Compliant' : 'Missing documents'); ?>

                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
                </div>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! $documentCompliance['is_compliant']): ?>
                    <p class="mt-2 text-sm text-amber-700">
                        Missing: <?php echo e(implode(', ', $documentCompliance['missing_labels'])); ?>

                    </p>
                    <p class="mt-1 text-xs text-slate-500">Warning only: employee status and payroll are not blocked.</p>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('documents_create')): ?>
            <form action="<?php echo e(route('employees.documents.store', $employee)); ?>" method="POST" enctype="multipart/form-data" class="mb-6 flex flex-wrap items-end gap-3 rounded-lg border border-slate-200 bg-slate-50 p-4">
                <?php echo csrf_field(); ?>
                <div>
                    <label class="block text-xs font-medium text-slate-500">Document category</label>
                    <select name="type" required class="mt-1 rounded-lg border border-slate-300 px-3 py-1.5 text-sm js-select2"  >
                        <option value="">Select category</option>
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $uploadCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoryKey => $categoryLabel): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($categoryKey); ?>" <?php echo e(old('type') === $categoryKey ? 'selected' : ''); ?>><?php echo e($categoryLabel); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </select>
                </div>
                <div>
                    <label class="block text-xs font-medium text-slate-500">File</label>
                    <input type="file" name="document" required class="mt-1 block w-full text-sm text-slate-500 file:mr-4 file:rounded-lg file:border-0 file:bg-slate-100 file:px-4 file:py-2 file:text-sm file:font-medium file:text-slate-700 hover:file:bg-slate-200">
                </div>
                <?php if (isset($component)) { $__componentOriginald0f1fd2689e4bb7060122a5b91fe8561 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginald0f1fd2689e4bb7060122a5b91fe8561 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.button','data' => ['type' => 'submit','variant' => 'primary','size' => 'sm']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('button'); ?>
<?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(['type' => 'submit','variant' => 'primary','size' => 'sm']); ?>Upload <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginald0f1fd2689e4bb7060122a5b91fe8561)): ?>
<?php $attributes = $__attributesOriginald0f1fd2689e4bb7060122a5b91fe8561; ?>
<?php unset($__attributesOriginald0f1fd2689e4bb7060122a5b91fe8561); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald0f1fd2689e4bb7060122a5b91fe8561)): ?>
<?php $component = $__componentOriginald0f1fd2689e4bb7060122a5b91fe8561; ?>
<?php unset($__componentOriginald0f1fd2689e4bb7060122a5b91fe8561); ?>
<?php endif; ?>
            </form>
            <?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($documents->isEmpty()): ?>
                <p class="text-sm text-slate-500">No documents uploaded for this employee.</p>
            <?php else: ?>
                <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?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([]); ?>
                     <?php $__env->slot('head', null, []); ?> 
                        <tr>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Name</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Type</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Uploaded</th>
                            <th class="px-4 py-3 text-right text-xs font-medium uppercase text-slate-500">Actions</th>
                        </tr>
                     <?php $__env->endSlot(); ?>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $documents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td class="whitespace-nowrap px-4 py-3 text-sm font-medium text-slate-900"><?php echo e($doc->name); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($uploadCategories[$doc->type] ?? $doc->type ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($doc->created_at?->format('M d, Y') ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-right text-sm">
                                <a href="<?php echo e(route('documents.download', $doc)); ?>" target="_blank" class="btn-icon-action btn-icon-action--view" title="View" aria-label="View"><i class="bi bi-eye"></i></a>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(auth()->user()->hasPermission('documents_create')): ?> <form action="<?php echo e(route('documents.destroy', $doc)); ?>?redirect=<?php echo e(urlencode(route('employees.show', $employee))); ?>" method="POST" class="inline" onsubmit="return confirm('Delete this document?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="btn-icon-action btn-icon-action--delete" title="Delete" aria-label="Delete"><i class="bi bi-trash3"></i></button>
                                </form>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
            <?php endif; ?><?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 if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($canViewFullEmployeeProfile)): ?>
        <div x-show="tab === 'assets'" <?php if (! ($initialTab === 'assets')): ?> x-cloak <?php endif; ?>>
            <p class="mb-4 text-sm text-slate-600">Assets assigned to this employee.</p>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($assets->isEmpty()): ?>
                <p class="text-sm text-slate-500">No assets assigned.</p>
            <?php else: ?>
                <?php if (isset($component)) { $__componentOriginal163c8ba6efb795223894d5ffef5034f5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal163c8ba6efb795223894d5ffef5034f5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('table'); ?>
<?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([]); ?>
                     <?php $__env->slot('head', null, []); ?> 
                        <tr>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Name</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Type</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Serial</th>
                            <th class="px-4 py-3 text-left text-xs font-medium uppercase text-slate-500">Status</th>
                        </tr>
                     <?php $__env->endSlot(); ?>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $assets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $asset): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td class="whitespace-nowrap px-4 py-3 text-sm font-medium text-slate-900"><?php echo e($asset->name); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($asset->assetType?->name ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm text-slate-600"><?php echo e($asset->serial_number ?? '—'); ?></td>
                            <td class="whitespace-nowrap px-4 py-3 text-sm"><?php if (isset($component)) { $__componentOriginal2ddbc40e602c342e508ac696e52f8719 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2ddbc40e602c342e508ac696e52f8719 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.badge','data' => ['status' => $asset->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('badge'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($asset->status)]); ?><?php echo e($asset->status ?? '—'); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $attributes = $__attributesOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__attributesOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2ddbc40e602c342e508ac696e52f8719)): ?>
<?php $component = $__componentOriginal2ddbc40e602c342e508ac696e52f8719; ?>
<?php unset($__componentOriginal2ddbc40e602c342e508ac696e52f8719); ?>
<?php endif; ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $attributes = $__attributesOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__attributesOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal163c8ba6efb795223894d5ffef5034f5)): ?>
<?php $component = $__componentOriginal163c8ba6efb795223894d5ffef5034f5; ?>
<?php unset($__componentOriginal163c8ba6efb795223894d5ffef5034f5); ?>
<?php endif; ?>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <div class="mt-4"><a href="<?php echo e(route('assets.index')); ?>" class="text-sm text-primary hover:underline">Manage assets →</a></div>
        </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </div>
    </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/kiyohr/v2_version/resources/views/employees/show.blade.php ENDPATH**/ ?>