@extends('layouts.app')

@section('content')
<div class="row">
    <div class="col-12 col-sm-6 col-md-3">
        <div class="info-box shadow-sm">
            <span class="info-box-icon bg-info elevation-1"><i class="fas fa-users"></i></span>
            <div class="info-box-content">
                <span class="info-box-text">Total Employees</span>
                <span class="info-box-number">{{ $stats['total_employees'] }}</span>
            </div>
        </div>
    </div>
    
    <div class="col-12 col-sm-6 col-md-3">
        <div class="info-box shadow-sm">
            <span class="info-box-icon bg-success elevation-1"><i class="fas fa-calendar-check"></i></span>
            <div class="info-box-content">
                <span class="info-box-text">Present Today</span>
                <span class="info-box-number">{{ $stats['present_today'] }}</span>
            </div>
        </div>
    </div>

    <div class="col-12 col-sm-6 col-md-3">
        <div class="info-box shadow-sm">
            <span class="info-box-icon bg-warning elevation-1"><i class="fas fa-clock"></i></span>
            <div class="info-box-content">
                <span class="info-box-text">Attendance Req.</span>
                <span class="info-box-number text-white">{{ $stats['pending_attendance'] }}</span>
            </div>
        </div>
    </div>

    <div class="col-12 col-sm-6 col-md-3">
        <div class="info-box shadow-sm">
            <span class="info-box-icon bg-danger elevation-1"><i class="fas fa-plane-departure"></i></span>
            <div class="info-box-content">
                <span class="info-box-text">Leave Req.</span>
                <span class="info-box-number">{{ $stats['pending_leaves'] }}</span>
            </div>
        </div>
    </div>
</div>

<div class="row mt-4">
    <div class="col-md-8">
        <div class="card card-outline card-primary">
            <div class="card-header">
                <h3 class="card-title font-weight-bold">System Status</h3>
            </div>
            <div class="card-body">
                @if (session('status'))
                    <div class="alert alert-success" role="alert">
                        {{ session('status') }}
                    </div>
                @endif

                <h5>Welcome to DUKE HRMS Management Portal.</h5>
                <p class="text-muted">You are correctly synchronized with the central attendance server. All systems are operational.</p>
                
                <hr>
                
                <div class="row">
                    <div class="col-sm-6">
                        <div class="description-block border-right">
                            <span class="description-percentage text-success"><i class="fas fa-caret-up"></i> 17%</span>
                            <h5 class="description-header">UPTIME</h5>
                            <span class="description-text">RELIABILITY</span>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="description-block">
                            <span class="description-percentage text-warning"><i class="fas fa-caret-left"></i> 0%</span>
                            <h5 class="description-header">SYNC</h5>
                            <span class="description-text">LATENCY</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="col-md-4">
        <div class="card card-primary card-outline">
            <div class="card-header">
                <h3 class="card-title">Quick Actions</h3>
            </div>
            <div class="card-body p-0">
                <ul class="nav flex-column">
                    <li class="nav-item">
                        <a href="{{ route('employees.create') }}" class="nav-link">
                            <i class="fas fa-user-plus mr-2"></i> Add Employee
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="{{ route('attendance-requests.index') }}" class="nav-link">
                            <i class="fas fa-tasks mr-2"></i> Review Requests
                            <span class="badge bg-warning float-right">{{ $stats['pending_attendance'] }}</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="{{ route('salaries.bulk.processor') }}" class="nav-link">
                            <i class="fas fa-file-invoice-dollar mr-2"></i> Process Payroll
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
@endsection
