<!DOCTYPE html>
<html lang="en">
<head>
    <?php echo $__env->make('layouts.partials.head', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
</head>
<body class="g-sidenav-show bg-gray-100">
    <?php echo $__env->make('layouts.partials.sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <main class="main-content position-relative border-radius-lg">
        <nav class="navbar navbar-main navbar-expand-lg px-0 mx-4 shadow-none border-radius-xl mt-4" id="navbarBlur">
            <div class="container-fluid py-1 px-3">
                <nav aria-label="breadcrumb">
                    <h6 class="font-weight-bolder mb-0"><?php echo $__env->yieldContent('title', 'Dashboard'); ?></h6>
                </nav>
                <div class="collapse navbar-collapse mt-sm-0 mt-2 me-md-0 me-sm-4" id="navbar">
                    <ul class="navbar-nav justify-content-end ms-auto align-items-center">
                        <li class="nav-item d-flex align-items-center me-3">
                            <span class="badge bg-gradient-primary text-white text-xxs"><?php echo e(ucfirst(auth()->user()->getRoleNames()->first() ?? 'user')); ?></span>
                        </li>
                        <li class="nav-item dropdown">
                            <a href="#" class="nav-link text-body font-weight-bold px-0 d-inline-flex align-items-center no-caret" data-bs-toggle="dropdown">
                                <i class="bi bi-person-circle me-1"></i>
                                <span><?php echo e(auth()->user()->name); ?></span>
                                <i class="bi bi-chevron-down ms-1 text-xs"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li>
                                    <form method="POST" action="<?php echo e(route('logout')); ?>">
                                        <?php echo csrf_field(); ?>
                                        <button class="dropdown-item d-flex align-items-center" type="submit"><i class="bi bi-box-arrow-right me-2"></i>Log out</button>
                                    </form>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

        <div class="container-fluid py-4">
            <?php if(session('success')): ?>
                <div class="alert alert-success text-white alert-dismissible fade show" role="alert">
                    <?php echo e(session('success')); ?>

                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
            <?php endif; ?>
            <?php if(session('error')): ?>
                <div class="alert alert-danger text-white alert-dismissible fade show" role="alert">
                    <?php echo e(session('error')); ?>

                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
            <?php endif; ?>
            <?php if($errors->any()): ?>
                <div class="alert alert-warning text-white alert-dismissible fade show" role="alert">
                    <ul class="mb-0 ps-3"><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li><?php echo e($e); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></ul>
                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
            <?php endif; ?>

            <?php echo $__env->yieldContent('content'); ?>

            <footer class="footer pt-3 mt-4">
                <div class="container-fluid">
                    <div class="text-center text-sm text-muted">
                        © <?php echo e(date('Y')); ?> Independent Sdn Bhd (1387076-M) · MyIndependent Worker Management
                    </div>
                </div>
            </footer>
        </div>
    </main>

    <script src="<?php echo e(asset('assets/js/bootstrap.bundle.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/chart.umd.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/tom-select.complete.min.js')); ?>"></script>
    <script>
        // Turn any <select class="searchable"> into a searchable dropdown.
        document.querySelectorAll('select.searchable').forEach(function (el) {
            new TomSelect(el, {
                maxOptions: 1000,
                allowEmptyOption: true,
                // Start each search fresh — don't keep the selected label as a prefix.
                onDropdownOpen: function () { this.setTextboxValue(''); this.refreshOptions(false); },
                onFocus: function () { this.setTextboxValue(''); },
            });
        });
    </script>
    <?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /Users/kalaiarasen/projects/myindependent-worker-management/resources/views/layouts/app.blade.php ENDPATH**/ ?>