
<?php $__env->startSection('content'); ?>
<div class="content-wrapper">

    
    <section class="content-header hideprint">
        <h1>
            تفاصيل عرض السعر رقم <small><?php echo e($order->id); ?></small>
            <div class="pull-right" style="margin-top:22px; display:flex; gap:8px; align-items:center;">
                <a class="btn btn-default" href="javascript:void(0)" onclick="openThemePicker();">
                    <i class="fa fa-paint-brush"></i> اختر تصميم
                </a>
                <a class="btn btn-warning" href="javascript:void(0)" onclick="window.print();">
                    <i class="fa fa-print"></i> طباعة
                </a>
            </div>
        </h1>
    </section>

    
    <div id="theme-modal" class="hideprint" style="display:none; position:fixed; inset:0; background:rgba(0,0,0,0.55); z-index:9999; align-items:center; justify-content:center;">
        <div style="background:#fff; border-radius:12px; padding:28px 32px; width:480px; max-width:95vw; box-shadow:0 8px 40px rgba(0,0,0,0.25); direction:rtl;">
            <h4 style="margin:0 0 6px 0; font-size:17px; color:#1a3c5e;">اختر تصميم عرض السعر</h4>
            <p style="margin:0 0 20px 0; font-size:12px; color:#777;">التغيير يظهر فوراً على عرض السعر قبل الطباعة</p>
            <div style="display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:24px;">
                <div class="theme-card" onclick="applyTheme('navy')" data-theme="navy"
                     style="border:2px solid #1a3c5e; border-radius:8px; padding:12px; cursor:pointer; text-align:center; background:#f0f4f8;">
                    <div style="height:28px; background:#1a3c5e; border-radius:4px; margin-bottom:8px;"></div>
                    <div style="height:8px; background:#c8960a; border-radius:2px; margin-bottom:6px;"></div>
                    <div style="height:6px; background:#eef2f7; border-radius:2px;"></div>
                    <div style="margin-top:8px; font-size:12px; font-weight:bold; color:#1a3c5e;">كحلي ذهبي</div>
                    <div style="font-size:10px; color:#888;">الافتراضي</div>
                </div>
                <div class="theme-card" onclick="applyTheme('green')" data-theme="green"
                     style="border:2px solid #ddd; border-radius:8px; padding:12px; cursor:pointer; text-align:center; background:#fff;">
                    <div style="height:28px; background:#1b5e38; border-radius:4px; margin-bottom:8px;"></div>
                    <div style="height:8px; background:#4caf50; border-radius:2px; margin-bottom:6px;"></div>
                    <div style="height:6px; background:#e8f5e9; border-radius:2px;"></div>
                    <div style="margin-top:8px; font-size:12px; font-weight:bold; color:#1b5e38;">أخضر</div>
                    <div style="font-size:10px; color:#888;">رسمي هادئ</div>
                </div>
                <div class="theme-card" onclick="applyTheme('gray')" data-theme="gray"
                     style="border:2px solid #ddd; border-radius:8px; padding:12px; cursor:pointer; text-align:center; background:#fff;">
                    <div style="height:28px; background:#37474f; border-radius:4px; margin-bottom:8px;"></div>
                    <div style="height:8px; background:#90a4ae; border-radius:2px; margin-bottom:6px;"></div>
                    <div style="height:6px; background:#eceff1; border-radius:2px;"></div>
                    <div style="margin-top:8px; font-size:12px; font-weight:bold; color:#37474f;">رمادي</div>
                    <div style="font-size:10px; color:#888;">احترافي بسيط</div>
                </div>
                <div class="theme-card" onclick="applyTheme('burgundy')" data-theme="burgundy"
                     style="border:2px solid #ddd; border-radius:8px; padding:12px; cursor:pointer; text-align:center; background:#fff;">
                    <div style="height:28px; background:#6a0f2a; border-radius:4px; margin-bottom:8px;"></div>
                    <div style="height:8px; background:#c0392b; border-radius:2px; margin-bottom:6px;"></div>
                    <div style="height:6px; background:#fdf0f0; border-radius:2px;"></div>
                    <div style="margin-top:8px; font-size:12px; font-weight:bold; color:#6a0f2a;">بردوني</div>
                    <div style="font-size:10px; color:#888;">فخم مميز</div>
                </div>
            </div>
            <div style="display:flex; gap:10px; justify-content:flex-end;">
                <button onclick="closeThemePicker()" style="padding:8px 20px; border:1px solid #ddd; border-radius:6px; background:#f5f5f5; cursor:pointer; font-size:13px;">إغلاق</button>
                <button onclick="closeThemePicker(); window.print();" style="padding:8px 20px; border:none; border-radius:6px; background:#1a3c5e; color:#fff; cursor:pointer; font-size:13px;">طباعة الآن</button>
            </div>
        </div>
    </div>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-body">
                        <div id="printInvoice">

                            <?php echo $__env->make('_partial.printheader', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                            <?php
                                $client = optional($order->client);
                                $car    = optional($order->car);
                            ?>

                            
                            <div class="inv-title-block">
                                <div class="inv-title-ar">عرض سعر</div>
                                <?php if(!empty($order->type)): ?>
                                    <div class="inv-subtitle"><?php echo e($order->type); ?></div>
                                <?php endif; ?>
                                <div class="inv-number">
                                    رقم عرض السعر &nbsp;|&nbsp; Quote NO: <strong><?php echo e($order->id); ?></strong>
                                </div>
                            </div>

                            
                            <table class="meta-table">
                                <tr>
                                    <td><span class="meta-lbl">اسم الموظف (Employee):</span><?php echo e(optional($order->creator)->name); ?></td>
                                    <td><span class="meta-lbl">الفرع (Branche):</span><?php echo e(optional($order->branche)->name); ?></td>
                                    <td><span class="meta-lbl">نوع الفاتورة (Type):</span><?php echo e($order->type); ?></td>
                                    <td><span class="meta-lbl">التاريخ (Date):</span>
                                        <?php
                                            try {
                                                $quoteDate = \Carbon\Carbon::parse($order->date ?? $order->created_at)->format('Y-m-d');
                                            } catch(\Exception $e) {
                                                $quoteDate = $order->post_date ?? '';
                                            }
                                        ?>
                                        <?php echo e($quoteDate); ?>

                                    </td>
                                </tr>
                            </table>

                            
                            <table class="info-wrap-table">
                                <tr>
                                    <td class="info-half-cell">
                                        <table class="info-tbl">
                                            <thead><tr><td colspan="2" class="info-head">بيانات السيارة &nbsp; ( Car Info )</td></tr></thead>
                                            <tbody>
                                              <tr><td class="ilbl">الموديل (Brand)</td><td class="ival"><?php echo e($car->car_brand); ?> / <?php echo e($car->model); ?></td></tr>
                                               <tr><td class="ilbl">سنة الصنع / اللون </td><td class="ival"><?php echo e($car->year); ?> / <?php echo e($car->color); ?></td></tr>
                                                <tr><td class="ilbl">رقم الهيكل (Chassis No)</td><td class="ival"><?php echo e($car->chassis_no); ?></td></tr>
                                                <tr><td class="ilbl">لوحة السيارة (Car Plate)</td><td class="ival"><?php echo e($car->car_number); ?></td></tr>
                                            </tbody>
                                        </table>
                                    </td>
                                    <td class="info-half-cell">
                                        <table class="info-tbl">
                                            <thead><tr><td colspan="2" class="info-head">بيانات العميل &nbsp; ( Client Info )</td></tr></thead>
                                            <tbody>
                                                <tr><td class="ilbl">اسم العميل (Client Name)</td><td class="ival"><?php echo e($client->name); ?></td></tr>
                                                <tr><td class="ilbl">رقم الهوية (Client ID)</td><td class="ival"><?php echo e($client->id_number); ?></td></tr>
                                                <tr><td class="ilbl">رقم الجوال (Mobile No)</td><td class="ival"><?php echo e($client->mobile); ?></td></tr>
                                                <tr><td class="ilbl">التاريخ (Date)</td><td class="ival"><?php echo e($quoteDate); ?></td></tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </table>

                            
                            <?php if($order->note): ?>
                            <table class="note-tbl">
                                <tr><td><?php echo e($order->note); ?></td></tr>
                            </table>
                            <?php endif; ?>

                            
                            <table class="items-tbl pitems">
                                <colgroup>
                                    <col style="width:5%">
                                    <col style="width:50%">
                                    <col style="width:12%">
                                    <col style="width:10%">
                                    <col style="width:10%">
                                    <col style="width:13%">
                                </colgroup>
                                <thead>
                                    <tr class="items-head-row">
                                        <th>#<br/>No</th>
                                        <th>الصنف / الخدمة<br/>Item / Service</th>
                                        <th>السعر<br/>Price</th>
                                        <th>الكمية<br/>Qty</th>
                                        <th>الخصم<br/>Discount</th>
                                        <th>الإجمالى<br/>Total</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                        $iter = 1;
                                        $totalDiscount = 0;
                                    ?>

                                    <?php if($order->details): ?>
                                        <?php $__currentLoopData = $order->details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $price     = $d->pivot->price;
                                                $qty       = $d->pivot->qty;
                                                $discount  = $d->pivot->discount;
                                                $lineTotal = $qty * ($price - $discount);
                                                $totalDiscount += ($qty * ($discount ?? 0));
                                            ?>
                                            <tr class="<?php echo e($iter % 2 == 0 ? 'row-even' : ''); ?>">
                                                <td class="td-center"><?php echo e($iter); ?></td>
                                                <td class="td-name"><?php echo e($d->code); ?> - <?php echo e($d->name); ?></td>
                                                <td class="td-center"><?php echo e(number_format($price, 2)); ?></td>
                                                <td class="td-center"><?php echo e($qty); ?></td>
                                                <td class="td-center"><?php echo e($discount ?: '--'); ?></td>
                                                <td class="td-center"><?php echo e(number_format($lineTotal, 2)); ?></td>
                                            </tr>
                                            <?php $iter++; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>

                                    <?php if(isset($order) && !empty($order->services)): ?>
                                        <?php $__currentLoopData = $order->services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr class="<?php echo e($iter % 2 == 0 ? 'row-even' : ''); ?>">
                                                <td class="td-center"><?php echo e($iter); ?></td>
                                                <td class="td-name"><?php echo e($service->title); ?></td>
                                                <td class="td-center"><?php echo e(number_format($service->price, 2)); ?></td>
                                                <td class="td-center">1</td>
                                                <td class="td-center">--</td>
                                                <td class="td-center"><?php echo e(number_format($service->price, 2)); ?></td>
                                            </tr>
                                            <?php $iter++; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>

                                    
                                    <?php
                                        $totalWithoutTax = $order->total_without_tax ?? ($order->total - ($order->tax_value ?? 0));
                                        $taxValue        = $order->total - $totalWithoutTax;
                                        $hasTax          = $taxValue > 0;
                                        $hasDiscount     = $totalDiscount > 0;
                                    ?>
                                    <tr class="totals-row">
                                        <td class="totals-cell" colspan="6">
                                            <table class="totals-inner">
                                                <?php if($hasDiscount): ?>
                                                <tr class="t-discount">
                                                    <td class="t-lbl">إجمالي الخصم <span class="t-en">(Total Discount)</span> :</td>
                                                    <td class="t-val"><?php echo e(number_format($totalDiscount, 2)); ?> <span class="t-cur"><?php echo e($settings['currency'] ?? ''); ?></span></td>
                                                </tr>
                                                <?php endif; ?>

                                                <tr class="t-subtotal">
                                                    <td class="t-lbl">الإجمالى قبل الضريبة <span class="t-en">(Subtotal)</span> :</td>
                                                    <td class="t-val"><?php echo e(number_format($totalWithoutTax, 2)); ?> <span class="t-cur"><?php echo e($settings['currency'] ?? ''); ?></span></td>
                                                </tr>

                                                <?php if($hasTax): ?>
                                                <tr class="t-tax">
                                                    <td class="t-lbl">القيمة المضافة (<?php echo e($order->tax); ?>%) <span class="t-en">(VAT)</span> :</td>
                                                    <td class="t-val"><?php echo e(number_format($taxValue, 2)); ?> <span class="t-cur"><?php echo e($settings['currency'] ?? ''); ?></span></td>
                                                </tr>
                                                <?php endif; ?>

                                                <tr class="t-grand">
                                                    <td class="t-lbl">الإجمالى بعد الضريبة <span class="t-en">(Grand Total)</span> :</td>
                                                    <td class="t-grand-val"><?php echo e(number_format($order->total, 2)); ?> <span class="t-cur"><?php echo e($settings['currency'] ?? ''); ?></span></td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>

                            
                            <div class="quote-notice">
                                <strong>ملاحظة:</strong> هذا عرض سعر فقط وليس فاتورة نهائية. الأسعار سارية لمدة محددة.
                                <br>
                                <span class="en-note"><em>Note: This is a price quote, not a final invoice. Prices are valid for a limited period.</em></span>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('css'); ?>
<style>
/* ═══════════════════════════════════════
   متغيرات التصاميم
═══════════════════════════════════════ */
:root {
    --theme-primary:    #1a3c5e;
    --theme-primary-dk: #0d2a45;
    --theme-accent:     #c8960a;
    --theme-accent-lt:  #f0b429;
    --theme-row-alt:    #f4f7fc;
    --theme-lbl-bg:     #eef2f7;
}

/* ═══════════════════════════════════════
   الحاوية الرئيسية
═══════════════════════════════════════ */
#printInvoice {
    direction: rtl;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 12px;
    color: #111;
    max-width: 200mm;
    margin: 0 auto;
    padding: 0;
}
#printInvoice table { border-collapse: collapse; }
#printInvoice .row  { margin: 0 !important; }
#printInvoice [class*="col-"] { padding: 0 !important; float: none !important; width: 100% !important; }

/* ═══════════════════════════════════════
   عنوان عرض السعر
═══════════════════════════════════════ */
.inv-title-block {
    text-align: center;
    border-top: 3px solid var(--theme-primary);
    border-bottom: 3px solid var(--theme-primary);
    padding: 10px 0;
    margin-bottom: 8px;
    forced-color-adjust: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.inv-title-ar {
    font-size: 22px;
    font-weight: 900;
    color: var(--theme-primary);
    letter-spacing: 2px;
    line-height: 1.2;
}
.inv-subtitle {
    font-size: 13px;
    font-weight: bold;
    color: var(--theme-accent);
    margin-top: 4px;
}
.inv-number { font-size: 12px; color: #555; margin-top: 4px; }
.inv-number strong { color: var(--theme-accent); font-size: 14px; }

/* ═══════════════════════════════════════
   شريط المعلومات
═══════════════════════════════════════ */
.meta-table {
    width: 100%;
    table-layout: fixed;
    background: var(--theme-primary);
    color: #fff;
    margin-bottom: 8px;
    border-radius: 3px;
    forced-color-adjust: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.meta-table td { padding: 6px 8px; font-size: 13px; text-align: center; border: none; vertical-align: middle; }
.meta-lbl { display: block; color: var(--theme-accent-lt); font-weight: bold; font-size: 11px; margin-bottom: 2px; }

/* ═══════════════════════════════════════
   جداول السيارة / العميل
═══════════════════════════════════════ */
.info-wrap-table { width: 100%; table-layout: fixed; margin-bottom: 8px; border-collapse: collapse; }
.info-wrap-table > tbody > tr > td.info-half-cell { width: 50%; padding: 0 3px; vertical-align: top; border: none !important; }
.info-wrap-table > tbody > tr > td.info-half-cell:first-child { padding-right: 0; }
.info-wrap-table > tbody > tr > td.info-half-cell:last-child  { padding-left: 0; }

.info-tbl { width: 100%; table-layout: fixed; border-collapse: collapse; height: 100%; }
.info-tbl td { border: 1px solid #333; padding: 5px 8px; font-size: 13px; vertical-align: middle; }
.info-tbl .info-head {
    background: var(--theme-primary);
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    padding: 7px;
    forced-color-adjust: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.info-tbl .ilbl { background: var(--theme-lbl-bg); font-weight: bold; width: 42%; text-align: right; }
.info-tbl .ival { text-align: right; padding-right: 10px !important; width: 58%; }

/* ═══════════════════════════════════════
   ملاحظة
═══════════════════════════════════════ */
.note-tbl { width: 100%; margin-bottom: 6px; border-collapse: collapse; }
.note-tbl td { border: 1px solid var(--theme-accent); background: #fffbeb; padding: 5px 10px; font-size: 11px; text-align: right; }

/* ═══════════════════════════════════════
   جدول البنود
═══════════════════════════════════════ */
.items-tbl {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 0;
    border: 2px solid #333;
}
.items-tbl thead .items-head-row th {
    background: var(--theme-primary);
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    padding: 7px 4px;
    border: 1px solid var(--theme-primary-dk);
    line-height: 1.4;
    forced-color-adjust: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.items-tbl tbody tr td {
    border: 1px solid #333;
    padding: 6px 4px;
    font-size: 13px;
    font-weight: bold;
    vertical-align: middle;
}
.items-tbl tbody tr.row-even td { background: var(--theme-row-alt); }
.td-center { text-align: center; }
.td-name   { text-align: right; padding-right: 8px !important; }

/* ═══════════════════════════════════════
   صف الإجماليات
═══════════════════════════════════════ */
.totals-row > td { border: 1px solid #333; padding: 0; vertical-align: top; }
.totals-inner { width: 100%; border-collapse: collapse; }
.totals-inner td { border: 1px solid #333; padding: 5px 12px; font-size: 12px; font-weight: bold; vertical-align: middle; line-height: 1.4; }
.t-lbl { background: var(--theme-lbl-bg); text-align: right; width: 75%; }
.t-val { text-align: center; width: 25%; }
.t-en  { font-size: 10px; color: #666; font-weight: normal; }
.t-cur { font-size: 10px; color: #666; }
.t-grand .t-lbl,
.t-grand .t-grand-val {
    background: var(--theme-primary) !important;
    color: #fff !important;
    font-size: 13px !important;
    padding: 7px 12px !important;
    forced-color-adjust: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    text-align: center;
    width: 25%;
}
.t-grand .t-lbl { text-align: right; width: 75%; }
.t-grand .t-en  { color: var(--theme-accent-lt) !important; }
.t-grand .t-cur { color: var(--theme-accent-lt) !important; }
.totals-row { page-break-inside: avoid !important; break-inside: avoid !important; }

/* ═══════════════════════════════════════
   ملاحظة عرض السعر
═══════════════════════════════════════ */
.quote-notice {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 11px;
    border-right: 4px solid var(--theme-accent);
    background: #fffbeb;
    color: #555;
    text-align: right;
    border-radius: 4px;
}
.quote-notice strong { color: var(--theme-primary); }
.quote-notice .en-note { font-size: 10px; color: #888; }

/* ═══════════════════════════════════════
   إعدادات الطباعة
═══════════════════════════════════════ */
@media  print {
    @page  { margin: 8mm 5mm; }

    html, body { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .content-wrapper, .content, .row, .col-md-12, .box, .box-body, .box-success,
    .panel, .panel-default, .panel-body, .container, .container-fluid {
        display: block !important; float: none !important; width: 100% !important;
        max-width: 100% !important; margin: 0 !important; padding: 0 !important;
        border: none !important; box-shadow: none !important; background: transparent !important;
    }
    #printInvoice { width: 100% !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .hideprint, .box-header, .content-header, nav, header, footer,
    .sidebar, .main-sidebar, .navbar, .main-header { display: none !important; }

    /* ضمان الألوان */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .meta-table, .meta-table td        { background: var(--theme-primary) !important; color: #fff !important; }
    .meta-lbl                          { color: var(--theme-accent-lt) !important; }
    .info-tbl .info-head               { background: var(--theme-primary) !important; color: #fff !important; }
    .info-tbl .ilbl                    { background: var(--theme-lbl-bg) !important; }
    .items-tbl thead .items-head-row th { background: var(--theme-primary) !important; color: #fff !important; }
    .items-tbl tbody tr.row-even td    { background: var(--theme-row-alt) !important; }
    .t-lbl                             { background: var(--theme-lbl-bg) !important; }
    .t-grand .t-lbl, .t-grand .t-grand-val { background: var(--theme-primary) !important; color: #fff !important; }
    .t-grand .t-en, .t-grand .t-cur   { color: var(--theme-accent-lt) !important; }

    /* رأس الجدول يتكرر في كل صفحة */
    .pitems thead { display: table-header-group !important; }

    /* منع القطع */
    .items-tbl tbody tr { page-break-inside: avoid; break-inside: avoid; }
    .totals-row { page-break-inside: avoid !important; break-inside: avoid !important; }
    .info-wrap-table { page-break-inside: avoid; }
}
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('js'); ?>
<script>
var currentTheme = localStorage.getItem('offer_theme') || 'navy';
var themes = {
    navy:     { primary:'#1a3c5e', primaryDk:'#0d2a45', accent:'#c8960a', accentLt:'#f0b429', rowAlt:'#f4f7fc', lblBg:'#eef2f7' },
    green:    { primary:'#1b5e38', primaryDk:'#144d2c', accent:'#4caf50', accentLt:'#81c784', rowAlt:'#f1f8f2', lblBg:'#e8f5e9' },
    gray:     { primary:'#37474f', primaryDk:'#263238', accent:'#78909c', accentLt:'#b0bec5', rowAlt:'#f5f6f7', lblBg:'#eceff1' },
    burgundy: { primary:'#6a0f2a', primaryDk:'#4a0a1e', accent:'#c0392b', accentLt:'#e57373', rowAlt:'#fdf5f6', lblBg:'#fdf0f0' }
};
function openThemePicker() {
    document.getElementById('theme-modal').style.display = 'flex';
    document.querySelectorAll('.theme-card').forEach(function(c) {
        var active = c.getAttribute('data-theme') === currentTheme;
        var t = themes[c.getAttribute('data-theme')];
        c.style.border = active ? '2px solid ' + t.primary : '2px solid #ddd';
        c.style.background = active ? '#f0f4f8' : '#fff';
    });
}
function closeThemePicker() { document.getElementById('theme-modal').style.display = 'none'; }
function applyTheme(name) {
    currentTheme = name;
    localStorage.setItem('offer_theme', name);
    var t = themes[name], r = document.documentElement;
    r.style.setProperty('--theme-primary',    t.primary);
    r.style.setProperty('--theme-primary-dk', t.primaryDk);
    r.style.setProperty('--theme-accent',     t.accent);
    r.style.setProperty('--theme-accent-lt',  t.accentLt);
    r.style.setProperty('--theme-row-alt',    t.rowAlt);
    r.style.setProperty('--theme-lbl-bg',     t.lblBg);
    document.querySelectorAll('.theme-card').forEach(function(c) {
        var active = c.getAttribute('data-theme') === name;
        c.style.border = active ? '2px solid ' + t.primary : '2px solid #ddd';
        c.style.background = active ? '#f0f4f8' : '#fff';
    });
}
// تطبيق الثيم المحفوظ عند التحميل
document.addEventListener('DOMContentLoaded', function() {
    if (currentTheme && themes[currentTheme]) applyTheme(currentTheme);
});
document.addEventListener('click', function(e) {
    if (e.target === document.getElementById('theme-modal')) closeThemePicker();
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.front', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/mwarsha2023/public_html/test4.mwarsha.com/resources/views/offers/print.blade.php ENDPATH**/ ?>