/* شاشات المال الأربع (FIN-UI، اعتماد المالك 2026-11-12): عمليات بانتظار التأكيد · مطابقة البنك · تنبيهات المراجعة · إغلاق الشهر والتقارير المعتمدة.
 * التخطيط والمكوّنات فقط: كل لون توكن من system.css (لا ألوان حرفية هنا؛ يحرس ذلك tests/test_design_single_source.py).
 * أهداف اللمس 44 فأكثر، الأرقام لاتينية داخل bdi/tabular-nums، النوافذ في وسط الشاشة بمكان ثابت، الحركة تُلغى تحت prefers-reduced-motion.
 * الأصناف كلها بالبادئة fx- فلا تتسرب إلى بقية الصفحات. النوافذ تُلحَق بـbody فتحمل لونها وخطها بنفسها. */

.fx-screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; color: var(--c-paper); font-family: inherit; }
.fx-screen *, .fx-scrim * { box-sizing: border-box; }
.fx-screen button, .fx-scrim button, .fx-screen input, .fx-scrim input, .fx-scrim textarea { font: inherit; }
.fx-screen bdi, .fx-scrim bdi { unicode-bidi: isolate; }
.fx-screen :focus-visible, .fx-scrim :focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; }
.fx-screen [hidden], .fx-scrim [hidden] { display: none !important; }
.fx-body { display: grid; gap: 16px; min-width: 0; }
.fx-body > * { min-width: 0; }
.fx-n { font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; display: inline-block; }
.fx-cur { font-size: max(12px, .7em); color: var(--c-paper-a80); font-weight: 600; margin-inline-start: 4px; }
.fx-grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; direction: ltr; unicode-bidi: isolate; color: var(--c-sand); }
.fx-nowrap { white-space: nowrap; }
.fx-small { font-size: 13px; color: var(--c-paper-a80); }
.fx-sub { margin: 4px 0 0; color: var(--c-paper-a80); font-size: 14px; }
.fx-title { font-size: 17px; font-weight: 800; }

/* رأس الشاشة وزر الرجوع وتبديل بسيط/محاسبي */
.fx-phead { display: flex; align-items: flex-start; gap: 10px; }
.fx-phead h1 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.35; color: var(--c-paper); }
.fx-phead h1:focus { outline: none; }
.fx-phead p { margin: 2px 0 0; color: var(--c-paper-a80); font-size: 14px; }
.fx-mode { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--tab-idle-line); background: var(--c-white-a06); justify-self: start; }
.fx-mode button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: none; color: var(--tab-idle-ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.fx-mode button[aria-pressed="true"] { background: var(--tab-active-bg); color: var(--tab-active-ink); font-weight: 800; }
.fx-mode svg { width: 18px; height: 18px; }

/* أقسام وبطاقات */
.fx-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 8px 2px -4px; }
.fx-sec h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--c-paper); }
.fx-count { font-size: 13px; color: var(--c-paper-a80); font-weight: 600; }
.fx-card { border-radius: var(--radius-card); padding: 16px; background: var(--c-white-a06); border: 1px solid var(--c-sand-a22); display: grid; gap: 12px; min-width: 0; }
.fx-card.focus { border-color: var(--c-sand-a45); }
.fx-card.warnline { border-color: var(--c-amber-a40); }
.fx-list { display: grid; gap: 10px; min-width: 0; }
.fx-sep { border: 0; border-top: 1px solid var(--c-white-a06); margin: 0; width: 100%; }

/* شريط الانتباه (أعلى الشاشة) */
.fx-attn { border-radius: 24px; padding: 16px; display: grid; gap: 12px; background: linear-gradient(165deg, var(--c-amber-a14), var(--c-white-a06) 60%); border: 1px solid var(--c-amber-a40); }
.fx-attn.calm { background: linear-gradient(165deg, var(--c-ok-a14), var(--c-white-a06) 60%); border-color: var(--c-sand-a22); }
.fx-attn-h { display: flex; align-items: center; gap: 12px; }
.fx-attn-num { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--c-amber-a14); color: var(--c-amber); font-size: 24px; font-weight: 800; flex: none; }
.fx-attn.calm .fx-attn-num { background: var(--c-ok-a14); color: var(--c-ok); }
.fx-attn-num svg { width: 26px; height: 26px; }
.fx-attn-h b { display: block; font-size: 17px; font-weight: 800; line-height: 1.4; }
.fx-attn-h span:not(.fx-attn-num) { display: block; font-size: 14px; color: var(--c-paper-a80); }

/* الحالة: نص + أيقونة دائماً (لا لون وحده) */
.fx-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; width: fit-content; max-width: 100%; background: var(--c-white-a06); color: var(--c-paper-a80); }
.fx-tag svg { width: 16px; height: 16px; flex: none; }
.fx-tag.ok { background: var(--c-ok-a14); color: var(--c-ok); }
.fx-tag.warn { background: var(--c-amber-a14); color: var(--c-amber); }
.fx-tag.bad { background: var(--c-sos-a14); color: var(--c-sos); }
.fx-tag.sand { background: var(--c-sand-a12); color: var(--c-sand); }

/* صف عملية */
.fx-op { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.fx-op-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--tile-icon-bg); color: var(--c-sand); }
.fx-op-ic svg { width: 22px; height: 22px; }
.fx-op-t { min-width: 0; display: grid; gap: 2px; }
.fx-op-t b { font-size: 15.5px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.45; }
.fx-amt { font-size: 17px; font-weight: 800; white-space: nowrap; text-align: end; }
.fx-amt.pos { color: var(--c-ok); }
.fx-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* أزرار */
.fx-btn { min-height: 48px; padding: 0 18px; border-radius: var(--radius-action2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 15px; border: 1px solid var(--c-sand-a22);
  background: var(--surface); color: var(--c-paper); cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.fx-btn svg { width: 20px; height: 20px; flex: none; }
.fx-btn:active { transform: scale(.97); }
.fx-btn.primary { background: var(--action-bg); color: var(--action-ink); border: 0; box-shadow: 0 8px 16px -10px var(--c-black-a70); }
.fx-btn.quiet { background: none; border-color: transparent; color: var(--c-sand); padding-inline: 10px; }
.fx-btn.wide { width: 100%; }
.fx-btn.quiet.warn { color: var(--warn); }
.fx-card > .fx-btn:not(.wide) { justify-self: start; }
.fx-btn.sm { min-height: 44px; font-size: 14px; padding: 0 14px; }
.fx-btn:disabled { opacity: .55; cursor: default; }

/* التفاصيل المحاسبية: خلف زر، مطوية في «بسيط» */
details.fx-tech { border-radius: 14px; background: var(--c-black-a20); border: 1px dashed var(--c-sand-a22); }
details.fx-tech > summary { list-style: none; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--c-sand); font-weight: 700; font-size: 14px; cursor: pointer; }
details.fx-tech > summary::-webkit-details-marker { display: none; }
details.fx-tech > summary::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
details.fx-tech[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.fx-tech-body { padding: 0 12px 12px; display: grid; gap: 8px; font-size: 13.5px; overflow-x: auto; }
.fx-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.fx-kv dt { color: var(--c-paper-a80); }
.fx-kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
table.fx-lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.fx-lines th { text-align: start; color: var(--c-paper-a80); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--c-sand-a22); }
table.fx-lines td { padding: 6px 4px; border-bottom: 1px solid var(--c-white-a06); }
table.fx-lines td.num, table.fx-lines th.num { text-align: end; }

/* خطوات وأشرطة ومقارنات */
.fx-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fx-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14.5px; }
.fx-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c-white-a06); color: var(--c-paper-a80); font-size: 13px; font-weight: 800; }
.fx-dot svg { width: 16px; height: 16px; }
.fx-steps .done .fx-dot { background: var(--c-ok-a14); color: var(--c-ok); }
.fx-bar { height: 10px; border-radius: 999px; background: var(--c-white-a06); overflow: hidden; display: flex; }
.fx-bar i { display: block; height: 100%; }
.fx-bar .ok { background: var(--c-ok); }
.fx-bar .warn { background: var(--c-amber); }
.fx-bar .mute { background: var(--c-paper-a60); }
.fx-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-compare.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-compare.one { grid-template-columns: minmax(0, 1fr); }
.fx-compare > div { padding: 10px; border-radius: 16px; background: var(--c-black-a20); min-width: 0; }
.fx-compare small { display: block; color: var(--c-paper-a80); font-size: 12.5px; }
.fx-compare strong { display: block; font-size: 15.5px; font-weight: 800; white-space: nowrap; }
.fx-compare .hi strong { color: var(--c-amber); }
.fx-compare strong.ok { color: var(--c-ok); }
.fx-compare strong.bad { color: var(--c-sos); }
.fx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-mini { padding: 12px; border-radius: 16px; background: var(--c-black-a20); display: grid; gap: 4px; min-width: 0; }
.fx-mini b { font-size: 15px; overflow-wrap: anywhere; }

/* الحالة الفارغة */
.fx-empty { border: 1px dashed var(--empty-border); border-radius: var(--radius-card); background: var(--surface); padding: 28px 18px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.fx-mark { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--tile-icon-bg); color: var(--c-sand); }
.fx-mark svg { width: 26px; height: 26px; }
.fx-empty h3 { margin: 0; font-size: 18px; font-weight: 800; }
.fx-empty p { margin: 0; color: var(--c-paper-a80); max-width: 46ch; }

/* اختيار السبب: أزرار جاهزة (راديو) */
fieldset.fx-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
fieldset.fx-reasons legend { font-weight: 800; font-size: 16px; margin-bottom: 8px; padding: 0; }
.fx-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fx-chip { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--c-sand-a22); background: var(--c-white-a06); font-weight: 600; font-size: 14.5px; line-height: 1.35; cursor: pointer; }
.fx-chip input { position: absolute; opacity: 0; pointer-events: none; }
.fx-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-paper-a60); display: grid; place-items: center; flex: none; }
.fx-tick svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.fx-chip:has(input:checked) { border-color: var(--c-sand); background: var(--c-sand-a12); color: var(--c-sand); font-weight: 800; }
.fx-chip:has(input:checked) .fx-tick { background: var(--c-sand); border-color: var(--c-sand); color: var(--c-sand-ink); }
.fx-chip:has(input:checked) .fx-tick svg { opacity: 1; }
.fx-chip:has(input:focus-visible) { outline: 2px solid var(--c-sand); outline-offset: 2px; }
@media (max-width: 359px) { .fx-chips { grid-template-columns: 1fr; } }
.fx-candidate { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--c-sand-a22); background: var(--c-white-a06); cursor: pointer; }
.fx-candidate input { width: 22px; height: 22px; accent-color: var(--c-sand); flex: none; }
.fx-candidate:has(input:checked) { border-color: var(--c-sand); background: var(--c-sand-a12); }
.fx-drop { border: 1.5px dashed var(--c-sand-a45); border-radius: 18px; padding: 20px; display: grid; justify-items: center; gap: 6px; text-align: center; background: var(--c-black-a20); position: relative; }
.fx-drop svg { width: 24px; height: 24px; color: var(--c-sand); }

/* حقول وملاحظات وختم */
.fx-field { display: grid; gap: 6px; }
.fx-field label { font-weight: 700; font-size: 14.5px; }
.fx-field textarea, .fx-field input[type=text], .fx-field input[type=number], .fx-field input[type=date] { width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--c-sand-a45); background: var(--c-black-a20); padding: 10px 12px; color: var(--c-paper); }
.fx-field textarea { min-height: 84px; resize: vertical; }
.fx-err-inline { display: flex; gap: 6px; align-items: center; color: var(--c-sos); font-size: 13.5px; font-weight: 700; }
.fx-err-inline svg { width: 16px; height: 16px; flex: none; }
.fx-field [aria-invalid="true"] { border-color: var(--c-sos); }
.fx-hint { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--c-paper-a80); }
.fx-err { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--c-sos-a14); color: var(--c-sos); font-size: 14px; font-weight: 700; }
.fx-note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 14px; background: var(--c-sand-a12); color: var(--c-paper); font-size: 14px; line-height: 1.55; }
.fx-note svg { color: var(--c-sand); margin-top: 2px; width: 20px; height: 20px; }
.fx-note.warn { background: var(--c-amber-a14); }
.fx-note.warn svg { color: var(--c-amber); }
.fx-stamp { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--c-sand-a45); color: var(--c-sand); font-weight: 700; font-size: 13.5px; background: var(--c-sand-a12); }
.fx-stamp svg { width: 18px; height: 18px; flex: none; }

/* النافذة المركزية: وسط الشاشة بمكان ثابت على كل العروض */
body.fx-lock { overflow: hidden; }
.fx-scrim { position: fixed; inset: 0; z-index: 1200; background: var(--scrim); display: grid; place-items: center; padding: 16px; color: var(--c-paper); font-family: inherit; }
.fx-dlg { width: min(560px, 100%); max-height: min(92dvh, calc(100dvh - 32px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 24px; background: var(--surface); border: 1px solid var(--c-sand-a22); box-shadow: var(--dialog-shadow); overflow: hidden; }
.fx-dlg:focus { outline: none; }
.fx-dlg-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--c-white-a06); }
.fx-dlg-h h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.4; color: var(--c-paper); }
.fx-dlg-h p { margin: 2px 0 0; font-size: 14px; color: var(--c-paper-a80); }
.fx-rnd { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c-white-a06); border: 0; color: var(--c-paper); flex: none; cursor: pointer; }
.fx-dlg-b { overflow: auto; padding: 14px 16px; display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.fx-dlg-f { padding: 12px 16px 16px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--c-white-a06); background: var(--surface); }
.fx-dlg-f:has(> :only-child) { grid-template-columns: 1fr; }

@media (max-width: 767px) { .fx-op { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; } .fx-op-ic { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .fx-btn { transition: none; } }

/* الشاشة مفتوحة: تُخفى ترويسة التشغيل (مقدّمة الصفحة وتبويباتها وبطاقة التعليف اليومي) فتبقى الشاشة وحدها بزر رجوع، كما في المعاينة المعتمدة */
.feed-workspace:has(.fx-open) > :is(.page-intro, .feed-section-tabs, .card) { display: none; }

/* تصحيح .fx-candidate القائم (عيب سابق في اختيار الصفوف بالراديو): كان يرث لون label العام الباهت وهامش 5px وحشوة الحقل العامة. كما في المعاينة المعتمدة 2026-11-13 */
.fx-candidate { color: var(--c-paper); margin: 0; font-size: 15px; font-weight: 700; }
html[data-ui] .fx-candidate input[type=radio] { margin: 0; padding: 0; background: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c-paper-a60); flex: none; }
html[data-ui] .fx-candidate input[type=radio]:checked { border-color: var(--c-sand); background: radial-gradient(circle, var(--c-sand) 0 45%, transparent 50%); }
.fx-candidate .fx-small { font-weight: 400; }
.fx-chip { margin: 0; }

/* قرارات المالك 2026-11-13: دعوة عضو، الملف القانوني، الرابط المؤقت. المكوّنات من المعاينة المعتمدة (توكنات system.css فقط) */
.fx-dlg-text { margin: 0; font-size: 15.5px; line-height: 1.7; }
.fx-empty.solid { border-style: solid; }
.fx-flush { margin: 0; }
.fx-reason { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.fx-stage { display: grid; gap: 14px; min-width: 0; }
.fx-linkbox { border: 1px dashed var(--c-sand-a45); }
.fx-linkbox .fx-code { overflow-wrap: anywhere; word-break: break-all; font-size: 14px; line-height: 1.6; }
.fx-linkbox.dead { opacity: .6; }
.fx-linkbox.dead .fx-code { text-decoration: line-through; }
.fx-clock { font-size: 22px; justify-self: start; }
.fx-actions.split { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.fx-field input.fx-ltr { direction: ltr; text-align: right; }
.fx-export-link { width: 100%; margin-top: 10px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fx-export-link svg { width: 20px; height: 20px; flex: none; }
