<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Balance Sheet Report</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.5;
            color: #333;
            background: #f5f5f5;
        }

        @media print {
            body {
                background: white;
            }
            .no-print {
                display: none !important;
            }
        }

        .report-container {
            max-width: 11in;
            margin: 20px auto;
            padding: 40px;
            background: white;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .report-header {
            border-bottom: 3px solid #2c3e50;
            margin-bottom: 20px;
            padding-bottom: 15px;
        }

        .company-logo {
            font-size: 24px;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .company-info {
            font-size: 11px;
            color: #666;
            line-height: 1.4;
        }

        .report-title {
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            color: #2c3e50;
            margin-top: 15px;
            margin-bottom: 10px;
        }

        .report-period {
            text-align: center;
            font-size: 12px;
            color: #666;
            margin-bottom: 30px;
        }

        .bs-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
        }

        .bs-section {
            border: 1px solid #ddd;
        }

        .bs-header {
            background: #34495e;
            color: white;
            padding: 10px;
            font-weight: bold;
            font-size: 12px;
        }

        .bs-table {
            width: 100%;
            border-collapse: collapse;
        }

        .bs-table tr {
            border-bottom: 1px solid #ddd;
        }

        .bs-table td {
            padding: 8px;
            font-size: 11px;
        }

        .bs-table td:first-child {
            text-align: left;
        }

        .bs-table td:last-child {
            text-align: right;
        }

        .bs-item {
            padding-left: 20px;
        }

        .bs-subtotal {
            background: #ecf0f1;
            font-weight: bold;
            border-top: 2px solid #34495e;
            border-bottom: 1px solid #34495e;
        }

        .bs-total {
            background: #34495e;
            color: white;
            font-weight: bold;
            border-top: 2px solid #34495e;
            border-bottom: 2px solid #34495e;
        }

        .summary-section {
            margin-top: 30px;
            border: 2px solid #34495e;
        }

        .summary-header {
            background: #34495e;
            color: white;
            padding: 10px;
            font-weight: bold;
        }

        .summary-table {
            width: 100%;
            border-collapse: collapse;
        }

        .summary-table tr {
            border-bottom: 1px solid #ddd;
        }

        .summary-table td {
            padding: 10px;
        }

        .summary-table td:first-child {
            text-align: left;
        }

        .summary-table td:last-child {
            text-align: right;
        }

        .check-balanced {
            background: #28a745;
            color: white;
        }

        .check-unbalanced {
            background: #dc3545;
            color: white;
        }

        .print-button {
            display: inline-block;
            margin: 20px auto;
            padding: 10px 20px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .print-button:hover {
            background: #2980b9;
        }

        .no-print-container {
            text-align: center;
            margin: 20px 0;
        }

        @media print {
            .print-button {
                display: none;
            }

            .report-container {
                box-shadow: none;
                margin: 0;
            }
        }

        @media (max-width: 1024px) {
            .bs-container {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .report-container {
                max-width: 100%;
                margin: 0;
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="no-print-container no-print">
        <button class="print-button" onclick="window.print()">🖨️ Print Report</button>
    </div>

    <div class="report-container">
        <!-- Report Header -->
        <d style="text-align: center; margin-bottom: 30px;">
                <h1 style="margin: 0; font-size: 32px; font-weight: bold;">STARUP MIND</h1>
                <p style="margin: 5px 0 0; font-size: 16px;">Your Trusted Technology Partner</p>

        <!-- Report Title -->
        <div class="report-title">BALANCE SHEET</div>
        <div class="report-period">
            As at <strong><?php echo e(\Carbon\Carbon::parse($asAt)->format('d M Y')); ?></strong>
        </div>

        <!-- Main Balance Sheet -->
        <div class="bs-container">
            <!-- ASSETS -->
            <div class="bs-section">
                <div class="bs-header">ASSETS</div>
                <table class="bs-table">
                    <tr>
                        <td>Cash in Hand</td>
                        <td><?php echo e(number_format($cashBalance, 2)); ?></td>
                    </tr>
                    <tr class="bs-subtotal">
                        <td colspan="2">BANK ACCOUNTS</td>
                    </tr>
                    <?php $__empty_1 = true; $__currentLoopData = $bankAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="bs-item">
                            <td><?php echo e($account['name']); ?></td>
                            <td><?php echo e(number_format($account['balance'], 2)); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr class="bs-item">
                            <td colspan="2">No bank accounts</td>
                        </tr>
                    <?php endif; ?>
                    <tr class="bs-subtotal">
                        <td>Total Bank Balance</td>
                        <td><?php echo e(number_format($totalBankBalance, 2)); ?></td>
                    </tr>
                    <tr class="bs-subtotal">
                        <td colspan="2">DIGITAL ACCOUNTS</td>
                    </tr>
                    <?php $__empty_1 = true; $__currentLoopData = $digitalAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="bs-item">
                            <td><?php echo e($account['name']); ?></td>
                            <td><?php echo e(number_format($account['balance'], 2)); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr class="bs-item">
                            <td colspan="2">No digital accounts</td>
                        </tr>
                    <?php endif; ?>
                    <tr class="bs-subtotal">
                        <td>Total Digital Balance</td>
                        <td><?php echo e(number_format($totalDigitalBalance, 2)); ?></td>
                    </tr>
                    <tr>
                        <td>Accounts Receivable</td>
                        <td><?php echo e(number_format($accountsReceivable, 2)); ?></td>
                    </tr>
                    <tr>
                        <td>Inventory Value</td>
                        <td><?php echo e(number_format($inventoryValue, 2)); ?></td>
                    </tr>
                    <tr class="bs-total">
                        <td>TOTAL ASSETS</td>
                        <td><?php echo e(number_format($totalAssets, 2)); ?></td>
                    </tr>
                </table>
            </div>

            <!-- LIABILITIES & EQUITY -->
            <div>
                <!-- LIABILITIES -->
                <div class="bs-section">
                    <div class="bs-header">LIABILITIES</div>
                    <table class="bs-table">
                        <tr>
                            <td>Accounts Payable</td>
                            <td><?php echo e(number_format($accountsPayable, 2)); ?></td>
                        </tr>
                        <tr class="bs-total">
                            <td>TOTAL LIABILITIES</td>
                            <td><?php echo e(number_format($totalLiabilities, 2)); ?></td>
                        </tr>
                    </table>
                </div>

                <!-- EQUITY -->
                <div class="bs-section" style="margin-top: 20px;">
                    <div class="bs-header">EQUITY</div>
                    <table class="bs-table">
                        <tr>
                            <td>Retained Earnings</td>
                            <td><?php echo e(number_format($retainedEarnings, 2)); ?></td>
                        </tr>
                        <tr class="bs-total">
                            <td>TOTAL EQUITY</td>
                            <td><?php echo e(number_format($totalEquity, 2)); ?></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <!-- SUMMARY & BALANCE CHECK -->
        <div class="summary-section">
            <div class="summary-header">BALANCE VERIFICATION</div>
            <table class="summary-table">
                <tr>
                    <td><strong>Total Assets</strong></td>
                    <td><strong><?php echo e(number_format($totalAssets, 2)); ?></strong></td>
                </tr>
                <tr>
                    <td><strong>Total Liabilities & Equity</strong></td>
                    <td><strong><?php echo e(number_format($totalLiabilitiesAndEquity, 2)); ?></strong></td>
                </tr>
                <tr class="<?php echo e($totalAssets == $totalLiabilitiesAndEquity ? 'check-balanced' : 'check-unbalanced'); ?>">
                    <td><strong>Status</strong></td>
                    <td><strong>
                        <?php if($totalAssets == $totalLiabilitiesAndEquity): ?>
                            ✓ BALANCED
                        <?php else: ?>
                            ✗ NOT BALANCED
                        <?php endif; ?>
                    </strong></td>
                </tr>
            </table>
        </div>

        <!-- Footer -->
        <div style="margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; text-align: center; font-size: 10px; color: #666;">
            <p>This is a computer-generated report. No signature required.</p>
            <p>Report Generated on <?php echo e(now()->format('d M Y')); ?> at <?php echo e(now()->format('H:i A')); ?></p>
        </div>
    </div>
</body>
</html>
<?php /**PATH C:\Users\startup sabbir\Desktop\jannat\sarvice-accounts\accounting-system\resources\views/reports/balance-sheet-print.blade.php ENDPATH**/ ?>