<!doctype html>
<html lang="ar" dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>طباعة تذاكر خياطة المصر</title>
<style>
body{font-family:Tahoma,Arial,sans-serif;background:#f7f3ef;margin:0;padding:20px;color:#1f2937}
.sheet{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:16px}
.ticket{background:linear-gradient(180deg,#fff,#fbf7f2);border:1px solid #eadfce;border-radius:24px;padding:18px;text-align:center;box-shadow:0 10px 24px rgba(17,24,39,.05)}
.num{font-size:34px;font-weight:800;margin:12px 0;color:#5e3b23}
.meta{margin-top:10px;background:#fff;border:1px solid #efe4d6;border-radius:16px;padding:10px}
.shop{font-size:18px;font-weight:700}.sys{font-size:13px;color:#8b6b52}.muted{color:#666}
.qr{display:flex;justify-content:center;margin-top:10px}
@media print{body{padding:0;background:#fff}.ticket{break-inside:avoid;box-shadow:none}}
</style>
</head>
<body onload="window.print()">
<div class="sheet">
<?php foreach($barcodes as $b): ?>
<div class="ticket">
  <div class="shop"><?= e(setting('shop_name_ar', 'فخر الأصالة العمانية')) ?></div>
  <div class="sys">خياطة المصر العماني</div>
  <div class="muted" style="margin-top:8px">رقم التذكرة</div>
  <div class="num"><?= e($order['ticket_no']) ?></div>
  <div class="meta">
    <div><strong><?= e($order['full_name']) ?></strong></div>
    <div class="muted"><?= e($order['phone']) ?></div>
    <div class="muted" style="margin-top:6px">الباركود</div>
    <div style="font-weight:700"><?= e($b['barcode_no']) ?></div>
    <div class="qr"><img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=<?= urlencode($b['barcode_no']) ?>" alt="qr"></div>
  </div>
</div>
<?php endforeach; ?>
</div>
</body>
</html>
