/* أنماط خاصة بصفحات المالية والموظفين (money.js / employees.js) — رموز فقط */

/* مبلغ بالدينار: الرقم LTR جدولي + وحدة صغيرة */
.iqd { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.iqd .money { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; font-weight: 600; }
.iqd small { font-size: 12px; font-weight: 500; color: var(--muted); }
.iqd.text-ok .money { color: var(--ok-ink); }
.iqd.text-danger .money { color: var(--danger-ink); }
.stat-value .iqd { font-size: inherit; }


/* أدوات التصفية */
.money-toolbar input[type="month"] { flex: 0 1 170px; min-width: 150px; }
.daterange .dr { display: inline-flex; align-items: center; gap: var(--s2); flex: 0 1 220px; min-width: 0; }
.daterange .dr span { color: var(--muted); font-size: 14px; font-weight: 600; }
.daterange .dr .in { flex: 1; min-width: 0; }

/* جداول المال: أعمدة المبالغ محاذاة للنهاية */
.money-tbl th.text-end, .money-tbl td.text-end { text-align: end; }
.money-tbl td.money { white-space: nowrap; }
.money-tbl td.text-ok { color: var(--ok-ink); }
.money-tbl td.text-danger { color: var(--danger-ink); }
.subs-tbl { min-width: 980px; }
.subs-tbl .linkname, .subs-tbl td .num { white-space: nowrap; }
.subs-tbl .note-cell { max-width: 180px; overflow-wrap: anywhere; }
.linkname { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: start; }
.linkname:hover { color: var(--primary-ink); text-decoration: underline; }
.rowacts { display: inline-flex; gap: var(--s1); align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.titlecell { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.money-totals .tot.ok { --c: var(--ok-ink); }
.money-totals .tot.danger { --c: var(--danger-ink); }
.fin-head { margin-block: var(--s3); }

/* البنود الشهرية: الرواتب والمصروفات */
.rec-toolbar { margin-block: var(--s3); }
.rec-type { flex: 0 1 180px; min-width: 150px; }
.rec-tbl { min-width: 860px; }
.rec-tbl td .num { white-space: nowrap; }
.spent-cell { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.rec-stopped { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.rec-stopped .listrow { flex-wrap: wrap; }
.rec-stopped .listrow .grow { min-width: min(100%, 160px); overflow-wrap: anywhere; }
.mb-field { margin-block-end: var(--s3); }
.orphans-banner { margin-block: var(--s3); }
.orphans-banner .row { flex-wrap: wrap; gap: var(--s2); }

/* اختيار نطاق التعديل أو الحذف */
.choice-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-block-end: var(--s2); }
.choice-list { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.choice { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.choice span { font-size: 13px; color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--line-strong); }
.choice.on { border-color: var(--primary); background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary); }
.choice:disabled { opacity: .55; cursor: not-allowed; }

/* نافذة الدفعة */
.paysummary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-block-end: var(--s4); }
.paysummary .ps { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.paysummary .ps.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.paysummary .ps.danger { background: var(--danger-soft); border-color: var(--danger-line); }
.paysummary .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.paysummary .iqd { font-size: 18px; }

/* نافذة الوصل */
.receipt-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding-block: var(--s2); }
.receipt-done > .ic { font-size: 40px; line-height: 1; color: var(--tone-money); }
.receipt-done .no { font-size: 18px; }
.receipt-done .no b { font-size: 22px; color: var(--accent-ink); }
.receipt-done .who { color: var(--muted); display: inline-flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; justify-content: center; }
.receipt-done .acts { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; margin-top: var(--s2); }
.receipt-done .hint { margin-top: var(--s2); }

/* الباقات */
.packform { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: var(--s3); align-items: end; margin-block-end: var(--s3); padding-block-end: var(--s3); border-block-end: 1px solid var(--line-soft); }
.packform .field { margin: 0; }
.packform-btns { display: flex; gap: var(--s2); }
.packlist { display: flex; flex-direction: column; gap: var(--s2); }
.listrow.static { cursor: default; }
.listrow.static:hover { box-shadow: none; }
.listrow.editing { border-color: var(--primary-line); background: var(--primary-tint); }

/* الموظفون */
.emp-list { display: flex; flex-direction: column; gap: var(--s2); }
.emp-list .listrow .go { font-size: 18px; }
.emp-profile { margin-block-end: var(--s4); }
.emp-notes { margin-top: var(--s3); }
.emp-ident { margin-block-end: var(--s4); align-items: stretch; }
.emp-ident > .card { display: flex; flex-direction: column; }
.emp-ident > .card > .emp-imgbox, .emp-ident > .card > .emp-pledge { flex: 1; }
.emp-imgbox { min-height: 96px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: var(--s2); }
.emp-imgbox img { max-height: 80px; max-width: 100%; border-radius: var(--radius-sm); }
.emp-imgbox img.sigimg { background: white; } /* ورقة بيضاء عمداً: التوقيع حبر داكن على خلفية شفافة */
.emp-pledge { font-size: 14px; white-space: pre-wrap; line-height: 1.8; }
.emp-docs { margin: 0; }
.emp-doc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s2); background: var(--card); display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.emp-doc .thumb { display: block; height: 110px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.emp-doc .thumb img { width: 100%; height: 100%; object-fit: cover; }
.emp-doc .thumb.file { display: flex; align-items: center; justify-content: center; font-size: 36px; text-decoration: none; }
.emp-profile + .emp-ident, .emp-ident + .card { margin-top: 0; }
.emp-ident + .card { margin-block-end: var(--s4); }

@media (max-width: 560px) {
  .paysummary { grid-template-columns: minmax(0, 1fr); }
  .paysummary .ps { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .packform { grid-template-columns: minmax(0, 1fr); }
  .packform-btns > .btn { flex: 1; }
  .subs-tbl, .rec-tbl { min-width: 0; }
  .money-tbl.stack-mobile .titlecell { justify-content: flex-end; min-width: 0; }
  .rec-toolbar .spacer { display: none; }
  .rec-toolbar .btn { flex: 1 1 100%; }
  .spent-cell { align-items: flex-end; }
  .money-tbl.stack-mobile td.money { direction: rtl; unicode-bidi: normal; } /* .money = LTR يقلب ترتيب التسمية/القيمة */
  .subs-tbl .note-cell { max-width: none; }
  .tbl.stack-mobile td.actions { justify-content: flex-end; border-top: 1px solid var(--line-soft); padding-top: 8px; margin-top: 4px; }
  .daterange .dr { flex: 1 1 140px; }
  .fin-head .btn { flex: 0 0 auto; }
}
.packlist .listrow { flex-wrap: nowrap; }
.packlist .listrow .grow { min-width: 0; overflow-wrap: anywhere; }
