<!-- DIGITAL ENTRY PASS MODAL -->
    <div id="pass-modal" class="fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-slate-950/70 backdrop-blur-sm hidden">
        <div class="<?= $style['cardBg'] ?> rounded-3xl border border-amber-200 shadow-2xl max-w-sm w-full p-6 text-center space-y-5 relative">
            <button type="button" onclick="closePassModal()" class="absolute top-4 right-4 text-slate-400 hover:text-slate-600 text-lg w-8 h-8 rounded-full bg-slate-100 flex items-center justify-center transition">
                &times;
            </button>

            <div class="space-y-1">
                <span class="text-[10px] font-bold uppercase tracking-wider text-amber-700 <?= $style['accentBg'] ?> px-3 py-1 rounded-full border border-amber-200">Official Entry Pass</span>
                <h3 class="text-xl font-bold font-serif-fancy <?= $style['textColor'] ?> pt-2"><?= escape_html($guestName) ?></h3>
                <p class="text-xs font-mono font-bold text-amber-700 pt-0.5">Code : <?= escape_html($guestToken ?: 'PREVIEW') ?></p>
            </div>

            <div class="bg-slate-50 border <?= $style['borderColor'] ?> rounded-2xl p-4 flex flex-col items-center justify-center">
                <?php if ($live_preview || $qr_code === ''): ?>
                    <div class="w-48 h-48 flex flex-col items-center justify-center text-slate-400 text-xs font-semibold gap-2 border border-dashed border-slate-300 rounded-xl bg-white">
                        <span class="text-4xl opacity-40">📲</span>
                        <span>QR Code Preview</span>
                    </div>
                <?php else: ?>
                    <img src="<?= $qr_code ?>" alt="Guest Pass QR Large" class="w-48 h-48 object-contain">
                <?php endif; ?>
            </div>

            <div class="bg-amber-50/60 border border-amber-200/80 rounded-2xl p-3.5 text-left text-xs space-y-1.5 text-slate-700">
                <p><strong>Max Invited Pax:</strong> <?= $pax ?> Person<?= $pax > 1 ? 's' : '' ?></p>
                <p><strong>Invited Events:</strong> <?= escape_html(implode(', ', array_column($events, 'event_name'))) ?></p>
                <p class="text-[10px] text-amber-800 pt-1 border-t border-amber-200/60">
                    ℹ️ Please show this QR code to our check-in crew upon arrival at the venue entrance.
                </p>
            </div>

            <button type="button" onclick="closePassModal()" class="w-full inline-flex justify-center items-center px-4 py-2.5 border border-transparent text-xs font-bold rounded-xl <?= $style['primaryBtn'] ?> transition shadow-sm">
                Done / Close
            </button>
        </div>
    </div>
