@font-face {
    font-family: 'Cairo';
    src: url('{{ url_for('static', filename='fonts/Cairo-Regular.ttf') }}') format('truetype');
    font-weight: normal;
}
@font-face {
    font-family: 'Cairo';
    src: url('{{ url_for('static', filename='fonts/Cairo-Bold.ttf') }}') format('truetype');
    font-weight: bold;
}
body {
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
    background-color: #f0f8ff;
    overflow: hidden;
}
.navbar {
    background-color: #343a40 !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand, .nav-link {
    color: white !important;
}

.nav-link:hover {
    color: #adb5bd !important;
}
.nav-item a.nav-link[href*="/cashier"] {
    color: #ffc107 !important;
    font-weight: bold;
}
.sidebar {
    background-color: #f0f8ff; /* لون ريمادي فاتح */
    padding: 20px;
    height: 100vh;
    overflow-y: auto; /* إضافة شريط تمرير عمودي عند الحاجة */
}
.item-button {
    background: linear-gradient(145deg, #f0f0f0, #cacaca); /* Gradient background */
    border: none;
    border-radius: 10px;
    padding: 20px; /* Increase padding for larger buttons */
    cursor: pointer;
    width: 100%; /* Make buttons responsive */
    height: 70px; /* Set a fixed height */
    font-family: 'Cairo', sans-serif !important;
    font-size: 18px; /* تكبير حجم النص */
    font-weight: bold; /* جعل النص عريض */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff; /* 3D shadow effect */
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, box-shadow 0.4s; /* Smooth transition for hover effects */
    position: relative; /* For pseudo-elements */
    overflow: hidden; /* Hide overflow for pseudo-elements */
    
}


.item-button::before, .item-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(66, 59, 59, 0.2);
    transition: opacity 0.3s ease;
    z-index: 0;
    opacity: 0;
}
.item-button:hover {
    background: #343a40;   /* نفس لون الشريط العلوي وزر الأصناف المثبتة */
    color: #ffc107; 
    transition: background 0.2s, color 0.2s, box-shadow 0.2s; 
}
.item-button:active {
    transform: translateY(0) scale(1); /* Reset lift and scale on click */
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff; /* Reset shadow on click */
    background: linear-gradient(145deg, #d0d0d0, #c0c0c0); /* Slightly darker gradient on click */
}
.item-button span {
    position: relative; /* Ensure text is above pseudo-elements */
    z-index: 1;
}
.order-summary {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 500px; /* تحديد ارتفاع ثابت */
    overflow-y: auto; /* إضافة شريط تمرير عمودي عند الحاجة */
    flex-grow: 1;
}
.classic-calculator {
    width: 320px; /* زيادة عرض الآلة الحاسبة قليلاً */
    margin: 0 auto; /* توسيط الآلة الحاسبة */
    border: none; /* إزالة الحدود */
    border-radius: 10px; /* زيادة استدارة الزوايا */
    padding: 15px; /* زيادة المساحة الداخلية */
    background-color: #f0f0f0; /* لون خلفية رمادي فاتح */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* إضافة ظل خفيف */
}

.CalculatorModal-display {
    width: 100%;
    margin-bottom: 15px; /* زيادة المسافة أسفل شاشة العرض */
    padding: 10px; /* زيادة المساحة الداخلية لشاشة العرض */
    font-size: 22px; /* زيادة حجم الخط */
    border: none; /* إزالة الحدود */
    border-radius: 5px; /* زيادة استدارة الزوايا */
    background-color: #e8e8e8; /* لون خلفية أفتح لشاشة العرض */
    text-align: right; /* محاذاة النص إلى اليمين */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* إضافة ظل داخلي */
}

.CalculatorModal-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 أعمدة متساوية */
    grid-gap: 8px; /* زيادة المساحة بين الأزرار */
}

.CalculatorModal-button {
    padding: 12px; /* زيادة المساحة الداخلية للأزرار */
    font-size: 20px; /* زيادة حجم الخط */
    border: none; /* إزالة الحدود */
    border-radius: 5px; /* زيادة استدارة الزوايا */
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: #f9f9f9; /* لون خلفية الأزرار الافتراضي */
    color: #333; /* لون النص الافتراضي */
}

.CalculatorModal-button:hover {
    background-color: #e0e0e0; /* لون أفتح عند التمرير */
}

/* ألوان محددة للأزرار */
.operator-button {
    background-color: #ffc107; /* لون أصفر للعمليات (+, -, *, /) */
    color: #fff;
}

.clear-button {
    background-color: #dc3545; /* لون أحمر لزر المسح (C) */
    color: #fff;
}

.equal-button {
    background-color: #28a745; /* لون أخضر لزر يساوي (=) */
    color: #fff;
}

.btn-number {
    background-color: #fff;
}

.btn-operation {
    background-color: #f0ad4e; /* لون برتقالي للعمليات */
    color: white;
}

.btn-operation:hover {
    background-color: #eea236;
}

.btn-equal {
    background-color: #5cb85c; /* لون أخضر لعلامة يساوي */
    color: white;
}

.btn-equal:hover {
    background-color: #4cae4c;
}

.btn-secondary {
    background-color: #6b6868; /* لون رمادي للأزرار الثانوية */
}

.btn-secondary:hover {
    background-color: #9e9999;
}

.operation-buttons {
    margin-top: 20px; 
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between; 
    gap: 7px; /* زيادة المسافة بين الأزرار */
}
.operation-buttons .btn {
    margin-bottom: 10px; 
    flex: 1 1 22%; /* عرض الزر 22% للسماح بأربعة أزرار في الصف */
}
@media (max-width: 768px) {
    .order-summary, .sidebar {
        height: auto; /* Adjust height for smaller screens */
    }
    .operation-buttons .btn {
        flex: 1 1 48%; /* Adjust button width for smaller screens */
    }
}
/* ...existing code... */
.main-actions-grid {
    display: grid;
    grid-template-rows: repeat(2, 1fr); /* صفين أفقيين */
    grid-auto-flow: column;             /* توزيع العناصر أفقياً عبر الأعمدة */
    gap: 8px;
    align-items: stretch;
    width: 100%;
}
@media (max-width: 900px) {
    .main-actions-grid {
        grid-template-rows: repeat(1, 1fr); /* صف واحد فقط في الشاشات الصغيرة */
        grid-auto-flow: row;
    }
}
/* ...existing code... */
.cashier-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 95vh; /* Full window height */
}



.buttons-container {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-top: 1px solid #ccc; /* Optional: Add a border above the buttons */
}

.notification-icon {
    position: fixed;
    top: 10px;
    left: 10px; 
    font-size: 30px;
    color: orange;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease-in-out;
}



@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

.notification-popup {
    display: none;
    position: fixed;
    top: 50px;
    left: 10px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 300px;
    z-index: 1001;
}

.notification-popup h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: orange;
}

.notification-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-popup ul li {
    margin-bottom: 5px;
    font-size: 14px;
}

.notification-popup ul li:last-child {
    margin-bottom: 0;
}
@font-face {
  font-family: 'Digital-7';
  /* المسار النسبي الصحيح من ملف CSS إلى ملف الخط */
  src: url('../fonts/digital-7.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
#totalAmount {
    font-family: 'Digital-7', monospace, sans-serif;
    font-size: 55px;
    font-weight: normal;
    text-align: right;
    color: #ffc107;
    background-color: #343a40;
    padding: 5px 15px;
    border-radius: 5px;
    border: 1px solid #333; /* هذا السطر مناسب جداً للون الجديد */
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    line-height: 1;
    display: inline-block;
    margin-bottom: 10px;
    text-shadow: 0 0 4px rgba(255, 193, 7, 0.5);
}
#currentDateTime {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    color: #26e426;
    text-shadow: 0 0 3px rgba(46, 204, 113, 0.5);
}
#paymentModal input[type="text"] { /* يمكنك تعديل المحدد ليشمل type="text" */
    direction: ltr;
    text-align: center;
    font-family: 'Cairo', Helvetica, sans-serif;
}
#editItemModal input[type="text"] {
    direction: ltr;
    text-align: center;
    font-family: 'Cairo', Helvetica, sans-serif;
}
/* (اختياري) تحسين بسيط لشكل الأرقام داخل حقول الإدخال */
#paymentModal input[type="number"],
#paymentModal input[type="text"] {
    font-family: 'Cairo', Helvetica, sans-serif; /* استخدام خط واضح للأرقام */
}
.order-summary table th,
.order-summary table td {
    padding: 8px;
    text-align: center;
}

.order-summary table th:nth-child(1),
.order-summary table td:nth-child(1) {
    width: 5%; /* عرض العمود الأول */
}

.order-summary table th:nth-child(2),
.order-summary table td:nth-child(2) {
    width: 35%; /* عرض العمود الثاني (الاسم) */
}

.order-summary table th:nth-child(3),
.order-summary table td:nth-child(3) {
    width: 15%; /* عرض العمود الثالث (الكمية) */
}

.order-summary table th:nth-child(4),
.order-summary table td:nth-child(4) {
    width: 15%; /* عرض العمود الرابع (السعر) */
}

.order-summary table th:nth-child(5),
.order-summary table td:nth-child(5) {
    width: 15%; /* عرض العمود الخامس (الخصم) */
}

.order-summary table th:nth-child(6),
.order-summary table td:nth-child(6) {
    width: 15%; /* عرض العمود السادس (المجموع) */
}

.order-summary table th:nth-child(7),
.order-summary table td:nth-child(7) {
    width: 5%; /* عرض العمود السابع */
}
.text-center {
    text-align: center;
}
.highlight {
    background-color: #97ccf0; /* لون أخضر فاتح */
    transition: background-color 0.5s ease-out; /* تأثير الانتقال */
}
#kilogramModal .modal-content {
    background-color: #f0f8ff; /* لون خلفية AliceBlue فاتح جدًا لتحسين الرؤية */
    border: 1px solid #90EE90; /* لون أخضر فاتح (LightGreen) للحدود، أنيق وغير طاغٍ */
    border-radius: 10px; /* زوايا مستديرة */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* ظل خفيف جدًا (لإضافة عمق دون إزعاج) */
}

#kilogramModal .modal-header {
    background-color: #3CB371; /* لون أخضر متوسط (MediumSeaGreen) للرأس، يتماشى مع الأخضر الفاتح */
    color: #fff; /* لون النص أبيض (أو قريب من الأبيض) لتحقيق أقصى قدر من التباين */
    border-bottom: 1px solid #2E8B57; /* لون أخضر داكن (SeaGreen) لحدود أسفل الرأس */
    padding: 10px 15px; /* إضافة مساحة داخلية للرأس */
}

#kilogramModal .modal-body {
    background-color: #fff; /* لون خلفية الجسم أبيض (أو قريب من الأبيض) لتحسين الرؤية */
    color: #333; /* لون النص رمادي داكن (أو أسود) لقراءة سهلة */
    padding: 15px; /* إضافة مساحة داخلية للجسم */
}

#kilogramModal .btn-primary {
    background-color: #228B22; /* لون أخضر غابة (ForestGreen) للأزرار، أكثر احترافية */
    border-color: #228B22; /* نفس لون الخلفية للحدود */
    color: #fff; /* لون النص أبيض (أو قريب من الأبيض) لتحقيق أقصى قدر من التباين */
    padding: 8px 16px; /* إضافة مساحة داخلية للأزرار */
    border-radius: 5px; /* زوايا مستديرة للأزرار */
}

#kilogramModal .btn-primary:hover {
    background-color: #006400; /* لون أخضر زيتوني (DarkGreen) أغمق عند التمرير */
    border-color: #006400; /* نفس لون الخلفية للحدود */
}

/* تحسينات إضافية (اختيارية) */
#kilogramModal .modal-title {
    font-size: 1.2em; /* زيادة حجم عنوان التبويب */
    font-weight: bold; /* جعل عنوان التبويب عريضًا */
}

#kilogramModal label {
    color: #555; /* لون تسميات الحقول (Labels) رمادي أغمق */
    margin-bottom: 5px; /* إضافة مساحة أسفل التسميات */
    display: block; /* جعل التسميات تظهر في سطر منفصل */
}

#kilogramModal input[type="text"],
#kilogramModal input[type="number"],
#kilogramModal select {
    padding: 8px; /* إضافة مساحة داخلية لحقول الإدخال */
    border: 1px solid #ccc; /* حدود رمادية لحقول الإدخال */
    border-radius: 4px; /* زوايا مستديرة لحقول الإدخال */
    margin-bottom: 10px; /* إضافة مساحة أسفل حقول الإدخال */
    width: 100%; /* جعل حقول الإدخال تأخذ عرض الحاوية بالكامل */
}
/* اللون الأخضر للدفع النقدي بتدرج */
.payment-modal-cash {
    background: linear-gradient(135deg, #a8e063, #56ab2f); /* تدرج أخضر فاتح إلى أخضر داكن */
}

/* اللون الأحمر للدفع الآجل بتدرج */
.payment-modal-credit {
    background: linear-gradient(135deg, #ffb199, #ff0844); /* تدرج أحمر فاتح إلى أحمر داكن */
}

/* اللون الأزرق لبطاقة الائتمان (كما هو) */
.payment-modal-creditcard {
    background: linear-gradient(135deg, #90caf9, #1565c0); /* تدرج أزرق فاتح إلى أزرق داكن */
}
/* Switch Style */
.form-check.form-switch {
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.form-check-input:checked {
    background-color: #28a745; /* لون أخضر عند التفعيل */
}

.form-check-input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease-in-out;
}

.form-check-input:checked::before {
    transform: translateX(20px);
}
.payment-modal-cash {
    background: linear-gradient(135deg, #85e085, #4caf50); /* تدرج أخضر */
}

.payment-modal-credit {
    background: linear-gradient(135deg, #f78c8c, #f44336); /* تدرج أحمر */
}
.exchange-icon {
    position: fixed;
    top: 10px;
    left: 60px; /* بجانب أيقونة الجرس */
    font-size: 30px;
    color: blue;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease-in-out;
}

.exchange-popup {
    position: fixed;
    top: 50px;
    left: 60px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 10px;
    width: 400px; /* زيادة العرض */
    z-index: 1010;
    text-align: right; /* محاذاة النص إلى اليمين */
    direction: rtl; 
}
.exchange-popup h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: blue;
}

.exchange-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exchange-popup ul li {
    margin-bottom: 5px;
    font-size: 14px;
}

.exchange-popup ul li:last-child {
    margin-bottom: 0;
}
.exchange-popup input[type="number"] {
    border: none;
    border-bottom: 1px solid #ccc; /* خط سفلي فقط */
    background: transparent; /* إزالة الخلفية */
    outline: none; /* إزالة الإطار عند التركيز */
    width: 100px; /* عرض الحقل */
    text-align: center; /* محاذاة النص إلى المنتصف */
    font-size: 14px; /* حجم النص */
    padding: 2px 0; /* تقليل الحشو */
    transition: border-color 0.3s ease; /* تأثير عند التفاعل */
}

.exchange-popup input[type="number"]:focus {
    border-bottom: 1px solid blue; /* تغيير لون الخط عند التركيز */
}

#cartonModal .tab-content {
    color: gray; /* لون النص رمادي دائمًا */
}

        /* --- تغيير خلفية التبويبات غير النشطة في نافذة الكرتونة --- */
#cartonModal .nav-tabs .nav-link:not(.active) {
    background-color: #e9ecef; /*!-- لون رمادي فاتح جداً للخلفية --*/
    color: #495057;             /*!-- تأكيد لون النص الداكن لضمان التباين --*/
    border-color: transparent transparent #dee2e6 transparent; /* تعديل الحدود لتناسب الخلفية */
}

#cartonModal .nav-tabs .nav-link:not(.active):hover {
    background-color: #dee2e6; /*!-- لون أغمق قليلاً عند المرور --*/
    color: #0056b3;             /* لون النص عند المرور */
    border-color: transparent transparent #dee2e6 transparent; /* تعديل الحدود عند المرور */
}

/* تأكد من أن التبويب النشط له خلفية بيضاء أو واضحة */
#cartonModal .nav-tabs .nav-link.active {
    background-color: #007bff;    /* خلفية بيضاء للتبويب النشط */
    color: #007bff;             /* لون النص للتبويب النشط */
    border-color: #dee2e6 #dee2e6 #fff; /* حدود التبويب النشط */
}
/* التبويبات غير النشطة: خلفية رمادية فاتحة ونص داكن */
#kilogramModal .nav-tabs .nav-link:not(.active) { /* استهداف نافذة الكيلوغرام */
    background-color: #e9ecef; /*!-- خلفية رمادية فاتحة جداً --*/
    color: #495057;             /*!-- نص رمادي داكن --*/
    border-color: transparent transparent #dee2e6 transparent; /* حدود معدلة */
}

#kilogramModal .nav-tabs .nav-link:not(.active):hover {
    background-color: #dee2e6; /*!-- خلفية أغمق قليلاً عند المرور --*/
    color: #0056b3;             /* نص أزرق عند المرور */
    border-color: transparent transparent #dee2e6 transparent; /* حدود عند المرور */
}

/* التبويب النشط: خلفية زرقاء ونص أبيض (مطابق لما اعتمدته) */
#kilogramModal .nav-tabs .nav-link.active {
    background-color: #289628;    /*!-- *** خلفية زرقاء للتبويب النشط *** --*/
    color: #ffffff;             /*!-- *** نص أبيض للتبويب النشط (للتباين) *** --*/
    border-color: #007bff #007bff #007bff; /*!-- حدود متناسقة مع الخلفية الزرقاء --*/
}
/* --- إصلاح لون نص التبويبات غير النشطة في نافذة الكرتونة --- */
.invoice-preview-tooltip {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
    /* إزالة transform و margin */
    pointer-events: none; /* لمنع التداخل مع العناصر الأخرى */
}
/* تحديث أنماط الجدول داخل tooltip */
.invoice-preview-tooltip table {
    width: 100%;
    margin-bottom: 0;
    background: white;
}

.invoice-preview-tooltip table th,
.invoice-preview-tooltip table td {
    padding: 4px 8px;
    font-size: 0.9em;
    text-align: right;
}

.invoice-preview-tooltip .total-row {
    font-weight: bold;
    border-top: 2px solid #ddd;
}


/* Find the existing toast styles in the <style> section */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease-in;
    direction: rtl;
}

.toast-success {
    background-color: #28a745; /* Green */
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.toast-credit {
    background-color: #dc3545; /* Red */
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.toast-return {
    background-color: #fd7e14; /* Orange */
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

/* --- ADD THIS NEW STYLE --- */
.toast-warning {
    background-color: #ffc107; /* Yellow/Gold Warning Color */
    color: #212529; /* Darker text for better contrast on yellow */
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}
/* --- End of New Style --- */


.toast-show {
    opacity: 1;
}
.toast-info {
    background-color: #17a2b8; /* Teal/Info Color */
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}
.form-group label,
.form-group .form-control,
.form-group .form-text {
    text-align: center;
}
/* --- توسيط نص نتائج البحث عن الزبائن في نافذة الدفع --- */
#customerSearchResults .customer-result-item {
    text-align: center; /* هذه الخاصية تقوم بتوسيط النص داخل العنصر */
}
#pendingInvoicesBtn {
    position: relative; /* ضروري لتحديد موضع الشعار بالنسبة للزر */
    overflow: visible; /* للسماح للشعار بالظهور خارج حدود الزر قليلاً */
}

.pending-badge {
    display: none; /* إخفاء الشعار مبدئيًا */
    position: absolute;
    top: -5px;      /* تعديل الموضع الرأسي حسب الحاجة */
    right: -5px;     /* تعديل الموضع الأفقي حسب الحاجة */
    width: 12px;     /* عرض الشعار */
    height: 12px;    /* ارتفاع الشعار */
    background-color: red; /* لون الخلفية (أحمر للتنبيه) */
    border-radius: 50%; /* لجعله دائريًا */
    border: 1px solid white; /* حد أبيض صغير للمظهر */
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); /* ظل خفيف */
    animation: pulse 1.5s infinite; /* إضافة حركة نبض خفيفة */
}

/* تعريف حركة النبض */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* فئة لإظهار الشعار */
.pending-badge.show {
    display: inline-block; /* أو block حسب الحاجة */
}

.payment-modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    /* إعادة تعريف لون خلفية النافذة عند اختيار نقدا أو آجل (باستخدام الألوان الأصلية المطلوبة) */
    transition: background 0.3s ease-in-out; /* Smooth transition for background color change */
}
/* اللون الأخضر الأصلي للدفع النقدي */
.payment-modal-content.payment-modal-cash {
    background: linear-gradient(135deg, #85e085, #4caf50);
}
/* اللون الأحمر الأصلي للدفع الآجل */
.payment-modal-content.payment-modal-credit {
    background: linear-gradient(135deg, #f78c8c, #f44336);
}


.payment-modal-header {
    border-bottom: none;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef); /* الحفاظ على رأس رمادي فاتح للتباين */
    padding-top: 15px;
    padding-bottom: 10px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.payment-modal-header .modal-title {
    font-weight: 600;
    color: #495057; /* لون النص في الرأس */
}

/* تعديل لون النص الأساسي داخل جسم النافذة لضمان الوضوح على الخلفيات الملونة */
.payment-modal-body {
    padding: 25px 30px;
    color: #333; /* لون نص أغمق قليلًا للوضوح */
}

.payment-label {
    display: block;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 500;
    color: #fff; /* تغيير لون التسميات إلى أبيض للتباين مع الخلفيات الملونة */
    font-size: 1.05em;
    /* إضافة ظل خفيف للنص لتحسين القراءة (اختياري) */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* النمط العام لحقول الإدخال */
.payment-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1); /* حد أفتح قليلاً */
    padding: 10px 15px;
    font-size: 1.1em;
    line-height: 1.5;
    background-color: rgba(255, 255, 255, 0.9); /* خلفية بيضاء شبه شفافة قليلاً */
    background-clip: padding-box;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    color: #333; /* لون النص داخل الحقول */
}

input[type="text"].payment-input,
input[type="number"].payment-input {
    text-align: center;
}

#paymentMethod.payment-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    direction: rtl;
    text-align: center;
    text-align-last: center;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 25px;
    padding-left: 25px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22%23343a40%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M1.646%204.646a.5.5%200%200%201%20.708%200L8%2010.293l5.646-5.647a.5.5%200%200%201%20.708.708l-6%206a.5.5%200%200%201-.708%200l-6-6a.5.5%200%200%201%200-.708z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 16px 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #333; /* لون النص المحدد */
    font-size: 1.1em; /* يمكنك تغيير هذه القيمة (مثل 1.2em, 1em, 16px) */
    line-height: 1.5;
    height: 50px; /* زيادة ارتفاع الحقل */
}

.payment-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background-color: #fff; /* تأكيد خلفية بيضاء عند التركيز */
}

/* حقل المبلغ المدفوع الكبير */
.large-input {
    font-size: 1.5em !important;
    font-weight: bold;
    height: auto;
    color: #007bff; /* لون أزرق للمبلغ المدفوع للتمييز */
}

/* حقل المبلغ المتبقي */
.remaining-amount-display {
    background-color: rgba(255, 255, 255, 0.7); /* خلفية شفافة قليلاً */
    font-weight: bold;
    color: #dc3545; /* لون أحمر للمتبقي */
    font-size: 1.2em !important;
    border-color: rgba(220, 53, 69, 0.3); /* حد خفيف بلون أحمر */
}

.preset-buttons-container .preset-cash-btn {
    margin: 0 3px;
    padding: 5px 10px;
    font-size: 0.85em;
    border-radius: 15px;
    transition: all 0.2s ease-in-out;
    color: white;
    border: none;
    font-weight: bold;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* إضافة ظل للأزرار */
}
.preset-buttons-container .preset-cash-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 7px rgba(0,0,0,0.25);
}
/* تحديد ألوان الأزرار المختلفة */
.preset-50 { background-color: #28a745; }
.preset-50:hover { background-color: #218838; }

.preset-100 { background-color: #198754; }
.preset-100:hover { background-color: #146c43; }

.preset-200 { background-color: #0f5132; }
.preset-200:hover { background-color: #0b4026; }

/* أنماط زر "المبلغ بالضبط" */
.preset-exact {
   color: #0d6efd !important; /* لون النص أزرق */
   font-weight: normal !important;
   background-color: rgba(255, 255, 255, 0.8) !important; /* خلفية بيضاء شفافة قليلاً */
   border: 1px solid #0d6efd !important;
   padding: 5px 10px;
   font-size: 0.85em;
   line-height: 1.4;
   box-shadow: none; /* إزالة الظل من الزر المخطط */
}
.preset-exact:hover {
    color: white !important;
    background-color: #0d6efd !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* إضافة ظل عند المرور */
}
/* --- نهاية أنماط الأزرار المحددة --- */

/* أنماط قائمة نتائج بحث العملاء */
.customer-search-results-list {
    position: absolute;
    z-index: 1051;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    display: none;
    background-color: white;
    top: 100%;
    left: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* أنماط حاوية مفتاح الطباعة */
.print-switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.print-switch-container .form-check-label {
    margin-right: 8px; /* تقليل المسافة قليلاً */
    margin-left: 0;
    color: #fff; /* لون أبيض للتسمية */
    font-size: 0.95em; /* تصغير حجم الخط قليلاً */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2); /* ظل للنص */
}
.print-switch-container .form-check-input {
    flex-shrink: 0; /* منع المفتاح من الانكماش */
}

/* أنماط زر إتمام الدفع */
.submit-payment-btn {
    padding: 10px 18px; /* تعديل الحشو */
    font-size: 1.1em; /* تعديل حجم الخط */
    font-weight: bold;
    border-radius: 8px;
}
.submit-payment-btn i {
    margin-left: 5px; /* مسافة للأيقونة */
}
        /* ...existing code... */
.notification-icon {
    /* ... */
    transition: color 0.2s, transform 0.2s;
}
.notification-icon.shake {
    animation: shake 0.7s infinite;
    color: #e53935 !important;
    animation: shake 0.5s infinite;
}
#expirySoonIcon { color: #ff9800 !important; }
#expiredIcon { color: #e53935 !important; }
        /* اجعل النص يبدأ من اليمين في جميع قوائم الإشعارات */
#expirySoonList,
#expiredList {
    direction: rtl;
    text-align: right;
}
/* ...existing code... */
.shortcuts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px; /* مسافة بين الأعمدة والصفوف */
    direction: rtl;
}

/* ...existing code... */
.shortcut-widget {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #fff8e1;
    border-radius: 8px;
    margin-bottom: 0; /* أزل المسافة السفلية لأن grid يتكفل بها */
    padding: 7px 12px 7px 12px;
    box-shadow: 0 1px 4px rgba(255,168,0,0.07);
}

.shortcut-key {
    min-width: 48px;
    text-align: center;
    background: #ffe0b2;
    color: #ff9800;
    font-weight: bold;
    font-size: 1.1em;
    border-radius: 6px;
    padding: 4px 12px;
    margin-left: 12px;
    margin-right: 0;
    box-shadow: 0 1px 2px rgba(255,168,0,0.08);
    border: 1px solid #ffd54f;
    display: inline-block;
}

.shortcut-desc {
    flex: 1;
    text-align: right;
    color: #333;
    font-size: 1em;
    font-weight: 500;
    margin-right: 0;
    margin-left: 12px;
}
/* ...existing code... */
/* تنسيق أزرار الأصناف الثابتة لتكون متساوية العرض وتقص النص الطويل */
#fixed-items-row .item-button {
    min-width: 0;
    flex: 1 1 0;
    max-width: 25%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 6px;
    font-size: 1.05em;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    margin: 0;
    margin-bottom: 0;
    margin-top: 0;
    margin-right: 0;
    margin-left: 0;
    box-sizing: border-box;
}

#fixed-items-row .item-button span {
    display: block;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#itemsContainer {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#fixed-items-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 48px; /* حتى لو لم يوجد أزرار يبقى مكانها */
}

#category-items-row {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;   /* المسافة الأفقية بين الأزرار */
    row-gap: 2px;      /* المسافة الرأسية بين الأزرار (قللها كما تريد) */
    min-height: 60px;
}

/* أزرار الأصناف المثبتة */
/* أزرار الأصناف المثبتة بلون مثل الشريط العلوي ونص برتقالي */
#fixed-items-row .item-button,
#fixed-items-row .fixed-item-btn {
    background: #343a40;   /* نفس لون الشريط العلوي */
    color: #ffc107;        /* نص برتقالي */
    border: none;
    font-weight: bold;
}
/* ...existing code... */
.active-print { 
    color: #ff9800 !important; 
    text-shadow: 0 0 8px #ff980055; 
}
/* ...existing code... */
.print-icon-toggle .fa-print {
    transition: color 0.2s, text-shadow 0.2s;
    position: relative;
}
.print-icon-toggle .fa-print.strike-print::after {
    content: "";
    position: absolute;
    right: 10%;
    left: 10%;
    top: 50%;
    height: 2px;
    background: #e53935;
    transform: rotate(-12deg);
    z-index: 2;
    pointer-events: none;
}
#itemDetailsModal .modal-content {
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #d1d1d1;
    transition: none;
    position: relative;
    overflow: hidden;
}

#itemDetailsModal .modal-header {
    background: #f5f5f5;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    text-align: center;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    transition: none;
}

#itemDetailsModal .modal-title {
    width: 100%;
    text-align: center;
    color: #222;
    font-weight: bold;
    letter-spacing: 0.5px;
    font-size: 1.15em;
}

#itemDetailsModal .modal-body {
    text-align: center;
    font-size: 1.08em;
    color: #222;
    padding: 22px 14px 16px 14px;
    background: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    transition: none;
    position: relative;
    z-index: 2;
    border-radius: 10px;
}

#itemDetailsModal .modal-body strong {
    color: #1976d2;
    font-weight: bold;
}

#itemDetailsModal .close {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 1.5em;
    color: #888;
    opacity: 0.8;
}

/* احذف أو عطل الخلفية الضبابية نهائياً */
#itemDetailsModal .item-details-bg {
    display: none !important;
}
/* --- شبكة أصناف الكاشير --- */
/* --- شبكة أصناف الكاشير المعدلة --- */
.cashier-grid-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* gap صغير وثابت */
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 10px;
    direction: rtl;
}

.cashier-grid-item {
    flex: 0 0 calc(33.3333% - 6px); /* اطرح جزء من gap */
    width: calc(33.3333% - 6px);
    min-width: 0;
    max-width: 100%;
    aspect-ratio: 1 / 1.5;
    margin-bottom: 12px;
    background: linear-gradient(145deg, #f0f0f0, #cacaca);
    border-radius: 12px;
    box-shadow: 3px 3px 8px #bebebe, -3px -3px 8px #ffffff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 0;
    text-align: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: none;
    transition: box-shadow 0.2s, background 0.2s;
}

/* منع تغيير عدد الأعمدة في الشاشات الصغيرة */
@media (max-width: 900px) {
    .cashier-grid-item {
        flex: 0 0 calc(33.3333% - 6px);
        width: calc(33.3333% - 6px);
        min-width: 0;
        max-width: 100%;
    }
}
.cashier-grid-item .item-name {
    font-weight: bold;
    font-size: 1.1em;
    padding: 7px 4px 0 4px;
    color: #333;
    background: transparent;
    min-height: 32px;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
    z-index: 2;
    background: #f0f0f0;
}

.cashier-grid-item:hover .item-name {
    color: #ffc107;
    background: #343a40; /* نفس لون الشريط العلوي */
    transition: background 0.2s, color 0.2s;
}
.cashier-grid-item:hover .item-price {
    background: #343a40;
    color: #ffc107;
    transition: background 0.2s, color 0.2s;
}
.cashier-grid-item .item-image {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    padding: 0;
    margin: 0;
    /* أزل أي حدود أو خلفية */
    background: none;
}

.cashier-grid-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    box-shadow: none;
    aspect-ratio: unset;
    display: block;
    image-rendering: auto;
}

.cashier-grid-item .item-price {
    font-size: 1.05em;
    font-weight: bold;
    color: #1976d2;
    background: #f8f8f8;
    padding: 8px 0 8px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
    width: 100%;
    position: relative;
    left: 0;
    bottom: 0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 2;
}

.cashier-grid-item .carton-toggle-icon {
    position: absolute;
    top: 7px;
    left: 7px;
    font-size: 1.1em;
    z-index: 3;
}
/* ========================================= */
/* ==== بداية: ستايل مؤشر التحميل الجديد ==== */
/* ========================================= */

#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 250, 252, 0.95); /* خلفية شبه شفافة */
    z-index: 9999; /* ليكون فوق كل شيء */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.5s ease;
}

#loader-wrapper.hidden {
    opacity: 0;
    pointer-events: none; /* لمنع التفاعل مع المؤشر بعد إخفائه */
}

.loader-container {
    text-align: center;
    color: #4a5568;
    max-width: 300px;
}

.loader-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: #38a169; /* أخضر */
    margin-bottom: 20px;
    animation: bounce 2s infinite ease-in-out;
}

.loader-logo span {
    margin-left: 10px;
    color: #2d3748;
}

.loader-logo .fa-seedling {
    color: #ffc107; /* أصفر وتد */
}

.loader-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loader-progress {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #38a169);
    border-radius: 4px;
    animation: loading-progress 2s infinite linear;
}

.loader-text {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* حركة الشعور بالتحميل للشعار */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* حركة شريط التقدم */
@keyframes loading-progress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}










/* ============================================================= */
/* ==== بداية: ستايل نص الزر حسب المخزون (النسخة النهائية 2) ==== */
/* ============================================================= */

/* تأثير انتقال سلس للخصائص */
.item-button {
    transition: color 0.3s ease, opacity 0.3s ease, box-shadow 0.2s ease;
}
.item-button span {
    transition: color 0.3s ease;
}

/* 1. الحالة الافتراضية (Hover) لكل الأزرار النشطة */
.item-button:hover {
    background: #343a40;
    color: #ffc107; /* اللون البرتقالي/الأصفر الافتراضي عند المرور */
    box-shadow: 7px 7px 12px #bebebe, -7px -7px 12px #ffffff;
}

/* 2. حالة المخزون المنخفض (تجاوز اللون الافتراضي عند المرور) */
/* سيتم تغيير لون النص "span" فقط إلى الأحمر */
.item-button.stock-low:hover span {
    color: #dc3545 !important; /* أحمر زاهي مع important لضمان الأولوية */
}

/* 3. حالة نفاد المخزون وغير مسموح بالبيع (لا تغيير هنا) */
.item-button.stock-out-blocked {
    opacity: 0.65;
    cursor: not-allowed;
    color: #6c757d;
}
.item-button.stock-out-blocked:hover span {
    color: #dc3545;
}
/* نلغي تغيير الخلفية للزر المحظور عند المرور */
.item-button.stock-out-blocked:hover {
    background: linear-gradient(145deg, #e0e0e0, #bcbcbc);
    color: #6c757d;
}


#connection-status-banner {
    position: fixed;
    /* توسيط أفقي ديناميكي */
    left: 50%;
    transform: translateX(-50%) translateY(-150%); /* ابدأ مخفياً و في المنتصف */
    
    top: 20px; /* المسافة من أعلى الشاشة */
    width: auto; /* أهم تعديل: العرض يتناسب مع المحتوى */
    
    padding: 8px 25px; /* حشوة داخلية (أفقية أكبر من العمودية) */
    border-radius: 50px; /* للحصول على الحواف الدائرية (شكل حبة الدواء) */
    
    color: white;
    text-align: center;
    font-weight: bold;
    z-index: 1051;
    transition: transform 0.5s ease-in-out, background-color 0.5s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.0em; /* يمكن تعديل حجم الخط حسب الرغبة */
}

#connection-status-banner.status-disconnected {
    background-color: #dc3545; /* أحمر للخطر */
    /* يظهر في المنتصف وينزل للأسفل قليلاً */
    transform: translateX(-50%) translateY(0);
}

#connection-status-banner.status-connected {
    background-color: #28a745; /* أخضر للنجاح */
    /* يظهر في المنتصف وينزل للأسفل قليلاً */
    transform: translateX(-50%) translateY(0);
}