/* ═══════════════ وحدة المشتريات ═══════════════ */

/* الأرقام تصطف في أعمدة */
.num { font-variant-numeric: tabular-nums; }

/* ── تنبيه داخل الصفحة (بديل alert المتصفح) ── */
.pur-alert {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem 1rem; border-radius: 11px; margin-bottom: 1rem;
    font-size: .87rem; font-weight: 600;
    background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.pur-alert--danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pur-alert--warn   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pur-alert__x {
    margin-inline-start: auto; border: 0; background: none; color: inherit;
    opacity: .55; cursor: pointer; padding: .15rem; font-size: .8rem;
}
.pur-alert__x:hover { opacity: 1; }

/* ── فلاتر ── */
.pur-filters {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .85rem; margin-bottom: 1rem;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: .9rem 1.1rem;
}

/* ── حالة المستند ── */
.pur-badge {
    display: inline-block; padding: .18rem .6rem; border-radius: 20px;
    font-size: .72rem; font-weight: 700; background: #f1f5f9; color: #475569;
}
.pur-badge--draft { background: #f1f5f9; color: #64748b; }
.pur-badge--ok    { background: #e0f2fe; color: #0369a1; }
.pur-badge--warn  { background: #fef3c7; color: #92400e; }
.pur-badge--done  { background: #d1fae5; color: #047857; }
.pur-badge--dead  { background: #fee2e2; color: #b91c1c; }

/* ── أزرار الصف ── */
.pur-act {
    width: 30px; height: 30px; margin-inline-start: .25rem;
    border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff;
    color: #475569; cursor: pointer; font-size: .8rem;
}
.pur-act:hover { border-color: #0E2A47; color: #0E2A47; }
.pur-act--go:hover { border-color: #059669; color: #059669; }
.pur-act--post { border-color: #bbf7d0; color: #047857; }
.pur-act--post:hover { background: #ecfdf5; }

/* ── لا يوجد بيانات ── */
.pur-empty { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.pur-empty > .bi { font-size: 2.5rem; display: block; margin-bottom: .75rem; color: #cbd5e1; }
.pur-empty__t { font-weight: 700; color: #475569; margin-bottom: .3rem; }
.pur-empty p { font-size: .84rem; margin: 0; }

/* ── صفحة تحرير مستند (بدل النوافذ المنبثقة) ── */
.pur-crumb {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: #94a3b8; margin-bottom: .3rem;
}
.pur-crumb a { color: #2563eb; text-decoration: none; font-weight: 600; }
.pur-crumb a:hover { text-decoration: underline; }

.pur-section { padding: 0; margin-bottom: 1.1rem; }
.pur-section__hd {
    display: flex; align-items: center; gap: .5rem;
    padding: .8rem 1.2rem; border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-weight: 800; font-size: .88rem; color: #1a2b45;
}
.pur-section__n {
    background: #e2e8f0; color: #475569; border-radius: 20px;
    padding: .05rem .5rem; font-size: .72rem; font-weight: 700;
}
.pur-section > .pur-grid,
.pur-section > .pur-totals,
.pur-section > .mt-3 { padding: 1.2rem; }
.pur-section > .pur-totals { margin-inline-start: auto; }

/* ── منتقي الصنف والوحدة ── */
/* display:contents يجعل حقلَي الصنف والوحدة عمودين مستقلين في شبكة السطر */
.iup { display: contents; }
.iup__f { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.iup__ro {
    display: flex; align-items: center; min-height: 38px;
    padding: .35rem .7rem; border-radius: 8px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    font-weight: 600; color: #475569; font-size: .84rem;
}
.iup__hint { font-size: .68rem; color: #8b5cf6; font-weight: 600; }

/* ── سطر مستند داخل صفحة ── */
.pur-row {
    display: grid; align-items: end; gap: .6rem;
    /* # | صنف | وحدة | كمية | تكلفة | ض% | إجمالي | حذف */
    grid-template-columns: 26px 1.9fr 1fr .8fr .9fr .55fr .9fr 34px;
    padding: .8rem 1.2rem; border-bottom: 1px solid #f1f5f9;
}
/* الاستلام يزيد حقلَي الدفعة والانتهاء */
.pur-row--grn {
    grid-template-columns: 26px 1.6fr .9fr .7fr .8fr .8fr .9fr .8fr 34px;
}
.pur-row:last-child { border-bottom: 0; }
.pur-row__n {
    width: 26px; height: 38px; display: grid; place-items: center;
    font-weight: 800; color: #cbd5e1; font-size: .8rem;
}
.pur-row__f { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.pur-row__del {
    width: 34px; height: 38px; border-radius: 8px;
    border: 1.5px solid #fecaca; background: #fff; color: #ef4444;
    cursor: pointer; font-size: .8rem;
}
.pur-row__del:hover { background: #fef2f2; }
.pur-row__del--off {
    border-color: #e2e8f0; color: #cbd5e1; cursor: default;
    display: grid; place-items: center;
}
.pur-row__base {
    grid-column: 2 / -1; font-size: .72rem; font-weight: 700;
    color: #0369a1; background: #f0f9ff; border-radius: 7px;
    padding: .25rem .6rem; justify-self: start;
}
@media (max-width: 1100px) {
    .pur-row { grid-template-columns: 1fr 1fr; }
    .pur-row__n { display: none; }
    .iup__f--item { grid-column: 1 / -1; }
    .pur-row__base { grid-column: 1 / -1; }
}

/* ── نافذة التحرير ── */
.pur-modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1040;
}
.pur-modal {
    position: fixed; z-index: 1050;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(1100px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem);
    display: flex; flex-direction: column;
    background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.pur-modal__hd {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.35rem; border-bottom: 1px solid #f1f5f9;
}
.pur-modal__hd h4 { margin: 0; font-size: 1rem; font-weight: 800; color: #1a2b45; }
.pur-modal__x {
    margin-inline-start: auto; border: 0; background: none; color: #94a3b8;
    cursor: pointer; font-size: .9rem; padding: .25rem;
}
.pur-modal__x:hover { color: #b91c1c; }
.pur-modal__bd { padding: 1.35rem; overflow-y: auto; display: grid; gap: 1.25rem; }
.pur-modal__ft {
    display: flex; justify-content: flex-end; gap: .6rem;
    padding: .9rem 1.35rem; border-top: 1px solid #f1f5f9;
}

.pur-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .85rem; }

/* ── بنود المستند ── */
.pur-lines { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.pur-lines__hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: .65rem 1rem; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
    font-weight: 700; font-size: .87rem; color: #1a2b45;
}
.pur-hint { padding: 1.25rem; text-align: center; color: #94a3b8; font-size: .83rem; }

.pur-line {
    display: grid; align-items: end; gap: .6rem;
    grid-template-columns: 2.2fr 1fr 1fr .8fr 1fr 34px;
    padding: .7rem 1rem; border-bottom: 1px solid #f1f5f9;
}
.pur-line:last-child { border-bottom: 0; }
@media (max-width: 900px) {
    .pur-line { grid-template-columns: 1fr 1fr; }
    .pur-line__f--wide { grid-column: 1 / -1; }
}
.pur-line__total {
    display: flex; align-items: center; justify-content: flex-end;
    min-height: 38px; padding: .35rem .6rem; border-radius: 8px;
    background: #f8fafc; border: 1.5px solid #e2e8f0; font-weight: 700; color: #1a2b45;
}
.pur-line__del {
    width: 34px; height: 38px; border-radius: 8px;
    border: 1.5px solid #fecaca; background: #fff; color: #ef4444;
    cursor: pointer; font-size: .8rem;
}
.pur-line__del:hover { background: #fef2f2; }

/* ── الإجماليات ── */
.pur-totals {
    margin-inline-start: auto; width: min(340px, 100%);
    display: grid; gap: .35rem; font-size: .88rem;
}
.pur-totals > div { display: flex; justify-content: space-between; gap: 1rem; color: #4b5563; }
.pur-totals__grand {
    border-top: 1px solid #e5e7eb; padding-top: .5rem; margin-top: .2rem;
    font-size: 1.05rem; font-weight: 800; color: #111827;
}

/* ── شريط مؤشرات ── */
.pur-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .85rem; margin-bottom: 1.1rem;
}
.pur-stat {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: .85rem 1.05rem; display: flex; align-items: center; gap: .8rem;
}
.pur-stat__icon {
    width: 42px; height: 42px; border-radius: 12px; flex: none;
    display: grid; place-items: center; font-size: 1.05rem;
}
.pur-stat__label { font-size: .76rem; font-weight: 600; color: #6b7280; margin-bottom: .1rem; }
.pur-stat__value {
    font-size: 1.35rem; font-weight: 800; color: #111827; line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* ── توزيع السداد على الفواتير ── */
.pur-alloc { display: flex; gap: .35rem; align-items: center; }
.pur-alloc .ui-input { text-align: end; }
.pur-alloc__max {
    width: 32px; height: 38px; flex: none; border-radius: 8px;
    border: 1.5px solid #bbf7d0; background: #f0fdf4; color: #047857;
    cursor: pointer; font-size: .78rem;
}
.pur-alloc__max:hover { background: #dcfce7; }
.pur-overdue { background: #fff7f7; }

/* ── حذف بتأكيد داخل الصف ── */
.pur-act--del { border-color: #fecaca; color: #ef4444; }
.pur-act--del:hover { background: #fef2f2; }
.pur-act--yes { border-color: #ef4444; background: #ef4444; color: #fff; }
.pur-act--yes:hover { background: #dc2626; }

/* ── مسار الدورة ── */
.pur-flow {
    display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: .6rem .9rem; margin-bottom: 1rem;
}
.pur-flow__step {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .7rem; border-radius: 20px;
    font-size: .76rem; font-weight: 700; color: #64748b;
    background: #f8fafc; border: 1px solid #e2e8f0; text-decoration: none;
}
.pur-flow__step:hover { border-color: #0E2A47; color: #0E2A47; }
.pur-flow__step--on { background: #0E2A47; border-color: #0E2A47; color: #fff; }
.pur-flow__sep { color: #cbd5e1; font-size: .65rem; }

.pur-link { color: #2563eb; font-weight: 700; text-decoration: none; }
.pur-link:hover { text-decoration: underline; }

/* ── سطر طلب الشراء: مطلوب / متاح / يُشترى ── */
.pur-row--req {
    grid-template-columns: 26px 1.7fr 1fr .9fr .9fr .9fr 34px;
}
.pur-short { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

/* ═══════════ مقارنة عروض الأسعار ═══════════ */

.qc-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .9rem; margin-bottom: 1.1rem;
}
.qc-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .35rem;
}
.qc-card--best { border-color: #86efac; box-shadow: 0 0 0 3px #dcfce7 inset; }
.qc-card--won  { border-color: #0E2A47; box-shadow: 0 0 0 3px #e2e8f0 inset; }
.qc-card__hd { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.qc-card__supplier { font-weight: 800; color: #1a2b45; }
.qc-card__num { font-size: .72rem; color: #94a3b8; font-weight: 700; }
.qc-card__total { font-size: 1.35rem; font-weight: 800; color: #111827; }
.qc-card__total small { font-size: .7rem; font-weight: 600; color: #9ca3af; }
.qc-card__meta {
    display: flex; flex-wrap: wrap; gap: .2rem .8rem;
    font-size: .72rem; color: #6b7280; font-weight: 600;
}
.qc-card__cta { margin-top: .5rem; justify-content: center; }

.qc-badge {
    font-size: .66rem; font-weight: 800; padding: .1rem .45rem; border-radius: 20px;
    background: #f1f5f9; color: #64748b;
}
.qc-badge--best { background: #dcfce7; color: #15803d; }
.qc-badge--won  { background: #0E2A47; color: #fff; }
.qc-badge--exp  { background: #fee2e2; color: #b91c1c; }

/* ── شبكة المقارنة ── */
.qc-table th.qc-sup { text-align: center; min-width: 130px; }
.qc-code { font-size: .68rem; color: #94a3b8; font-weight: 600; }
.qc-cell {
    text-align: center; cursor: pointer; position: relative;
    border-inline-start: 1px solid #f1f5f9; transition: background .12s;
}
.qc-cell:hover { background: #f8fafc; }
.qc-cell--none { color: #cbd5e1; cursor: default; }
.qc-cell--none:hover { background: transparent; }
.qc-cell--best { background: #f0fdf4; }
.qc-cell--picked { background: #e0f2fe; box-shadow: inset 0 0 0 2px #38bdf8; }
.qc-price { font-weight: 800; color: #111827; font-size: .9rem; }
.qc-sub {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    font-size: .66rem; font-weight: 700; margin-top: .1rem;
}
.qc-best { color: #15803d; }
.qc-diff { color: #b45309; }
.qc-days { color: #64748b; }
.qc-check {
    position: absolute; inset-inline-end: 4px; top: 4px;
    color: #0284c7; font-size: .8rem;
}
.qc-total--best { color: #15803d; }

/* ═══════════ تقارير المشتريات ═══════════ */

.rpt-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: .9rem;
}
.rpt-card {
    display: flex; align-items: center; gap: .9rem;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 1rem 1.15rem; text-decoration: none; transition: all .12s;
}
.rpt-card:hover { border-color: #0E2A47; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.rpt-card__icon {
    width: 46px; height: 46px; border-radius: 13px; flex: none;
    display: grid; place-items: center; font-size: 1.15rem;
}
.rpt-card__body { flex: 1; min-width: 0; }
.rpt-card__title { font-weight: 800; color: #1a2b45; font-size: .92rem; }
.rpt-card__desc { font-size: .76rem; color: #6b7280; margin-top: .1rem; }
.rpt-card__go { color: #cbd5e1; font-size: .8rem; }

/* رأس التقرير — يظهر في الورق أيضًا */
.rpt-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: .9rem 1.2rem; border-bottom: 1px solid #f1f5f9;
}
.rpt-head__title { font-weight: 800; color: #1a2b45; }
.rpt-head__meta { font-size: .76rem; color: #6b7280; font-weight: 600; }

.rpt-warn { color: #b45309; font-weight: 700; }
.rpt-bad  { color: #b91c1c; font-weight: 800; }

.rpt-opening td { background: #f8fafc; }

/* شريط نسبة */
.rpt-bar {
    height: 7px; border-radius: 20px; background: #f1f5f9; overflow: hidden;
}
.rpt-bar__fill { height: 100%; border-radius: 20px; background: #94a3b8; }
.rpt-bar__fill--done { background: #22c55e; }
.rpt-bar__fill--mid  { background: #38bdf8; }
.rpt-bar__fill--low  { background: #f59e0b; }

.rpt-trend { font-size: .74rem; font-weight: 700; color: #94a3b8; }
.rpt-trend--up   { color: #b91c1c; }
.rpt-trend--down { color: #15803d; }

.rpt-grade {
    display: inline-grid; place-items: center;
    width: 26px; height: 26px; border-radius: 8px;
    font-weight: 800; font-size: .8rem; color: #fff;
}
.rpt-grade--a { background: #16a34a; }
.rpt-grade--b { background: #0ea5e9; }
.rpt-grade--c { background: #f59e0b; }
.rpt-grade--d { background: #dc2626; }

/* ═══════════ نمط شاشات التقارير ═══════════
   بطاقة واحدة تضم الفلاتر والجدول، رأس رمادي فاتح بعناوين هادئة،
   وخلية الطرف تحمل صورة رمزية واسمًا وسطرًا فرعيًا — فيُقرأ الصف كسجل لا كأرقام. */

.co-page {
    --co-ink: #2f2f3b;
    --co-mute: #52526c;
    --co-line: #eef0f5;
    --co-head: #f5f6f9;
    --co-accent: #0E2A47;
    --co-shadow: 0 9px 20px rgba(46, 35, 94, .07);
}

/* ── رأس الصفحة ── */
.co-head {
    background: #fff; border-radius: 15px; box-shadow: var(--co-shadow);
    padding: 1.05rem 1.4rem; margin-bottom: 1.15rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.co-head h3 {
    margin: 0; font-size: 1.3rem; font-weight: 700; color: #1a2b45;
    display: flex; align-items: center; gap: .5rem;
}
.co-head h3 i { color: var(--co-accent); opacity: .75; font-size: 1.05rem; }
.co-head__sub { font-size: .78rem; color: var(--co-mute); opacity: .8; margin: .2rem 0 0; }

.co-crumb {
    display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
    font-size: .74rem; color: var(--co-mute); opacity: .85; margin-bottom: .3rem;
}
.co-crumb a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.co-crumb a:hover { color: var(--co-accent); }
.co-crumb__sep { font-size: .58rem; opacity: .6; }

.co-btn {
    display: inline-flex; align-items: center; gap: .4rem;
    border: 1px solid #e6e9f0; background: #fff; color: var(--co-mute);
    border-radius: 10px; padding: .5rem .95rem; cursor: pointer;
    font-family: inherit; font-size: .82rem; font-weight: 600; transition: .15s;
}
.co-btn:hover { border-color: #cfd5e3; color: var(--co-ink); }
.co-btn--solid { background: var(--co-accent); border-color: var(--co-accent); color: #fff; }
.co-btn--solid:hover { background: #16375c; border-color: #16375c; color: #fff; }

/* ── مؤشرات ── */
.co-widgets {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 1rem; margin-bottom: 1.15rem;
}
.co-widget {
    background: #fff; border-radius: 15px; box-shadow: var(--co-shadow);
    padding: 1.05rem 1.2rem; display: flex; align-items: center; gap: .9rem;
}
.co-widget__ico {
    width: 48px; height: 48px; border-radius: 14px; flex: none;
    display: grid; place-items: center; font-size: 1.15rem;
}
.co-widget__b { min-width: 0; }
.co-widget__l { font-size: .76rem; font-weight: 600; color: var(--co-mute); opacity: .85; }
.co-widget__v {
    font-size: 1.5rem; font-weight: 700; color: #1a2b45; line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.co-widget__s { font-size: .7rem; font-weight: 600; color: var(--co-mute); opacity: .65; }

/* ── البطاقة ── */
.co-card {
    background: #fff; border-radius: 15px; box-shadow: var(--co-shadow);
    margin-bottom: 1.15rem; overflow: hidden;
}

/* ── شريط الأدوات داخل البطاقة ── */
.co-top {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    padding: 1rem 1.4rem; border-bottom: 1px solid var(--co-line);
}
.co-top__lbl { font-size: .8rem; font-weight: 600; color: var(--co-mute); margin: 0; }
.co-top__end { margin-inline-start: auto; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }

.co-field {
    border: 1px solid #e6e9f0; border-radius: 10px; background: #fff;
    padding: .5rem .8rem; font-size: .84rem; font-family: inherit; color: var(--co-ink);
    transition: border-color .15s, box-shadow .15s;
}
.co-field:focus { outline: none; border-color: var(--co-accent); box-shadow: 0 0 0 3px rgba(14, 42, 71, .08); }

.co-search { position: relative; display: inline-flex; }
.co-search i {
    position: absolute; inset-inline-start: .7rem; top: 50%; transform: translateY(-50%);
    color: #a9adbb; font-size: .78rem; pointer-events: none;
}
.co-search .co-field { padding-inline-start: 2rem; min-width: 215px; }

.co-chip {
    border: 1px solid #e6e9f0; background: #fff; border-radius: 20px;
    padding: .42rem .85rem; font-size: .76rem; font-weight: 600; color: var(--co-mute);
    cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: .35rem;
    font-family: inherit;
}
.co-chip:hover { border-color: #cfd5e3; }
.co-chip--on { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* مفتاح ألوان الشرائح — يفكّ تلوين الأرقام في الجدول */
.co-legend { display: flex; align-items: center; gap: .1rem; padding: 0; margin: 0; list-style: none; }
.co-legend li:not(:first-child) { margin-inline-start: -9px; }
.co-dot {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff;
    display: grid; place-items: center; font-size: .62rem; font-weight: 700;
    transition: transform .35s; cursor: default;
}
.co-dot:hover { transform: translateY(-4px) scale(1.04); }

/* ── الجدول ── */
.co-scroll { width: 100%; overflow-x: auto; }
.co-table { width: 100%; border-collapse: collapse; font-size: .86rem; color: var(--co-ink); }
.co-table thead th {
    background: var(--co-head); color: var(--co-mute);
    font-weight: 600; font-size: .77rem; letter-spacing: .2px;
    padding: .8rem 1rem; white-space: nowrap; border: 0; text-align: start;
}
.co-table tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--co-line); vertical-align: middle; }
.co-table th:first-child, .co-table td:first-child { padding-inline-start: 1.4rem; }
.co-table th:last-child,  .co-table td:last-child  { padding-inline-end: 1.4rem; }
.co-table tbody tr:hover td { background: #fafbfd; }
.co-table tbody tr:last-child td { border-bottom: 0; }

.co-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-zero { color: #ccd0da; }
.co-strong { font-weight: 700; color: #1a2b45; }

/* خلية الطرف */
.co-party { display: flex; align-items: center; gap: .75rem; }
.co-ava {
    width: 42px; height: 42px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.co-party__n { color: #3f475a; font-weight: 600; line-height: 1.3; }
.co-party__s { font-size: .71rem; color: var(--co-mute); opacity: .8; margin-top: .1rem; }
.co-table tbody tr:hover .co-party__n { color: var(--co-accent); }

/* شريط تركيب المستحق */
.co-bar {
    display: flex; height: 5px; border-radius: 20px; overflow: hidden;
    background: #f1f3f8; margin-top: .35rem;
    width: 104px; margin-inline-start: auto;
}
.co-bar span { display: block; height: 100%; }

.co-tag {
    display: inline-block; padding: .22rem .6rem; border-radius: 20px;
    font-size: .72rem; font-weight: 700; white-space: nowrap;
}

.co-table tfoot td {
    background: var(--co-head); font-weight: 700; color: #1a2b45;
    padding: .95rem 1rem; border-top: 2px solid #e4e7ef;
}

/* عناصر باقية من التصميم السابق تُوحَّد داخل البطاقة بدل تكرار ترميزها */
.co-card .rpt-head {
    padding: 1rem 1.4rem; border-bottom: 1px solid var(--co-line);
    align-items: center;
}
.co-card .rpt-head__title { font-weight: 700; color: #1a2b45; font-size: .92rem; }
.co-card .rpt-head__meta  { font-size: .76rem; color: var(--co-mute); opacity: .8; font-weight: 600; }

.co-card .pur-filters {
    border: 0; box-shadow: none; margin: 0; background: transparent;
    padding: 1.1rem 1.4rem; border-radius: 0;
    align-items: end;
}
/* زر التنفيذ يأخذ عرض نصّه لا عرض العمود — الشريط الممتد يثقل الشاشة */
.pur-filters__go {
    display: flex; align-items: flex-end; justify-content: flex-start;
}
.pur-filters__go .co-btn { padding: .52rem 1.5rem; white-space: nowrap; }
@media (max-width: 640px) {
    .pur-filters__go .co-btn { width: 100%; justify-content: center; }
}
.co-card .pur-hint {
    padding: .8rem 1.4rem; border-top: 1px solid var(--co-line);
    font-size: .76rem; color: var(--co-mute); opacity: .85; text-align: start;
}
.co-card .pur-section__hd {
    padding: 1rem 1.4rem; border-bottom: 1px solid var(--co-line);
    display: flex; align-items: center; gap: .5rem;
    font-weight: 700; color: #1a2b45;
}

.co-empty { padding: 3.5rem 1.5rem; text-align: center; color: var(--co-mute); }
.co-empty i { font-size: 2.4rem; opacity: .28; display: block; margin-bottom: .6rem; }
.co-empty__t { font-weight: 700; color: #1a2b45; margin-bottom: .25rem; }
.co-empty p { font-size: .82rem; opacity: .8; margin: 0; }

/* ── الطباعة ── */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .ui-card { box-shadow: none; border: 1px solid #d1d5db; }
    .ui-table { font-size: .72rem; }
    .ui-table thead { display: table-header-group; }
    .ui-table tr { break-inside: avoid; }

    .co-card, .co-head, .co-widget { box-shadow: none; border: 1px solid #d1d5db; }
    .co-table { font-size: .72rem; }
    .co-table thead { display: table-header-group; }
    .co-table tr { break-inside: avoid; }
    .co-table thead th { background: #f1f3f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .co-ava, .co-bar { display: none; }
}

/* سطر مصروف التحميل */
.pur-row--exp { grid-template-columns: 26px 1.1fr 2fr .9fr .55fr 1.1fr 34px; }
.pur-row__f--wide { grid-column: span 1; }
@media (max-width: 1100px) {
    .pur-row--exp { grid-template-columns: 1fr 1fr; }
    .pur-row__f--wide { grid-column: 1 / -1; }
}


/* ═══ co-check — خيار ثنائي داخل بطاقات co-card ═══ */
.co-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .86rem;
    font-weight: 600;
    color: #33334d;
    cursor: pointer;
    user-select: none;
}
.co-check input[type="checkbox"] {
    inline-size: 1.05rem;
    block-size: 1.05rem;
    accent-color: #4f46e5;
    cursor: pointer;
    flex: none;
}
.co-check:hover { color: #4f46e5; }
.co-check + .co-party__s { margin-block-start: .2rem; }
