/* ============================================================
 * pos-theme.css
 * ------------------------------------------------------------
 * إعادة تصميم شاشة نقطة البيع لتطابق ثيم الترويسة والشريط الجانبي.
 *
 * تنسيق فقط: لا تعديل على أي blade أو على pos.js.
 * كل المعرّفات والأصناف التي يعتمد عليها pos.js تبقى كما هي
 * (#pos_table, .pos_quantity, .pos_unit_price_inc_tax, .price_total,
 *  .pos-express-finalize, #pos-finalize, ...) — نغيّر المظهر فقط.
 *
 * ما كان قبل ذلك:
 * - ترويسة الجدول بلون بنفسجي رمادي عبر خاصية bgcolor في الـ HTML.
 * - بطاقات المجاميع بتدرّجات باستيل (أزرق/برتقالي/أخضر) لا تمتّ للثيم.
 * - لافتة رقم الفاتورة بتدرّج بنفسجي.
 * - أزرار الإجراءات بألوان متعدّدة بلا تدرّج بصري بين إجراء وآخر.
 *
 * المنهج: سطح محايد هادئ، لون واحد للتمييز (الكحلي/الأزرق)، وإبراز
 * إجراء الدفع الأساسي وحده. الأخضر يبقى للتأكيد النهائي فقط.
 * ============================================================ */

:root {
    --pos-navy:       #0d2b52;
    --pos-navy-soft:  #14375f;
    --pos-blue:       #1d5bd6;
    --pos-blue-hi:    #2a6ae8;
    --pos-green:      #1e9e63;
    --pos-green-hi:   #23b573;
    --pos-amber:      #b7791f;
    --pos-red:        #c0392b;
    --pos-line:       #e3e8f0;
    --pos-surface:    #ffffff;
    --pos-surface-2:  #f6f8fc;
    --pos-text:       #24344d;
    --pos-text-dim:   #6b7c93;
    --pos-radius:     10px;
}

/* ============================================================
 * 1. ترويسة الجدول
 * الـ blade يضع bgcolor="#8D8AA1" كخاصية HTML. الخاصية أضعف من
 * أي قاعدة CSS، فيكفي تعريف الخلفية هنا دون لمس القالب.
 * ============================================================ */

table#pos_table > thead > tr > th,
#pos_table thead th {
    background-color: var(--pos-navy) !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, .10) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .2px;
    padding: 10px 8px !important;
    vertical-align: middle !important;
    text-transform: none;
}

table#pos_table {
    background: var(--pos-surface) !important;
    border-radius: var(--pos-radius);
    overflow: hidden;
    border: 1px solid var(--pos-line) !important;
    box-shadow: 0 1px 3px rgba(16, 32, 64, .06);
}

/* أول وآخر خلية في الترويسة تأخذان انحناء الجدول */
table#pos_table > thead > tr > th:first-child { border-top-left-radius: var(--pos-radius); }
table#pos_table > thead > tr > th:last-child  { border-top-right-radius: var(--pos-radius); }

/* ============================================================
 * 2. صفوف المنتجات
 * ============================================================ */

table#pos_table > tbody > tr.product_row > td,
#pos_table tbody tr td {
    border-color: var(--pos-line) !important;
    color: var(--pos-text);
    font-size: 13px;
    padding: 8px !important;
    vertical-align: middle !important;
}

/* التخطيط المخطّط (striped) بلون خافت جداً بدل الرمادي الافتراضي */
table#pos_table.table-striped > tbody > tr:nth-of-type(odd),
table#pos_table > tbody > tr.product_row:nth-of-type(odd) {
    background-color: var(--pos-surface-2) !important;
}

table#pos_table > tbody > tr.product_row:hover {
    background-color: #eef3fb !important;
}

/* اسم المنتج هو المعلومة الأهم في الصف */
table#pos_table > tbody > tr.product_row > td:first-child {
    font-weight: 600;
    color: var(--pos-navy);
}

table#pos_table .text-link,
table#pos_table td a {
    color: var(--pos-blue) !important;
    text-decoration: none;
}

/* ============================================================
 * 3. الحقول داخل الجدول
 * حقول الأسعار والكميات تُقرأ وتُعدَّل كثيراً أثناء البيع،
 * فتستحق تباينًا واضحًا وحدودًا محسوسة.
 * ============================================================ */

table#pos_table input.form-control,
table#pos_table input.input_number,
table#pos_table input.pos_quantity,
table#pos_table input.pos_unit_price,
table#pos_table input.pos_unit_price_inc_tax,
table#pos_table input.pos_line_total {
    height: 32px !important;
    border: 1px solid #d5dde9 !important;
    border-radius: 7px !important;
    background: var(--pos-surface) !important;
    color: var(--pos-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

table#pos_table input.form-control:focus,
table#pos_table input.input_number:focus {
    border-color: var(--pos-blue) !important;
    box-shadow: 0 0 0 3px rgba(29, 91, 214, .13) !important;
    outline: none !important;
}

/* السعر شامل الضريبة هو الحقل الذي يراجعه الكاشير - يُميَّز بلمسة زرقاء */
table#pos_table td.price-after-tax-col input.pos_unit_price_inc_tax {
    border-color: #bcd0f0 !important;
    background: #f4f8ff !important;
    color: var(--pos-navy) !important;
}

/* إجمالي الصف */
table#pos_table span.pos_line_total_text,
table#pos_table span.pos_line_total_text1 {
    font-weight: 700;
    color: var(--pos-navy);
}

/* زر حذف الصف */
table#pos_table .pos_remove_row,
table#pos_table .btn-danger {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #c0392b !important;
    border-radius: 7px !important;
    padding: 5px 8px !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease;
}

table#pos_table .pos_remove_row:hover,
table#pos_table .btn-danger:hover {
    background: #fdecea !important;
    border-color: #f5c6c2 !important;
    color: #a5281b !important;
}

/* ============================================================
 * 4. صندوق البحث وشريط العميل
 * ============================================================ */

.pos-search-container {
    border: 1px solid #d5dde9 !important;
    border-radius: var(--pos-radius) !important;
    background: var(--pos-surface) !important;
    box-shadow: 0 1px 3px rgba(16, 32, 64, .05) !important;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pos-search-container:focus-within {
    border-color: var(--pos-blue) !important;
    box-shadow: 0 0 0 3px rgba(29, 91, 214, .12) !important;
}

.pos-search-input {
    border: 0 !important;
    box-shadow: none !important;
    font-size: 14px !important;
    color: var(--pos-text) !important;
    background: transparent !important;
}

.pos-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.pos-search-left-buttons > button,
.pos-search-right-buttons > button,
.btn-weighing-scale,
.pos_add_quick_product,
.btn-search-config {
    background: var(--pos-surface-2) !important;
    border: 0 !important;
    color: var(--pos-text-dim) !important;
    border-radius: 8px !important;
    transition: background-color .15s ease, color .15s ease;
}

.pos-search-left-buttons > button:hover,
.pos-search-right-buttons > button:hover,
.btn-weighing-scale:hover,
.pos_add_quick_product:hover,
.btn-search-config:hover {
    background: #e6edf9 !important;
    color: var(--pos-blue) !important;
}

/* مربّع العميل */
.input-group-addon {
    background: var(--pos-surface-2) !important;
    border-color: #d5dde9 !important;
    color: var(--pos-text-dim) !important;
    border-radius: 8px 0 0 8px !important;
}

html[dir="rtl"] .input-group-addon {
    border-radius: 0 8px 8px 0 !important;
}

.btn-add-customer {
    background: var(--pos-blue) !important;
    border-color: var(--pos-blue) !important;
    color: #fff !important;
    border-radius: 0 8px 8px 0 !important;
}

html[dir="rtl"] .btn-add-customer {
    border-radius: 8px 0 0 8px !important;
}

.btn-add-customer:hover {
    background: var(--pos-blue-hi) !important;
    border-color: var(--pos-blue-hi) !important;
}

/* ============================================================
 * 5. لافتة رقم الفاتورة
 * كانت بتدرّج بنفسجي دخيل. النمط المضمّن في الـ blade أقوى من
 * قاعدة عادية، فنستخدم !important دون تعديل القالب.
 * ============================================================ */

#next_invoice_no_box {
    background: var(--pos-surface) !important;
    background-image: none !important;
    border: 1px solid var(--pos-line) !important;
    border-left: 3px solid var(--pos-blue) !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: 0 1px 3px rgba(16, 32, 64, .05) !important;
    padding: 9px 14px !important;
    text-align: center;
}

html[dir="rtl"] #next_invoice_no_box {
    border-left: 1px solid var(--pos-line) !important;
    border-right: 3px solid var(--pos-blue) !important;
}

#next_invoice_no_box > i,
#next_invoice_no_box > span {
    color: var(--pos-text-dim) !important;
}

#next_invoice_no_value {
    background: #eaf1fd !important;
    color: var(--pos-navy) !important;
    font-size: 15px !important;
    padding: 3px 12px !important;
    border-radius: 20px !important;
}

/* ============================================================
 * 6. بطاقات المجاميع
 * كانت ثلاث بطاقات بتدرّجات باستيل متنافرة. الآن سطح واحد
 * هادئ، والتمييز باللون في الأرقام لا في الخلفيات.
 * ============================================================ */

.pos-totals-row table {
    background: var(--pos-surface) !important;
    border: 1px solid var(--pos-line) !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: 0 1px 3px rgba(16, 32, 64, .06) !important;
    overflow: hidden;
}

.pos-totals-row table > tbody > tr > td {
    background: var(--pos-surface) !important;
    background-image: none !important;
    border-color: var(--pos-line) !important;
    vertical-align: middle !important;
}

/* الصف الأول: البطاقات الثلاث */
.pos-totals-row table > tbody > tr:first-child > td {
    background: var(--pos-surface-2) !important;
    border-radius: 0 !important;
    padding: 12px 15px !important;
}

.pos-totals-row table > tbody > tr:first-child > td + td {
    border-left: 1px solid var(--pos-line) !important;
}

/* الأيقونات والعناوين داخل البطاقات */
.pos-totals-row .pull-center > i {
    color: var(--pos-text-dim) !important;
    font-size: 13px !important;
}

.pos-totals-row .pull-center > div {
    color: var(--pos-text-dim) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .2px;
}

/* الأرقام: هنا يقع التمييز اللوني */
.pos-totals-row .price_total {
    color: var(--pos-navy) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    padding: 2px 0 !important;
}

.pos-totals-row .order_tax_display {
    color: var(--pos-amber) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    padding: 2px 0 !important;
}

.pos-totals-row .total_including_tax {
    color: var(--pos-green) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    padding: 2px 0 !important;
}

.pos-totals-row b,
.pos-totals-row strong {
    color: var(--pos-text) !important;
    font-size: 13px;
}

.pos-totals-row input.form-control,
.pos-totals-row select.form-control {
    height: 32px !important;
    border: 1px solid #d5dde9 !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.pos-totals-row input.form-control:focus,
.pos-totals-row select.form-control:focus {
    border-color: var(--pos-blue) !important;
    box-shadow: 0 0 0 3px rgba(29, 91, 214, .13) !important;
}

/* ============================================================
 * 7. شريط الإجراءات السفلي
 * ============================================================ */

.pos-form-actions {
    background: var(--pos-surface) !important;
    border-top: 1px solid var(--pos-line) !important;
    box-shadow: 0 -2px 10px rgba(16, 32, 64, .07) !important;
    padding: 8px 6px !important;
}

.pos-form-actions > .col-md-12 > .btn {
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 13px !important;
    margin: 3px !important;
    box-shadow: none !important;
    transition: background-color .15s ease, border-color .15s ease,
                color .15s ease, transform .1s ease;
}

.pos-form-actions > .col-md-12 > .btn:active {
    transform: translateY(1px);
}

.pos-form-actions .btn i {
    font-size: 13px !important;
    margin-inline-end: 4px;
}

/* الإجراءات الثانوية: سطح محايد.
   المسودّة وعرض السعر والتعليق ليست دفعاً، فلا تُنافس زر الدفع بصرياً. */
.pos-form-actions .btn-draft,
.pos-form-actions .btn-quotation,
.pos-form-actions .btn-suspend,
.pos-form-actions .btn-profit-calc,
.pos-form-actions .btn-expense-voucher {
    background: var(--pos-surface-2) !important;
    background-image: none !important;
    border-color: #dae1ec !important;
    color: var(--pos-text) !important;
}

.pos-form-actions .btn-draft:hover,
.pos-form-actions .btn-quotation:hover,
.pos-form-actions .btn-suspend:hover,
.pos-form-actions .btn-profit-calc:hover,
.pos-form-actions .btn-expense-voucher:hover {
    background: #e9eff8 !important;
    border-color: #c7d3e4 !important;
    color: var(--pos-navy) !important;
}

/* الدفع بالبطاقة والآجل ودفع متعدّد: أزرق - إجراءات دفع لكنها ليست
   المسار الأسرع، فتأخذ لون الثيم دون أن تكون الأبرز. */
.pos-form-actions .btn-payment-card,
.pos-form-actions .btn-payment-credit,
.pos-form-actions .btn-multi-pay,
.pos-form-actions #pos-finalize {
    background: var(--pos-blue) !important;
    background-image: none !important;
    border-color: var(--pos-blue) !important;
    color: #fff !important;
}

.pos-form-actions .btn-payment-card:hover,
.pos-form-actions .btn-payment-credit:hover,
.pos-form-actions .btn-multi-pay:hover,
.pos-form-actions #pos-finalize:hover {
    background: var(--pos-blue-hi) !important;
    border-color: var(--pos-blue-hi) !important;
    color: #fff !important;
}

/* الدفع النقدي: الإجراء الأساسي والأكثر استخداماً على الطاولة */
.pos-form-actions .btn-payment-cash {
    background: var(--pos-green) !important;
    background-image: none !important;
    border-color: var(--pos-green) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(30, 158, 99, .28) !important;
}

.pos-form-actions .btn-payment-cash:hover {
    background: var(--pos-green-hi) !important;
    border-color: var(--pos-green-hi) !important;
}

/* الإلغاء: إجراء هدّام - محايد في السكون، أحمر عند المرور فقط */
.pos-form-actions .btn-cancel {
    background: var(--pos-surface-2) !important;
    background-image: none !important;
    border-color: #dae1ec !important;
    color: var(--pos-text-dim) !important;
}

.pos-form-actions .btn-cancel:hover {
    background: #fdecea !important;
    border-color: #f3c9c4 !important;
    color: var(--pos-red) !important;
}

/* إجمالي المبلغ المستحق في شريط الموبايل */
.pos-form-actions #total_payable {
    color: var(--pos-green) !important;
    font-weight: 700 !important;
}

/* ============================================================
 * 8. قائمة اقتراحات البحث
 * ============================================================ */

.ui-autocomplete {
    border: 1px solid var(--pos-line) !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: 0 8px 24px rgba(16, 32, 64, .14) !important;
    padding: 5px !important;
    background: var(--pos-surface) !important;
}

.ui-autocomplete .ui-menu-item > div,
.ui-autocomplete .ui-menu-item a {
    border-radius: 7px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    color: var(--pos-text) !important;
    border: 0 !important;
}

.ui-autocomplete .ui-menu-item > div.ui-state-active,
.ui-autocomplete .ui-menu-item > div:hover {
    background: #eaf1fd !important;
    color: var(--pos-navy) !important;
    border: 0 !important;
    margin: 0 !important;
}

/* ============================================================
 * 9. النوافذ المنبثقة (الدفع، الخصم، الضريبة)
 * ============================================================ */

#modal_payment .modal-header,
.payment_modal .modal-header,
#edit_discount_modal .modal-header,
#edit_order_tax_modal .modal-header {
    background: var(--pos-navy) !important;
    background-image: none !important;
    color: #fff !important;
    border-bottom: 0 !important;
    border-radius: var(--pos-radius) var(--pos-radius) 0 0;
}

#modal_payment .modal-header .modal-title,
.payment_modal .modal-header .modal-title,
#edit_discount_modal .modal-header .modal-title,
#edit_order_tax_modal .modal-header .modal-title {
    color: #fff !important;
    font-weight: 600;
}

#modal_payment .modal-header .close,
.payment_modal .modal-header .close {
    color: #fff !important;
    opacity: .85;
    text-shadow: none;
}

#modal_payment .modal-content,
.payment_modal .modal-content {
    border: 0 !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: 0 12px 40px rgba(16, 32, 64, .22) !important;
}

/* ============================================================
 * 10. الموبايل
 * ============================================================ */

@media (max-width: 767px) {
    table#pos_table > thead > tr > th {
        font-size: 11px !important;
        padding: 8px 5px !important;
    }

    table#pos_table > tbody > tr.product_row > td {
        padding: 6px 5px !important;
        font-size: 12px;
    }

    .pos-form-actions > .col-md-12 > .btn {
        font-size: 12px !important;
        padding: 8px 9px !important;
        margin: 2px !important;
    }

    .pos-totals-row table > tbody > tr:first-child > td {
        padding: 9px 7px !important;
    }

    .pos-totals-row .price_total,
    .pos-totals-row .order_tax_display,
    .pos-totals-row .total_including_tax {
        font-size: 15px !important;
    }
}

/* ============================================================
 * 11. تخطيط رصيف جانبي  (شاشات ≥ 1200px)
 * ------------------------------------------------------------
 * المشكلة البنيوية: الشاشة عمود واحد، فيبقى فراغ كبير بين الجدول
 * وشريط أزرار سفلي من عشرة أزرار متساوية الوزن، و"الإجمالي المستحق"
 * - أهم رقم على الشاشة - مدفون في أسفل اليمين.
 *
 * الحل: تثبيت المجاميع والأزرار في عمود يميني دائم الظهور، وترك
 * السلة تملأ اليسار. هذا هو تخطيط أجهزة نقاط البيع الفعلية.
 *
 * تنسيق فقط: لا نُحرّك أي عنصر في الـ DOM. نستعمل position:fixed
 * على .pos-totals-row و .pos-form-actions - وكلاهما موجود أصلاً -
 * فيبقى pos.js يجدهما بنفس المحدّدات تماماً.
 * ============================================================ */

@media (min-width: 1200px) {

    /* 340px كان أوسع مما يلزم لصفوف مجاميع مضغوطة وأزرار في عمودين.
       310px يكفيها ويعيد 30px إلى السلة حيث الجدول بحاجة لكل بكسل. */
    :root { --pos-rail: 310px; }

    /* السلة تفسح مكاناً للرصيف */
    body.pos-with-sidebar .content,
    .pos-with-sidebar section.content {
        padding-inline-end: calc(var(--pos-rail) + 18px) !important;
    }

    /* ---------- بطاقة المجاميع أعلى الرصيف ---------- */
    .pos-totals-row {
        position: fixed !important;
        top: 92px;
        inset-inline-end: 14px;
        width: var(--pos-rail);
        margin: 0 !important;
        z-index: 830;
    }

    .pos-totals-row > .col-md-12 {
        width: 100% !important;
        padding: 0 !important;
        float: none !important;
    }

    /* الأعمدة الثلاثة تصبح صفوفاً رأسية داخل بطاقة واحدة */
    .pos-totals-row table,
    .pos-totals-row table > tbody,
    .pos-totals-row table > tbody > tr {
        display: block !important;
        width: 100% !important;
    }

    .pos-totals-row table > tbody > tr > td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-top: 0 !important;
        border-bottom: 1px solid var(--pos-line) !important;
        padding: 9px 14px !important;
        text-align: start !important;
    }

    .pos-totals-row table > tbody > tr > td:last-child {
        border-bottom: 0 !important;
    }

    /* الأيقونة والعنوان يساراً، الرقم يميناً - سطر واحد لكل مجموع */
    .pos-totals-row .pull-center {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 10px;
    }

    /* إخفاء الأيقونات الزخرفية فقط (حاسبة/نسبة/نقود) لأنها تزاحم السطر
       في رصيف ضيّق. محدّدة بالاسم صراحةً حتى لا تطال بالخطأ أيقونات
       fa-edit التفاعلية (#pos-edit-discount, #pos-edit-tax, الشحن)
       التي تفتح نوافذ التعديل - وهي ليست أبناءً مباشرين لـ .pull-center
       أصلاً، لكن التخصيص بالاسم يجعل ذلك مضموناً. */
    .pos-totals-row .pull-center > i.fa-calculator,
    .pos-totals-row .pull-center > i.fa-percent,
    .pos-totals-row .pull-center > i.fa-money {
        display: none !important;
    }

    .pos-totals-row .pull-center > div {
        margin: 0 !important;
        white-space: nowrap;
    }

    /* الإجمالي شامل الضريبة: أبرز رقم في الرصيف */
    .pos-totals-row .total_including_tax {
        font-size: 24px !important;
        letter-spacing: -.4px;
    }

    /* ---------- الأزرار أسفل الرصيف ---------- */
    .pos-form-actions {
        position: fixed !important;
        inset-inline-end: 14px;
        inset-inline-start: auto !important;
        bottom: 14px;
        width: var(--pos-rail);
        background: var(--pos-surface) !important;
        border: 1px solid var(--pos-line) !important;
        border-radius: var(--pos-radius) !important;
        box-shadow: 0 6px 22px rgba(16, 32, 64, .13) !important;
        padding: 10px !important;
        z-index: 830;
    }

    .pos-form-actions > .col-md-12 {
        width: 100% !important;
        padding: 0 !important;
        float: none !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .pos-form-actions > .col-md-12 > .btn {
        margin: 0 !important;
        width: 100% !important;
        justify-content: center;
        display: inline-flex !important;
        align-items: center;
    }

    /* الدفع النقدي يمتدّ على العرض كاملاً: المسار الأسرع لإنهاء البيع */
    .pos-form-actions > .col-md-12 > .btn-payment-cash {
        grid-column: 1 / -1;
        font-size: 15px !important;
        padding: 12px !important;
    }

    /* الإجمالي المستحق فوق الأزرار، بحجم يليق بأهمّيته */
    .pos-form-actions > .col-md-12 > .text-right,
    .pos-form-actions > .col-md-12 > div:has(#total_payable) {
        grid-column: 1 / -1;
        display: flex !important;
        align-items: baseline;
        justify-content: space-between;
        padding: 4px 4px 8px 4px;
        border-bottom: 1px solid var(--pos-line);
        margin-bottom: 3px;
    }

    .pos-form-actions #total_payable {
        font-size: 26px !important;
        line-height: 1.1 !important;
    }

    /* السلة تمتدّ لملء الارتفاع بدل ترك فراغ ميت تحت الجدول */
    .pos-with-sidebar .box.box-solid.mb-12 {
        min-height: calc(100vh - 150px);
    }
}

/* ============================================================
 * 12. شريط نقطة البيع العلوي
 * ------------------------------------------------------------
 * الشريط هو `.pos-header` - عنصر div مستقل وليس داخل
 * `.main-header .navbar`، ولهذا لم تطاله قواعد ثيم الترويسة.
 *
 * كان صفاً من مربّعات ملوّنة (أخضر/أحمر/برتقالي/أزرق/رمادي) بحجم
 * واحد ووزن بصري واحد، فلا يُعرف منها الشائع من النادر ولا الآمن
 * من الهدّام. نوحّدها على سطح كحلي، ونُبقي الأحمر للإجراء الهدّام
 * وحده كتمييز وظيفي.
 * ============================================================ */

.pos-header {
    background: var(--pos-navy) !important;
    padding: 8px 14px !important;
    margin: 0 0 12px 0 !important;
    border-radius: 0 0 var(--pos-radius) var(--pos-radius);
    box-shadow: 0 2px 8px rgba(16, 32, 64, .16);
}

/* نص الموقع والتاريخ */
.pos-header p,
.pos-header strong,
.pos-header .form-control {
    color: #dce6f5 !important;
}

.pos-header p strong {
    font-weight: 600;
}

.pos-header .form-control {
    background: rgba(255, 255, 255, .10) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 7px !important;
    color: #fff !important;
    height: 30px !important;
    font-size: 13px !important;
}

.pos-header .text-muted,
.pos-header .fa-keyboard {
    color: #93a9c8 !important;
}

/* زر قائمة نقطة البيع */
.pos-header .pos-sidebar-toggle {
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 8px !important;
    color: #dce6f5 !important;
    transition: background-color .15s ease;
}

.pos-header .pos-sidebar-toggle:hover {
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
}

/* ---------- أزرار الإجراءات ---------- */
.pos-header .btn,
.pos-header .btn-flat,
.pos-header .btn-xs {
    background: rgba(255, 255, 255, .11) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 8px !important;
    color: #dce6f5 !important;
    box-shadow: none !important;
    min-height: 34px !important;
    padding: 6px 11px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 3px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color .15s ease, border-color .15s ease,
                color .15s ease, transform .1s ease;
}

.pos-header .btn:hover,
.pos-header .btn:focus {
    background: rgba(255, 255, 255, .2) !important;
    border-color: rgba(255, 255, 255, .32) !important;
    color: #fff !important;
}

.pos-header .btn:active {
    transform: translateY(1px);
}

.pos-header .btn i {
    font-size: 14px !important;
    margin: 0 !important;
}

/* الرئيسية: الإجراء الأبرز في الشريط */
.pos-header .btn.btn-success:not(.btn-modal),
.pos-header a.btn[href*="home"] {
    background: var(--pos-blue) !important;
    border-color: var(--pos-blue) !important;
    color: #fff !important;
}

.pos-header .btn.btn-success:not(.btn-modal):hover,
.pos-header a.btn[href*="home"]:hover {
    background: var(--pos-blue-hi) !important;
    border-color: var(--pos-blue-hi) !important;
}

/* الإجراء الهدّام (إغلاق الصندوق) يحتفظ بالأحمر - تمييز وظيفي */
.pos-header .btn.btn-danger {
    background: rgba(214, 69, 69, .24) !important;
    background-image: none !important;
    border-color: rgba(214, 69, 69, .5) !important;
    color: #ffb3b3 !important;
}

.pos-header .btn.btn-danger:hover {
    background: var(--pos-red) !important;
    border-color: var(--pos-red) !important;
    color: #fff !important;
}

/* حقل التاريخ/الموقع لا يلتصق بالحافة */
.pos-header .row > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}


/* ============================================================
 * 13. نافذة آخر العمليات
 * ------------------------------------------------------------
 * المشكلة: ترويسة الجدول سوداء (.table-dark)، وأزرار الإجراءات
 * ضخمة تبدو كصناديق داخل صناديق - لأن ملفات أخرى تضيف خلفية
 * للأيقونة داخل زر ملوّن أصلاً - وزر بحث أخضر لا يمتّ للثيم.
 *
 * الجزئية المضمّنة في الـ partial تفرض ألواناً بـ !important،
 * وهذا الملف يُحمَّل بعدها فتفوز قواعده.
 * ============================================================ */

.recent_transactions_modal .modal-content,
#recent_transactions_modal .modal-content {
    border: 0 !important;
    border-radius: var(--pos-radius) !important;
    box-shadow: 0 16px 48px rgba(16, 32, 64, .24) !important;
}

.recent_transactions_modal .modal-header,
#recent_transactions_modal .modal-header {
    border-bottom: 1px solid var(--pos-line) !important;
    padding: 15px 20px !important;
}

.recent_transactions_modal .modal-title,
#recent_transactions_modal .modal-title {
    color: var(--pos-navy) !important;
    font-weight: 700 !important;
    font-size: 17px !important;
}

/* ---------- التبويبات ---------- */
.recent_transactions_modal .nav-tabs,
#recent_transactions_modal .nav-tabs {
    border-bottom: 1px solid var(--pos-line) !important;
    padding: 0 14px;
}

.recent_transactions_modal .nav-tabs > li > a,
#recent_transactions_modal .nav-tabs > li > a {
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    color: var(--pos-text-dim) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    background: transparent !important;
}

.recent_transactions_modal .nav-tabs > li > a:hover,
#recent_transactions_modal .nav-tabs > li > a:hover {
    color: var(--pos-navy) !important;
    background: transparent !important;
    border-bottom-color: #c7d3e4 !important;
}

.recent_transactions_modal .nav-tabs > li.active > a,
.recent_transactions_modal .nav-tabs > li.active > a:hover,
.recent_transactions_modal .nav-tabs > li.active > a:focus,
#recent_transactions_modal .nav-tabs > li.active > a {
    color: var(--pos-blue) !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid var(--pos-blue) !important;
}

/* ---------- شريط البحث ---------- */
.recent_transactions_modal .input-group .form-control,
#recent_transactions_modal .input-group .form-control {
    height: 38px !important;
    border: 1px solid #d5dde9 !important;
    box-shadow: none !important;
    font-size: 14px !important;
}

.recent_transactions_modal .input-group .form-control:focus,
#recent_transactions_modal .input-group .form-control:focus {
    border-color: var(--pos-blue) !important;
    box-shadow: 0 0 0 3px rgba(29, 91, 214, .12) !important;
}

/* زر البحث كان أخضر بلا مبرّر - الأخضر محجوز لتأكيد الدفع */
.recent_transactions_modal .input-group-btn > .btn,
.recent_transactions_modal .btn-success,
#recent_transactions_modal .input-group-btn > .btn,
#recent_transactions_modal .btn-success {
    background: var(--pos-blue) !important;
    background-image: none !important;
    border: 1px solid var(--pos-blue) !important;
    color: #fff !important;
    height: 38px !important;
    padding: 0 18px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.recent_transactions_modal .input-group-btn > .btn:hover,
.recent_transactions_modal .btn-success:hover,
#recent_transactions_modal .btn-success:hover {
    background: var(--pos-blue-hi) !important;
    border-color: var(--pos-blue-hi) !important;
}

/* ---------- الجدول ---------- */
.recent-transactions-table {
    border: 1px solid var(--pos-line) !important;
    border-radius: var(--pos-radius) !important;
    overflow: hidden;
    margin-bottom: 0 !important;
}

.recent-transactions-table > thead > tr > th,
.recent-transactions-table > thead > tr > th.table-dark {
    background: var(--pos-surface-2) !important;
    background-color: var(--pos-surface-2) !important;
    color: var(--pos-text-dim) !important;
    border-bottom: 1px solid var(--pos-line) !important;
    border-top: 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .3px;
    padding: 10px 12px !important;
}

.recent-transactions-table > tbody > tr > td {
    border-top: 1px solid var(--pos-line) !important;
    color: var(--pos-text) !important;
    font-size: 13px !important;
    padding: 9px 12px !important;
    vertical-align: middle !important;
}

.recent-transactions-table > tbody > tr:hover > td {
    background: #f2f6fd !important;
}

/* رقم الفاتورة مفتاح الصف */
.recent-transactions-table > tbody > tr > td:first-child {
    font-weight: 700 !important;
    color: var(--pos-navy) !important;
    font-variant-numeric: tabular-nums;
}

/* القيمة تُقارَن بين الصفوف - أرقام جدولية للمحاذاة */
.recent-transactions-table > tbody > tr > td.display_currency {
    font-weight: 700 !important;
    color: var(--pos-navy) !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- أزرار الإجراءات ----------
   كانت مربّعات ضخمة متداخلة (خلفية على الزر وأخرى على الأيقونة).
   الآن أزرار أيقونية مسطّحة متساوية، ولونها يظهر عند المرور فقط. */
.recent-transactions-table td .btn,
.recent-transactions-table .btn.btn-sm,
.recent-transactions-table .btn-primary,
.recent-transactions-table .btn-info,
.recent-transactions-table .btn-danger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 3px !important;
    background: var(--pos-surface-2) !important;
    background-color: var(--pos-surface-2) !important;
    background-image: none !important;
    border: 1px solid #dae1ec !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    color: var(--pos-text-dim) !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.recent-transactions-table td .btn i,
.recent-transactions-table .btn i {
    display: inline-block !important;
    font-size: 13px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: inherit !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.recent-transactions-table .btn-primary:hover {
    background: #eaf1fd !important;
    border-color: #b9cdf0 !important;
    color: var(--pos-blue) !important;
}

.recent-transactions-table .btn-info:hover {
    background: #e8eef7 !important;
    border-color: #c2d0e4 !important;
    color: var(--pos-navy) !important;
}

.recent-transactions-table .btn-danger:hover {
    background: #fdecea !important;
    border-color: #f3c9c4 !important;
    color: var(--pos-red) !important;
}

/* ارتفاع محدود مع تمرير بدل نافذة تطول بلا نهاية */
.recent_transactions_modal .modal-body,
#recent_transactions_modal .modal-body {
    max-height: 68vh;
    overflow-y: auto;
    padding: 0 0 12px 0 !important;
}


/* ============================================================
 * 14. معالجة تراكب نص الموقع في الشريط العلوي
 * ------------------------------------------------------------
 * "Location:" يُكتب داخل <strong> مع الاسم والتاريخ في فقرة واحدة
 * بـ direction:ltr مضمّن، فيتراكب النص العربي مع الإنجليزي.
 * flex-wrap مع فجوة يفصل العناصر دون تعديل القالب.
 * ============================================================ */

.pos-header .row > .col-md-6:first-child > div {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 8px;
    direction: ltr;
}

.pos-header .row > .col-md-6:first-child p {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 !important;
    line-height: 1.5 !important;
    font-size: 13px !important;
}

/* اسم المنشأة عربي داخل فقرة ltr - يُعزل باتجاهه الصحيح */
.pos-header .row > .col-md-6:first-child p {
    unicode-bidi: isolate;
}

.pos-header .row > .col-md-6:first-child strong {
    flex: 0 0 auto;
    white-space: nowrap;
    color: #93a9c8 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* حقل اختيار الموقع لا يفيض */
.pos-header .row > .col-md-6:first-child div[style*="width"] {
    width: auto !important;
    min-width: 150px;
    margin: 0 !important;
}

/* ---------- تجميع أزرار الشريط ---------- */
/* تسعة أيقونات بلا فواصل تُقرأ كصفّ واحد بلا معنى. مسافة أوسع
   حول الإجراء الرئيسي (الرئيسية) تفصل التنقّل عن أدوات البيع. */
.pos-header .row > .col-md-6:last-child {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 2px;
}

.pos-header .btn.btn-success:not(.btn-modal),
.pos-header a.btn[href*="home"] {
    margin-inline-start: 10px !important;
}

/* الأيقونات المجرّدة تحتاج تلميحاً واضحاً عند المرور */
.pos-header .btn[title]:hover {
    position: relative;
}


/* ============================================================
 * 15. توسيع لوحة السلة
 * ------------------------------------------------------------
 * حين يكون hide_product_suggestion=1 يستعمل القالب
 * `col-md-10 col-md-offset-1`، فيضيع ~16% من العرض في هامش
 * offset لا لزوم له بعد وجود الرصيف الجانبي. النتيجة جدول مضغوط
 * يُقتطع عموده الأخير ويظهر شريط تمرير أفقي.
 *
 * نُلغي الـ offset ونمنح العمود العرض الكامل المتاح، فيتّسع الجدول
 * لكل أعمدته. تنسيق فقط - لا تعديل على أصناف القالب.
 * ============================================================ */

@media (min-width: 1200px) {

    .pos-with-sidebar .col-md-10.col-md-offset-1,
    section.content .col-md-10.col-md-offset-1 {
        width: 100% !important;
        margin-inline-start: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-inline-start: 0 !important;
    }

    /* حاوية المحتوى نفسها بحشو أقل لتكسب السلة عرضاً إضافياً */
    .pos-with-sidebar section.content,
    body.pos-with-sidebar .content {
        padding-inline-start: 10px !important;
    }

    /* الصندوق يملأ العرض ولا يفرض حداً أدنى يدفع الجدول للانكماش */
    .pos-with-sidebar .box.box-solid.mb-12 {
        width: 100% !important;
    }

    .pos-with-sidebar .box-body.pb-0 {
        padding-inline-start: 14px !important;
        padding-inline-end: 14px !important;
    }

    /* الجدول يستعمل كامل العرض المتاح */
    table#pos_table {
        width: 100% !important;
        table-layout: auto !important;
    }

    /* أعمدة الأسعار الضيّقة لا تُجبَر على الالتفاف سطرين */
    table#pos_table > thead > tr > th {
        white-space: nowrap;
        padding: 9px 6px !important;
        font-size: 11.5px !important;
    }

    /* عمود المنتج يأخذ ما يفيض ليبقى الاسم مقروءاً */
    table#pos_table > thead > tr > th:first-child {
        width: auto !important;
        min-width: 180px;
    }
}

/* الشريط الأفقي - إن ظهر على شاشة أضيق - يبقى غير مزعج */
.box-body::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.box-body::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: #c7d3e4;
    border-radius: 4px;
}

.box-body::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}


/* ============================================================
 * 16. زر قائمة نقطة البيع يتراكب مع نص الموقع
 * ------------------------------------------------------------
 * الـ partial يضع `.pos-sidebar-toggle` بـ position:absolute على
 * left:8px (أو right:8px في RTL) بارتفاع 40px، بينما فقرة
 * "LOCATION: ..." تبدأ من نفس النقطة - فيجلس الزر فوق النص.
 *
 * الحل: إخراجه من التموضع المطلق وجعله عنصراً في التدفّق داخل
 * ترويسة مرنة، فيأخذ مكانه ويُزيح النص بدل أن يعلوه.
 * ============================================================ */

.pos-header {
    display: flex !important;
    align-items: center;
    gap: 10px;
    position: relative;
}

.pos-header .pos-sidebar-toggle {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    flex: 0 0 auto;
    width: 38px !important;
    height: 38px !important;
    background: rgba(255, 255, 255, .12) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    box-shadow: none !important;
    font-size: 16px !important;
}

.pos-header .pos-sidebar-toggle:hover {
    background: rgba(255, 255, 255, .22) !important;
    background-image: none !important;
}

/* الصف الداخلي يملأ ما تبقّى بعد الزر */
.pos-header > .row {
    flex: 1 1 auto;
    margin: 0 !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

/* لا حاجة لحشو يساري كان يفسح مكاناً للزر المطلق */
.pos-header .row > .col-md-6:first-child {
    padding-inline-start: 0 !important;
}

.pos-header .row > .col-md-6:first-child > div {
    margin: 0 !important;
}


/* ============================================================
 * 17. توسيع نافذة آخر العمليات + إزالة المربّعات الشبحية
 * ------------------------------------------------------------
 * المربّع الرمادي خلف كل أيقونة هو عنصر زائف (::before/::after)
 * يأتي من نمط الجداول المتجاوبة الذي يحقن تسمية العمود قبل الخلية.
 * يوجد في المشروع ملف recent-transactions-fix.css كُتب لهذا الغرض
 * تحديداً لكنه غير مُحمَّل إطلاقاً، فبقيت المشكلة. نُعالجها هنا.
 * ============================================================ */

/* عرض أوسع: الجدول أربعة أعمدة وأرقام فواتير وأسماء عملاء */
#recent_transactions_modal .modal-dialog,
.recent_transactions_modal .modal-dialog {
    width: 92% !important;
    max-width: 1100px !important;
    margin: 24px auto !important;
}

@media (max-width: 992px) {
    #recent_transactions_modal .modal-dialog {
        width: 96% !important;
    }
}

/* ---------- إزالة العناصر الزائفة داخل النافذة ---------- */
#recent_transactions_modal td::before,
#recent_transactions_modal td::after,
#recent_transactions_modal th::before,
#recent_transactions_modal th::after,
#recent_transactions_modal .btn::before,
#recent_transactions_modal .btn::after,
#recent_transactions_modal a.btn::before,
#recent_transactions_modal a.btn::after,
.recent-transactions-table td::before,
.recent-transactions-table td::after,
.recent-transactions-table .btn::before,
.recent-transactions-table .btn::after,
.recent-transactions-table a.btn::before,
.recent-transactions-table a.btn::after {
    content: none !important;
    display: none !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ملاحظة: لا نلمس `i::before` إطلاقاً - فهو ما ترسم به Font Awesome
   الأيقونة نفسها. القواعد أعلاه مقصورة على ::before الخاص بالخلايا
   والأزرار، لا الأيقونات. */

/* ---------- خلية الإجراءات ---------- */
.recent-transactions-table > tbody > tr > td:last-child {
    white-space: nowrap;
    text-align: center;
    width: 1%;
}

/* ---------- توزيع الأعمدة ---------- */
.recent-transactions-table > thead > tr > th:nth-child(1) { width: 15%; }
.recent-transactions-table > thead > tr > th:nth-child(2) { width: 45%; }
.recent-transactions-table > thead > tr > th:nth-child(3) { width: 20%; }
.recent-transactions-table > thead > tr > th:nth-child(4) { width: 20%; }

/* ---------- زر الإغلاق ---------- */
#recent_transactions_modal .modal-footer,
.recent_transactions_modal .modal-footer {
    border-top: 1px solid var(--pos-line) !important;
    padding: 12px 20px !important;
    background: var(--pos-surface-2) !important;
    border-radius: 0 0 var(--pos-radius) var(--pos-radius);
}

#recent_transactions_modal .modal-footer .btn,
.recent_transactions_modal .modal-footer .btn,
#recent_transactions_modal .btn-default {
    background: var(--pos-surface) !important;
    background-image: none !important;
    border: 1px solid #dae1ec !important;
    border-radius: 8px !important;
    color: var(--pos-text) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 20px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    width: auto !important;
    height: auto !important;
}

#recent_transactions_modal .modal-footer .btn:hover,
.recent_transactions_modal .modal-footer .btn:hover {
    background: #e9eff8 !important;
    border-color: #c7d3e4 !important;
    color: var(--pos-navy) !important;
}


/* ============================================================
 * 18. جدول آخر العمليات - بنية جديدة
 * ------------------------------------------------------------
 * أُعيد بناء الـ partial بجدول HTML كامل: أعمدة للتاريخ وعدد
 * الأصناف والخصم والضريبة والمدفوع والمتبقّي وحالة السداد،
 * مع ترقيم صفحات بدل limit(10) الثابت.
 *
 * أصناف rt-* جديدة خاصة بهذا الجدول، فلا تتعارض مع أي ملف قائم
 * ولا تحتاج !important لتفوز.
 * ============================================================ */

.rt-wrap {
    padding: 0 16px 4px 16px;
}

.rt-table-scroll {
    border: 1px solid var(--pos-line);
    border-radius: var(--pos-radius);
    overflow-x: auto;
    overflow-y: visible;
    background: var(--pos-surface);
}

table.rt-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* ---------- الترويسة ---------- */
table.rt-table > thead > tr > th {
    background: var(--pos-surface-2);
    color: var(--pos-text-dim);
    border: 0;
    border-bottom: 1px solid var(--pos-line);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    padding: 10px 10px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ---------- الصفوف ---------- */
table.rt-table > tbody > tr > td {
    border: 0;
    border-bottom: 1px solid #eef1f6;
    padding: 9px 10px;
    vertical-align: middle;
    color: var(--pos-text);
}

table.rt-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

table.rt-table > tbody > tr:hover > td {
    background: #f4f8ff;
}

/* ---------- الأعمدة ---------- */
.rt-col-inv       { width: 1%; white-space: nowrap; }
.rt-col-date      { width: 1%; white-space: nowrap; }
.rt-col-num       { width: 1%; text-align: center; }
.rt-col-money     { width: 1%; text-align: end; white-space: nowrap; }
.rt-col-status    { width: 1%; text-align: center; }
.rt-col-actions   { width: 1%; white-space: nowrap; text-align: center; }
.rt-col-customer  { min-width: 170px; }

.rt-invoice {
    font-weight: 700;
    color: var(--pos-navy);
    font-variant-numeric: tabular-nums;
}

.rt-date, .rt-time, .rt-customer, .rt-mobile, .rt-table-name {
    display: block;
    line-height: 1.35;
}

.rt-date { font-weight: 600; }
.rt-time, .rt-mobile { font-size: 11px; color: var(--pos-text-dim); }

.rt-customer { font-weight: 600; }

.rt-table-name {
    font-size: 11px;
    color: var(--pos-blue);
}

/* الأرقام تُقارَن رأسياً - أرقام جدولية للمحاذاة */
.rt-col-money, .rt-col-num {
    font-variant-numeric: tabular-nums;
}

.rt-col-total {
    font-weight: 700;
    color: var(--pos-navy);
}

/* المتبقّي غير الصفري هو ما يحتاج انتباهاً */
.rt-due-open {
    color: var(--pos-red);
    font-weight: 700;
}

/* ---------- شارات حالة السداد ---------- */
.rt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.rt-badge-paid    { background: #e4f6ed; color: #10794b; }
.rt-badge-partial { background: #fdf2dd; color: #96660f; }
.rt-badge-due     { background: #fdecea; color: #a5281b; }

/* ---------- أزرار الإجراءات ---------- */
.rt-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 2px;
    border: 1px solid #dae1ec;
    border-radius: 7px;
    background: var(--pos-surface-2);
    color: var(--pos-text-dim);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.rt-act:hover, .rt-act:focus {
    text-decoration: none;
}

.rt-act i {
    font-size: 12px;
    line-height: 1;
}

.rt-act-edit:hover   { background: #eaf1fd; border-color: #b9cdf0; color: var(--pos-blue); }
.rt-act-print:hover  { background: #e8eef7; border-color: #c2d0e4; color: var(--pos-navy); }
.rt-act-return:hover { background: #fdecea; border-color: #f3c9c4; color: var(--pos-red); }

/* ---------- ترقيم الصفحات ---------- */
.rt-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 2px 2px 2px;
}

.rt-pagination-info {
    font-size: 12px;
    color: var(--pos-text-dim);
    font-variant-numeric: tabular-nums;
}

.rt-pagination .pagination {
    margin: 0;
    display: inline-flex;
    gap: 4px;
}

.rt-pagination .pagination > li > a,
.rt-pagination .pagination > li > span,
.rt-pagination .page-item .page-link {
    border: 1px solid #dae1ec;
    border-radius: 7px;
    color: var(--pos-text);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 11px;
    background: var(--pos-surface);
    line-height: 1.3;
}

.rt-pagination .pagination > li > a:hover,
.rt-pagination .page-item .page-link:hover {
    background: #eaf1fd;
    border-color: #b9cdf0;
    color: var(--pos-blue);
}

.rt-pagination .pagination > .active > a,
.rt-pagination .pagination > .active > span,
.rt-pagination .page-item.active .page-link {
    background: var(--pos-blue);
    border-color: var(--pos-blue);
    color: #fff;
}

.rt-pagination .pagination > .disabled > span,
.rt-pagination .page-item.disabled .page-link {
    background: var(--pos-surface-2);
    color: #b6c1d1;
    border-color: #e6ebf3;
}

/* ---------- حالة فارغة ---------- */
.rt-empty {
    text-align: center;
    padding: 42px 20px;
    color: var(--pos-text-dim);
}

.rt-empty i {
    font-size: 34px;
    opacity: .35;
    margin-bottom: 12px;
    display: block;
}

.rt-empty p {
    margin: 0;
    font-size: 14px;
}

/* ---------- الموبايل ---------- */
@media (max-width: 767px) {
    .rt-wrap { padding: 0 8px 4px 8px; }
    table.rt-table { font-size: 12px; }
    table.rt-table > thead > tr > th,
    table.rt-table > tbody > tr > td { padding: 7px 7px; }
}


/* ============================================================
 * 19. بطاقة المنتج - الصورة هي البطل
 * ------------------------------------------------------------
 * ملاحظة تحديد: pos-touch.css يُحمَّل داخل قسم css أي بعد
 * layouts.partials.css. لذلك يُعاد تحميل هذا الملف في
 * create.blade.php بعده مباشرةً، وإلا فازت قواعده في كل تعادل.
 *
 * التخطيط: صورة مربّعة تملأ أعلى البطاقة، ثم شريط معلومات مضغوط.
 * هذا هو النمط المألوف في شبكات المنتجات، والتعرّف البصري عليه
 * أسرع من قراءة سطر نصّي مقتطع.
 * ============================================================ */

.pos_touch .product_box,
.pos_touch .product_list .product_box {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: start !important;
    background: var(--pos-surface) !important;
    border: 1px solid var(--pos-line) !important;
    border-radius: 12px !important;
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pos_touch .product_box:hover {
    border-color: #b9cdf0 !important;
    box-shadow: 0 4px 16px rgba(16, 32, 64, .12) !important;
}

/* ---------- الشارة: رقعة صغيرة فوق الصورة ----------
   كانت تمتدّ بعرض البطاقة لأنها عنصر كتلي داخل عمود flex.
   position:absolute يُخرجها من التدفّق فتأخذ عرض محتواها فقط. */
.pos_touch .product_box .stock_badge,
.pos_touch .stock_badge {
    position: absolute !important;
    top: 7px !important;
    inset-inline-start: 7px !important;
    z-index: 3;
    width: auto !important;
    max-width: calc(100% - 14px);
    margin: 0 !important;
    padding: 2px 8px !important;
    background: rgba(255, 255, 255, .94) !important;
    color: #10794b !important;
    border: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 1px 3px rgba(16, 32, 64, .12) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.7 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos_touch .product_box .stock_badge_out,
.pos_touch .stock_badge_out {
    color: #a5281b !important;
}

/* ---------- الصورة: تملأ أعلى البطاقة ---------- */
.pos_touch .product_box .image-container,
.pos_touch .product_list .product_box .image-container {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--pos-surface-2) !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.pos_touch .product_box .image-container img,
.pos_touch .product_list .product_box .image-container img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    display: block !important;
}

/* الصور النائبة لا تُقصّ بل تُعرض مصغّرة ومخفّتة، فلا تبدو
   كصورة منتج حقيقية مشوّهة. */
.pos_touch .product_box .image-container img[src*="default"] {
    width: 40% !important;
    height: auto !important;
    object-fit: contain !important;
    opacity: .26;
}

/* ---------- شريط المعلومات ---------- */
.pos_touch .product_box .text_div,
.pos_touch .product_list .product_box .text_div {
    flex: 1 1 auto !important;
    width: auto !important;
    padding: 9px 10px 0 10px !important;
    margin: 0 !important;
    background: transparent !important;
    text-align: start !important;
    min-height: 0 !important;
}

.pos_touch .product_box .text_div .text,
.pos_touch .product_list .product_box .text_div .text {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    color: var(--pos-text) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: start !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ---------- الرمز والوحدة ---------- */
.pos_touch .product_box .product_meta {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 0 10px;
    margin: 0;
}

.pos_touch .product_box .product_sku {
    color: var(--pos-text-dim);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos_touch .product_box .product_unit {
    color: #a8b4c4;
    font-size: 10px;
    font-weight: 600;
}

.pos_touch .product_box .product_unit::before {
    content: "\00B7";
    margin-inline-end: 4px;
}

/* ---------- الشريط السفلي ---------- */
.pos_touch .product_box .product_foot,
.pos_touch .product_list .product_box .product_foot {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 8px 10px !important;
    background: transparent !important;
    border-top: 1px solid #eef1f6 !important;
}

.pos_touch .product_box .product_add_btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 27px !important;
    height: 27px !important;
    flex: 0 0 27px !important;
    background: var(--pos-blue) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 7px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin: 0 !important;
    transition: background-color .15s ease;
}

.pos_touch .product_box:hover .product_add_btn {
    background: var(--pos-blue-hi) !important;
}

.pos_touch .product_box .product-price-label {
    flex: 1 1 auto !important;
    color: var(--pos-navy) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    text-align: end !important;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    letter-spacing: -.2px;
}

.pos_touch .product_box .product-price-label small {
    font-size: 10px !important;
    font-weight: 600 !important;
    opacity: .65;
}

/* النافد: الصورة تُخفَّت، والبيع يبقى ممكناً */
.pos_touch .product_box:has(.stock_badge_out) .image-container {
    opacity: .5;
}

/* ---------- الشبكة ---------- */
@media (min-width: 1200px) {
    .pos_touch #product_list_body > .product_list {
        flex: 0 0 20% !important;
        max-width: 20% !important;
    }
}

@media (min-width: 1600px) {
    .pos_touch #product_list_body > .product_list {
        flex: 0 0 16.666% !important;
        max-width: 16.666% !important;
    }
}


/* ============================================================
 * 20. صفّ السلة في التخطيط اللمسي
 * ------------------------------------------------------------
 * المشكلة: عمود الاسم بـ width:auto بينما الكمية 104px والمجموع
 * 78px، فيتبقّى للاسم عرض ضيّق جداً في عمود سلة أصلاً ضيّق.
 * النتيجة اسم عربي طويل يتكسّر كلمةً في كل سطر، فيطول الصفّ
 * بلا داعٍ ولا يظهر من السلة إلا صنفان أو ثلاثة.
 *
 * الحل: table-layout ثابت بعروض محسوبة، واسم على سطرين بحدّ أقصى،
 * وأدوات كمية أفقية بدل عمودية.
 * ============================================================ */

.pos_touch_cart_body table#pos_table {
    table-layout: fixed !important;
    width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
}

.pos_touch_cart_body table#pos_table td {
    padding: 9px 6px !important;
    vertical-align: middle !important;
}

/* ---------- عمود الاسم ---------- */
/* عرض صريح بدل auto: مع table-layout:fixed يصبح النصيب محسوماً
   فلا تلتهمه الأعمدة الأخرى. */
.pos_touch_cart_body table#pos_table td:first-child {
    width: auto !important;
    padding-inline-start: 10px !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: var(--pos-text) !important;
    overflow: hidden;
}

/* الاسم: سطران كاملان، قطع عند حدّ الكلمة لا داخلها */
.pos_touch_cart_body table#pos_table td:first-child .text-link,
.pos_touch_cart_body table#pos_table td:first-child > a,
.pos_touch_cart_body table#pos_table td:first-child > span:not(.sr-only) {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    color: var(--pos-navy) !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-decoration: none !important;
}

/* أيقونة المعلومات الصغيرة أسفل الاسم تبقى في سطرها */
.pos_touch_cart_body table#pos_table td:first-child .fa-info-circle {
    color: var(--pos-text-dim) !important;
    font-size: 11px !important;
    margin-top: 3px;
}

/* ---------- عمود الكمية ---------- */
.pos_touch_cart_body table#pos_table td:nth-child(2) {
    width: 118px !important;
}

/* أفقي بدل عمودي: الوحدة بجانب أدوات العدد لا تحتها،
   فينخفض ارتفاع الصفّ وتظهر أصناف أكثر دون تمرير. */
.pos_touch_cart_body .pos-qty-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
}

.pos_touch_cart_body .pos-qty-container {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
    background: var(--pos-surface) !important;
    border: 1px solid #d5dde9 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.pos_touch_cart_body .pos-qty-btn {
    background: var(--pos-surface-2) !important;
    background-image: none !important;
    border: 0 !important;
    color: var(--pos-text) !important;
    width: 28px !important;
    height: 30px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    padding: 0 !important;
    flex: 0 0 28px;
    transition: background-color .15s ease, color .15s ease;
}

.pos_touch_cart_body .pos-qty-btn:hover {
    background: #e6edf9 !important;
    color: var(--pos-blue) !important;
}

.pos_touch_cart_body .pos-qty-container input.pos_quantity {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: 30px !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--pos-navy) !important;
    background: transparent !important;
    flex: 1 1 auto;
    min-width: 0;
}

/* محدّد الوحدة: صغير ومحايد، ليس عنصراً رئيسياً */
.pos_touch_cart_body select.sub_unit,
.pos_touch_cart_body td:nth-child(2) select {
    height: 26px !important;
    padding: 0 6px !important;
    border: 1px solid #e2e8f2 !important;
    border-radius: 7px !important;
    background: var(--pos-surface-2) !important;
    color: var(--pos-text-dim) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    width: 100% !important;
}

/* ---------- عمود المجموع ---------- */
.pos_touch_cart_body table#pos_table td.grand-total-col {
    width: 86px !important;
    text-align: end !important;
    padding-inline-end: 8px !important;
    color: var(--pos-navy) !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    font-variant-numeric: tabular-nums;
}

/* التسمية أسفل الرقم تصغر فلا تنافسه */
.pos_touch_cart_body table#pos_table td.grand-total-col small,
.pos_touch_cart_body table#pos_table td.grand-total-col .text-muted {
    display: block;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    color: var(--pos-text-dim) !important;
    line-height: 1.3;
    margin-top: 1px;
}

/* ---------- زر الحذف ---------- */
.pos_touch_cart_body table#pos_table td:last-child {
    width: 40px !important;
    text-align: center !important;
    padding: 0 4px !important;
}

.pos_touch_cart_body table#pos_table .pos_remove_row {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    color: #c9d3e0 !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.pos_touch_cart_body table#pos_table .pos_remove_row:hover {
    background: #fdecea !important;
    border-color: #f5c6c2 !important;
    color: var(--pos-red) !important;
}

.pos_touch_cart_body table#pos_table .pos_remove_row i {
    font-size: 13px !important;
}

/* ---------- الصفّ ككل ---------- */
.pos_touch_cart_body table#pos_table > tbody > tr.product_row {
    background: var(--pos-surface) !important;
}

.pos_touch_cart_body table#pos_table > tbody > tr.product_row:hover {
    background: #f6f9ff !important;
}

.pos_touch_cart_body table#pos_table > tbody > tr.product_row > td {
    border-bottom: 1px solid #eef1f6 !important;
}


/* ============================================================
 * 21. تبسيط أزرار نافذة آخر العمليات
 * ------------------------------------------------------------
 * ثلاثة أزرار مؤطّرة في عمود ضيّق تُنتج ضجيجاً بصرياً. الأبسط:
 * أيقونات بلا إطار ولا خلفية في السكون، تكتسب لوناً خفيفاً عند
 * المرور فقط. الهدف واضح والصفّ أهدأ.
 * ============================================================ */

.rt-act {
    width: 28px;
    height: 28px;
    margin: 0 1px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #b9c4d4;
}

.rt-act i {
    font-size: 13px;
}

.rt-act-edit:hover   { background: #eaf1fd; color: var(--pos-blue); }
.rt-act-print:hover  { background: #eef2f8; color: var(--pos-navy); }
.rt-act-return:hover { background: #fdecea; color: var(--pos-red); }

/* الصفّ عند المرور يكشف الأيقونات بوضوح أكبر */
table.rt-table > tbody > tr:hover .rt-act {
    color: var(--pos-text-dim);
}


/* ============================================================
 * 22. تنظيف نافذة آخر العمليات
 * ------------------------------------------------------------
 * ما ظهر: صندوق أزرق حول كل قيمة (رقم الفاتورة، التاريخ، الوقت،
 * العميل)، ومربّعات شبحية خلف أزرار الإجراءات.
 *
 * السبب: ورقة أنماط أخرى تُزيّن عناصر داخل الجداول بحدود وخلفيات،
 * فتلتقط عناصر البطاقة الجديدة. بدل ملاحقة مصدرها في 14 ملفاً،
 * نُصرّح بإلغاء الزينة على عناصرنا نفسها - وهي أعلى تحديداً
 * ومُحمَّلة أخيراً فتفوز يقيناً.
 * ============================================================ */

table.rt-table .rt-invoice,
table.rt-table .rt-date,
table.rt-table .rt-time,
table.rt-table .rt-customer,
table.rt-table .rt-mobile,
table.rt-table .rt-table-name,
table.rt-table td > span,
table.rt-table td > span > span {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    display: block;
}

/* الشارة وحدها تحتفظ بمظهرها */
table.rt-table .rt-badge {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
}

table.rt-table .rt-badge-paid {
    background: #e4f6ed !important;
    color: #10794b !important;
}

table.rt-table .rt-badge-partial {
    background: #fdf2dd !important;
    color: #96660f !important;
}

table.rt-table .rt-badge-due {
    background: #fdecea !important;
    color: #a5281b !important;
}

/* ---------- التاريخ والوقت في خلية واحدة ---------- */
/* عمودان منفصلان للتاريخ والوقت يبدّدان العرض. الوقت سطر ثانوي
   تحت التاريخ يكفي، ويُعيد عرضاً للعميل والمبالغ. */
table.rt-table .rt-date {
    font-weight: 600 !important;
    font-size: 12.5px !important;
    color: var(--pos-text) !important;
    font-variant-numeric: tabular-nums;
}

table.rt-table .rt-time {
    font-size: 10.5px !important;
    color: var(--pos-text-dim) !important;
    font-weight: 500 !important;
    margin-top: 1px !important;
}

table.rt-table .rt-invoice {
    font-weight: 800 !important;
    color: var(--pos-navy) !important;
    font-variant-numeric: tabular-nums;
    font-size: 13px !important;
}

table.rt-table .rt-customer {
    font-weight: 600 !important;
    color: var(--pos-text) !important;
    font-size: 12.5px !important;
}

table.rt-table .rt-mobile {
    font-size: 10.5px !important;
    color: var(--pos-text-dim) !important;
    margin-top: 1px !important;
}

/* ---------- أزرار الإجراءات: بلا مربّعات شبحية ---------- */
table.rt-table .rt-act,
table.rt-table td .rt-act {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 1px !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 6px !important;
    color: #b9c4d4 !important;
    text-decoration: none !important;
    position: relative;
    overflow: visible;
}

table.rt-table .rt-act::before,
table.rt-table .rt-act::after,
table.rt-table td::before,
table.rt-table td::after,
table.rt-table th::before,
table.rt-table th::after {
    content: none !important;
    display: none !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

table.rt-table .rt-act i {
    font-size: 13px !important;
    line-height: 1 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
}

table.rt-table .rt-act-edit:hover   { background: #eaf1fd !important; color: var(--pos-blue) !important; }
table.rt-table .rt-act-print:hover  { background: #eef2f8 !important; color: var(--pos-navy) !important; }
table.rt-table .rt-act-return:hover { background: #fdecea !important; color: var(--pos-red) !important; }

table.rt-table > tbody > tr:hover .rt-act {
    color: var(--pos-text-dim) !important;
}

/* ---------- الأرقام ---------- */
table.rt-table .rt-col-money,
table.rt-table .rt-col-num {
    font-variant-numeric: tabular-nums;
    color: var(--pos-text) !important;
}

/* القيم الصفرية تُخفَّت فتبرز المبالغ الحقيقية */
table.rt-table .rt-col-money {
    color: #93a2b5 !important;
}

table.rt-table .rt-col-total {
    color: var(--pos-navy) !important;
    font-weight: 800 !important;
}

table.rt-table .rt-due-open {
    color: var(--pos-red) !important;
    font-weight: 800 !important;
}

/* ---------- الترقيم ---------- */
.rt-pagination .pagination > li > a,
.rt-pagination .page-item .page-link {
    min-width: 34px;
    text-align: center;
}


/* ============================================================
 * 23. أيقونات الإجراءات - تبسيط نهائي
 * ------------------------------------------------------------
 * المربّعات الشبحية المزاحة أعلى-يسار كل أيقونة سببها box-shadow
 * موروث من قاعدة عامة للأزرار في مكان آخر، لا حدود ولا خلفية.
 * لذلك لم يكفِ إلغاء background/border وحدهما.
 *
 * هنا نُصفّر كل زينة ممكنة على الرابط وعلى عنصريه الزائفين:
 * الظل والحدّ والخلفية والحشو والتحويل. النتيجة أيقونة مجرّدة.
 * ============================================================ */

.recent-transactions-table a,
.recent-transactions-table a.btn,
table.rt-table a,
table.rt-table a.rt-act,
table.rt-table td a {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    transform: none !important;
}

/* الحالة الأساسية: أيقونة رمادية بلا أي إطار */
table.rt-table .rt-act {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 5px !important;
    color: #9aa8bb !important;
    vertical-align: middle !important;
    transition: color .12s ease !important;
}

/* المرور: تغيّر اللون فقط - لا خلفية ولا إطار */
table.rt-table .rt-act:hover,
table.rt-table .rt-act:focus,
table.rt-table .rt-act:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: 0 !important;
    transform: none !important;
}

table.rt-table .rt-act-edit:hover   { color: var(--pos-blue) !important; }
table.rt-table .rt-act-print:hover  { color: var(--pos-navy) !important; }
table.rt-table .rt-act-return:hover { color: var(--pos-red) !important; }

/* الأيقونة نفسها بلا زينة */
table.rt-table .rt-act i,
table.rt-table .rt-act .fas,
table.rt-table .rt-act .fa {
    font-size: 14px !important;
    line-height: 1 !important;
    color: inherit !important;
    background: none !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    filter: none !important;
}

/* لا عناصر زائفة على الرابط ولا على الأيقونة */
table.rt-table .rt-act::before,
table.rt-table .rt-act::after,
table.rt-table .rt-act i::after,
.recent-transactions-table a.btn::before,
.recent-transactions-table a.btn::after {
    content: none !important;
    display: none !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* خلية الإجراءات: مسافة مريحة بين الأيقونات الثلاث */
table.rt-table td.rt-col-actions {
    white-space: nowrap !important;
    text-align: center !important;
    padding: 8px 10px !important;
}

table.rt-table td.rt-col-actions .rt-act + .rt-act {
    margin-inline-start: 12px !important;
}


/* ============================================================
 * 24. النافذة: تمرير واحد + عرض أوسع + أيقونات مجرّدة
 * ------------------------------------------------------------
 * ثلاث مشاكل ظاهرة:
 *
 * 1) تمريران متداخلان: .modal-body له max-height:68vh مع
 *    overflow-y، و .rt-table-scroll له overflow أيضاً. الحل:
 *    التمريــر في مكان واحد فقط - غلاف الجدول - ويُترك جسم
 *    النافذة بلا حدّ ارتفاع.
 *
 * 2) العرض: الجدول أحد عشر عموداً، فـ 1100px تُجبره على التمرير
 *    الأفقي. نرفعه إلى 96% حتى 1360px.
 *
 * 3) الأيقونات ما زالت داخل مربّعات: القواعد السابقة استهدفت
 *    .rt-act، لكن الزينة تأتي من قاعدة عامة على `a` داخل الجدول
 *    تحمل !important. نستهدف الرابط بمحدّد أعلى تحديداً.
 * ============================================================ */

/* ---------- 1) عرض أوسع ---------- */
#recent_transactions_modal .modal-dialog,
.recent_transactions_modal .modal-dialog {
    width: 96% !important;
    max-width: 1360px !important;
    margin: 18px auto !important;
}

/* ---------- 2) تمرير واحد ---------- */
#recent_transactions_modal .modal-body,
.recent_transactions_modal .modal-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 0 10px 0 !important;
}

#recent_transactions_modal .tab-content,
#recent_transactions_modal .tab-pane {
    overflow: visible !important;
    max-height: none !important;
}

/* غلاف الجدول هو صاحب التمرير الوحيد */
.rt-table-scroll {
    max-height: 62vh;
    overflow-y: auto;
    overflow-x: auto;
}

/* شريط تمرير رفيع غير مزعج */
.rt-table-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.rt-table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e3;
    border-radius: 5px;
}
.rt-table-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3) أيقونات مجرّدة تماماً ---------- */
/* محدّد يبدأ من النافذة نفسها ليتجاوز أي قاعدة عامة على a/.btn */
#recent_transactions_modal table.rt-table td.rt-col-actions a,
#recent_transactions_modal table.rt-table td.rt-col-actions a.rt-act,
#recent_transactions_modal .rt-wrap table.rt-table td a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    margin: 0 6px !important;
    background: none !important;
    background-color: rgba(0,0,0,0) !important;
    background-image: none !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
    text-decoration: none !important;
    color: #9aa8bb !important;
    vertical-align: middle !important;
}

#recent_transactions_modal table.rt-table td.rt-col-actions a:hover,
#recent_transactions_modal table.rt-table td.rt-col-actions a:focus,
#recent_transactions_modal table.rt-table td.rt-col-actions a:active,
#recent_transactions_modal .rt-wrap table.rt-table td a:hover {
    background: none !important;
    background-color: rgba(0,0,0,0) !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    transform: none !important;
    text-decoration: none !important;
}

#recent_transactions_modal table.rt-table td.rt-col-actions a.rt-act-edit:hover   { color: var(--pos-blue) !important; }
#recent_transactions_modal table.rt-table td.rt-col-actions a.rt-act-print:hover  { color: var(--pos-navy) !important; }
#recent_transactions_modal table.rt-table td.rt-col-actions a.rt-act-return:hover { color: var(--pos-red) !important; }

#recent_transactions_modal table.rt-table td.rt-col-actions a i,
#recent_transactions_modal .rt-wrap table.rt-table td a i {
    font-size: 15px !important;
    line-height: 1 !important;
    color: inherit !important;
    background: none !important;
    background-color: rgba(0,0,0,0) !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
}

/* ---------- أعمدة أضيق للمبالغ ليتّسع العميل ---------- */
table.rt-table .rt-col-money { padding-inline: 7px !important; }
table.rt-table .rt-col-num   { padding-inline: 6px !important; }

/* الترويسة تبقى ظاهرة أثناء التمرير الرأسي */
table.rt-table > thead > tr > th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    background: var(--pos-surface-2) !important;
    box-shadow: inset 0 -1px 0 var(--pos-line);
}
