﻿hr {
    color: #1D92EB;
}

@media print {
    body {
        background-color: red !important;
    }

    tbody {
        word-break: break-word;
    }

    #Description {
        min-width: 225px !important;
    }

    #Period {
        min-width: 100px !important;
    }

    #Threshold {
        min-width: 50px !important;
    }

    #Min {
        min-width: 30px !important;
    }

    #Mix {
        min-width: 30px !important;
    }

    #Field1 {
        min-width: 30px !important;
    }
}


/* ===== Modal تفاصيل الفاتورة ===== */

/* --- رأس الفاتورة --- */
.inv-header-bar {
    background: #f4f6fb;
    border: 1px solid #dde3f0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.inv-header-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dde3f0;
    background: #fff;
}
.inv-field {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    flex: 1 1 130px;
    border-left: 1px solid #dde3f0;
    min-width: 0;
}
[dir="rtl"] .inv-field { border-left: none; border-right: 1px solid #dde3f0; }
.inv-field:first-child { border-right: none; }
[dir="rtl"] .inv-field:first-child { border-right: none; }
.inv-field:last-child  { border-left: none; }
[dir="rtl"] .inv-field:last-child  { border-right: 1px solid #dde3f0; border-left: none; }
.inv-field-label {
    font-size: 0.72rem;
    color: #888;
    margin-bottom: 3px;
    white-space: nowrap;
}
.inv-field-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1F7A3A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inv-no { font-size: 1.1rem; letter-spacing: 1px; color: #1d5fa8; }
.inv-notes {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #555;
    border-top: 1px dashed #dde3f0;
    padding-top: 8px;
}
.inv-notes-label { font-weight: 700; color: #333; }

/* بيانات التوصيل داخل تفاصيل الفاتورة */
.inv-delivery-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #c8e6c9;
    background: #f1f8f1;
}
.inv-delivery-bar .inv-field { border-color: #c8e6c9; }
.inv-delivery-bar .inv-field-label { color: #555; }
.inv-delivery-bar .inv-field-value { color: #1a6b2f; }

/* شارات الحالة */
.inv-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}
.inv-badge-posted { background: #d1fae5; color: #065f46; }
.inv-badge-open   { background: #dbeafe; color: #1e40af; }

/* --- جدول المواد --- */
.inv-lines-wrap {
    border: 1px solid #dde3f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}
.inv-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.inv-lines-table thead tr {
    background: #E8F2E6;
    color: #1F7A3A;
}
.inv-lines-table thead th {
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
    border: none;
}
.inv-lines-table thead th.col-num { text-align: end; }
.inv-lines-table tbody tr { border-bottom: 1px solid #eef0f6; }
.inv-lines-table tbody tr:last-child { border-bottom: none; }
.inv-lines-table tbody tr:nth-child(even) { background: #f9fafc; }
.inv-lines-table tbody tr:hover { background: #eef4ff !important; }
.inv-lines-table tbody td {
    padding: 9px 12px;
    color: #2c2c3e;
    vertical-align: middle;
}
.inv-lines-table .col-code { width: 110px; }
.inv-lines-table .col-name { min-width: 160px; }
.inv-lines-table .col-num  { width: 100px; text-align: end; }
.inv-empty {
    text-align: center;
    color: #aaa;
    padding: 28px !important;
}

/* --- ملخص مالي --- */
.inv-summary-bar {
    display: flex;
    justify-content: flex-end;
}
[dir="rtl"] .inv-summary-bar { justify-content: flex-start; }
.inv-summary-grid {
    border: 1px solid #dde3f0;
    border-radius: 10px;
    overflow: hidden;
    min-width: 320px;
    background: #fff;
}
.inv-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 18px;
    border-bottom: 1px solid #eef0f6;
    font-size: 0.88rem;
    color: #444;
}
.inv-sum-row:last-child { border-bottom: none; }
.inv-sum-label { color: #555; font-weight: 500; }
.inv-sum-value { font-weight: 600; color: #1F7A3A; min-width: 90px; text-align: end; }
.inv-sum-net {
    background: #1F7A3A;
    color: #fff !important;
}
.inv-sum-net .inv-sum-label { color: #a7d7b8; font-weight: 700; font-size: 0.95rem; }
.inv-sum-net .inv-sum-value { color: #fff; font-size: 1.05rem; font-weight: 800; }

/* هيدر الـ modal */
.inv-modal-header {
    background: #fff;
    color: #1F7A3A;
    padding: 14px 20px;
    border-bottom: 2px solid #E8F2E6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.inv-modal-header .modal-title { color: #1F7A3A; }
.inv-modal-header i { color: #1F7A3A; }
.inv-modal-header .btn-close { filter: none; }

/* سطر hover في القائمة الرئيسية */
.detail-row:hover td { background: #f0f7ff !important; cursor: pointer; }

/* (نُبقي الكلاسات القديمة خالية لعدم كسر أي استخدام آخر) */
.detail-meta-cell {}
.detail-meta-label {}
.detail-meta-value {}
.invoice-summary {}
.summary-row {}
.summary-row-bold {}
.summary-label {}
.summary-value {}
