<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo e(config('app.name')); ?> - Staff Monitoring</title>
    <style>
        :root {
            --bg: #f2f5fb;
            --surface: #ffffff;
            --surface-2: #f8faff;
            --border: #e5eaf4;
            --text: #1f2937;
            --muted: #6b7280;
            --primary: #4f46e5;
            --primary-soft: #eef0ff;
            --success: #16a34a;
            --danger: #dc2626;
            --warning: #d97706;
            --shadow: 0 8px 30px rgba(31, 41, 55, 0.06);
            --radius: 14px;
        }

        * { box-sizing: border-box; }
        body {
            margin: 0;
            font-family: "Inter", "Segoe UI", Arial, sans-serif;
            color: var(--text);
            background: radial-gradient(circle at top right, #eef2ff 0%, var(--bg) 38%);
        }

        .app-shell {
            min-height: 100vh;
            display: grid;
            grid-template-columns: 250px 1fr;
        }

        .sidebar {
            background: linear-gradient(170deg, #111827 0%, #1f2937 65%, #312e81 120%);
            color: #e5e7eb;
            padding: 26px 18px;
            position: sticky;
            top: 0;
            height: 100vh;
        }

        .brand {
            font-weight: 700;
            font-size: 18px;
            margin-bottom: 18px;
            color: #fff;
        }

        .role-pill {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.14);
            color: #dbeafe;
            margin-bottom: 20px;
        }

        .side-nav { display: grid; gap: 8px; }
        .side-nav a {
            color: #d1d5db;
            text-decoration: none;
            font-size: 14px;
            padding: 10px 12px;
            border-radius: 10px;
            transition: all .2s ease;
        }
        .side-nav a:hover {
            background: rgba(255, 255, 255, 0.10);
            color: #fff;
        }

        .logout-btn {
            margin-top: 20px;
            width: 100%;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: transparent;
            color: #f8fafc;
            padding: 10px;
            border-radius: 10px;
            cursor: pointer;
        }

        .main-panel { padding: 22px; }
        .topbar {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 16px 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .page-title { margin: 0; font-size: 20px; }
        .subtle { color: var(--muted); font-size: 12px; }

        .container {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 18px;
        }

        .card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 14px;
        }

        .soft-card {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px;
        }

        .grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; }
        .grid-2 { display: grid; grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); gap: 14px; }

        .kpi-value { font-size: 24px; font-weight: 700; margin-top: 6px; }
        .kpi-label { color: var(--muted); font-size: 13px; }

        .btn {
            border: 0;
            background: var(--primary);
            color: #fff;
            padding: 10px 14px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 600;
        }
        .btn-danger { background: var(--danger); }
        .btn-secondary { background: #475569; }

        input, textarea, select {
            width: 100%;
            padding: 10px 12px;
            margin-top: 6px;
            margin-bottom: 12px;
            border: 1px solid #d6dfeb;
            border-radius: 10px;
            background: #fff;
            outline: none;
        }
        input:focus, textarea:focus, select:focus {
            border-color: #a5b4fc;
            box-shadow: 0 0 0 3px #e0e7ff;
        }

        table { width: 100%; border-collapse: collapse; }
        th, td {
            border-bottom: 1px solid var(--border);
            padding: 10px 8px;
            text-align: left;
            font-size: 13px;
            vertical-align: top;
        }

        .badge {
            display: inline-block;
            padding: 4px 9px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            background: #eef2ff;
            color: #4338ca;
        }

        .alert {
            padding: 12px;
            border-radius: 10px;
            margin-bottom: 12px;
            border: 1px solid transparent;
            font-size: 14px;
        }
        .alert-success { background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
        .alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
        .small { font-size: 12px; color: var(--muted); }

        .auth-shell {
            min-height: 100vh;
            display: grid;
            place-items: center;
            padding: 24px;
        }

        .auth-card {
            width: min(940px, 100%);
            display: grid;
            grid-template-columns: 1fr 1fr;
            background: var(--surface);
            border-radius: 18px;
            overflow: hidden;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
        }

        .auth-cover {
            padding: 32px;
            background: linear-gradient(160deg, #312e81 0%, #4f46e5 52%, #6366f1 100%);
            color: #fff;
        }

        .auth-form-wrap { padding: 28px; }

        @media (max-width: 980px) {
            .app-shell { grid-template-columns: 1fr; }
            .sidebar { height: auto; position: static; }
            .auth-card { grid-template-columns: 1fr; }
        }
    </style>
</head>
<body>
<?php if(auth()->guard()->check()): ?>
    <div class="app-shell">
        <aside class="sidebar">
            <div class="brand">Staff Monitoring</div>
            <div class="role-pill">Role: <?php echo e(auth()->user()->role); ?></div>

            <nav class="side-nav">
                <a href="<?php echo e(route('dashboard')); ?>">Dashboard</a>
                <?php if(auth()->user()->role === 'staff'): ?>
                    <a href="<?php echo e(route('attendance.index')); ?>">Attendance</a>
                    <a href="<?php echo e(route('tasks.index')); ?>">My Tasks</a>
                    <a href="<?php echo e(route('marketplace.index')); ?>">🛒 Job Board</a>
                    <a href="<?php echo e(route('reports.salary')); ?>">Salary Report</a>
                <?php endif; ?>
                <?php if(auth()->user()->role === 'admin'): ?>
                    <a href="<?php echo e(route('admin.tasks.index')); ?>">Task Management</a>
                    <a href="<?php echo e(route('admin.task-requests.index')); ?>">Task Requests</a>
                    <a href="<?php echo e(route('staff.index')); ?>">Staff Management</a>
                    <a href="<?php echo e(route('admin.reports.monthly')); ?>">Monthly Attendance</a>
                    <a href="<?php echo e(route('admin.settings.index')); ?>">Settings</a>
                <?php endif; ?>
            </nav>

            <form method="POST" action="<?php echo e(route('logout')); ?>">
                <?php echo csrf_field(); ?>
                <button class="logout-btn" type="submit">Logout</button>
            </form>
        </aside>

        <main class="main-panel">
            <div class="topbar">
                <div>
                    <h1 class="page-title"><?php echo $__env->yieldContent('page_title', 'Dashboard'); ?></h1>
                    <div class="subtle">Company Staff Monitoring, Task & Salary Automation</div>
                </div>
                <div class="subtle"><?php echo e(now('Asia/Dhaka')->format('d M, Y h:i A')); ?> (BST)</div>
            </div>

            <div class="container">
                <?php if(session('success')): ?>
                    <div class="alert alert-success"><?php echo e(session('success')); ?></div>
                <?php endif; ?>

                <?php if($errors->any()): ?>
                    <div class="alert alert-error">
                        <ul style="margin:0; padding-left: 18px;">
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <?php echo $__env->yieldContent('content'); ?>
            </div>
        </main>
    </div>
<?php else: ?>
    <div class="auth-shell">
        <?php echo $__env->yieldContent('content'); ?>
    </div>
<?php endif; ?>
</body>
</html>
<?php /**PATH E:\Antigravity Projects\staff-monitoring\resources\views/layouts/app.blade.php ENDPATH**/ ?>