﻿/* حاوية الجدول */
.grid-container {
    background: #ffffff;
    overflow: hidden;
}

/* تخصيص الجدول */
.custom-erp-grid {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

    /* الهيدر الخاص بالجدول */
    .custom-erp-grid thead th {
        background-color: #f8f9fa !important;
        color: #495057;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        padding: 12px 8px !important;
        border-bottom: 2px solid #dee2e6 !important;
    }

    /* تأثير عند تمرير الماوس على الصفوف */
    .custom-erp-grid tbody tr:hover {
        background-color: #f1f5ff !important;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

/* الأفاتار الصغير لاسم المستخدم */
.user-avatar-sm {
    width: 24px;
    height: 24px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #6c757d;
}

/* البادج المخصص */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
}

/* جعل الجدول يتنفس في الشاشات الصغيرة */
@media (max-width: 768px) {
    .custom-erp-grid {
        font-size: 0.8rem;
    }
}

/* شريط الأدوات العلوي */
.erp-toolbar {
    background: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* زر الأيقونات المطور */
.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
    color: #495057;
    transition: all 0.2s ease;
    text-decoration: none;
}

    .icon-btn i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .icon-btn .label {
        font-size: 11px;
        font-weight: 500;
        text-transform: uppercase;
    }

    .icon-btn:hover {
        background-color: #f8f9fa;
        color: #0d6efd;
        border-color: #dee2e6;
    }

    .icon-btn.active {
        background-color: #e7f1ff;
        color: #0d6efd;
    }

    .icon-btn.text-danger:hover {
        background-color: #fff5f5;
        color: #dc3545 !important;
    }

/* فواصل عمودية أنيقة */
.toolbar-divider {
    width: 1px;
    height: 30px;
    background-color: #dee2e6;
    margin: 0 8px;
}

/* صندوق الفلاتر */
.filter-card {
    background: #fdfdfd;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    padding: 20px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
}

/* تحسين شكل الليبل */
.form-label-custom {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

/* تقسيم عمودي ناعم */
.vertical-divider {
    border-right: 1px solid #edf0f2;
}

/* صندوق الإجماليات في الأسفل */
.summary-box {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.total-highlight {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0d6efd;
}

/* تنسيق الجداول داخل التاب */
.tab-table-container {
    min-height: 300px;
}

.table-responsive {
    border-radius: 8px;
    overflow-x: auto; /* يسمح بالتمرير الأفقي فقط للجداول */
}

.text-nowrap {
    white-space: nowrap; /* يمنع نزول الأرقام لسطر جديد */
}
/* تأثير بسيط عند تمرير الماوس على الصفوف */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
    transition: background-color 0.2s ease;
}

/* تنسيق أزرار العمليات */
.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}
.cursor-pointer {
    cursor: pointer;
    transition: transform 0.2s;
    display: inline-block;
}

    .cursor-pointer:hover {
        transform: scale(1.2);
    }
/* تمييز الأسطر الرئيسية بلون خفيف جداً */
.table-light-alt {
    background-color: #fcfcfc !important;
}

/* تحسين شكل أيقونات التوسيع */
.btn-link {
    font-size: 0.8rem;
    line-height: 1;
    vertical-align: middle;
}

/* تأثير التمرير على الجدول */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.03) !important;
}

/* خط فاصل عمودي بسيط لإظهار التدرج الشجري (اختياري) */
.table td {
    position: relative;
}

/* تحسين شكل المدخلات داخل الجدول */
.custom-input-select, .custom-input-text, .bg-highlight-input {
    background-color: #fcfcfc !important; /* خلفية فاتحة جداً لتمييزها عن الجدول */
    border: 1px solid #e9ecef !important;
    transition: all 0.2s;
}

    .custom-input-select:focus, .custom-input-text:focus, .bg-highlight-input:focus {
        background-color: #ffffff !important;
        border-color: #0d6efd !important;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1) !important;
    }

/* تلوين حقل المبلغ ليكون واضحاً جداً */
.bg-highlight-input {
    background-color: #fffdec !important; /* لون كريمي خفيف جداً لجذب العين للمبلغ */
}

/* الحاويات والفواصل */
.border-end-lg {
    border-right: 1px solid #eee;
}

/* التجاوب مع الشاشات الصغيرة */
@media (max-width: 991px) {
    .border-end-lg {
        border-right: none;
        border-bottom: 1px solid #eee;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    /* التأكد من أن الجدول لا ينكمش ويسمح بالتمرير */
    .custom-table-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* تأثير تمرير لطيف للجدول */
.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
/* تمييز حقول الإدخال داخل الجدول */
.table-input-style {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
}

    .table-input-style:focus {
        background-color: #ffffff !important;
        border-color: #0d6efd !important;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1) !important;
    }

/* تمييز حقل المبلغ */
.amount-input-style {
    background-color: #fffdec !important; /* لون كريمي لتمييزه */
    border: 1px solid #ffecb3 !important;
}

/* التحكم في اسكرول الجدول للشاشات الصغيرة */
.custom-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.border-end-lg {
    border-right: 1px solid #dee2e6;
}

@media (max-width: 991px) {
    .border-end-lg {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
}

/* التزاماً بنفس الـ Style العام للمشروع */
.bg-highlight-debit {
    background-color: rgba(25, 135, 84, 0.04) !important;
}

.bg-highlight-credit {
    background-color: rgba(220, 53, 69, 0.04) !important;
}

.custom-table-scroll {
    max-height: 550px;
    overflow-x: auto;
}

/* تحسين شكل الـ Select في الفلاتر */
.form-select-sm, .form-control-sm {
    border-radius: 6px;
}

.barcode-wrapper .form-control {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease-in-out;
}

    .barcode-wrapper .form-control:focus {
        background-color: #fff !important;
        border-color: #0d6efd;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    }

    /* لجعل النص يبدو كأنه Badge عند الكتابة */
    .barcode-wrapper .form-control::placeholder {
        color: #6c757d;
        font-size: 0.85rem;
    }