
<?php
    $lcTitle = $card['title'] ?? 'Bilgiler';
    $lcIcon = $card['icon'] ?? 'fa-circle-info';
    $lcUrl = $card['url'] ?? null;
    $lcNote = $card['note'] ?? null;
    $lcSections = $card['sections'] ?? [];
    $lcCtype = $card['ctype'] ?? null;

    // Boş sayacı: kart tipine uymayan satırlar ekranda olmadığı için sayılmaz.
    $lcEmpty = 0;
    foreach ($lcSections as $lcS) {
        foreach ($lcS['rows'] as $lcR) {
            $lcRowCtype = $lcR['ctype'] ?? ($lcS['ctype'] ?? null);
            if ($lcRowCtype && $lcCtype && $lcRowCtype !== $lcCtype) continue;
            if (blank(trim((string) ($lcR['text'] ?? '')))) $lcEmpty++;
        }
    }
?>


<div class="pfx show-empty <?php echo e($card['class'] ?? ''); ?>" <?php if($lcUrl): ?> data-url="<?php echo e($lcUrl); ?>" <?php endif; ?>>
    <div class="pfx-top">
        <span class="pfx-top-t"><i class="fas <?php echo e($lcIcon); ?>"></i> <?php echo e($lcTitle); ?></span>
        <button type="button" class="pfx-chip" data-a="empties" title="Doldurulmamış alanları göster / gizle">
            <i class="fas fa-eye-slash"></i> <span data-role="empties-n"><?php echo e($lcEmpty); ?></span> boş alan
        </button>
        <button type="button" class="pfx-chip" data-a="copy-all" title="Dolu tüm alanları kopyala">
            <i class="fas fa-clone"></i> Tümü
        </button>
        <?php if($card['foldable'] ?? false): ?>
            <button type="button" class="pfx-fold" data-a="fold" title="Kartı katla / aç" aria-expanded="true">
                <i class="fas fa-chevron-up"></i>
            </button>
        <?php endif; ?>
    </div>

    <?php $__currentLoopData = $lcSections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lcS): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <section class="pfx-sec <?php echo e(($lcS['muted'] ?? false) ? 'muted' : ''); ?>"
                 <?php if($lcS['ctype'] ?? null): ?> data-ctype="<?php echo e($lcS['ctype']); ?>" <?php endif; ?>>
            <div class="pfx-sec-h">
                <i class="fas <?php echo e($lcS['icon'] ?? 'fa-circle-info'); ?>"></i>
                <span><?php echo e($lcS['title']); ?></span>
                <button type="button" class="pfx-secopy" data-a="copy-sec" title="Bu bölümü kopyala">
                    <i class="fas fa-copy"></i>
                </button>
            </div>

            <?php $__currentLoopData = $lcS['rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lcR): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                
                <?php echo $__env->make('components.quick-view.ledger-row', [
                    'r' => ($lcS['ctype'] ?? null) && ! ($lcR['ctype'] ?? null)
                        ? array_merge($lcR, ['ctype' => $lcS['ctype']])
                        : $lcR,
                ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </section>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

    <?php if($card['append'] ?? null): ?>
        <?php echo $__env->make($card['append'], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php endif; ?>

    <?php if($lcNote): ?>
        <div class="pfx-note"><i class="fas fa-circle-info"></i> <?php echo e($lcNote); ?></div>
    <?php endif; ?>
</div>
<?php /**PATH C:\xampp\htdocs\acente\resources\views/components/quick-view/ledger-card.blade.php ENDPATH**/ ?>