/* ════════════════════════════════════════════════════════════════
   FrmPOS / FrmOrders / FrmPriceOffer — Mobile Fixes (Real Classes)
   ─────────────────────────────────────────────
   Based on actual class names: .inv-form, .inv-cell, .inv-row,
   .inv-collapse-btn, .inv-lbl, .inv-row-b, etc.
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ═══ 1) Form Container — ضغط padding ═══ */
    body .inv-form {
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 12px !important;
    }

    /* ═══ 2) Form Header — Toggle ═══ */
    body .inv-form-header {
        padding: 8px 12px !important;
        min-height: 42px !important;
        gap: 8px !important;
    }
    body .inv-form-header-title {
        font-size: 13px !important;
        font-weight: 700 !important;
    }
    body .inv-form-header-title i {
        font-size: 14px !important;
    }
    body .inv-form-summary {
        gap: 6px !important;
    }
    body .inv-form-summary-chip {
        font-size: 11.5px !important;
        padding: 4px 8px !important;
    }
    body .inv-form-summary-chip .s-lbl { font-size: 10.5px !important; }
    body .inv-form-summary-chip .s-val { font-size: 12px !important; font-weight: 700 !important; }

    /* ═══ 3) Toggle Button — دائرى أنيق ═══ */
    body .inv-collapse-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        border-radius: 50% !important;
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        color: #fff !important;
        border: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 8px rgba(var(--fs-primary-rgb),.4) !important;
        transition: transform .2s !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
    }
    body .inv-collapse-btn:active {
        transform: scale(0.92) !important;
    }
    body .inv-form.collapsed .inv-collapse-btn {
        transform: rotate(180deg) !important;
    }
    body .inv-collapse-icon {
        font-size: 16px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        color: #fff !important;
    }

    /* ═══ 4) Form Body — padding ═══ */
    body .inv-form-body {
        padding: 8px !important;
    }

    /* ═══ 5) Rows — Grid Equal Columns ═══ */
    body .inv-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;     /* صفّين متساويين */
        gap: 8px !important;
        margin-bottom: 6px !important;
    }
    body .inv-row-b {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    /* ═══ 6) Cells — كل حقل عرض موحّد ═══ */
    body .inv-cell,
    body .inv-cell-b {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* خانة "عميل نقدى" (Customer) — تأخذ صف كامل */
    body .inv-row-b > .inv-cell-b:first-child {
        grid-column: 1 / -1 !important;
    }

    /* ════════════════════════════════════════════════════════════════
       خانة الـ extra (تفعيل الضريبة + أسعار 1/2/3) — صف واحد compact
       ════════════════════════════════════════════════════════════════ */
    body .inv-cell-extra {
        grid-column: 1 / -1 !important;
        margin-top: 4px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;        /* ✦ مفيش wrap — صف واحد دائماً */
        gap: 4px !important;
        background: var(--fs-tint-2) !important;
        border: 1px solid rgba(var(--fs-primary-rgb),.2) !important;
        border-radius: 8px !important;
        padding: 4px 8px !important;
        min-height: 40px !important;
        overflow-x: auto !important;          /* لو ضاقت الشاشة، scroll أفقى */
        -webkit-overflow-scrolling: touch !important;
    }

    /* تفعيل الضريبة (الـ label + checkbox) — compact */
    body .inv-cell-extra .inv-vat-row {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 0 0 auto !important;
        font-size: 11.5px !important;
        font-weight: 700 !important;
        color: #1f2937 !important;
        cursor: pointer !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }

    /* الـ separator بين تفعيل الضريبة و الأسعار */
    body .inv-cell-extra .inv-form-sep {
        width: 1px !important;
        height: 18px !important;
        background: rgba(var(--fs-primary-rgb),.4) !important;
        flex-shrink: 0 !important;
        margin: 0 2px !important;
    }

    /* CustomerPriceRadioGroup */
    body .inv-cell-extra > div:not(.inv-form-sep),
    body .inv-cell-extra > .rz-radio-button-list {
        flex: 0 1 auto !important;
        display: inline-flex !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    /* الـ radio items (سعر1, سعر2, سعر3) — compact جداً */
    body .inv-cell-extra .rz-radio-button-list-item,
    body .inv-cell-extra label:not(.inv-vat-row) {
        flex: 0 0 auto !important;
        font-size: 10.5px !important;
        padding: 2px 8px !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }
    body .inv-cell-extra .rz-radio-button-list-item .rz-radio-button-list-item-text {
        font-size: 10.5px !important;
    }

    /* ✦ خانة بـ class .inv-cell-full → صف كامل (مركز التكلفة، ملاحظات، البيان) ✦ */
    body .inv-cell.inv-cell-full,
    body .inv-row > .inv-cell-full,
    body .inv-row-b > .inv-cell-full,
    body .inv-cell-b.inv-cell-full {
        grid-column: 1 / -1 !important;
    }

    /* ═══ 7) Labels — اتجاه طبيعى حسب اللغة ═══ */
    /* text-align: start = يمين فى RTL، يسار فى LTR (تلقائى) */
    body .inv-lbl {
        font-size: 11.5px !important;
        font-weight: 700 !important;
        color: var(--fs-primary-ink) !important;
        margin-bottom: 4px !important;
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: start !important;       /* ✦ start = يمين فى RTL */
        padding-inline-start: 4px !important;
    }

    /* ═══ 8) Inputs — أحجام متساوية (نفس font-size, نفس height) ═══ */
    body .inv-cell .dxbl-text-edit,
    body .inv-cell .dxbl-spin-edit,
    body .inv-cell .dxbl-combobox,
    body .inv-cell .dxbl-date-edit,
    body .inv-cell-b .dxbl-text-edit,
    body .inv-cell-b .dxbl-spin-edit,
    body .inv-cell-b .dxbl-combobox,
    body .inv-cell-b .dxbl-date-edit {
        width: 100% !important;
        min-height: 40px !important;
    }

    /* الـ inputs الفعلية */
    body .inv-cell input,
    body .inv-cell .dxbl-text-edit-input,
    body .inv-cell .dxbl-spin-edit-input,
    body .inv-cell .dxbl-combobox-input,
    body .inv-cell .dxbl-date-edit-input,
    body .inv-cell-b input,
    body .inv-cell-b .dxbl-text-edit-input,
    body .inv-cell-b .dxbl-combobox-input {
        font-size: 13.5px !important;        /* موحّد */
        font-weight: 600 !important;
        padding: 8px 10px !important;
        text-align: center !important;
        min-height: 40px !important;
        height: 40px !important;
    }

    /* ═══ 9) خانة تاريخ الفاتورة — أكبر و أوضح ═══ */
    body .inv-cell .dxbl-date-edit-input {
        font-size: 14px !important;
        font-weight: 700 !important;
        letter-spacing: .3px !important;
    }

    /* ═══ 10) Editor buttons (icons داخل inputs) — حجم مناسب ═══ */
    body .inv-cell .dxbl-edit-btn,
    body .inv-cell-b .dxbl-edit-btn,
    body .inv-cell .dxbl-text-edit-button {
        min-width: 30px !important;
        padding: 0 6px !important;
    }
    body .inv-cell .dxbl-edit-btn i,
    body .inv-cell-b .dxbl-edit-btn i {
        font-size: 14px !important;
    }

    /* ═══ 11) Customer Price Radio Group (سعر1, سعر2, سعر3) ═══ */
    body .inv-cell-extra .rz-radio-button-list {
        display: flex !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }
    body .inv-cell-extra .rz-radio-button-list-item,
    body .inv-cell-extra label {
        flex: 1 1 auto !important;
        font-size: 12px !important;
        padding: 6px 10px !important;
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    /* ═══ 12) Customer Name (عميل نقدى) — أبرز ═══ */
    body .inv-cell-b .f-cu .dxbl-text-edit-input {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #2563eb !important;
        text-align: center !important;
    }

    /* ════════════════════════════════════════════════════════════════
       Footer (الإجماليات + الأزرار) — Mobile Layout
       ──────────────────────────────────────────────
       • الإجماليات Grid 2-3 columns على الموبايل
       • الأزرار صف كبير touch-friendly
       • Sticky bottom — دائماً ظاهر
       ════════════════════════════════════════════════════════════════ */

    /* Footer container — تصميم احترافى compact ملتصق بالجرد */
    body .inv-footer {
        position: static !important;
        background: linear-gradient(180deg, #fff 0%, #fef9f4 100%) !important;
        border-top: 1.5px solid rgba(var(--fs-primary-rgb),.4) !important;
        box-shadow: 0 -1px 4px rgba(var(--fs-primary-rgb),.08) !important;
        margin: 0 0 70px !important;        /* ✦ ملتصق بالجرد بدون مسافة */
        border-radius: 10px !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body .inv-footer-inner {
        display: flex !important;
        flex-direction: column-reverse !important;    /* الإجماليات فوق، الأزرار تحت */
        gap: 0 !important;
        padding: 6px !important;
    }

    /* ═══ FrmOrders: لو فيه .inv-mob-totals، اخفِ الـ desktop totals ═══ */
    /* SalesInvoice & PriceOffer لهم mobile-specific totals جاهزة */
    body .inv-footer:has(.inv-mob-totals) .inv-footer-right {
        display: none !important;
    }

    /* ═══ الإجماليات (Right Section) — للشاشات اللى مالهاش inv-mob-totals (FrmPOS) ═══ */
    body .inv-footer-right {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        padding: 8px 0 !important;
        border-bottom: 1px dashed rgba(var(--fs-primary-rgb),.3) !important;
        margin-bottom: 8px !important;
        width: 100% !important;
    }

    body .inv-tot-cell {
        background: var(--fs-tint-2) !important;
        border: 1px solid rgba(var(--fs-primary-rgb),.2) !important;
        border-radius: 8px !important;
        padding: 6px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        text-align: center !important;
        min-height: 50px !important;
    }

    body .inv-tot-lbl {
        font-size: 10.5px !important;
        font-weight: 700 !important;
        color: var(--fs-primary-ink-2) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    body .inv-tot-val {
        font-size: 13px !important;
        font-weight: 800 !important;
        color: #1f2937 !important;
        white-space: nowrap !important;
    }

    /* الإجمالى الصافى — أبرز */
    body .inv-tot-cell.tc-net {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        border-color: transparent !important;
        grid-column: 1 / -1 !important;          /* صف كامل */
        min-height: 56px !important;
    }
    body .inv-tot-cell.tc-net .inv-tot-lbl,
    body .inv-tot-cell.tc-net .inv-tot-val {
        color: #fff !important;
    }
    body .inv-tot-cell.tc-net .inv-tot-val {
        font-size: 18px !important;
    }

    /* SpinEdit داخل cells — حجم متناسب */
    body .inv-tot-cell .dxbl-spin-edit {
        width: 100% !important;
    }
    body .inv-tot-cell .dxbl-spin-edit-input {
        font-size: 13px !important;
        font-weight: 800 !important;
        text-align: center !important;
        padding: 4px 6px !important;
        height: 28px !important;
        background: #fff !important;
    }

    /* ═══ أزرار الفاتورة (Left Section) — compact أنيق ═══ */
    body .inv-footer-left {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        padding: 4px 0 0 !important;
        width: 100% !important;
    }

    body .inv-abtn {
        flex: 1 1 calc(50% - 2px) !important;
        min-height: 38px !important;        /* أصغر */
        min-width: 0 !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        padding: 7px 10px !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        white-space: nowrap !important;
        border: none !important;
        box-shadow: 0 1px 3px rgba(0,0,0,.08) !important;
    }

    body .inv-abtn i {
        font-size: 12px !important;
    }

    /* New button — رمادى صغير ثابت */
    body .inv-abtn.a-new {
        background: #f1f5f9 !important;
        color: #475569 !important;
        flex: 0 0 78px !important;
        max-width: 78px !important;
        order: 0 !important;
    }

    /* Save — أخضر يأخذ الباقى */
    body .inv-abtn.a-save {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        color: #fff !important;
        flex: 1 1 0 !important;
        min-width: 90px !important;
        order: 1 !important;
        box-shadow: 0 2px 8px rgba(34,197,94,.3) !important;
    }

    /* Print + Delete + Edit صف ثانى */
    body .inv-abtn.a-print,
    body .inv-abtn.a-print2,
    body .inv-abtn.a-del,
    body .inv-abtn.a-edit {
        order: 2 !important;
        flex: 1 1 calc(50% - 2px) !important;
    }

    /* Print — أزرق */
    body .inv-abtn.a-print {
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        color: #fff !important;
    }
    body .inv-abtn.a-print2 {
        background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
        color: #fff !important;
    }

    /* Delete — أحمر */
    body .inv-abtn.a-del {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: #fff !important;
    }

    /* ════════════════════════════════════════════════════════════════
       سند القبض / سند الصرف / قيود اليومية — Scroll عادى (مش Fixed)
       ──────────────────────────────────────────────
       ▸ المشكلة: .sr-pg بـ height: 100vh + overflow: hidden → footer ثابت
       ▸ الحل على الموبايل: height: auto + overflow: visible → scroll طبيعى
       ▸ Receipt/Payment/JournalEntry (Classes: .sr-pg, .sr-wrap, .sr-footer)
       ════════════════════════════════════════════════════════════════ */

    /* الصفحة الرئيسية — مفيش height ثابت ولا overflow:hidden */
    body .sr-pg {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }
    body .sr-wrap {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    /* أى body/main داخلى مفروض يفك الـ overflow */
    body .sr-pg .sr-body,
    body .sr-pg .sr-content,
    body .sr-pg main {
        overflow: visible !important;
        height: auto !important;
    }

    /* Footer — يكمل الصفحة طبيعى مع scroll، مش ثابت */
    body .sr-footer {
        position: static !important;
        background: #fff !important;
        border-top: 2px solid var(--fs-primary) !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,.06) !important;
        border-radius: 14px 14px 0 0 !important;
        padding: 8px !important;
        margin-bottom: 80px !important;     /* مساحة من Bottom Nav */
        flex-shrink: 0 !important;
    }

    body .sr-ftr-l {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* الـ separator — نخفيه على الموبايل */
    body .sr-ftr-sep {
        display: none !important;
    }

    /* أى زر */
    body .sr-btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-height: 46px !important;
        min-width: 0 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
        border: none !important;
    }
    body .sr-btn i { font-size: 14px !important; }

    /* New — رمادى صغير ثابت */
    body .sr-btn.sr-btn-new {
        background: #f1f5f9 !important;
        color: #475569 !important;
        flex: 0 0 90px !important;
        max-width: 90px !important;
        order: 0 !important;
    }

    /* Save — أخضر يأخذ الباقى */
    body .sr-btn.sr-btn-save {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        color: #fff !important;
        flex: 1 1 0 !important;
        min-width: 100px !important;
        order: 1 !important;
    }

    /* Edit/Print/Del يأخذوا الصف الثانى */
    body .sr-btn.sr-btn-edit,
    body .sr-btn.sr-btn-out,
    body .sr-btn.sr-btn-del {
        order: 2 !important;
        flex: 1 1 calc(50% - 4px) !important;
    }

    /* Edit — برتقالى */
    body .sr-btn.sr-btn-edit {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        color: #fff !important;
    }

    /* Print — أزرق */
    body .sr-btn.sr-btn-out {
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        color: #fff !important;
    }
    /* لو فيه أكتر من زر طباعة، التانى بنفسجى */
    body .sr-btn.sr-btn-out + .sr-btn.sr-btn-out {
        background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    }

    /* Delete — أحمر */
    body .sr-btn.sr-btn-del {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: #fff !important;
    }

    /* spinner داخل الأزرار */
    body .sr-btn .sr-spin {
        width: 14px;
        height: 14px;
        border: 2px solid rgba(255,255,255,.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: sr-spin .7s linear infinite;
    }
    @@keyframes sr-spin { to { transform: rotate(360deg); } }

    /* Footer bottom (Points) — مدمج */
    body .inv-footer-bottom {
        padding: 6px 0 0 !important;
        border-top: 1px dashed rgba(var(--fs-primary-rgb),.3) !important;
        margin-top: 6px !important;
    }

    /* ════════════════════════════════════════════════════════════════
       PROFESSIONAL POS TOOLBAR — Mobile-First Design v2
       ─────────────────────────────────────────────────────────────
       ▸ Row 1: Action Buttons — مجمعة، بدون فراغات، 24px
       ▸ Row 2: Barcode Pill — أيقونات 16px، input متوسط، اتزان كامل
       ▸ RTL-aware ▸ Touch-friendly ▸ Zero overflow ▸ Stable
       ════════════════════════════════════════════════════════════════ */

    /* Container — flat, clean, 2 rows مع مسافة كبيرة بين الصفين */
    body .inv-gtb,
    body .inv-grid-card .inv-gtb {
        display: flex !important;
        flex-direction: column-reverse !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 12px !important;              /* ✦ 12px مسافة كبيرة لمنع التداخل تماماً */
        padding: 8px 10px 10px !important;  /* ✦ padding أكبر */
        min-height: auto !important;
        height: auto !important;
        background: #fff !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    /* ═══════════════════════════════════════════════════════════
       ROW 1: ACTION BUTTONS — مطابق ارتفاع الباركود (28px)
       ─────────────────────────────────────────────────────────
       ▸ ارتفاع: 28px = نفس الباركود تماماً (visual harmony)
       ▸ تمركز كامل للنص والأيقونة (vertical & horizontal)
       ▸ Padding: 0 (مفيش padding عمودى)
       ▸ NO box-shadow — flat design
       ═══════════════════════════════════════════════════════════ */
    body .inv-gtb .inv-gtb-actions,
    body .inv-grid-card .inv-gtb .inv-gtb-actions {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
        min-height: 24px !important;
        height: 24px !important;              /* ✦ 24px أصغر */
        max-height: 24px !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    /* الزر الموحد — 24px أصغر وأنيق، تمركز عمودى مثالى */
    body .inv-gtb .inv-tb,
    body .inv-gtb-actions .inv-tb {
        height: 24px !important;              /* ✦ 24px أصغر */
        min-height: 24px !important;
        max-height: 24px !important;
        line-height: 22px !important;         /* ✦ height - 2*border = 22px = تمركز مثالى */
        padding: 0 9px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        border-radius: 5px !important;
        border: 1px solid transparent !important;
        gap: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
        transition: background .15s, color .15s, transform .12s !important;
        letter-spacing: 0 !important;
        margin: 0 !important;
        text-align: center !important;
        text-indent: 0 !important;
        position: relative !important;
        box-shadow: none !important;
        overflow: hidden !important;
        vertical-align: middle !important;
    }

    /* الأيقونات داخل الأزرار — flex centered, no offset */
    body .inv-gtb .inv-tb i,
    body .inv-gtb-actions .inv-tb i {
        font-size: 10px !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        vertical-align: middle !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        position: relative !important;
        top: 0 !important;
    }
    body .inv-gtb .inv-tb:disabled {
        opacity: .45 !important;
        cursor: not-allowed !important;
    }
    body .inv-gtb .inv-tb:active:not(:disabled) {
        transform: scale(.96) !important;
    }

    /* ─── Layout proportions ───
       order:1 (يمين RTL) = + أدرج سطر (flex:2)
       order:2 (وسط)     = 📊 Cols (32px ثابت)
       order:3 (يسار RTL) = حذف التحديد (flex:1.2) */

    /* [1] + أدرج سطر — Primary برتقالى flat */
    body .inv-gtb .inv-tb-new {
        order: 1 !important;
        flex: 2 1 0 !important;
        background: linear-gradient(135deg, var(--fs-primary) 0%, var(--fs-primary-deep) 100%) !important;
        color: #fff !important;
        border-color: transparent !important;
        box-shadow: none !important;
    }
    body .inv-gtb .inv-tb-new:hover {
        background: linear-gradient(135deg, var(--fs-primary-deep) 0%, var(--fs-primary-deeper) 100%) !important;
    }

    /* [2] Cols — أيقونة 32×24 رمادى */
    body .inv-gtb .inv-tb-cols {
        order: 2 !important;
        flex: 0 0 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        background: #f8fafc !important;
        color: #64748b !important;
        border-color: #e2e8f0 !important;
        box-shadow: none !important;
    }
    body .inv-gtb .inv-tb-cols:hover {
        background: var(--fs-tint-2) !important;
        color: var(--fs-primary) !important;
        border-color: var(--fs-tint-4) !important;
    }
    body .inv-gtb .inv-tb-cols i {
        font-size: 10.5px !important;
    }
    body .inv-gtb .inv-tb-cols span:not(.inv-tb-cnt) {
        display: none !important;
    }

    /* [3] حذف التحديد — outline أحمر flat */
    body .inv-gtb .inv-tb-del {
        order: 3 !important;
        flex: 1.2 1 0 !important;
        background: #fff !important;
        color: #ef4444 !important;
        border-color: #fecaca !important;
        padding: 0 8px !important;
        box-shadow: none !important;
    }
    body .inv-gtb .inv-tb-del:hover:not(:disabled) {
        background: #fef2f2 !important;
        border-color: #fca5a5 !important;
    }
    body .inv-gtb.has-sel .inv-tb-del {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: #fff !important;
        border-color: transparent !important;
        box-shadow: none !important;
    }
    body .inv-gtb.has-sel .inv-tb-del:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    }

    /* Selection counter badge */
    body .inv-gtb .inv-tb-cnt {
        background: #ef4444 !important;
        color: #fff !important;
        border-radius: 999px !important;
        padding: 0 5px !important;
        font-size: 9.5px !important;
        font-weight: 800 !important;
        min-width: 14px !important;
        height: 14px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
        margin-inline-start: 3px !important;
    }
    body .inv-gtb.has-sel .inv-tb-cnt {
        background: #fff !important;
        color: #dc2626 !important;
    }

    /* ═══════════════════════════════════════════════════════════
       ROW 2: BARCODE PILL — Sleek, Aligned, No Overflow
       [📊 icon] [────── input ──────] [📷 button]
       All elements: 16x16 hit area, font 13px, vertically centered
       ═══════════════════════════════════════════════════════════ */
    body .inv-gtb .inv-bc-wrap,
    body .inv-grid-card .inv-gtb .inv-bc-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
        gap: 8px !important;
        height: 28px !important;                   /* ✦ ارتفاع compact */
        min-height: 28px !important;
        background: #fff !important;
        border: 1.5px solid var(--fs-tint-4) !important;
        border-radius: 8px !important;
        padding: 0 10px !important;
        overflow: hidden !important;
        box-shadow: 0 1px 2px rgba(var(--fs-primary-rgb),.06) !important;
        box-sizing: border-box !important;
        transition: border-color .15s, box-shadow .15s !important;
    }
    body .inv-gtb .inv-bc-wrap:focus-within {
        border-color: var(--fs-primary) !important;
        box-shadow: 0 0 0 3px rgba(var(--fs-primary-rgb),.12) !important;
    }

    /* [Right in RTL] Barcode icon — fixed 16px hit area */
    body .inv-gtb .inv-bc-ico {
        order: 1 !important;
        flex: 0 0 16px !important;
        width: 16px !important;
        height: 16px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--fs-primary) !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }
    body .inv-gtb .inv-bc-ico i {
        font-size: 13px !important;
        line-height: 1 !important;
        color: var(--fs-primary) !important;
        display: block !important;
    }

    /* [Center] Input — fills remaining space, no jitter */
    body .inv-gtb .inv-bc-field {
        order: 2 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    body .inv-gtb .inv-bc-field .dxbl-text-edit {
        height: 24px !important;
        min-height: 24px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    body .inv-gtb .inv-bc-field .dxbl-text-edit-input {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        font-size: 12.5px !important;
        font-weight: 600 !important;
        padding: 0 4px !important;
        border: none !important;
        background: transparent !important;
        text-align: center !important;
        color: var(--fs-primary-ink-2) !important;
        outline: none !important;
        box-shadow: none !important;
        letter-spacing: .3px !important;
        line-height: 1.1 !important;
    }
    body .inv-gtb .inv-bc-field .dxbl-text-edit-input::placeholder {
        color: var(--fs-primary-soft-3) !important;
        font-weight: 500 !important;
        font-size: 12px !important;
        opacity: 1 !important;
    }
    /* hide DevExpress edit-buttons inside barcode field — keeps width stable */
    body .inv-gtb .inv-bc-field .dxbl-edit-btn,
    body .inv-gtb .inv-bc-field .dxbl-text-edit-buttons {
        display: none !important;
    }

    /* [Left in RTL] Camera button — fixed 16px hit area */
    body .inv-gtb .header-barcode-btn,
    body .header-barcode-btn {
        order: 3 !important;
        flex: 0 0 16px !important;
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        color: var(--fs-primary) !important;
        border: none !important;
        border-radius: 0 !important;
        cursor: pointer !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        line-height: 1 !important;
        transition: transform .12s, color .15s !important;
    }
    body .inv-gtb .header-barcode-btn:hover {
        color: var(--fs-primary-deep) !important;
        background: transparent !important;
    }
    body .inv-gtb .header-barcode-btn:active {
        transform: scale(.85) !important;
    }
    body .inv-gtb .header-barcode-btn i {
        font-size: 13px !important;
        line-height: 1 !important;
        color: inherit !important;
        pointer-events: none !important;
        display: block !important;
    }

    /* Separator hidden */
    body .inv-gtb .inv-gtb-sep {
        display: none !important;
    }

    /* ════════════════════════════════════════════════════════════════
       ✦ Grid Layout — Spacing & Min-Height فقط
       ─────────────────────────────────────────────────────────────
       ▸ إزالة المسافة بين الجرد والإجماليات
       ▸ إعطاء الجرد ارتفاع كافى لإظهار ~8 صفوف
       ▸ ⚠️ ممنوع: max-height على cells/rows (يكسر autocomplete)
       ▸ ⚠️ ممنوع: z-index على sticky header (يغطى dropdowns)
       ▸ ⚠️ ممنوع: تعديل arrows/heights على input (يكسر التعديل)
       ════════════════════════════════════════════════════════════════ */
    /* الجرد card — مفيش margin سفلى */
    body .inv-grid-card,
    body .pos-grid-card {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    /* الجرد body — مفيش padding/margin سفلى + ارتفاع كافى لـ 8 صفوف */
    body .inv-grid-body {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        min-height: 340px !important;     /* 8 rows × 38px + header ≈ 340px */
    }
    /* الـ footer/totals — مفيش margin علوى */
    body .inv-footer {
        margin-top: 0 !important;
    }
    body .inv-mob-totals {
        margin-top: 0 !important;
        padding-top: 4px !important;
    }

    /* ════════════════════════════════════════════════════════════════
       Mobile Totals — Grid 3x2 (سطرين × 3 مربعات)
       ────────────────────────────────────────────────
       Row 1: المجموع | الخصم | نسبة الخصم
       Row 2: خصم نقاطى | الضريبة | الصافى
       ════════════════════════════════════════════════════════════════ */
    body .inv-mob-totals {
        padding: 4px 0 !important;
        margin-bottom: 4px !important;
    }

    body .inv-mob-tot-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 5px !important;
        margin-bottom: 5px !important;
    }

    /* Default cell — display only */
    body .inv-mob-tot-cell {
        background: #fff !important;
        border: 1px solid rgba(var(--fs-primary-rgb),.25) !important;
        border-radius: 8px !important;
        padding: 6px 8px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        min-height: 50px !important;
        text-align: center !important;
    }

    body .inv-mob-lbl {
        font-size: 10.5px !important;
        font-weight: 700 !important;
        color: var(--fs-primary-ink-2) !important;
        white-space: nowrap !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body .inv-mob-val {
        font-size: 13.5px !important;
        font-weight: 800 !important;
        color: #1f2937 !important;
        white-space: nowrap !important;
    }
    body .inv-mob-val.red { color: #dc2626 !important; }

    /* ✦ Editable cell (الخصم/نسبة الخصم/Retention) ✦ */
    body .inv-mob-tot-cell.mob-edit-cell {
        background: #fff !important;
        border: 1.5px solid var(--fs-primary) !important;
        box-shadow: 0 1px 3px rgba(var(--fs-primary-rgb),.15) !important;
    }
    body .inv-mob-tot-cell.mob-edit-cell .inv-mob-spin,
    body .inv-mob-tot-cell.mob-edit-cell .dxbl-spin-edit {
        width: 100% !important;
    }
    body .inv-mob-tot-cell.mob-edit-cell .dxbl-spin-edit-input {
        font-size: 13.5px !important;
        font-weight: 800 !important;
        text-align: center !important;
        padding: 2px 4px !important;
        height: 22px !important;
        background: transparent !important;
        border: none !important;
        color: #dc2626 !important;
    }

    /* ✦ خانة الضريبة (مميزة بأصفر) ✦ */
    body .inv-mob-tot-cell.mob-vat-cell {
        background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
        border: 1.5px solid #f59e0b !important;
    }
    body .inv-mob-tot-cell.mob-vat-cell .inv-mob-lbl {
        color: var(--fs-primary-ink-2) !important;
        font-weight: 800 !important;
    }
    body .inv-mob-tot-cell.mob-vat-cell .inv-mob-val {
        color: #b45309 !important;
        font-size: 14px !important;
    }

    /* ✦ خانة الصافى (مميزة بالبرتقالى الكامل) ✦ */
    body .inv-mob-tot-cell.mob-net-cell {
        background: linear-gradient(135deg, var(--fs-primary), var(--fs-primary-deep)) !important;
        border: 1.5px solid transparent !important;
        box-shadow: 0 2px 6px rgba(var(--fs-primary-rgb),.35) !important;
    }
    body .inv-mob-tot-cell.mob-net-cell .inv-mob-lbl {
        color: rgba(255,255,255,.95) !important;
        font-weight: 800 !important;
    }
    body .inv-mob-tot-cell.mob-net-cell .inv-mob-val {
        color: #fff !important;
        font-size: 15px !important;
        font-weight: 900 !important;
    }

    /* إخفاء الصفوف القديمة الغير مستخدمة */
    body .inv-mob-edit-row,
    body .inv-mob-edit-sep,
    body .inv-mob-vat-row,
    body .inv-mob-net {
        display: none !important;
    }
    body .inv-pts-wrap {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        font-size: 11.5px !important;
        align-items: center !important;
    }
    body .inv-pts-lbl {
        font-size: 11.5px !important;
        color: #64748b !important;
    }
    body .inv-pts-val {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: var(--fs-primary) !important;
    }
}

/* ─── PHONES (≤480px) — اضغط شوية ─── */
@media (max-width: 480px) {
    body .inv-form-header {
        padding: 6px 10px !important;
    }
    body .inv-form-header-title {
        font-size: 12px !important;
    }
    body .inv-form-summary {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    body .inv-form-summary-chip {
        font-size: 11px !important;
        padding: 3px 7px !important;
    }
    body .inv-row,
    body .inv-row-b {
        gap: 6px !important;
    }
    body .inv-lbl {
        font-size: 11px !important;
    }
    body .inv-cell input,
    body .inv-cell .dxbl-text-edit-input,
    body .inv-cell .dxbl-spin-edit-input,
    body .inv-cell .dxbl-combobox-input,
    body .inv-cell-b input {
        font-size: 13px !important;
        padding: 7px 8px !important;
    }
    body .inv-cell-b .f-cu .dxbl-text-edit-input {
        font-size: 14px !important;
    }

    /* ✦ Toolbar على الشاشات الصغيرة جداً (≤480px) — أزرار 22px مع مسافة كبيرة ✦ */
    body .inv-gtb {
        padding: 8px !important;
        gap: 12px !important;            /* ✦ مسافة كبيرة بين الصفين */
    }
    body .inv-gtb .inv-gtb-actions {
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        gap: 3px !important;
    }
    body .inv-gtb .inv-tb {
        font-size: 10px !important;
        padding: 0 8px !important;
        min-height: 22px !important;
        height: 22px !important;
        max-height: 22px !important;
        line-height: 20px !important;
        border-radius: 5px !important;
    }
    body .inv-gtb .inv-tb-cols {
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        flex-basis: 30px !important;
    }
    body .inv-gtb .inv-tb i { font-size: 9.5px !important; }
    /* الباركود على الشاشات الصغيرة — 26px أيضاً (تطابق كامل) */
    body .inv-gtb .inv-bc-wrap {
        height: 26px !important;
        min-height: 26px !important;
    }
    body .inv-gtb .inv-bc-field,
    body .inv-gtb .inv-bc-field .dxbl-text-edit-input {
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
    }
    body .inv-gtb .inv-bc-wrap {
        height: 26px !important;
        min-height: 26px !important;
        padding: 0 8px !important;
        gap: 6px !important;
    }
    body .inv-gtb .inv-bc-field { height: 22px !important; }
    body .inv-gtb .inv-bc-field .dxbl-text-edit-input {
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
        font-size: 12px !important;
    }
    body .inv-gtb .inv-bc-ico,
    body .inv-gtb .header-barcode-btn { font-size: 12px !important; }
    body .inv-gtb .inv-bc-ico i,
    body .inv-gtb .header-barcode-btn i { font-size: 12px !important; }

    /* ⚠️ تم إلغاء تعديلات الجرد للحفاظ على وظيفة البحث بكود الصنف */
}
