<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <!-- Hero Section -->
    <div class="hero-banner">
        <div class="row align-items-center">
            <div class="col-md-9">
                <div class="welcome-text">
                    <h1>Welcome, <?php echo e(Auth::user()->name); ?></h1>
                </div>
            </div>
            <div class="col-md-3 text-md-end d-none d-md-block">
                <div class="date-badge">
                    <span class="fs-5 fw-bold text-white"><i class="far fa-calendar-alt me-2"></i><?php echo e(date('D, d M')); ?></span>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <!-- Main Stats Column -->
        <div class="col-lg-9">
            <div class="row g-4 mb-5">
                <?php if($isAdmin): ?>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Workforce</span>
                            <div class="stat-value text-primary"><?php echo e($stats['total_employees']); ?></div>
                            <div class="small text-muted fw-500">Total Registered</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Today's Presence</span>
                            <div class="stat-value text-success">
                                <span class="pulse"></span><?php echo e($stats['active_today']); ?>

                            </div>
                            <div class="small text-muted fw-500">Employees Clocked-in</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Total Payout</span>
                            <div class="stat-value text-slate-800">
                                <?php echo e($businessSettings->currency_symbol ?? '₹'); ?><?php echo e(number_format($stats['salary_distributed'] / 1000, 1)); ?>k
                            </div>
                            <div class="small text-muted fw-500">Recent Payroll Cycle</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Leave Status</span>
                            <div class="stat-value text-warning"><?php echo e($stats['pending_leaves']); ?></div>
                            <div class="small text-muted fw-500">Pending Approvals</div>
                        </div>
                    </div>
                <?php else: ?>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Attendance</span>
                            <div class="stat-value text-success"><?php echo e($stats['my_attendance_days']); ?></div>
                            <div class="small text-muted fw-500">Days Present (Month)</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Approvals</span>
                            <div class="stat-value text-warning"><?php echo e($stats['my_pending_leaves']); ?></div>
                            <div class="small text-muted fw-500">Requests Pending</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">Leave Bank</span>
                            <div class="stat-value text-primary"><?php echo e($stats['my_total_leaves']); ?></div>
                            <div class="small text-muted fw-500">Total Allotted Days</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="glass-card">
                            <span class="stat-label">My Payout</span>
                            <div class="stat-value text-slate-800">
                                <?php echo e($businessSettings->currency_symbol ?? '₹'); ?><?php echo e(number_format($stats['my_last_salary'] / 1000, 1)); ?>k
                            </div>
                            <div class="small text-muted fw-500">Recent Payslip Summary</div>
                        </div>
                    </div>
                <?php endif; ?>
            </div>

            <!-- Action Center -->
            <div class="mb-5">
                <div class="d-flex align-items-center mb-4">
                    <h5 class="fw-bold mb-0 me-3">Quick Navigation</h5>
                    <div class="flex-grow-1 border-top opacity-10"></div>
                </div>
                <div class="row g-4">
                    <?php if($isAdmin): ?>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('employees.index')); ?>" class="action-card">
                                <i class="fas fa-users-cog text-primary"></i>
                                <span class="fw-bold">Staff Directory</span>
                            </a>
                        </div>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('salaries.bulk.processor')); ?>" class="action-card">
                                <i class="fas fa-money-bill-transfer text-success"></i>
                                <span class="fw-bold">Payroll Engine</span>
                            </a>
                        </div>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('reports.attendance.daily')); ?>" class="action-card">
                                <i class="fas fa-file-contract text-warning"></i>
                                <span class="fw-bold">Organization Reports</span>
                            </a>
                        </div>
                    <?php else: ?>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('attendances.mine')); ?>" class="action-card">
                                <i class="fas fa-fingerprint text-success"></i>
                                <span class="fw-bold">My Attendance</span>
                            </a>
                        </div>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('leave-requests.index')); ?>" class="action-card">
                                <i class="fas fa-calendar-plus text-primary"></i>
                                <span class="fw-bold">Apply for Leave</span>
                            </a>
                        </div>
                        <div class="col-md-4">
                            <a href="<?php echo e(route('profile.index')); ?>" class="action-card">
                                <i class="fas fa-user-circle text-warning"></i>
                                <span class="fw-bold">My Profile</span>
                            </a>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <!-- Sidebar / Event Column -->
        <div class="col-lg-3">
            <div class="card company-pulse-card border-0 shadow-none p-2 mb-4">
                <div class="card-body p-4">
                    <h6 class="fw-800 text-uppercase letter-spacing-1 text-slate-600 mb-4" style="font-size: 0.7rem;">Upcoming Holiday</h6>
                    
                    <?php if($nextHoliday): ?>
                        <div class="d-flex align-items-center mb-0">
                            <div class="bg-white p-3 rounded-4 shadow-sm me-3 text-center border border-slate-100" style="min-width: 65px;">
                                <span class="d-block fw-900 text-primary fs-4"><?php echo e(\Carbon\Carbon::parse($nextHoliday->date)->format('d')); ?></span>
                                <span class="small text-uppercase fw-700 text-muted" style="font-size: 11px;"><?php echo e(\Carbon\Carbon::parse($nextHoliday->date)->format('M')); ?></span>
                            </div>
                            <div>
                                <span class="d-block fw-800 text-slate-800 mb-1"><?php echo e($nextHoliday->name); ?></span>
                                <span class="badge bg-soft-info text-info rounded-pill px-2 py-1" style="font-size: 11px;"><?php echo e(\Carbon\Carbon::parse($nextHoliday->date)->diffForHumans()); ?></span>
                            </div>
                        </div>
                    <?php else: ?>
                        <p class="text-muted small mb-0">No upcoming holidays.</p>
                    <?php endif; ?>
                </div>
            </div>

            <!-- Dashboard Footer Info -->
            <div class="text-center p-4 mt-2">
                <img src="<?php echo e($businessSettings->logo_url ?? asset('images/logo.png')); ?>" height="25" class="mb-3 grayscale opacity-30">
                <p class="text-muted" style="font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;">HRMS Intelligence Engine</p>
                <p class="text-muted opacity-50" style="font-size: 10px;"><?php echo e(date('Y')); ?> &copy; All Rights Reserved</p>
            </div>
        </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 C:\xampp\htdocs\hrms\resources\views/dashboard.blade.php ENDPATH**/ ?>