/* إضافات AR&T فوق app.css المنسوخ من TRUST */
.nav-link { padding: .5rem .75rem; border-radius: .375rem; white-space: nowrap; }
.nav-link:hover { background: #f1f5f9; }
.nav-link.active { background: #f1f5f9; font-weight: 600; }
.switcher { position: relative; }
.switcher-btn { border: 1px solid #cbd5e1; border-radius: .5rem; padding: .35rem .75rem; background: #fff;
  font-size: .875rem; white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.switcher-panel { position: absolute; top: 110%; inset-inline-start: 0; z-index: 50; width: 22rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .5rem; }
.switcher-panel ul { max-height: 20rem; overflow-y: auto; margin-top: .5rem; }
.switcher-panel li a { display: block; padding: .4rem .6rem; border-radius: .375rem; font-size: .875rem; }
.switcher-panel li a:hover, .switcher-panel li a.current { background: #f1f5f9; }
.switcher-panel .recent { font-size: .7rem; color: #64748b; }
.switcher-panel .empty { padding: .5rem; color: #64748b; font-size: .875rem; }
.bell { position: relative; font-size: 1.1rem; }
.bell .badge { position: absolute; top: -.5rem; inset-inline-end: -.75rem; font-size: .65rem; }
.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: left; white-space: nowrap; }
.entry-lines td { padding: .15rem .25rem; }
.entry-lines input, .entry-lines select { width: 100%; padding: .3rem .4rem; border: 1px solid #cbd5e1;
  border-radius: .375rem; font-size: .875rem; }
.entry-lines input.amt { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.diff-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e2e8f0; padding: .75rem 0; }
.diff-ok { color: #15803d; font-weight: 700; }
.diff-bad { color: #b91c1c; font-weight: 700; }
tr.is-main td { font-weight: 600; background: #f8fafc; }
.lvl-2 { padding-inline-start: 1rem !important; } .lvl-3 { padding-inline-start: 2rem !important; }
.lvl-4 { padding-inline-start: 3rem !important; } .lvl-5 { padding-inline-start: 4rem !important; }
.status-draft { background: #f1f5f9; color: #334155; } .status-saved { background: #dbeafe; color: #1e40af; }
.status-returned { background: #fef3c7; color: #92400e; } .status-posted { background: #dcfce7; color: #166534; }
.status-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
/* الاتجاهان: الجداول تبدأ من جهة القراءة، والأرقام في الطرف المقابل (يسار في العربية، يمين في الإنجليزية) */
table.data th, table.data td { text-align: start; }
[dir="rtl"] .num, [dir="rtl"] table.data th.num, [dir="rtl"] .entry-lines input.amt { text-align: left; }
[dir="ltr"] .num, [dir="ltr"] table.data th.num, [dir="ltr"] .entry-lines input.amt { text-align: right; }
.attachment-img { max-width: 100%; max-height: 40rem; border: 1px solid #e2e8f0; border-radius: .5rem; }
.attachment-pdf { width: 100%; height: 40rem; border: 1px solid #e2e8f0; border-radius: .5rem; }
.company-card { display: block; transition: box-shadow .12s, transform .12s; border-inline-start: 4px solid #e2e8f0; }
.company-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.company-card.has-waiting { border-inline-start-color: #f59e0b; }
.waiting-count { min-width: 2rem; height: 2rem; border-radius: 999px; background: #f59e0b; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 .5rem; }
.company-select { border: 1px solid #cbd5e1; border-radius: .5rem; padding: .4rem .6rem; background: #fff;
  font-size: .9rem; font-weight: 600; max-width: 22rem; min-width: 14rem; }
.chart-tree .tree-toggle { width: 1.25rem; display: inline-block; color: #475569; cursor: pointer; }
.chart-tree .tree-spacer { width: 1.25rem; display: inline-block; }
.chart-tree tr.is-main .acc-name { cursor: pointer; }
.chart-tree .acc-name.editable { cursor: text; border-bottom: 1px dashed transparent; }
.chart-tree .acc-name.editable:hover { border-bottom-color: #94a3b8; }
.chart-tree tr.tree-new td { background: #f0f9ff; }
.low-confidence, .low-accounts input[name="line-account"], .low-amounts input.amt { background: #fffbeb !important; border-color: #f59e0b !important; }
.suggest-box { border-inline-start: 4px solid #0ea5e9; }
.art-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  border: 2px dashed #cbd5e1; border-radius: .75rem; padding: 1.25rem; text-align: center; cursor: pointer;
  background: #f8fafc; color: #475569; transition: border-color .12s, background .12s; }
.art-dropzone:hover { border-color: #94a3b8; }
.art-dropzone.drag-over { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.art-dropzone.has-files { border-color: #16a34a; background: #f0fdf4; }
.art-dropzone .dz-icon { font-size: 1.5rem; }
.art-dropzone .dz-files { font-weight: 600; color: #166534; }
.art-dropzone .dz-hint { font-size: .75rem; color: #94a3b8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.work-table tr.is-idle td { opacity: .45; }
.work-count { display: inline-block; min-width: 2.2rem; padding: .15rem .6rem; border-radius: 999px; font-weight: 700; text-align: center; }
.work-count:hover { filter: brightness(.95); }
.work-inbox { background: #e0f2fe; color: #075985; } .work-returned { background: #fef3c7; color: #92400e; }
.work-drafts { background: #f1f5f9; color: #334155; } .work-to_post { background: #dbeafe; color: #1e40af; }
.new-menu { position: relative; }
.new-menu > summary { list-style: none; cursor: pointer; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu-panel { position: absolute; inset-inline-end: 0; top: 110%; z-index: 40; min-width: 14rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .35rem; }
.new-menu-panel a { display: block; padding: .5rem .75rem; border-radius: .375rem; font-size: .9rem; }
.new-menu-panel a:hover { background: #f1f5f9; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1.05rem; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1024px) { .review-grid { grid-template-columns: 1fr; } }
.review-attachment { position: sticky; top: 1rem; }
.review-attachment .attachment-pdf { height: 80vh; }
.review-attachment .attachment-img { max-height: 80vh; }
.seg { display: flex; gap: .25rem; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #cbd5e1; border-radius: .5rem;
  padding: .35rem .7rem; cursor: pointer; background: #fff; font-weight: 400; }
.seg label:has(input:checked) { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.totals { display: flex; flex-direction: column; gap: .35rem; max-width: 22rem; margin-inline-start: auto; }
.totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.totals .grand { border-top: 1px solid #e2e8f0; padding-top: .35rem; font-size: 1.1rem; }
.amt-big { direction: ltr; text-align: start; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem 1.5rem; }
.doc-summary dt { font-size: .75rem; color: #64748b; }
.doc-summary dd { font-weight: 600; }
.low-accounts input[name="item-account"] { background: #fffbeb !important; border-color: #f59e0b !important; }
.section-h { font-weight: 700; font-size: 1.05rem; margin-bottom: .5rem; }
/* صفحة الشركة (القسم 4): زر داكن، منطقة إفلات عدة ملفات، بطاقات القوائم، صفوف العمل */
.btn-dark { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-dark:hover { background: #1e293b; }
.bulk-drop-zone { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2rem 1rem; text-align: center;
  border: 2px dashed #cbd5e1; border-radius: 1rem; background: #fff; cursor: pointer; transition: border-color .12s, background .12s; }
.bulk-drop-zone:hover, .bulk-drop-zone:focus { border-color: #94a3b8; outline: none; }
.bulk-drop-zone.drag-over { border-color: #2563eb; background: #eff6ff; }
.bulk-progress { margin-top: .5rem; display: grid; gap: .35rem; }
.bulk-item { display: grid; grid-template-columns: minmax(8rem, 16rem) minmax(6rem, 1fr) auto; gap: .75rem; align-items: center;
  font-size: .85rem; background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem; padding: .4rem .75rem; }
.bulk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.bulk-bar { height: .45rem; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bulk-bar span { display: block; height: 100%; width: 0; background: #2563eb; transition: width .3s; }
.bulk-item.is-reading .bulk-bar span { width: 100% !important;
  background: repeating-linear-gradient(45deg, #93c5fd 0 10px, #2563eb 10px 20px); background-size: 28px 28px; animation: bulk-move 1s linear infinite; }
.bulk-item.is-done .bulk-bar span { background: #16a34a; }
.bulk-item.is-failed .bulk-bar span { background: #dc2626; }
.bulk-item.is-failed .bulk-state { color: #b91c1c; }
@keyframes bulk-move { to { background-position: 28px 0; } }
.queue-card { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: 1rem 1.25rem; border-radius: 1rem;
  border: 2px solid transparent; text-align: start; transition: box-shadow .12s, border-color .12s; }
.queue-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.queue-card .queue-count { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.queue-card .queue-title { font-weight: 700; }
.queue-card .queue-sub { font-size: .8rem; opacity: .8; }
.queue-card.is-empty { opacity: .6; }
.queue-inbox { background: #eff6ff; color: #1e40af; } .queue-inbox.is-selected { border-color: #2563eb; }
.queue-returned { background: #fff7ed; color: #9a3412; } .queue-returned.is-selected { border-color: #ea580c; }
.queue-drafts { background: #f1f5f9; color: #334155; } .queue-drafts.is-selected { border-color: #64748b; }
.queue-to_post { background: #fffbeb; color: #92400e; } .queue-to_post.is-selected { border-color: #f59e0b; }
.wl-rows { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; }
.wl-row { display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem; }
.wl-row + .wl-row { border-top: 1px solid #f1f5f9; }
.wl-thumb { width: 3rem; height: 3.5rem; flex: none; border-radius: .4rem; overflow: hidden; border: 1px solid #e2e8f0;
  background: #f8fafc; display: flex; align-items: center; justify-content: center; }
.wl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wl-thumb .thumb-pdf { font-size: .7rem; font-weight: 800; color: #b91c1c; }
.wl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wl-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-meta { font-size: .8rem; color: #64748b; }
.wl-note { font-size: .8rem; color: #9a3412; }
.wl-reason { font-size: .8rem; color: #b45309; }
.wl-amount { font-weight: 700; min-width: 6.5rem; }
@media (max-width: 640px) { .wl-row { flex-wrap: wrap; } .bulk-item { grid-template-columns: 1fr; } }
.attachment-text { white-space: pre-wrap; max-height: 40rem; overflow: auto; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .5rem; padding: 1rem; font-size: .85rem; }
/* نموذج المستند: المرفق بجانب النموذج */
.doc-layout.has-side { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .doc-layout.has-side { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.doc-side { position: sticky; top: 1rem; align-self: start; }
.doc-side .attachment-pdf { height: 75vh; }
.doc-side .attachment-img { max-height: 75vh; width: 100%; object-fit: contain; }
.att-tab { font-size: .8rem; padding: .25rem .6rem; border-radius: .4rem; border: 1px solid #e2e8f0; background: #fff; }
.att-tab.is-active { background: #0f172a; color: #fff; border-color: #0f172a; }
.new-party { font-size: .85rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: .5rem; padding: .4rem .6rem; }
.intake-no { font-size: .75rem; font-weight: 600; color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: .35rem; padding: .05rem .4rem; direction: ltr; unicode-bidi: isolate; white-space: nowrap; vertical-align: middle; }
.source-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .9rem; }
.source-grid dt { color: #64748b; }
.wl-row > .btn, .wl-row > form { flex: none; width: auto; }
/* hidden يغلب display من الأصناف (grid/flex)، مثل حقول الشيك عند «نقداً» */
[hidden] { display: none !important; }
.tax-pct { width: 3.5rem !important; }
.entry-lines select[name=item-tax] { min-width: 7.5rem; }
/* الشيكات */
tr.cheque-overdue td { background: #fef2f2; }
tr.cheque-soon td { background: #fffbeb; }
.cheque-received, .cheque-issued { background: #e0f2fe; color: #075985; }
.cheque-deposited { background: #ede9fe; color: #5b21b6; }
.cheque-collected, .cheque-cleared, .cheque-returned_collected { background: #dcfce7; color: #166534; }
.cheque-returned { background: #fee2e2; color: #991b1b; }
.cheque-endorsed, .cheque-given_back, .cheque-cancelled { background: #f1f5f9; color: #475569; }

/* سجل الحركة (البند 5): لون مرحلة الدورة */
.entry-timeline .tl-posted { color: #047857; }
.entry-timeline .tl-returned { color: #b45309; }
.entry-timeline .tl-excluded, .entry-timeline .tl-reversed { color: #b91c1c; }
