<?php
$direction = is_rtl() ? 'rtl' : 'ltr';
$langCode = current_lang();
?>
<!DOCTYPE html>
<html lang="<?= $langCode ?>" dir="<?= $direction ?>">
<head>
    <meta charset="UTF-8">
    <title><?= e($title ?? 'Print') ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body { padding: 20px; font-size: 12pt; }
        @media print { .no-print { display: none !important; } }
        table { width: 100%; border-collapse: collapse; }
        th, td { border: 1px solid #ddd; padding: 6px 8px; }
    </style>
</head>
<body>
    <div class="no-print mb-3">
        <button onclick="window.print()" class="btn btn-primary btn-sm"><i class="fas fa-print"></i> Print</button>
        <button onclick="window.close()" class="btn btn-secondary btn-sm"><i class="fas fa-times"></i> Close</button>
    </div>
    <?= $content ?>
</body>
</html>