

<?php $__env->startSection('title', 'Ringkasan laporan — '.config('portal.product_line')); ?>
<?php $__env->startSection('page_heading', 'Laporan — Ringkasan'); ?>
<?php $__env->startSection('page_subheading', 'Angka kunci periode terpilih. Gunakan tab di atas untuk detail laba rugi, harian, item, layanan, dan sumber data.'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('owner.reports._nav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php echo $__env->make('owner.reports._filters', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <?php if(!empty($data['errors'])): ?>
        <div class="mb-6 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-950" role="alert">
            <p class="font-semibold text-amber-900">Perlu perhatian</p>
            <ul class="mt-2 list-disc space-y-1 pl-5">
                <?php $__currentLoopData = $data['errors']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $err): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><span class="font-medium"><?php echo e($err['source']); ?></span>: <?php echo e($err['message']); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php endif; ?>

    <div class="mb-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
        <div class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm">
            <p class="text-xs font-medium uppercase tracking-wide text-slate-500">Revenue gabungan</p>
            <p class="mt-2 text-2xl font-bold tracking-tight text-slate-900">Rp <?php echo e(number_format($data['combined']['total_revenue_all_businesses'] ?? 0, 0, ',', '.')); ?></p>
        </div>
        <div class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm">
            <p class="text-xs font-medium uppercase tracking-wide text-slate-500">Kontribusi gabungan <span class="font-normal normal-case text-slate-400">(indikatif)</span></p>
            <p class="mt-2 text-2xl font-bold tracking-tight text-emerald-700">Rp <?php echo e(number_format($data['combined']['total_gross_profit_combined'] ?? 0, 0, ',', '.')); ?></p>
        </div>
        <div class="rounded-2xl border border-sky-100 bg-sky-50/80 p-5 shadow-sm">
            <p class="text-xs font-medium uppercase tracking-wide text-slate-600"><?php echo e(config('portal.sources.esborder.title')); ?></p>
            <?php if($data['esborder']['ok'] ?? false): ?>
                <span class="mt-2 inline-flex rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-semibold text-emerald-800">Terhubung</span>
            <?php else: ?>
                <span class="mt-2 inline-flex rounded-full bg-red-100 px-2 py-0.5 text-xs font-semibold text-red-800">Perlu setup</span>
            <?php endif; ?>
            <p class="mt-2 text-lg font-semibold text-slate-900">Rp <?php echo e(number_format($data['esborder']['revenue'] ?? 0, 0, ',', '.')); ?></p>
            <p class="mt-1 text-xs text-slate-600"><?php echo e(number_format($data['esborder']['order_count'] ?? 0, 0, ',', '.')); ?> order selesai</p>
        </div>
        <div class="rounded-2xl border border-violet-100 bg-violet-50/80 p-5 shadow-sm">
            <p class="text-xs font-medium uppercase tracking-wide text-slate-600"><?php echo e(config('portal.sources.sysreflex.title')); ?></p>
            <?php if($data['sysreflex']['ok'] ?? false): ?>
                <span class="mt-2 inline-flex rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-semibold text-emerald-800">Terhubung</span>
            <?php else: ?>
                <span class="mt-2 inline-flex rounded-full bg-red-100 px-2 py-0.5 text-xs font-semibold text-red-800">Perlu setup</span>
            <?php endif; ?>
            <p class="mt-2 text-lg font-semibold text-slate-900">Rp <?php echo e(number_format($data['sysreflex']['gross_revenue'] ?? 0, 0, ',', '.')); ?></p>
            <p class="mt-1 text-xs text-slate-600"><?php echo e(number_format($data['sysreflex']['transaction_count'] ?? 0, 0, ',', '.')); ?> transaksi</p>
        </div>
    </div>

    <div class="rounded-2xl border border-slate-200 bg-white p-5 text-sm text-slate-600 shadow-sm">
        <p class="font-medium text-slate-800">Langkah berikutnya</p>
        <ul class="mt-2 list-disc space-y-1 pl-5">
            <li>Tab <strong>Laba rugi</strong> — rincian pendapatan &amp; biaya indikatif per sumber.</li>
            <li>Tab <strong>Harian</strong> — tabel gabungan per tanggal dengan halaman (paginate).</li>
            <li>Tab <strong>Item FnB</strong> / <strong>Layanan</strong> — detail terlaris &amp; layanan teratas, juga berpaginasi.</li>
            <li>Tab <strong>Detail sumber</strong> — outlet, harian FnB, harian refleksologi (masing-masing paginate).</li>
        </ul>
        <p class="mt-3 text-xs text-slate-500"><?php echo e($data['combined']['note'] ?? ''); ?></p>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.portal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\sysorder\resources\views/owner/reports/index.blade.php ENDPATH**/ ?>