<!doctype html>
<html lang="<?php echo e(app()->getLocale()); ?>" dir="<?php echo e(in_array(app()->getLocale(), ['ps','fa','ar']) ? 'rtl' : 'ltr'); ?>">
<head>
    <meta charset="utf-8">
    <title><?php echo $__env->yieldContent('title', 'Petrol Pump MIS'); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/9.0.0/mdb.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.0/css/all.min.css" rel="stylesheet">

    <style>
        :root{--green:#16a34a;--green2:#0f766e;--blue:#0ea5e9;--dark:#0f172a;--soft:#f8fafc;--line:#e5e7eb;--text:#1f2937;--muted:#64748b}
        *{box-sizing:border-box}
        body{background:var(--soft);color:var(--text);font-family:"Segoe UI",Tahoma,Arial,sans-serif;font-size:15px}
        [dir="rtl"] body{font-family:"Bahij Zar","Noto Naskh Arabic",Tahoma,sans-serif;font-size:16px}
        .sidebar{width:245px;min-height:100vh;background:#fff;border-right:1px solid var(--line);position:fixed;top:0;bottom:0;overflow-y:auto;z-index:10}
        [dir="rtl"] .sidebar{border-right:0;border-left:1px solid var(--line)}
        .brand{padding:18px;text-align:center;border-bottom:1px solid var(--line);background:linear-gradient(135deg,#ecfdf5,#eff6ff)}
        .brand-icon{width:62px;height:62px;border-radius:20px;background:linear-gradient(135deg,var(--green),var(--blue));color:#fff;display:flex;align-items:center;justify-content:center;margin:0 auto 8px;font-size:28px}
        .menu-title{font-size:12px;color:#94a3b8;font-weight:800;padding:14px 18px 5px}
        .nav-link-simple,.menu-toggle{color:#334155;text-decoration:none;display:flex;align-items:center;gap:11px;padding:12px 14px;border-radius:15px;margin:5px 10px;font-weight:800;border:0;background:transparent;width:calc(100% - 20px);text-align:start}
        .nav-link-simple i,.menu-toggle i:first-child{width:24px;text-align:center;font-size:18px}
        .nav-link-simple:hover,.nav-link-simple.active,.menu-toggle:hover{background:#dcfce7;color:#166534}
        .sub a{font-size:14px;margin-left:25px;padding:9px 12px;font-weight:700}.chev{margin-left:auto}[dir="rtl"] .sub a{margin-left:10px;margin-right:25px}[dir="rtl"] .chev{margin-left:0;margin-right:auto}
        .content{margin-left:245px;padding:18px}[dir="rtl"] .content{margin-left:0;margin-right:245px}
        .topbar,.top-card{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 6px 18px rgba(15,23,42,.04)}
        .topbar{padding:12px 15px}.top-card{padding:16px}.btn{border-radius:14px;font-weight:800}.btn-lg{min-height:58px;font-size:17px}.form-control,.form-select{border-radius:14px;min-height:50px;font-size:16px}.form-control-lg,.form-select-lg{min-height:58px;font-size:18px}.easy-label{font-size:14px;color:#475569;font-weight:900;margin-bottom:6px}.required:after{content:' *';color:#ef4444}.mini-help{font-size:13px;color:var(--muted)}
        .big-action{display:flex;gap:14px;align-items:center;padding:18px;border-radius:20px;text-decoration:none;color:#fff;min-height:104px}.big-action i{font-size:34px}.big-action .title{font-size:20px;font-weight:900}.big-action .subtext{font-size:13px;opacity:.9}.bg-sale{background:linear-gradient(135deg,#16a34a,#0f766e)}.bg-stock{background:linear-gradient(135deg,#0ea5e9,#2563eb)}.bg-customer{background:linear-gradient(135deg,#f97316,#ea580c)}.bg-report{background:linear-gradient(135deg,#6366f1,#4338ca)}.bg-config{background:linear-gradient(135deg,#64748b,#0f172a)}
        .fuel-choice{border:3px solid transparent;border-radius:24px;background:#fff;padding:18px;width:100%;min-height:150px;text-align:center;transition:.15s}.fuel-choice i{font-size:38px;color:var(--green)}.fuel-choice .name{font-size:22px;font-weight:900}.fuel-choice .rate{font-size:18px;font-weight:900;color:#0f766e}.fuel-choice:hover,.fuel-choice.selected{border-color:#22c55e;background:#f0fdf4;transform:translateY(-2px)}
        .summary-box{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:18px;padding:14px}.amount-big{font-size:34px;font-weight:900;color:#166534}.stock-pill{display:inline-block;border-radius:999px;padding:4px 10px;font-weight:900;background:#ecfeff;color:#0f766e;font-size:12px}.table thead th{background:#f1f5f9;color:#334155;white-space:nowrap}
        @media(max-width:991px){.sidebar{position:relative;width:100%;min-height:auto}.content,[dir="rtl"] .content{margin:0;padding:12px}.brand{display:flex;align-items:center;gap:12px;text-align:start}.brand-icon{margin:0}.nav-link-simple,.menu-toggle{display:inline-flex;width:calc(50% - 24px);vertical-align:top}.sub a{margin-left:10px;margin-right:10px;width:calc(50% - 24px)}}
        @media(max-width:560px){.nav-link-simple,.menu-toggle,.sub a{width:calc(100% - 20px)}.top-card{padding:12px}}
    </style>
    <?php echo $__env->yieldPushContent('css'); ?>
</head>
<body>
<div class="sidebar">
    <div class="brand">
        <div class="brand-icon"><i class="fa-solid fa-gas-pump"></i></div>
        <div>
            <div class="fw-bold fs-5"><?php echo e(\App\Models\Setting::getValue('company_name','Petrol Pump MIS')); ?></div>
            <small class="text-muted">ساده پټرول پمپ سیستم</small>
        </div>
    </div>

    <?php ($u = auth()->user()); ?>
    <div class="menu-title">اصلي کارونه</div>

    <?php if($u?->hasPermission('dashboard')): ?>
        <a class="nav-link-simple" href="<?php echo e(route('dashboard')); ?>"><i class="fa-solid fa-house"></i> کور پاڼه</a>
    <?php endif; ?>

    <?php if($u?->hasPermission('pos_sale')): ?>
        <a class="nav-link-simple" href="<?php echo e(route('fuel-sales.create')); ?>"><i class="fa-solid fa-gas-pump"></i> تیل خرڅول</a>
    <?php endif; ?>

    <?php if($u?->hasPermission('purchase')): ?>
        <a class="nav-link-simple" href="<?php echo e(route('purchases.create')); ?>"><i class="fa-solid fa-truck-droplet"></i> ذخیره اضافه کول</a>
    <?php endif; ?>

    <?php if($u?->hasPermission('stock')): ?>
        <a class="nav-link-simple" href="<?php echo e(route('tanks.index')); ?>"><i class="fa-solid fa-oil-can"></i> ذخیره کتل</a>
    <?php endif; ?>

    <?php if($u?->hasPermission('customers')): ?>
        <a class="nav-link-simple" href="<?php echo e(route('customers.index')); ?>"><i class="fa-solid fa-users"></i> مشتریان</a>
    <?php endif; ?>

    <button class="menu-toggle" data-bs-toggle="collapse" data-bs-target="#moreMenu" type="button">
        <i class="fa-solid fa-bars"></i> نور کارونه <i class="fa-solid fa-angle-down chev"></i>
    </button>
    <div class="collapse sub" id="moreMenu">
        <?php if($u?->hasPermission('sales_list')): ?><a class="nav-link-simple" href="<?php echo e(route('fuel-sales.index')); ?>"><i class="fa-solid fa-receipt"></i> د خرڅلاو لیست</a><?php endif; ?>
        <?php if($u?->hasPermission('purchase')): ?><a class="nav-link-simple" href="<?php echo e(route('purchases.index')); ?>"><i class="fa-solid fa-list"></i> د خرید لیست</a><?php endif; ?>
        <?php if($u?->hasPermission('suppliers')): ?><a class="nav-link-simple" href="<?php echo e(route('suppliers.index')); ?>"><i class="fa-solid fa-building"></i> سپلایران</a><?php endif; ?>
        <?php if($u?->hasPermission('cash')): ?><a class="nav-link-simple" href="<?php echo e(route('customer-receipts.create')); ?>"><i class="fa-solid fa-hand-holding-dollar"></i> پیسې اخیستل</a><?php endif; ?>
        <?php if($u?->hasPermission('expenses')): ?><a class="nav-link-simple" href="<?php echo e(route('expenses.index')); ?>"><i class="fa-solid fa-wallet"></i> مصارف</a><?php endif; ?>
        <?php if($u?->hasPermission('cash')): ?><a class="nav-link-simple" href="<?php echo e(route('daily-closing.index')); ?>"><i class="fa-solid fa-calendar-check"></i> ورځنی حساب</a><?php endif; ?>
        <?php if($u?->hasPermission('reports')): ?><a class="nav-link-simple" href="<?php echo e(route('reports.daily-sales')); ?>"><i class="fa-solid fa-chart-simple"></i> راپورونه</a><?php endif; ?>
        <a class="nav-link-simple" href="<?php echo e(route('guide.index')); ?>"><i class="fa-solid fa-circle-question"></i> لارښود</a>
        <?php if($u?->hasPermission('settings')): ?><a class="nav-link-simple" href="<?php echo e(route('settings.edit')); ?>"><i class="fa-solid fa-gears"></i> قیمت او تنظیمات</a><?php endif; ?>
        <?php if($u?->hasPermission('users')): ?><a class="nav-link-simple" href="<?php echo e(route('users.index')); ?>"><i class="fa-solid fa-user-shield"></i> یوزران</a><?php endif; ?>
        <?php if($u?->hasPermission('localization')): ?><a class="nav-link-simple" href="<?php echo e(route('localization.index')); ?>"><i class="fa-solid fa-language"></i> ژبې</a><?php endif; ?>
    </div>
</div>

<main class="content">
    <div class="topbar d-flex flex-wrap justify-content-between align-items-center mb-3 gap-2">
        <div>
            <h4 class="fw-bold mb-0"><?php echo $__env->yieldContent('page_title', 'کور پاڼه'); ?></h4>
            <small class="text-muted">قیمتونه له تنظیماتو راځي؛ په خرڅلاو کې بیا قیمت مه لیکئ.</small>
        </div>
        <div class="d-flex flex-wrap gap-2 align-items-center">
            <?php if(auth()->user()?->hasPermission('pos_sale')): ?>
                <a class="btn btn-success" href="<?php echo e(route('fuel-sales.create')); ?>"><i class="fa-solid fa-plus"></i> نوی خرڅلاو</a>
            <?php endif; ?>
            <div class="btn-group">
                <a class="btn btn-light" href="<?php echo e(route('lang.switch','ps')); ?>">پښتو</a>
                <a class="btn btn-light" href="<?php echo e(route('lang.switch','fa')); ?>">دری</a>
                <a class="btn btn-light" href="<?php echo e(route('lang.switch','en')); ?>">EN</a>
            </div>
            <form method="POST" action="<?php echo e(route('logout')); ?>"><?php echo csrf_field(); ?><button class="btn btn-outline-danger"><i class="fa-solid fa-right-from-bracket"></i></button></form>
        </div>
    </div>

    <?php if(session('success')): ?><div class="alert alert-success"><i class="fa-solid fa-check-circle"></i> <?php echo e(session('success')); ?></div><?php endif; ?>
    <?php if(session('error')): ?><div class="alert alert-danger"><i class="fa-solid fa-triangle-exclamation"></i> <?php echo e(session('error')); ?></div><?php endif; ?>
    <?php if($errors->any()): ?><div class="alert alert-danger"><strong>مهرباني وکړئ دا معلومات سم کړئ:</strong><ul class="mb-0"><?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'); ?>
</main>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/9.0.0/mdb.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<?php echo $__env->yieldPushContent('js'); ?>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\petrolmump\resources\views/layouts/app.blade.php ENDPATH**/ ?>