/* ==========================================
   نظام ميرا لايت - تنسيقات إدارة المخزون الكاملة
   ========================================== */

/* المتغيرات الأساسية */
:root {
    --mira-navy: #1e2d4d;
    --mira-gold: #b48a32;
    --mira-bg: #f8fafc;
    --mira-card: #ffffff;
    --mira-text: #1e293b;
    --mira-muted: #64748b;
    --mira-border: #e2e8f0;
}

.mira-inventory-modern { direction: rtl; font-family: inherit; color: var(--mira-navy); max-width: 1400px; margin: 0 auto; padding-bottom: 140px; box-sizing: border-box; }
.mira-inventory-modern * { box-sizing: border-box; }

/* شاشة التحميل الفخمة */
#mira-fullscreen-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(6px); z-index: 99999; display: none; justify-content: center; align-items: center; }
.mira-loader-box { background: white; padding: 40px 50px; border-radius: 24px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); border: 2px solid var(--mira-border); animation: zoomIn 0.3s ease; }
.mira-loader-box i { font-size: 45px; color: var(--mira-gold); margin-bottom: 15px; }
.mira-loader-box h3 { margin: 0; font-size: 18px; font-weight: 900; color: var(--mira-navy); }
.mira-loader-box p { margin: 8px 0 0 0; font-size: 13px; color: #64748b; font-weight: 700; }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* اللوحة العلوية */
.inventory-top-panel { background: var(--mira-card); border-radius: 20px; padding: 25px; margin-bottom: 25px; box-shadow: 0 5px 20px rgba(30,45,77,0.05); }
.panel-header-flex { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 15px; }
.title-group { flex: 1; }
.main-title { font-weight: 900; color: var(--mira-navy); margin: 0; font-size: 22px; }
.mira-badge-live { background: #f0fdf4; color: #10b981; padding: 5px 12px; border-radius: 50px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; border: 1px solid #dcfce7; }
.pulse-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; animation: miraPulse 2s infinite; }
@keyframes miraPulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

/* حقل البحث */
.search-wrapper { position: relative; width: 100%; max-width: 350px; flex-shrink: 0; }
.search-wrapper i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--mira-muted); font-size: 18px; z-index: 2; }
.search-wrapper input { width: 100%; padding: 14px 45px 14px 45px; border-radius: 15px; border: 2px solid #e2e8f0; font-weight: 700; color: var(--mira-navy); font-family: inherit; transition: 0.3s; background: #f8fafc; outline: none; }
.search-wrapper input:focus { border-color: var(--mira-gold); background: white; box-shadow: 0 5px 15px rgba(180,138,50,0.1); }
.clear-search-btn { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 16px; padding: 5px; display: none; z-index: 3; }
.clear-search-btn:hover { color: #ef4444; }

/* شبكة المنتجات والبطاقات الأساسية */
.modern-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding-bottom: 120px; }
.mira-product-card { background: var(--mira-card); border-radius: 25px; border: 1px solid #f1f5f9; transition: 0.3s; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.02); }
.mira-product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(30,45,77,0.08); border-color: var(--mira-gold); }
.card-body { padding: 25px; }

/* عناصر داخل البطاقة */
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.barcode-tag { font-size: 12px; font-weight: 800; color: var(--mira-text); background: var(--mira-bg); padding: 5px 12px; border-radius: 10px; font-family: monospace; }
.btn-history-trigger { background: var(--mira-bg); border: none; width: 38px; height: 38px; border-radius: 12px; color: var(--mira-navy); cursor: pointer; transition: 0.2s; }
.btn-history-trigger:hover { background: var(--mira-navy); color: white; }
.btn-adjust-trigger { background: #fef3c7; border: none; width: 38px; height: 38px; border-radius: 12px; color: #d97706; cursor: pointer; transition: 0.2s; }
.btn-adjust-trigger:hover { background: #d97706; color: white; }
.product-title { font-size: 17px; font-weight: 900; color: var(--mira-navy); margin-bottom: 20px; height: 45px; overflow: hidden; line-height: 1.4; }

/* صف البيانات (المتوفر - حد النواقص) */
.data-display-row { display: flex; justify-content: space-between; background: var(--mira-bg); padding: 15px 20px; border-radius: 18px; margin-bottom: 20px; }
.data-item .label { display: block; font-size: 11px; color: var(--mira-muted); font-weight: 800; margin-bottom: 4px; }
.data-item .val { font-weight: 900; font-size: 18px; }
.stock-val { color: var(--mira-navy); }
.price-val { color: var(--mira-gold); }

/* حقول الإدخال الاحترافية داخل البطاقة */
.mira-input-section { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; margin-top: 15px; }
.mira-column { display: flex; flex-direction: column; gap: 12px; }
.mira-input-group { display: flex; flex-direction: column; gap: 6px; }
.mira-input-group label { display: block; font-weight: 800; color: var(--mira-navy); margin-bottom: 8px; font-size: 13px; }
.mira-input-group label .currency-label { color: #94a3b8; font-weight: 600; font-size: 11px; }

.mira-smart-input-container { display: flex; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; height: 45px; padding: 0 15px; cursor: text; transition: all 0.3s ease; position: relative; overflow: hidden; }
.mira-smart-input-container:focus-within { border-color: var(--mira-gold); background: white; box-shadow: 0 0 0 3px rgba(180,138,50,0.1); }
.mira-smart-input-container i { color: #94a3b8; font-size: 14px; margin-left: 10px; flex-shrink: 0; }
.mira-smart-input-container input { flex-grow: 1; width: 100%; height: 100%; border: none; background: transparent; font-family: inherit; font-weight: 700; font-size: 15px; color: var(--mira-navy); text-align: right; outline: none; padding: 0; margin: 0; font-variant-numeric: tabular-nums; }
.mira-smooth-input::placeholder { color: #cbd5e1; font-weight: 500; }

/* أزرار زيادة ونقصان الكمية */
.mira-qty-stepper { display: flex; align-items: stretch; height: 45px; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; background: white; }
.mira-qty-stepper:focus-within { border-color: var(--mira-gold); box-shadow: 0 0 0 3px rgba(180,138,50,0.1); }
.mira-qty-stepper .stepper-btn { background: #f1f5f9; border: none; color: var(--mira-navy); width: 45px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.mira-qty-stepper .stepper-btn:hover { background: #e2e8f0; color: var(--mira-gold); }
.mira-qty-stepper .qty-field { flex: 1; min-width: 0; text-align: center; border: none; border-left: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; background: transparent; font-weight: 900; font-size: 16px; color: var(--mira-navy); -moz-appearance: textfield; }
.mira-qty-stepper .qty-field:focus { outline: none; }

/* شريط الحفظ السفلي */
.mira-floating-bar { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); width: 92%; max-width: 600px; background: var(--mira-navy); padding: 15px 25px; border-radius: 25px; z-index: 2000; box-shadow: 0 20px 50px rgba(30,45,77,0.4); display: none; }
.bar-inner { display: flex; justify-content: space-between; align-items: center; }
.status-info { display: flex; align-items: center; gap: 15px; color: white; }
.active-count { background: var(--mira-gold); width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; color:white; }
.btn-mira-save { background: var(--mira-gold); color: white; border: none; padding: 14px 20px; border-radius: 15px; font-weight: 900; font-size: 14px; cursor: pointer; transition: 0.3s; display: flex; gap: 10px; align-items: center; }
.btn-mira-save:hover { background: #9e792c; transform: translateY(-2px); }

/* حالات البطاقة والتنبيهات */
.low-stock-card { border: 2px solid #ef4444 !important; box-shadow: 0 5px 20px rgba(239, 68, 68, 0.15) !important; }
.badge-low-stock { background: #fee2e2; color: #ef4444; padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 900; display: inline-flex; align-items: center; gap: 5px; animation: pulseRedAlert 1.5s infinite; }
@keyframes pulseRedAlert { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.min-stock-field:focus { border-color: var(--mira-gold) !important; box-shadow: 0 0 0 3px rgba(180,138,50,0.2); }

/* التجاوب مع الشاشات الصغيرة (Responsive) */
@media (max-width: 768px) {
    .panel-header-flex { flex-direction: column; align-items: stretch; text-align: right; gap: 20px; }
    .search-wrapper { max-width: 100%; }
    .modern-products-grid { grid-template-columns: 1fr; }
    .mira-input-section { grid-template-columns: 1fr; gap: 15px; }
}


  .mira-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(30,45,77,0.8); z-index: 99999; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
    .mira-modal-box { background: #fff; width: 95%; max-width: 700px; border-radius: 30px; overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,0.5); direction: rtl; }
    .mira-modal-box .modal-head { background: var(--mira-navy, #1e2d4d); color: white; padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; }
    .mira-modal-box .modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
    .mira-table { width: 100%; border-collapse: collapse; text-align: right; }
    .mira-table th { padding: 12px; background: #f8fafc; font-weight: 800; color: #1e293b; font-size: 12px; border-bottom: 2px solid #e2e8f0; }
    .mira-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-weight: 700; font-size: 13px; color: #1e2d4d; }
    
    /* تنسيقات الماسح الضوئي */
    .scanner-icon-btn { width: 48px; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; color: #1e2d4d; font-size: 18px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; }
    .scanner-icon-btn:hover { background: #fff; border-color: #b48a32; color: #b48a32; transform: translateY(-2px); }
    .scanner-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; box-shadow: inset 0 0 0 50px rgba(0, 0, 0, 0.4); }
    .scanner-frame { position: absolute; top: 50px; left: 50px; right: 50px; bottom: 50px; border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 10px; }
    .scan-laser { position: absolute; width: calc(100% - 100px); height: 2px; background: #10b981; box-shadow: 0 0 10px 3px rgba(16, 185, 129, 0.6); left: 50px; top: 50%; animation: scanning-laser 2s infinite alternate cubic-bezier(0.4, 0, 0.2, 1); }
    @keyframes scanning-laser { 0% { top: 55px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 55px); opacity: 0; } }
    
    /* تنسيق أزرار الأكشن في أعلى البطاقة */
.card-meta div style { /* لتنسيق الحاوية */
    display: flex;
    gap: 8px;
}
/* --- التنسيق المشترك لجميع الأزرار (المقاسات والشكل) --- */
.btn-edit-product, 
.btn-print-label,
.btn-history-trigger, 
.btn-adjust-trigger {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.btn-edit-product i, 
.btn-print-label i,
.btn-history-trigger i, 
.btn-adjust-trigger i {
    font-size: 15px;
}

/* 📱 تأثير الضغط (Tap) الخاص بشاشات الجوال */
.btn-edit-product:active, 
.btn-print-label:active,
.btn-history-trigger:active, 
.btn-adjust-trigger:active {
    transform: scale(0.92); /* تصغير الزر قليلاً عند لمسه ليعطي إحساساً بالضغط */
}

/* --- 1. زر التعديل (أزرق - يدل على التحرير والإجراء الأساسي) --- */
.btn-edit-product {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0284c7;
}

/* --- 2. زر التسوية الجردية (برتقالي/ذهبي - يدل على إجراء يحتاج انتباه لأنه يغير الرصيد) --- */
.btn-adjust-trigger {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #d97706;
}

/* --- 3. زر سجل الحركات (بنفسجي فاتح - لون عصري يدل على السجلات والتاريخ) --- */
.btn-history-trigger {
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    color: #9333ea;
}

/* --- 4. زر الطباعة (رمادي داكن كلاسيكي - يدل على إجراء روتيني للأنظمة الخارجية) --- */
.btn-print-label {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}


/* تحسين شكل المدخلات (Inputs) داخل نافذة التعديل لتكون "ناعمة" */
.mira-smooth-input {
    transition: all 0.3s ease;
}

.mira-smooth-input:focus {
    border-color: #b48a32 !important;
    box-shadow: 0 0 0 4px rgba(180, 138, 50, 0.1) !important;
    background: #fff !important;
}
@media print {
    /* إخفاء كل شيء */
    body * { visibility: hidden; margin: 0; padding: 0; }
    
    /* ضبط الصفحة لتكون بمقاس الملصق تماماً وبدون أي هوامش */
    @page {
        size: 40mm 25mm;
        margin: 0 !important;
    }

    #mira-print-section, #mira-print-section * { 
        visibility: visible !important; 
    }

    #mira-print-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100% !important; /* التمدد ليملأ عرض الورقة */
        height: 100% !important;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #fff;
    }
}

/* تنسيق شكل الملصق في المعاينة */
.label-preview-container {
    width: 100%;
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
}



/* --- تنسيق شريط الفلاتر للموبايل --- */
@media (max-width: 768px) {
    .mira-filter-bar {
        flex-direction: column;
        align-items: stretch !important;
        padding: 15px !important;
    }
    .mira-filter-bar > div {
        flex-direction: column;
        width: 100%;
    }
    .mira-filter-input, .mira-toggle-btn {
        width: 100% !important;
        justify-content: center;
    }
}
/* --- الحاوية الأساسية للترقيم --- */
#mira-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-bottom: 40px;
    direction: rtl; /* لضمان ترتيب الأزرار (السابق يمين، التالي يسار) */
    flex-wrap: nowrap; /* منع نزول الأزرار لسطر جديد */
}

/* --- تنسيقات أزرار الترقيم للكمبيوتر والشاشات الكبيرة --- */
.mira-page-btn {
    background: #fff;
    border: 2px solid #cbd5e1;
    color: #1e2d4d;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap; /* يمنع انكسار النص */
}

.mira-page-btn:not([disabled]):hover {
    background: #1e2d4d;
    color: #fff;
    border-color: #1e2d4d;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30,45,77,0.15);
}

.mira-page-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

.mira-page-info {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #64748b;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap; /* يمنع انكسار النص */
}

/* --- 📱 السحر هنا: التنسيقات المخصصة لشاشات الجوال --- */
@media (max-width: 480px) {
    #mira-pagination-container {
        gap: 6px; /* تقليل الفراغ بين الأزرار */
        width: 100%;
    }
    
    .mira-page-btn {
        padding: 8px 12px; /* تصغير حجم الزر */
        font-size: 12px; /* تصغير الخط */
        border-radius: 8px;
        gap: 5px;
    }
    
    .mira-page-info {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 8px;
        flex: 1; /* يجعل النص بالمنتصف يتمدد لملء الفراغ بشكل متناسق */
        text-align: center;
    }
}


/* تنسيقات القوائم المنسدلة الاحترافية */
.mira-custom-dropdown {
    user-select: none;
    z-index: 10;
}

.mira-dropdown-header {
    background: #fff;
    border: 2px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 800;
    color: #1e2d4d;
    transition: all 0.3s ease;
}

.mira-dropdown-header:hover, 
.mira-custom-dropdown.open .mira-dropdown-header {
    border-color: #b48a32;
    box-shadow: 0 0 0 4px rgba(180, 138, 50, 0.1);
}

.mira-dropdown-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

/* حركة السهم عند الفتح */
.mira-custom-dropdown.open .mira-dropdown-icon {
    transform: rotate(180deg);
    color: #b48a32;
}

/* القائمة المخفية */
.mira-dropdown-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(30,45,77,0.1);
    list-style: none;
    padding: 10px;
    margin: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 250px;
    overflow-y: auto;
}

/* إظهار القائمة */
.mira-custom-dropdown.open .mira-dropdown-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* عناصر القائمة */
.mira-dropdown-list li {
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    color: #64748b;
    transition: 0.2s;
    margin-bottom: 2px;
}

.mira-dropdown-list li:hover {
    background: #f8fafc;
    color: #1e2d4d;
    padding-right: 20px; /* حركة بسيطة للنص عند التمرير */
}

.mira-dropdown-list li.active {
    background: #f0fdf4;
    color: #10b981;
    font-weight: 900;
}

/* --- إصلاح خروج الأزرار عن البطاقة في الجوال --- */

.mira-product-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap !important; /* 👈 السر هنا: السماح بالنزول لسطر جديد */
    gap: 10px;
    margin-bottom: 15px;
}

.mira-product-card .card-meta > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* السماح لمجموعات الأزرار والباركود بالالتفاف */
    gap: 8px;
}

/* تنسيقات خاصة لتصغير العناصر في الشاشات الصغيرة جداً لتجنب الزحام */
@media (max-width: 480px) {
    .badge-low-stock {
        font-size: 10px !important;
        padding: 4px 6px !important;
        text-align: center;
        line-height: 1.2;
    }
    
    .barcode-tag {
        font-size: 12px !important;
    }
    
    /* تصغير الأزرار الأربعة لضمان بقائها في سطر واحد إن أمكن */
    .btn-edit-product, 
    .btn-history-trigger, 
    .btn-adjust-trigger,
    .btn-print-label {
        width: 30px !important;
        height: 30px !important;
    }
    
    .btn-edit-product i, 
    .btn-history-trigger i, 
    .btn-adjust-trigger i,
    .btn-print-label i {
        font-size: 12px !important;
    }
}

/* --- إصلاح أزرار الإلغاء والإغلاق في جميع النوافذ المنبثقة --- */

.close-adj-modal, 
.close-add-barcodes-modal, 
.close-edit-modal, 
.close-pro-modal, 
.close-mira-modal,
.close-barcode-modal {
    background-color: #f8fafc !important; /* خلفية رمادية فاتحة جداً */
    color: #475569 !important; /* لون النص رمادي داكن مرئي بوضوح */
    border: 2px solid #cbd5e1 !important; /* إطار واضح */
    font-weight: 800 !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

/* تأثير جميل عند تمرير الماوس فوق زر الإلغاء */
.close-adj-modal:hover, 
.close-add-barcodes-modal:hover, 
.close-edit-modal:hover, 
.close-pro-modal:hover, 
.close-mira-modal:hover,
.close-barcode-modal:hover {
    background-color: #e2e8f0 !important; /* تغميق الخلفية قليلاً */
    color: #1e293b !important; /* تغميق النص */
    border-color: #94a3b8 !important;
}

/* إصلاح زر X الصغير في أعلى النوافذ (في الهيدر الكحلي) */
.modal-head button, .mira-pro-header button {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important; /* إجباره ليكون أبيض ليظهر على الكحلي */
}

.modal-head button:hover, .mira-pro-header button:hover {
    background: rgba(239, 68, 68, 0.8) !important; /* لون أحمر عند التمرير للإغلاق */
}

/* --- إصلاح حقول إدخال الأسعار (التوسيط العمودي ومنع قص الأرقام) --- */

.mira-smart-input-container {
    display: flex !important;
    align-items: center !important;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 15px !important; /* حشوة جانبية فقط، وإلغاء الحشوة العلوية/السفلية */
    height: 45px; /* تثبيت الارتفاع الكلي للحقل */
    transition: all 0.3s ease;
    overflow: hidden;
}

/* تنسيق الأيقونة (علامة السعر والسلة) */
.mira-smart-input-container i {
    color: #94a3b8;
    font-size: 16px;
    flex-shrink: 0;
}

/* تنسيق حقل الإدخال نفسه */
.mira-smart-input-container input {
    flex: 1 !important; /* يتمدد لملء باقي المساحة */
    height: 100% !important; /* يأخذ نفس ارتفاع الحاوية */
    border: none !important; /* إلغاء إطار الحقل الداخلي */
    background: transparent !important;
    padding: 0 10px !important; /* مسافة بسيطة بين الرقم والأيقونة */
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #1e2d4d !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: normal !important; /* 👈 هذا السطر يمنع انزياح الرقم للأسفل */
}

/* التأثير التفاعلي عند الضغط داخل الحقل (Focus) */
.mira-smart-input-container:focus-within {
    border-color: #b48a32;
    box-shadow: 0 0 0 4px rgba(180, 138, 50, 0.1);
}

.mira-smart-input-container:focus-within i {
    color: #b48a32; /* تلوين الأيقونة بالذهبي عند الكتابة */
}


/* --- 1. ميزة النسخ السريع للباركود --- */
.barcode-tag {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.barcode-tag:hover {
    background: #e2e8f0;
    color: #1e2d4d;
    transform: scale(1.02);
}
.barcode-tag::before {
    content: '\f0c5'; /* أيقونة النسخ من FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 8px;
    color: #94a3b8;
    transition: color 0.2s;
}
.barcode-tag:hover::before {
    color: #1e2d4d;
}

/* --- 2. حالة طوارئ المخزون (نفدت الكمية = 0) --- */
.mira-product-card[data-stock="0"] .card-meta {
    border-bottom: 2px dashed #fca5a5;
    padding-bottom: 10px;
}
.mira-product-card[data-stock="0"] .stock-box {
    background-color: #fef2f2 !important; /* خلفية حمراء باهتة */
    border-color: #fca5a5 !important;
}
.mira-product-card[data-stock="0"] .stock-val {
    color: #ef4444 !important; /* نص أحمر فاقع */
}
/* تبهيت صورة المنتج ليدل على عدم توفره */
.mira-product-card[data-stock="0"] .product-image-wrap img {
    filter: grayscale(100%) opacity(0.6);
}

/* --- 3. نافذة تكبير الصورة (Lightbox) --- */
.mira-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,0.9);
    backdrop-filter: blur(5px);
    z-index: 9999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}
.mira-lightbox-overlay.active {
    opacity: 1;
}
.mira-lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mira-lightbox-overlay.active .mira-lightbox-img {
    transform: scale(1);
}

/* --- 4. تعطيل زر السحب الذكي --- */
.stepper-btn.mira-disabled-btn {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    background: #f8fafc !important;
    color: #cbd5e1 !important;
}


/* --- تصميم بطاقات نوع التسوية الجردية --- */
.mira-adj-type-toggle {
    display: flex;
    gap: 15px;
}

.adj-radio-card {
    flex: 1;
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* إخفاء زر الراديو التقليدي */
.adj-radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* التصميم الافتراضي للبطاقة قبل الاختيار */
.adj-radio-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-weight: 800;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.adj-radio-card .card-content i {
    font-size: 22px;
    transition: transform 0.3s ease;
}

/* تأثير التمرير */
.adj-radio-card:hover .card-content {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* --- التأثير عند اختيار (نقص / سحب) --- */
.adj-radio-card.out input:checked + .card-content {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}
.adj-radio-card.out input:checked + .card-content i {
    transform: translateY(3px); /* حركة السهم للأسفل */
}

/* --- التأثير عند اختيار (فائض / إضافة) --- */
.adj-radio-card.in input:checked + .card-content {
    background: #f0fdf4;
    border-color: #10b981;
    color: #059669;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
}
.adj-radio-card.in input:checked + .card-content i {
    transform: translateY(-3px); /* حركة السهم للأعلى */
}


