/* باب «المال» (دفتر القيادة، 2026-11-14): الجذر `.ux.money-hub.mm-page` (uxRoot) ومكوّنات ui_kit.css تعمل تحته.
 * هذا الملف: تخطيط الصفحة والبلاطات القائمة (أزرار hubEntry) التي تسكن الأقسام، وورقة تسجيل الحركة (mm-sheet/mm-scrim تُلحَق بـbody).
 * رموز system.css/tokens.css وحدها (لا ألوان حرفية). هدف اللمس 48. الأرقام لاتينية داخل bdi/tabular-nums. الحركة تُلغى تحت prefers-reduced-motion. */
.mm-page { color: var(--c-paper); font-family: inherit; }
:is(html, html[data-ui]) .mm-page bdi { unicode-bidi: isolate; }
:is(html, html[data-ui]) .mm-page button { font-family: inherit; }
:is(html, html[data-ui]) .mm-page :focus-visible,
:is(html, html[data-ui]) .mm-sheet :focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; }
:is(html, html[data-ui]) .mm-page [hidden],
:is(html, html[data-ui]) .mm-sheet [hidden] { display: none !important; }


:is(html, html[data-ui]) .mm-n { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
:is(html, html[data-ui]) .mm-amount { white-space: nowrap; font-weight: 800; }
:is(html, html[data-ui]) .mm-cur { font-size: max(12px, .62em); color: var(--c-paper-a60); font-weight: 600; margin-inline-start: 3px; }
:is(html, html[data-ui]) .mm-sub,
:is(html, html[data-ui]) .mm-dim { color: var(--c-paper-a60); font-size: 12.5px; line-height: 1.5; font-weight: 500; }

/* شرائح الأشهر */

/* البطل (غير قابل للنقر) */
:is(html, html[data-ui]) .mm-skel { min-height: 30px; border-radius: 14px; background: var(--c-white-a06); }
:is(html, html[data-ui]) .mm-body.mm-skel { min-height: 56px; }

/* البلاطات (أزرار hubEntry نفسها) */
:is(html, html[data-ui]) .mm-bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
:is(html, html[data-ui]) .mm-page .account-action-card.mm-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; width: 100%; min-height: 132px;
  padding: 16px; border-radius: 24px; background: var(--c-white-a06); border: 1px solid var(--c-paper-a60); color: var(--c-paper); text-align: start; font: inherit; cursor: pointer; }
:is(html, html[data-ui]) .mm-page .account-action-card.mm-tile:hover { border-color: var(--c-sand-a45); transform: none; }
:is(html, html[data-ui]) .mm-wide { grid-column: 1 / -1; }
:is(html, html[data-ui]) .mm-th { display: flex; align-items: center; gap: 8px; color: var(--c-paper-a80); font-size: 13.5px; font-weight: 700; min-width: 0; }
:is(html, html[data-ui]) .mm-th strong { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
:is(html, html[data-ui]) .mm-th .account-action-icon { width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; background: none; color: var(--c-paper-a80); display: grid; place-items: center; flex: none; }
:is(html, html[data-ui]) .mm-th .account-action-icon svg { width: 20px; height: 20px; }
:is(html, html[data-ui]) .mm-th .hub-arrow { margin-inline-start: auto; color: var(--c-paper-a60); font-size: 18px; flex: none; }
:is(html, html[data-ui]) .mm-body { display: block; min-width: 0; }
:is(html, html[data-ui]) .mm-stack { display: grid; gap: 10px; min-width: 0; }
:is(html, html[data-ui]) .mm-row-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
:is(html, html[data-ui]) .mm-row-wrap > .mm-amount { font-size: 24px; letter-spacing: -.4px; }
:is(html, html[data-ui]) .mm-chip { display: inline-flex; gap: 5px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; justify-self: start; white-space: nowrap;
  background: var(--c-amber-a14); color: var(--c-amber); width: fit-content; }
:is(html, html[data-ui]) .mm-chip:not(.amber):not(.ok):not(.sos) { background: var(--c-white-a06); color: var(--c-paper-a80); }
:is(html, html[data-ui]) .mm-chip.ok { background: var(--c-ok-a14); color: var(--c-ok); }
:is(html, html[data-ui]) .mm-chip.sos { background: var(--c-sos-a14); color: var(--c-sos); }

/* الديون */
:is(html, html[data-ui]) .mm-page .mm-tall { grid-row: auto; }
:is(html, html[data-ui]) .mm-due { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
:is(html, html[data-ui]) .mm-day { height: 46px; border-radius: 14px; display: grid; place-content: center; text-align: center; background: var(--c-white-a06); font-weight: 800; font-size: 17px; line-height: 1; }
:is(html, html[data-ui]) .mm-day small { font-size: 12px; color: var(--c-paper-a60); font-weight: 600; margin-top: 3px; }
:is(html, html[data-ui]) .mm-due:first-of-type .mm-day { background: var(--c-amber-a14); color: var(--c-amber); }
:is(html, html[data-ui]) .mm-grow { min-width: 0; display: grid; }
:is(html, html[data-ui]) .mm-grow b { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }

/* الشركاء */
:is(html, html[data-ui]) .mm-share { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 3px; background: none; }
:is(html, html[data-ui]) .mm-share i { display: block; border-radius: 999px; }
:is(html, html[data-ui]) .mm-c-sand { background: var(--c-sand); } :is(html, html[data-ui]) .mm-c-ok { background: var(--c-ok); } :is(html, html[data-ui]) .mm-c-amber { background: var(--c-amber); } :is(html, html[data-ui]) .mm-c-sos { background: var(--c-sos); }
:is(html, html[data-ui]) .mm-person { display: grid; gap: 2px; font-size: 13px; background: none; min-width: 0; }
:is(html, html[data-ui]) .mm-pname { display: flex; gap: 6px; align-items: center; min-width: 0; flex: 1; color: var(--c-paper-a80); }
:is(html, html[data-ui]) .mm-pname::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c-paper); flex: none; }
:is(html, html[data-ui]) .mm-person.mm-c-sand .mm-pname::before { background: var(--c-sand); } :is(html, html[data-ui]) .mm-person.mm-c-ok .mm-pname::before { background: var(--c-ok); }
:is(html, html[data-ui]) .mm-person.mm-c-amber .mm-pname::before { background: var(--c-amber); } :is(html, html[data-ui]) .mm-person.mm-c-sos .mm-pname::before { background: var(--c-sos); }
:is(html, html[data-ui]) .mm-ellipsis { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(html, html[data-ui]) .mm-pct { flex: none; white-space: nowrap; }
:is(html, html[data-ui]) .mm-person > .mm-amount { font-size: 13px; padding-inline-start: 14px; }

/* الحسابات */
:is(html, html[data-ui]) .mm-acc { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: center; padding: 9px 10px; border-radius: 16px; background: var(--c-black-a20); min-width: 0; }
:is(html, html[data-ui]) .mm-acc em { grid-row: 1 / span 2; font-style: normal; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--c-sand-a12); color: var(--c-sand); font-size: 12px; font-weight: 800; flex: none; }
:is(html, html[data-ui]) .mm-acc .mm-grow { flex: 1; font-size: 13px; font-weight: 600; }
:is(html, html[data-ui]) .mm-acc .mm-amount { font-size: 13.5px; grid-column: 2; }

/* الشراء والمؤشرات */
:is(html, html[data-ui]) .mm-steps,
:is(html, html[data-ui]) .mm-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
:is(html, html[data-ui]) .mm-step,
:is(html, html[data-ui]) .mm-kpis > span { padding: 8px 4px; border-radius: 14px; background: var(--c-black-a20); min-width: 0; }
:is(html, html[data-ui]) .mm-step b,
:is(html, html[data-ui]) .mm-kpis b { display: block; font-size: 20px; font-weight: 800; }
:is(html, html[data-ui]) .mm-kpis b { font-size: 15px; }
:is(html, html[data-ui]) .mm-step small,
:is(html, html[data-ui]) .mm-kpis small { display: block; color: var(--c-paper-a60); font-size: 12px; line-height: 1.35; margin-top: 2px; }
:is(html, html[data-ui]) .mm-step.hot b { color: var(--c-amber); }

/* المطابقة */
:is(html, html[data-ui]) .mm-match { display: grid; gap: 6px; }
:is(html, html[data-ui]) .mm-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--c-paper-a60); }
:is(html, html[data-ui]) .mm-bar { display: block; position: relative; height: 8px; border-radius: 999px; background: var(--c-white-a06); overflow: hidden; }
:is(html, html[data-ui]) .mm-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; width: clamp(0%, calc(var(--r, 0) * 100%), 100%); }

/* الأفق: النقاط المتقاربة دُمجت في الخادم؛ التسميات تتناوب تحت الخط وفوقه فلا تتراكب */
:is(html, html[data-ui]) .mm-horizon { position: relative; display: block; height: 96px; margin: 4px 30px 0; }
:is(html, html[data-ui]) .mm-horizon::before { content: ""; position: absolute; inset-inline: -30px; top: 47px; height: 2px; background: linear-gradient(90deg, var(--c-paper-a60), var(--c-paper-a60)); }
:is(html, html[data-ui]) .mm-dot { position: absolute; top: 38px; width: 18px; height: 18px; margin-inline-start: -9px; border-radius: 50%; border: 3px solid var(--c-forest-800); }
:is(html, html[data-ui]) .mm-dot span { position: absolute; top: 24px; inset-inline-start: 50%; transform: translateX(50%); white-space: nowrap; font-size: 11px; color: var(--c-paper-a60); font-style: normal; }
:is(html, html[data-ui])[dir="ltr"] .mm-dot span { transform: translateX(-50%); }
:is(html, html[data-ui]) .mm-dot.alt span { top: auto; bottom: 24px; }

/* رف التقارير: مستندات طويلة (أيقونة أعلى وعنوان أسفل) */
:is(html, html[data-ui]) .mm-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
:is(html, html[data-ui]) .mm-page .mm-shelf .account-action-card.mm-tile { min-height: 150px; border-radius: 22px; padding: 14px; align-content: space-between; gap: 6px; grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, var(--c-white-a06), var(--c-white-a06)); }
:is(html, html[data-ui]) .mm-shelf .mm-th { display: contents; }
:is(html, html[data-ui]) .mm-shelf .mm-th .account-action-icon { grid-row: 1; width: 40px; height: 52px; border-radius: 8px 14px 8px 8px; background: var(--c-sand-a12); color: var(--c-sand); }
:is(html, html[data-ui]) .mm-shelf .mm-th .account-action-icon svg { width: 22px; height: 22px; }
:is(html, html[data-ui]) .mm-shelf .mm-th strong { grid-row: 3; font-size: 14.5px; font-weight: 800; line-height: 1.35; color: var(--c-paper); }
:is(html, html[data-ui]) .mm-shelf .mm-th .hub-arrow { display: none; }
:is(html, html[data-ui]) .mm-shelf .mm-body { grid-row: 4; margin-top: -2px; }
:is(html, html[data-ui]) .mm-page .mm-shelf .mm-ex { background: linear-gradient(180deg, var(--c-sand-a22), var(--c-sand-a12)); border-color: var(--c-sand-a22); }

/* الدفتر: البطاقة كلها زر */
:is(html, html[data-ui]) .mm-ledger .mm-body { margin-inline: -16px; margin-bottom: -10px; }
:is(html, html[data-ui]) .mm-ledger .mm-stack { gap: 0; }
:is(html, html[data-ui]) .mm-lrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 16px; }
:is(html, html[data-ui]) .mm-lrow + .mm-lrow { border-top: 1px solid var(--c-paper-a60); }
:is(html, html[data-ui]) .mm-tag { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--c-white-a06); color: var(--c-paper-a60); }
:is(html, html[data-ui]) .mm-lrow .mm-grow b { font-size: 13.5px; }
:is(html, html[data-ui]) .mm-lrow .mm-grow .mm-sub { font-size: 12px; }
:is(html, html[data-ui]) .mm-lrow .mm-amount { font-size: 14px; }

/* صفوف الأدوات */
:is(html, html[data-ui]) .mm-tools { display: grid; gap: 8px; }
:is(html, html[data-ui]) .mm-page .mm-tools .account-action-card.mm-tile { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; border-radius: 20px; font-size: 14px; }
:is(html, html[data-ui]) .mm-tools .mm-th { display: contents; }
:is(html, html[data-ui]) .mm-tools .mm-th .account-action-icon { order: 1; width: 36px; height: 36px; border-radius: 11px; background: var(--c-white-a06); color: var(--c-sand); }
:is(html, html[data-ui]) .mm-tools .mm-th strong { order: 2; flex: 1; font-size: 14px; font-weight: 700; color: var(--c-paper); }
:is(html, html[data-ui]) .mm-tools .mm-body { order: 3; }
:is(html, html[data-ui]) .mm-tools .mm-body .mm-sub,
:is(html, html[data-ui]) .mm-tools .mm-body .mm-chip { color: var(--c-sand); font-size: 12.5px; font-weight: 700; background: none; padding: 0; }
:is(html, html[data-ui]) .mm-tools .mm-th .hub-arrow { order: 4; margin: 0; }

/* زر التسجيل */
/* زر التسجيل: بعد البطل بعرض كامل في التدفق؛ يصير حبة مدمجة ثابتة فقط حين تخرج خانته من الشاشة (≤999px) */
:is(html, html[data-ui]) body.mm-sheet-open .mm-fab { display: none; }

/* الورقة السفلية */
.mm-scrim { position: fixed; inset: 0; background: var(--c-black-a70); backdrop-filter: blur(3px); z-index: 1000; }
.mm-sheet { position: fixed; inset-inline: 0; bottom: 0; z-index: 1001; max-height: 88vh; overflow-y: auto; border-radius: 30px 30px 0 0; padding: 10px 16px 26px;
  background: var(--c-forest-800); border-top: 1px solid var(--c-sand-a22); color: var(--c-paper); font-family: inherit; display: block; }
:is(html, html[data-ui]) .mm-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--c-paper-a60); margin: 0 auto 14px; }
:is(html, html[data-ui]) .mm-sheet h3 { margin: 0 0 4px; font-size: 19px; color: var(--c-paper); }
:is(html, html[data-ui]) .mm-sheet > .mm-sub { margin: 0 0 6px; }
:is(html, html[data-ui]) .mm-sgl { margin: 14px 0 8px; color: var(--c-paper-a60); font-size: 12px; font-weight: 700; }
:is(html, html[data-ui]) .mm-sg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
:is(html, html[data-ui]) .mm-sg button { display: grid; justify-items: center; align-content: start; gap: 8px; min-height: 48px; padding: 12px 4px; border-radius: 20px; background: var(--c-white-a06);
  border: 1px solid var(--c-paper-a60); color: var(--c-paper); font-weight: 700; font-size: 12.5px; line-height: 1.35; font-family: inherit; text-align: center; cursor: pointer; }
:is(html, html[data-ui]) .mm-sic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--c-sand-a12); color: var(--c-sand); }
:is(html, html[data-ui]) .mm-sic svg { width: 22px; height: 22px; }

@media (min-width: 768px) {
  .mm-sheet { inset-inline: 0; margin-inline: auto; bottom: auto; top: 50%; translate: 0 -50%; width: min(560px, 92vw); border-radius: 30px; border: 1px solid var(--c-sand-a22); }
}

/* واسع (≥1000): عمود واحد داخل إطار 834 (DP-3)؛ الزر داخل التدفق بعرض كامل والبنتو عمودان (قيم الأساس) */
@media (min-width: 1000px) {
}
/* شاشة ضيقة جداً: البلاطات عمود واحد */
@media (max-width: 360px) {
  :is(html, html[data-ui]) .mm-bento { grid-template-columns: 1fr; }
  :is(html, html[data-ui]) .mm-bento .mm-wide { grid-column: auto; }
}

/* ضيق/واسع البطل: تأتي بعد القواعد الأساسية لتغلبها */
/* أكبر رقم واقعي بكسوره (9,132,750.50 ر.س) لا يتسع في ثلاث خانات بخط المظهر الفعّال (أعرض من خط النظام)؛ تُرصّ الخانات صفوفاً حين يضيق البطل عن 600px (يشمل عمود الحاسوب الجانبي) */
@container (max-width: 599px) {
}
@media (prefers-reduced-motion: no-preference) {
  :is(html, html[data-ui]) .mm-page .mm-tile { transition: transform 140ms cubic-bezier(.23, 1, .32, 1); }
  :is(html, html[data-ui]) .mm-page .mm-tile:active { transform: scale(.98); }
  .mm-sheet { animation: mm-up 280ms cubic-bezier(.32, .72, 0, 1); }
  :is(html, html[data-ui]) .mm-sheet.closing { animation: mm-down 200ms cubic-bezier(.32, .72, 0, 1) forwards; }
  .mm-scrim { animation: mm-fade 200ms ease; }
  :is(html, html[data-ui]) .mm-scrim.closing { animation: mm-fade 200ms ease reverse forwards; }
}
@keyframes mm-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes mm-down { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes mm-fade { from { opacity: 0; } to { opacity: 1; } }


/* ───── تخطيط باب المال (دفتر القيادة) ───── */
.ux.mm-page { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; padding-bottom: 24px; color: var(--ink); }
.ux.mm-page > *, .ux .mm-content > * { min-width: 0; }
.ux .mm-content { display: flex; flex-direction: column; gap: var(--sp-4); }
.ux .mm-page .tabs { overflow-x: auto; scrollbar-width: none; }
.ux .mm-page .tabs::-webkit-scrollbar { display: none; }
.ux .mm-gap { font-size: var(--fs-label); line-height: 1.6; }
.ux .mm-panel { gap: var(--sp-3); }
.ux .mm-manage { gap: var(--sp-3); }
.ux .mm-skel { min-height: 30px; border-radius: var(--r-md); background: var(--surface-2); }
.ux .mm-skel-hero { min-height: 120px; }
.ux .mm-compare .table th, .ux .mm-compare .table td { height: 44px; padding-inline: 8px; white-space: normal; }
.ux .mm-compare .table th[scope="row"] { font-weight: 600; font-size: var(--fs-body); color: var(--ink); text-align: start; box-shadow: none; position: static; }
.ux .mm-compare .table td.is-num { text-align: end; }
.ux .mm-cats .hbars { margin-top: 4px; }
.ux .mm-due-note > .btn, .ux .mm-page .note > .btn { flex: none; }

/* شريط الفترة والوضع والتسجيل */
.ux .mm-page .strip { gap: var(--sp-3); }
.ux .mm-months { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; flex: 1 1 200px; min-width: 0; }
.ux .mm-months::-webkit-scrollbar { display: none; }
.ux .mm-months button { flex: none; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-label); cursor: pointer; }
.ux .mm-months button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); border-color: var(--accent); font-weight: 600; }
.ux .mm-fab { margin-inline-start: auto; }
body.mm-sheet-open .ux .mm-fab { display: none; }

/* شرائح فئات المصروف */
.ux .mm-cat-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ux .mm-cat-chips::-webkit-scrollbar { display: none; }
.ux .mm-cat-chips .filter-chip { flex: none; min-height: 44px; }
.ux .mm-day-group { display: flex; flex-direction: column; gap: 8px; }
.ux .mm-day-head { font-size: var(--fs-label); }
.ux .mm-day-head b { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

/* بلاطات hubEntry داخل الأقسام (بالرموز الجديدة) */
.ux .mm-page .account-action-card.mm-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; width: 100%; min-height: 132px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-align: start; font: inherit; cursor: pointer; box-shadow: none; }
.ux .mm-page .account-action-card.mm-tile:hover { border-color: var(--accent); background: var(--surface); }
.ux .mm-page .mm-th, .ux .mm-page .mm-th .account-action-icon, .ux .mm-page .mm-th .hub-arrow { color: var(--muted); }
.ux .mm-page .mm-th strong { color: var(--ink); }
.ux .mm-page .mm-cur, .ux .mm-page .mm-sub, .ux .mm-page .mm-dim { color: var(--muted); }
.ux .mm-page .mm-acc, .ux .mm-page .mm-step, .ux .mm-page .mm-kpis > span, .ux .mm-page .mm-day, .ux .mm-page .mm-tag { background: var(--surface-2); }
.ux .mm-page .mm-bar, .ux .mm-page .mm-skel { background: var(--surface-2); }
.ux .mm-page .mm-chip { background: var(--surface-2); color: var(--muted); }
.ux .mm-page .mm-chip.amber { background: var(--warn-soft); color: var(--warn); }
.ux .mm-page .mm-chip.ok { background: var(--primary-soft); color: var(--ok); }
.ux .mm-page .mm-chip.sos { background: var(--danger-soft); color: var(--danger); }
.ux .mm-page .mm-step.hot b, .ux .mm-page .mm-due:first-of-type .mm-day { color: var(--warn); }
.ux .mm-page .mm-tools .account-action-card.mm-tile { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; }
.ux .mm-page .mm-tools .mm-th .account-action-icon { background: var(--surface-2); color: var(--accent-ink); }
.ux .mm-page .mm-tools .mm-th strong { color: var(--ink); }
.ux .mm-page .mm-tools .mm-body .mm-sub, .ux .mm-page .mm-tools .mm-body .mm-chip { color: var(--accent-ink); background: none; }
.ux .mm-page .mm-ledger .mm-lrow + .mm-lrow { border-top-color: var(--line-soft); }
.ux .mm-page .mm-c-sand { background: var(--accent); } .ux .mm-page .mm-c-ok { background: var(--ok); } .ux .mm-page .mm-c-amber { background: var(--warn); } .ux .mm-page .mm-c-sos { background: var(--danger); }
.ux .mm-page .mm-person.mm-c-sand .mm-pname::before { background: var(--accent); } .ux .mm-page .mm-person.mm-c-ok .mm-pname::before { background: var(--ok); }
.ux .mm-page .mm-person.mm-c-amber .mm-pname::before { background: var(--warn); } .ux .mm-page .mm-person.mm-c-sos .mm-pname::before { background: var(--danger); }
.ux .mm-page .mm-person, .ux .mm-page .mm-pname, .ux .mm-page .mm-th { color: var(--muted); }

/* الحاسوب: إطار بسيط، الجدول يملأ العرض والحقول الأفقية تتسع */
@media (min-width: 1024px) {
  .ux .mm-months { flex: 0 1 auto; }
  .ux .mm-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ux .mm-cat-chips { flex-wrap: wrap; overflow: visible; }
}

/* ───── FX1 (2026-11-15) ───── */
.ux .btn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.ux .mm-dl-group { gap: var(--sp-3); }
.ux .mm-dl-card { display: flex; flex-direction: column; gap: var(--sp-2); }
.ux .mm-dl-card + .mm-dl-card { padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.ux .mm-dl-card > h3 { font-size: var(--fs-md); }
.ux .mm-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; margin: 0; padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }
.ux .mm-dl dt { color: var(--muted); font-size: var(--fs-label); }
.ux .mm-dl dd { margin: 0; font-weight: 600; text-align: end; font-variant-numeric: tabular-nums lining-nums; }
.ux .mm-dl dd bdi { direction: ltr; unicode-bidi: isolate; }
.ux .partners-hub select { min-height: 48px; width: 100%; }
/* خط واحد للتبويبات والجداول داخل باب المال (V13) */
.ux .mm-page .tabs, .ux .mm-page .tab-link, .ux .mm-page table, .ux .mm-page th, .ux .mm-page td { font-family: var(--font-body); }
.ux .mm-page .tab-link { font-size: var(--fs-body); }
/* رأس الباب: العنوان الفرعي لا يُقصّ (V9) */
.ux .mm-skel-hero[aria-hidden] { min-height: 64px; }
@media (min-width: 1024px) {
  .ux .mm-content, .ux .mm-page > section, .ux .mm-page > .stack-v, .ux .mm-page .partners-hub { max-width: 720px; }
}
/* WAVE2: تبويبات المال الخمسة تتبع مكوّن ui_kit الواحد (تمرير بتلاشٍ حين لا تتّسع في سطر واحد) */
/* FX1 (متابعة): عنوان صفحة الشركاء وأزرارها بحجم المكتبة، وفجوة قبل صندوق الملاحظة وبعد سطر الربح */
.ux .partners-hub .page-heading h1 { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; line-height: 1.3; letter-spacing: 0; }
html[data-ui] body .mm-page :is(button.primary, button.ghost, .btn) { font-family: var(--font-body); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; }
.ux .partners-hub .mm-dl-group { margin-block: var(--sp-3); }
.ux .partners-hub p.hint { margin-block-start: var(--sp-3); }
.ux .mm-gap { white-space: normal; overflow-wrap: anywhere; min-width: 0; }

/* R1a: شهر كل قيمة في جدول المقارنة يظهر في العرض الضيّق حيث تُقرأ الخلايا بلا رأس العمود */
.ux .mm-compare .mm-cell { display: inline-flex; flex-direction: column; align-items: flex-end; }
.ux .mm-compare .mm-cell-month { display: none; font-size: var(--fs-small, 12px); color: var(--faint); line-height: 1.2; }
@media (max-width: 640px) { .ux .mm-compare .mm-cell-month { display: block; } }
@media (max-width: 640px) { .ux .mm-compare table:not(.compact-table) td.mm-change-dash { display: none; } }

/* R1b: ورقة تفاصيل تصحيحات الفترات السابقة وملاحظات S7/S8 */
.ux .mm-corr-sheet { gap: var(--sp-3); }
.ux .mm-corr-item { display: flex; flex-direction: column; gap: 2px; padding-block: var(--sp-3); border-block-end: 1px solid var(--line); }
.ux .mm-corr-item > span { font-size: var(--fs-label); line-height: 1.6; overflow-wrap: anywhere; }
.ux .mm-corr-herd { gap: 2px; padding-block-start: var(--sp-2); }
.ux .mm-corr-foot { gap: var(--sp-2); padding-block-start: var(--sp-2); overflow-wrap: anywhere; }
.ux .mm-notices { gap: var(--sp-2); }
.ux .mm-notice { font-size: var(--fs-label); line-height: 1.7; margin: 0; overflow-wrap: anywhere; }

.ux .mm-corr-id { white-space: nowrap; unicode-bidi: isolate; }
.ux .mm-corr-audit > span { display: block; font-size: var(--fs-label); line-height: 1.6; overflow-wrap: anywhere; }
.ux .mm-corr-foot-row { font-size: var(--fs-body); }
.ux .mm-corr-foot-row.is-strong { font-weight: 700; }
.ux .mm-export-divider { border: 0; border-block-start: 1px solid var(--line); margin-block: var(--sp-2); width: 100%; }
/* ورقة التصحيحات: عنوان النافذة بمحاذاة حشوة المحتوى وزر إغلاق 48×48 في الطرف المقابل (15 تصحيح 10) */
html[data-ui] body .modal-box:not(.vx-drawer):not(.vx-wizard-box) .ux-modal-host:has(.mm-corr-sheet) .modal-head { padding: 0 var(--sp-4); justify-content: space-between; text-align: start; }
html[data-ui] body .modal-box:not(.vx-drawer):not(.vx-wizard-box) .ux-modal-host:has(.mm-corr-sheet) .modal-head .icon-btn { position: static; width: 48px; height: 48px; min-width: 48px; min-height: 48px; margin-inline-end: -12px; }

/* R1b recheck: N3 ملاحظة المسحوبات (ui_kit يصفّر حشو p فيُعاد هنا)، N4 زر التفاصيل، N5 رأس الصف */
.ux .partners-hub p.hint { padding: var(--sp-3) var(--sp-4); line-height: 1.6; }
.ux .mm-corr-toggle { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; cursor: pointer; font-size: var(--fs-label); color: var(--ink); }
.ux .mm-corr-toggle::-webkit-details-marker { display: none; }
.ux .mm-corr-toggle svg { flex: none; transition: transform .15s; }
.ux .mm-corr-audit[open] > .mm-corr-toggle svg { transform: rotate(90deg); }
.ux .mm-corr-item > .between { align-items: flex-start; gap: var(--sp-3); }
.ux .mm-corr-item > .between > b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ux .mm-corr-item > .between > :last-child { flex: none; white-space: nowrap; }

/* R2: زر الفترة (حبة بإطار ظاهر، 48) وورقتها */
.ux .mm-period { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 48px; max-width: 100%; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--surface); border: 1.5px solid var(--muted); color: var(--ink); font: 600 var(--fs-body)/1 var(--font-body); cursor: pointer; }
.ux .mm-period svg { flex: none; color: var(--muted); }
.ux .mm-period-label { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.ux .mm-period.is-wide { flex: 1 1 100%; order: 3; }
.ux .mm-period-sheet { display: flex; flex-direction: column; gap: var(--sp-2); }
html[data-ui] body .mm-period-sheet .mm-period-list { display: flex; flex-direction: column; gap: 2px; }
html[data-ui] body .mm-period-sheet .mm-period-opt { display: flex; box-sizing: border-box; width: 100%; box-shadow: none; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 52px; padding: 6px var(--sp-3); border-radius: var(--r-md); border: 1px solid transparent; background: transparent; color: var(--ink); text-align: start; width: 100%; }
html[data-ui] body .mm-period-sheet .mm-period-opt b { display: block; font-weight: 600; font-size: var(--fs-body); }
html[data-ui] body .mm-period-sheet .mm-period-opt small { color: var(--muted); font-size: var(--fs-label); white-space: nowrap; }
html[data-ui] body .mm-period-sheet .mm-period-opt.is-on { background: var(--surface-2); border-color: var(--accent); }
html[data-ui] body .mm-period-sheet .mm-period-opt.is-locked { opacity: .55; cursor: not-allowed; }
html[data-ui] body .mm-period-sheet .mm-period-mark { width: 20px; flex: none; }
html[data-ui] body .mm-period-sheet .mm-period-lock { color: var(--muted); display: inline-flex; }
html[data-ui] body .mm-period-sheet .mm-period-plan { display: flex; gap: var(--sp-2); align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); font-size: var(--fs-label); line-height: 1.7; }
html[data-ui] body .mm-period-sheet .mm-period-plan svg { flex: none; margin-top: 3px; color: var(--muted); }
html[data-ui] body .mm-period-sheet .mm-period-switch { display: flex; box-sizing: border-box; width: 100%; box-shadow: none; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 52px; padding: 4px var(--sp-3); background: transparent; border: 0; color: var(--ink); text-align: start; }
html[data-ui] body .mm-period-sheet .mm-period-switch i { position: relative; width: 46px; height: 28px; border-radius: 999px; flex: none; background: var(--surface-2); border: 1.5px solid var(--muted); }
html[data-ui] body .mm-period-sheet .mm-period-switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); }
html[data-ui] body .mm-period-sheet .mm-period-switch.is-on i { background: var(--accent); border-color: var(--accent); }
html[data-ui] body .mm-period-sheet .mm-period-switch.is-on i::after { inset-inline-start: 21px; background: var(--surface); }
html[data-ui] body .mm-period-sheet .mm-period-switch.is-locked { opacity: .6; cursor: not-allowed; }
html[data-ui] body .mm-period-sheet .mm-period-custom { border-top: 1px solid var(--line); padding-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
html[data-ui] body .mm-period-sheet .mm-period-custom.is-on { border: 1px solid var(--accent); border-radius: var(--r-md); padding: var(--sp-3); }
html[data-ui] body .mm-period-sheet .mm-period-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
html[data-ui] body .mm-period-sheet .mm-period-error { color: var(--danger); font-size: var(--fs-label); margin: 0; }
html[data-ui] body .mm-period-sheet .mm-period-fields > * { min-width: 0; }
html[data-ui] body .mm-period-sheet .mm-period-fields input { width: 100%; min-width: 0; box-sizing: border-box; }

/* R2 v2: حقل التاريخ المشترك، صفوف الأشهر (نمط «حركة القطيع»)، رؤوس الجدول بتسميات الخادم، وتصحيحات الورقة R2–R5 */
html[data-ui] body .dsel { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
html[data-ui] body .dsel-legend { font-size: var(--fs-label); color: var(--muted); padding: 0; }
html[data-ui] body .dsel-group { display: flex; min-height: 48px; border: 1.5px solid var(--muted); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
html[data-ui] body .dsel-group select { flex: 1 1 0; min-width: 0; min-height: 48px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: inherit; padding: 0 8px; }
html[data-ui] body .dsel-group select + select { border-inline-start: 1px solid var(--line); }
html[data-ui] body .dsel-group .dsel-month { flex: 1.7 1 0; }
.ux .mm-compare .mm-cmp-th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; white-space: nowrap; line-height: 1.3; }
.ux .mm-compare .table-scroll { overflow-x: auto; max-width: 100%; }
.ux .mm-mrows { display: flex; flex-direction: column; }
.ux .mm-mrow { display: grid; grid-template-columns: minmax(70px, auto) minmax(24px, 1fr) auto 18px; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; text-align: start; cursor: pointer; }
.ux .mm-mrow:last-child { border-bottom: 0; }
.ux .mm-mname { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ux .mm-mname b { font-weight: 600; font-size: var(--fs-body); white-space: nowrap; }
.ux .mm-mname small { flex-basis: 100%; color: var(--muted); font-size: 11px; }
.ux .mm-mbar { display: block; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.ux .mm-mbar i { display: block; height: 100%; border-radius: 6px; background: var(--faint, var(--muted)); }
.ux .mm-mbar.is-live i { background: transparent; border: 2px dashed var(--ink); box-sizing: border-box; }
.ux .mm-mrow .num { white-space: nowrap; direction: ltr; }
.ux .mm-ring { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px dashed var(--ink); box-sizing: border-box; }
.ux .mm-mkey { display: flex; align-items: center; gap: 8px; }
.ux .mm-row-prev { white-space: nowrap; }
html[data-ui] body .mm-period-sheet > h3 { justify-content: flex-start; text-align: start; padding-inline: 0 56px; }
html[data-ui] body .mm-period-sheet .mm-period-opt b, html[data-ui] body .mm-period-sheet .btn, html[data-ui] body .mm-period-sheet .mm-period-switch { font-family: var(--font-body); }
html[data-ui] body .mm-period-sheet:focus, html[data-ui] body .mm-period-sheet:focus-visible { outline: none; box-shadow: none; }
html[data-ui] body .mm-period-sheet .mm-period-available { margin: 0; font-size: var(--fs-label); }
html[data-ui] body .mm-period-sheet .mm-period-custom .btn { min-height: 48px; width: 100%; }
html[data-ui] body .mm-period-sheet .mm-period-fields { grid-template-columns: 1fr; }
@media (min-width: 768px) { html[data-ui] body .mm-period-sheet .mm-period-fields { grid-template-columns: 1fr 1fr; } }
html[data-ui] body .dsel-group .dsel-year { flex: 1.3 1 0; }
html[data-ui] body .dsel-group select { padding-inline: 6px; text-overflow: clip; }

.mm-nowrap { white-space: nowrap; unicode-bidi: isolate; }
html[data-ui] body .field-row:has(> .dsel-row) { display: flex; flex-direction: column; gap: var(--sp-3); }
html[data-ui] body .dsel-row { width: 100%; }
/* حوار التصدير: الرأس وزر الإغلاق ثابتان والجسم يمرَّر داخل حوار مركزي بارتفاع أقصى */
html[data-ui] body .ux-modal-host:has(.rp-export) .modal { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100dvh - 48px); }
html[data-ui] body .ux-modal-host:has(.rp-export) .modal-head { flex: none; }
html[data-ui] body .ux-modal-host:has(.rp-export) .modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }

/* جدول مقارنة الفترات: رؤوس قصيرة ومفتاح التسميات فوق الجدول؛ المبالغ لا تلتفّ؛ تحت 600px لا تمرير أفقي ومعه جدول ثانٍ للعام الماضي */
.ux .mm-compare .mm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-label); color: var(--muted); }
.ux .mm-compare .mm-legend .mm-legend-name { color: var(--ink); font-weight: 600; }
.ux .mm-compare .compact-table { table-layout: auto; width: 100%; }
.ux .mm-compare .compact-table td, .ux .mm-compare .compact-table th.mm-cmp-th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ux .mm-compare .compact-table td .num { white-space: nowrap; unicode-bidi: isolate; }
.ux .mm-compare .compact-table th[scope="row"] { position: static; white-space: normal; min-width: 72px; }
.ux .mm-compare .mm-ly-block { display: none; }
.ux .mm-compare .mm-ly-block h4 { margin: var(--sp-3, 12px) 0 var(--sp-2, 8px); font-size: var(--fs-body); }
@media (max-width: 599px) {
  .ux .mm-compare .table-scroll { overflow-x: visible; }
  .ux .mm-compare .mm-ly-col { display: none; }
  .ux .mm-compare .mm-ly-block { display: block; }
  .ux .mm-compare .compact-table th, .ux .mm-compare .compact-table td { padding-inline: 3px; font-size: 12.5px; }
  .ux .mm-compare .compact-table th.mm-cmp-th { font-size: 12px; }
  .ux .mm-compare .compact-table td.is-num:last-child { white-space: normal; }
  .ux .mm-compare .mm-cmp-th small { font-size: 10.5px; white-space: normal; }
}
