/* ===== المتغيّرات والهوية ===== */
:root {
  --brand: #0f766e; --brand-dark: #0b5a54; --brand-light: #14b8a6;
  --accent: #d97706; --ink: #0f172a;
}
* { font-family: "El Messiri", "Segoe UI", Tahoma, sans-serif; }
body { -webkit-font-smoothing: antialiased; }

.text-brand { color: var(--brand); }
.bg-brand { background-color: var(--brand); }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border-radius: .65rem; font-weight: 600;
  font-size: .875rem; transition: all .15s ease; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none;
}
.btn-sm { padding: .35rem .7rem; font-size: .8rem; border-radius: .55rem; }
/* حلقة تركيز موحّدة للوحة المفاتيح — تظهر عند التنقّل بـTab فقط (:focus-visible)، لا عند النقر بالفأرة.
   كانت المدخلات وحدها تُظهِر التركيز؛ الأزرار/الروابط/التبويبات كانت تبتلعه فيضيع مستخدم الكيبورد. */
.btn:focus-visible, .app-tab:focus-visible, .nav-link:focus-visible, .app-waffle:focus-visible,
.app-tile:focus-visible, .star-btn:focus-visible, .tbl th.tbl-sortable:focus-visible,
a:focus-visible, select:focus-visible, input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: .4rem;
}
/* احترام تفضيل تقليل الحركة (إتاحة) — يُلغي الرسوم والانتقالات لمن يتأثّر بها */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: #334155; border-color: #e2e8f0; }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { color: #be123c; border-color: #fecdd3; background: #fff; }
/* §10.303 — نقصٌ لا خطأ: فاتورةٌ سُدِّدت بلا إثبات. كهرمانٌ لا أحمر. */
.btn-warn { color: #b45309; border-color: #fde68a; background: #fffbeb; }
/* §10.312 — شريطُ «المطلوبُ لنبدأ» يلتصق فوق: النموذجُ طويلٌ والمقياسُ يجب أن يُرى
   وأنت تكتب، لا أن يُصعَد إليه. والخلفيّةُ صلبةٌ وإلّا قُرئ النصُّ فوق النصّ. */
.brief-sticky { position: sticky; top: .5rem; z-index: 20; }
/* *ما يُملأ عنك يُقال لك* — سطرٌ خفيفٌ تحت الحقل المعبّأ من ملفّ العميل. */
.brief-pre { display: flex; align-items: center; gap: .3rem; margin-top: .25rem;
  font-size: 11px; color: #0f766e; }
/* §10.313 — الحقلُ المُجاب يُرى مُجاباً: شريطٌ أخضرُ على حافّته وعلامةٌ بعد عنوانه.
   الحدُّ شفّافٌ في الحالتين فلا يقفز النصُّ حين تُملأ الخانة — *علامةٌ تُزحزح ما حولها
   تُقرأ اضطراباً لا إنجازاً.* */
/* 🔴 §10.318 — كان شريطاً أخضرَ على حافّة الحقل كلِّه: يمتدّ على العنوان والتلميح
   وسطرِ «لماذا نسأل» فيصبح **خطّاً طويلاً يُقرأ فاصلَ أقسامٍ** لا علامةَ إنجاز.
   > **علامةٌ أطولُ من الشيء الذي تصفه تُقرأ حدّاً لا علامة.**
   فصارت **شارةً عند العنوان**: دائرةٌ صغيرةٌ فيها ✓ — تقول «أُجيب» ولا تزاحم شيئاً.
   والمساحةُ محفوظةٌ دائماً بـ`::before` شفّاف، فلا يقفز العنوانُ حين تُملأ الخانة. */
.brief-f > .fld > .fld-label::before {
  content: '✓'; display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; border-radius: 999px; margin-inline-end: .35rem;
  font-size: 10px; font-weight: 700; line-height: 1;
  background: transparent; color: transparent; transition: background .15s ease, color .15s ease;
}
.brief-f.is-done > .fld > .fld-label::before { background: #10b981; color: #fff; }
/* §10.318 — الحقلُ المركَّبُ يأخذ الصفَّ كلَّه في الشبكة ذاتِ العمودين. */
.brf-full { grid-column: 1 / -1; }

/* ===== §10.322 — منطقةُ رفعٍ تُري ما فيها ===== */
.upl { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; text-align: center; min-height: 7rem; padding: .9rem;
  border: 2px dashed #cbd5e1; border-radius: .7rem; background: #f8fafc;
  transition: border-color .15s, background .15s; }
.upl:hover { border-color: var(--brand-light, #8b7cc8); background: #f1f5f9; }
/* *موضعٌ يشبه المُسقَطَ فيه يُسقَط فيه* — والسحبُ فوقه يُقال. */
.upl.is-over { border-color: var(--brand, #533F99); background: #f5f3ff; }
/* والمملوءُ صفٌّ لا صندوقٌ فارغ: معاينةٌ واسمٌ وحجمٌ وأبوابٌ على سطرٍ واحد. */
.upl.is-full { flex-direction: row; align-items: center; text-align: start;
  min-height: 0; border-style: solid; border-color: #d1fae5; background: #f0fdf4;
  /* 🔴 §10.375 — صفٌّ لا يلتفّ يفيض، وفيضُه يُقاس فيُنفِخ عمودَ الشبكة. */
  flex-wrap: wrap; }
/* الاسمُ والحجمُ يقصّان ويلتفّان؛ والأبوابُ مجموعةٌ واحدةٌ تنتقل معاً. */
.upl-meta { flex: 1 1 9rem; min-width: 0; }
/* ===== 🔴🔴 §10.377 — رأسُ أعمدةٍ مكتوبٌ بصنفٍ غيرِ مولَّد ===== */
/* `hidden sm:flex` — و`sm:flex` **ليست في `tailwind.css` المولَّد**. قِيس على شاشته
   الحيّة: `hidden sm:flex` تُعطي `display:none` عند عرضِ ١٤٦٤ بكسلاً. فالرأسُ كان
   **مخفيّاً في كلّ عرض**، في مُدخِل بنود عرض السعر وفي كلّ جدولٍ مركَّب.
   > رأسٌ يُكتَب بصنفٍ مولَّدٍ غيرِ مولَّدٍ لا يظهر أبداً — وحارسٌ يقرأ الشيفرة يراه موجوداً.
   فالقاعدةُ تُكتَب حيث تُحمَّل حتماً (§10.291). */
.rowhead { display: none; align-items: center; gap: .5rem; font-size: 11px; color: #94a3b8; }
/* §10.379 — تناقضُ إجابتين يُعرَض **عند حقله** في النموذج. وصنفٌ مكتوبٌ بيدٍ لا مولَّد
   (§10.377): *قاعدةٌ يعتمد عليها إنذارٌ تُكتَب حيث تُحمَّل حتماً.* */
/* ===== §10.381 — صفُّ مراجعةِ التعبئة: الحقلُ · القيمةُ · الجملةُ التي جاءت منها ===== */
/* وأصنافٌ مكتوبةٌ بيدٍ لا مولَّدة (§10.377): *قاعدةٌ يعتمد عليها تخطيطٌ تُكتَب حيث تُحمَّل حتماً.* */
.fill-row { display: flex; align-items: flex-start; gap: .6rem;
  padding: .6rem .7rem; border: 1px solid #eef1f6; border-radius: .7rem; background: #fff; }
.fill-row:hover { border-color: #ddd6fe; background: #fcfbff; }
.fill-pick { display: flex; align-items: center; padding-top: .15rem; flex-shrink: 0; }
.fill-quote { display: flex; align-items: flex-start; gap: .35rem; margin-top: .1rem;
  font-size: 11px; line-height: 1.8; color: #64748b;
  background: #f8fafc; border-inline-start: 3px solid #cbd5e1;
  border-radius: .35rem; padding: .3rem .45rem; }
.fill-quote > svg { flex-shrink: 0; margin-top: .2rem; color: #94a3b8; }
/* §10.402 — عرضُ الجدول المشتقُّ من صندوقه: يُقرأ سطراً سطراً بدل نصِّ JSON */
.fill-rows-prev { margin-top: .25rem; display: flex; flex-direction: column; gap: .15rem;
  font-size: 11px; line-height: 1.9; color: #334155;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: .4rem; padding: .3rem .5rem; }
.fill-rows-line { display: block; }
.fill-rows-line + .fill-rows-line { border-top: 1px dashed #ddd6fe; }
.ai-note { display: flex; align-items: flex-start; gap: .4rem; font-size: .78rem; line-height: 1.8;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: .5rem; padding: .45rem .55rem; }
.ai-note > svg { flex-shrink: 0; margin-top: .15rem; }

.brief-contra { display: flex; align-items: flex-start; gap: .4rem; margin-top: .4rem;
  padding: .45rem .55rem; border-radius: .5rem; font-size: .78rem; line-height: 1.7;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.brief-contra > svg { flex-shrink: 0; margin-top: .15rem; }
.brief-contra-n { margin-top: .15rem; font-weight: 400; }
@media (min-width: 640px) { .rowhead { display: flex; } }
/* وتلتفّ في نفسها عند أضيقِ عرض — *مجموعةٌ تلتفّ ككلٍّ ولا تلتفّ في نفسها تفيض عند
   آخرِ عرضٍ قبل الجوّال.* */
.upl-acts { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap;
  flex-shrink: 0; margin-inline-start: auto; }
.upl-ico { color: #94a3b8; }
.upl.is-full .upl-ico { color: #059669; }
.upl-t { font-size: .82rem; font-weight: 600; color: #475569; }
.upl-s { font-size: 11px; color: #94a3b8; line-height: 1.6; }
.upl-name { font-size: .82rem; font-weight: 600; color: #1e293b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl-img { width: 3rem; height: 3rem; border-radius: .5rem; object-fit: contain;
  background: #fff; padding: .2rem; border: 1px solid #e2e8f0; flex-shrink: 0; }
/* ===== §10.325 — خريطةٌ تُحدَّد عليها ===== */
.map-where { margin-top: .3rem; font-size: .78rem; line-height: 1.8; }
.map-ok { display: inline-flex; align-items: center; gap: .3rem; color: #047857; font-weight: 600; }
.map-canvas { height: 20rem; border-radius: .7rem; border: 1px solid #e2e8f0;
  background: #f1f5f9; overflow: hidden; display: grid; place-items: center; }
/* ⚠️ عناصرُ Leaflet المطلقةُ تحتاج `z-index` أدنى من غطاء النافذة، وإلّا طفت فوقه. */
.map-canvas .leaflet-pane, .map-canvas .leaflet-control { z-index: 1; }
.map-load { font-size: .8rem; color: #64748b; padding: 1rem; text-align: center; line-height: 1.9; }
.map-coord { font-size: .78rem; color: #475569; line-height: 1.9; }
.map-hits { display: flex; flex-wrap: wrap; gap: .3rem; }
.map-hits .map-hit { max-width: 100%; text-align: start; }

/* ===== §10.324 — حقلٌ بلا حدٍّ يُقرأ مع جاره =====
   رآه صاحبُ المشروع في «أرقام العمل»: «صار النموذج غير مفهوم والحقول بتحسها داخلة
   ببعض». والسببُ أنّ كلَّ سؤالٍ **أربعةُ أسطر** (عنوانٌ · حقلٌ · تلميحٌ · «لماذا نسأل»)
   وبينها وبين جارتها **٠٫٧٥rem** وحدَها: فتلميحُ سؤالٍ يلتصق بعنوان الذي بعده.
   > **حقلٌ بلا حدٍّ يُقرأ مع جاره — والفراغُ وحدَه لا يفصل أربعةَ أسطر.**
   وشبكةٌ بارتفاعاتٍ متفاوتةٍ تُمدِّد القصيرَ إلى طول الطويل، فيبدو الحقلان صفّاً واحداً:
   فـ`align-items: start`. والشبكةُ **مكتوبةٌ هنا** لا بأصناف Tailwind (§10.291). */
.brief-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; align-items: start; }
/* 🔴🔴 §10.375 — `1fr` هي `minmax(auto, 1fr)`، و`auto` أدناها **أضيقُ محتوى**. فخليّةٌ
   واحدةٌ لا تُقسَم (صفُّ ملفٍّ مرفوعٍ بلا التفاف) قِيست ٥٩٨ بكسلاً فأخذت عمودَها كلَّه
   وتركت لأخيه ١٨٥ — **في كلّ صفوف النموذج**، لا في صفّها.
   > عمودٌ يُقاس بأوسعِ ما فيه يُضيّق أخاه في كلّ صفّ.
   و`minmax(0, 1fr)` تقطع الصلةَ: العمودُ حصّةٌ لا مقياسُ محتوى. */
@media (min-width: 640px) { .brief-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem 1rem; } }
.brief-f { padding: .6rem .7rem .5rem; border: 1px solid #eef1f6; border-radius: .75rem;
  background: #fff; transition: border-color .15s, background .15s; }
.brief-f:focus-within { border-color: #cfc6ea; background: #fcfbff; }
.brief-f.is-done { border-color: #d6f2e4; background: #fcfffd; }

/* ===== §10.323 — جدولُ ساعات الأسبوع =====
   🔴 **قاعدةٌ تُكتَب قبل القاعدة العامّة تُغلَب بها.** هذه الكتلةُ في أعلى الورقة و`.inp`
   عند السطر ١٨٦ بـ`width: 100%` — وبتساوي الأولويّة **يفوز الأخير**، فصار كلُّ حقلِ وقتٍ
   يأخذ سطراً كاملاً ورآه صاحبُ المشروع: «من وإلى ليه كل وحدة على سطر».
   > **عرضٌ يُكتَب لصنفٍ خاصٍّ بأولويّةِ العامّ يَعِد بمقاسٍ لا يقع.**
   والعلاجُ صنفان في المُحدِّد (`.hrs-row .hrs-t`) لا ترتيبٌ في الورقة: *ترتيبٌ يُعتمَد
   عليه يُكسَر بأوّل قاعدةٍ تُضاف بعده.* */
.hrs-sum { font-size: .82rem; font-weight: 600; line-height: 1.9; }
.hrs-on { color: #047857; }
.hrs-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .35rem .5rem; border-radius: .5rem; background: #f8fafc; }
.hrs-row .hrs-day { display: flex; align-items: center; gap: .4rem; width: 5.6rem; flex: none;
  font-size: .84rem; font-weight: 600; color: #334155; cursor: pointer; }
.hrs-ck { width: 1rem; height: 1rem; accent-color: var(--brand, #533F99); cursor: pointer; flex: none; }
.hrs-w { font-size: .76rem; color: #94a3b8; flex: none; }
.hrs-row .hrs-t { width: 7.5rem; flex: none; }
.hrs-row .hrs-t:disabled { opacity: .45; }

/* ===== §10.323 — اللونُ يُرى لا يُكتَب كوداً وحدَه ===== */
.clr-rows { display: flex; flex-direction: column; gap: .35rem; }
.clr-row { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.clr-row .clr-sw { width: 2.4rem; height: 2.1rem; padding: 0; border: 1px solid #d1d9e2;
  border-radius: .45rem; background: #fff; cursor: pointer; flex: none; }
/* ⚠️ صنفان في المُحدِّد — وإلّا غلبها `.inp { width: 100% }` فخرج زرُّ الحذف من البطاقة
   (رآه صاحبُ المشروع: «حقل اللون طالع من النموذج»). */
.clr-row .clr-tx { width: 7.5rem; flex: none; font-family: ui-monospace, monospace; text-align: start; }

/* §10.308 — سطرُ العقدِ الأبِ على الملحق المطبوع: يُقرأ ولا يزاحم العنوان. */
.pr-parent { margin-top: .25rem; padding: .35rem .55rem; background: #f8fafc;
  border-right: 3px solid #533F99; border-radius: .25rem; }
.btn-warn:hover { background: #fef3c7; border-color: #fcd34d; }
.btn-danger:hover { background: #fff1f2; }
.btn-brand.btn-danger { background: #e11d48; color: #fff; border-color: transparent; }
.btn-brand.btn-danger:hover { background: #be123c; }
.btn-white { background: #fff; color: var(--brand-dark); }
.btn-white:hover { background: #f1f5f9; }
.btn-glass { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-glass:hover { background: rgba(255,255,255,.28); }

.card { background: #fff; border: 1px solid #e9eef3; border-radius: 1rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.logo-box { display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light)); border-radius: .75rem; }

/* ===== الشريط الجانبي ===== */
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: .7rem;
  color: #475569; font-size: .9rem; font-weight: 500; transition: all .15s; cursor: pointer; text-decoration: none; }
.nav-link:hover { background: #f1f5f9; color: var(--ink); }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-ico { width: 1.15rem; height: 1.15rem; opacity: .8; flex: none; }
.nav-group-title { font-size: .7rem; font-weight: 700; color: #94a3b8; padding: .9rem .8rem .35rem; }

/* ===== الشارات ===== */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge .dot { width: .5rem; height: .5rem; border-radius: 999px; display: inline-block; }

/* ===== النجوم ===== */
.stars { display: inline-flex; gap: 1px; }
.star-on { color: #f59e0b; fill: #f59e0b; }
.star-half { color: #f59e0b; fill: #fde68a; }
.star-off { color: #e2e8f0; fill: #e2e8f0; }

/* ===== الجداول ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: right; font-weight: 600; color: #64748b; font-size: .76rem; padding: .6rem .75rem; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.tbl td { padding: .65rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafcfd; }
.tbl th.tbl-sortable { cursor: pointer; user-select: none; transition: color .12s; }
.tbl th.tbl-sortable:hover { color: var(--brand-dark); }
.tbl-sort-ind { display: inline-block; margin-inline-start: .25rem; font-size: .7rem; opacity: 0; transition: opacity .12s; }
.tbl th.tbl-sortable:hover .tbl-sort-ind { opacity: .5; }
.tbl-sort-ind.is-active { opacity: .9; }
.tbl-pager { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .75rem .5rem 0; }

/* ===== أدوات عامة ===== */
.progress { height: .5rem; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; }
.brand-spinner { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 3px solid #e2e8f0; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== شاشة الإقلاع (بديل «جارٍ تحميل النظام» الرمادي) ===== */
.boot { position: fixed; inset: 0; display: grid; place-items: center; z-index: 200;
  background: radial-gradient(1100px 620px at 50% -8%, color-mix(in srgb, var(--brand) 14%, #ffffff), #f4f8f7 62%); }
.boot-in { text-align: center; animation: bootIn .5s ease both; }
@keyframes bootIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.boot-orb { width: 4.6rem; height: 4.6rem; margin: 0 auto 1.5rem; border-radius: 1.45rem; position: relative;
  background: linear-gradient(140deg, var(--brand-light, #34d399), var(--brand) 45%, var(--brand-dark)); color: #fff;
  display: grid; place-items: center; box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 42%, transparent);
  animation: bootBreathe 2.4s ease-in-out infinite; }
.boot-orb svg { width: 2rem; height: 2rem; }
@keyframes bootBreathe { 0%,100% { transform: scale(1); box-shadow: 0 14px 36px color-mix(in srgb, var(--brand) 34%, transparent); }
  50% { transform: scale(1.055); box-shadow: 0 22px 52px color-mix(in srgb, var(--brand) 52%, transparent); } }
.boot-msg { font-family: 'El Messiri', system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--brand-dark); margin: 0; }
.boot-sub { font-size: .9rem; color: #8a9a95; margin: .35rem 0 0; }
.boot-loader { display: flex; justify-content: center; gap: .45rem; margin-top: 1.25rem; }
.boot-loader span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--brand); animation: bootBounce 1.2s ease-in-out infinite; }
.boot-loader span:nth-child(2) { animation-delay: .16s; }
.boot-loader span:nth-child(3) { animation-delay: .32s; }
@keyframes bootBounce { 0%,100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-.42rem); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .boot-orb, .boot-in, .boot-loader span { animation: none; } .boot-loader span { opacity: .7; } }
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
::-webkit-scrollbar { height: 9px; width: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[hidden] { display: none !important; }

/* ===== حقول النماذج — §10.512: الحقلُ بطاقةٌ واحدة (عنوانٌ + حقلٌ + تلميح) =====
   كان العنوانُ يبعد عن حقله (٤px) بقدر ما يقرب من الحقل الذي قبله، والتلميحُ (٠٫٧rem/#94a3b8)
   يكاد يطابق العنوانَ (٠٫٧٨rem/#475569)، وحدُّ الحقل (#e2e8f0) يختفي على الأبيض — فلا تُعرَف
   لمن السطر. البطاقةُ تجمع الثلاثةَ في حدٍّ واحدٍ يبيضُّ ويتوهّج عند التركيز. المصدرُ واحد:
   `field()` في ui.js تبني `.fld`، وهذه القواعدُ تلبسها — ولا تُكتَب بطاقةٌ في شاشة.
   *عنوانٌ يبعد عن حقله بقدر ما يقرب من جاره لا يُعرَف لمن هو.* */
.fld { display: block; background: #f8fafc; border: 1px solid #eef2f6; border-radius: .75rem; padding: .6rem .75rem .55rem; transition: background .15s, border-color .15s, box-shadow .15s; }
.fld:focus-within { background: #fff; border-color: var(--brand-light); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.fld-label { display: block; font-size: .8rem; font-weight: 700; color: #334155; margin-bottom: .35rem; }
.fld-hint { display: block; font-size: .74rem; color: #64748b; margin-top: .35rem; line-height: 1.6; }
/* داخل البطاقة يكفي توهُّجُها: الحقلُ يلوّن حدَّه ولا يتوهّج ثانيةً */
.fld .inp:focus { box-shadow: none; }
/* حاوٍ له بطاقتُه أو صفُّه المضغوط لا يُبطَّن بطاقةً ثانية: سؤالُ النموذج (.brief-f) وشريطُ المرشّحات */
.brief-f > .fld, .filters-adv .fld { background: none; border: 0; padding: 0; box-shadow: none; }
/* صندوقُ معاينةٍ (يُقرأ ولا يُكتَب فيه) — حدٌّ منقّطٌ كي لا يُظنَّ حقلاً */
.fld-preview { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: .6rem; padding: .5rem .8rem; font-size: .8rem; color: #475569; line-height: 1.7; }
.inp { width: 100%; border: 1px solid #cbd5e1; border-radius: .6rem; padding: .5rem .7rem; font-size: .85rem; background: #fff; color: #1e293b; transition: border .15s, box-shadow .15s; outline: none; }
.inp:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.inp-sm { padding: .4rem .6rem; font-size: .8rem; }
.skill-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: #475569; cursor: pointer; }
.skill-check input { width: 1rem; height: 1rem; accent-color: var(--brand); }

/* ===== شرائح التصنيف ===== */
.catchip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s; }
.catchip:hover { border-color: #cbd5e1; background: #f8fafc; }
.catchip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.catchip-n { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.catchip.active .catchip-n { background: rgba(255,255,255,.25); }

/* ===== شبكة بطاقات الموديلز ===== */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.mc { display: block; overflow: hidden; transition: transform .18s, box-shadow .18s; text-decoration: none; }
.mc:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15,23,42,.12); }
.mc-cover { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #eef2f6; }
.mc-img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mc:hover .mc-img { transform: scale(1.05); }
.mc-overlay { position: absolute; inset-inline: 0; bottom: 0; padding: 2rem .8rem .7rem; color: #fff;
  background: linear-gradient(to top, rgba(2,6,23,.85), rgba(2,6,23,.15) 60%, transparent); }
.mc-name { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.mc-sub { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; flex-wrap: wrap; }
.mc-city { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; color: rgba(255,255,255,.85); }
.mc-badges { position: absolute; top: .6rem; inset-inline-start: .6rem; display: flex; align-items: center; gap: .35rem; }
.mc-star { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: rgba(255,255,255,.9); color: #f59e0b; }
.mc-hidden { position: absolute; top: .6rem; inset-inline-end: .6rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: rgba(2,6,23,.55); color: #fff; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; }
.mc-rate { font-weight: 700; color: var(--brand-dark); font-size: .9rem; }
.avatar-fallback { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 700; font-size: 2rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light)); }

/* ===== ملف الموديل ===== */
.md-hero { position: relative; overflow: hidden; }
.md-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(26px) saturate(1.2); opacity: .28; transform: scale(1.15); }
.md-hero-inner { position: relative; display: flex; align-items: center; gap: 1.2rem; padding: 1.4rem; flex-wrap: wrap; }
.md-avatar { width: 108px; height: 108px; border-radius: 1.2rem; overflow: hidden; flex: none; box-shadow: 0 6px 20px rgba(15,23,42,.18); border: 3px solid #fff; background: #eef2f6; }
.md-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.md-hero-main { flex: 1; min-width: 220px; }
.md-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* زرّ الرجوع داخل الهيدر — زاويةٌ علويّة (يسار في RTL) بدل صفٍّ منفصلٍ يأكل حيّزاً */
.md-hero-back { position: absolute; top: .6rem; inset-inline-end: 1rem; z-index: 3; }
.md-hero-inner { padding-top: 1.7rem; }
@media (max-width: 640px) { .md-hero-back { position: static; padding: .8rem 1rem 0; } .md-hero-inner { padding-top: 1.4rem; } }

.tabbar { display: flex; gap: .3rem; border-bottom: 1px solid #eef2f6; margin-bottom: 1rem; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .9rem; font-size: .85rem; font-weight: 600; color: #64748b; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* تبويباتٌ بمربّعاتٍ ملوّنة (tileTabs) — بلا تمرير أفقيّ، شبكةٌ متجاوبة */
.tile-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .4rem; margin-bottom: 1rem; }
.tile-tab { --tile: #6366f1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  padding: .55rem .3rem; border-radius: .7rem; border: 1.5px solid transparent; cursor: pointer; text-align: center;
  background: color-mix(in srgb, var(--tile) 9%, #fff); transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.tile-tab:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(2,6,23,.07); }
.tile-tab-ico { width: 1.7rem; height: 1.7rem; border-radius: .55rem; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tile) 16%, #fff); color: var(--tile); transition: background .15s, color .15s; }
.tile-tab-ico svg { width: 1.05rem; height: 1.05rem; }
.tile-tab-title { font-size: .74rem; font-weight: 600; color: #334155; line-height: 1.12; }
.tile-tab-n { font-size: .74rem; font-weight: 800; color: var(--tile); line-height: 1; }
.tile-tab.active { border-color: var(--tile); background: color-mix(in srgb, var(--tile) 15%, #fff);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--tile) 22%, transparent); }
.tile-tab.active .tile-tab-ico { background: var(--tile); color: #fff; }
.tile-tab:focus-visible { outline: 2px solid var(--tile); outline-offset: 2px; }
@media (max-width: 640px) { .tile-tabs { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem; }
  .tile-tab { padding: .6rem .3rem; } .tile-tab-title { font-size: .72rem; } }
/* §10.127 — تبويباتٌ مضغوطةٌ داخل النوافذ: صفٌّ أفقيٌّ صغير لا بلاطاتٌ كبيرة */
.tile-tabs-sm { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.tile-tabs-sm .tile-tab { flex-direction: row; gap: .4rem; padding: .35rem .7rem; border-radius: .6rem; }
.tile-tabs-sm .tile-tab-ico { width: 1.4rem; height: 1.4rem; border-radius: .45rem; }
.tile-tabs-sm .tile-tab-ico svg { width: .9rem; height: .9rem; }
.tile-tabs-sm .tile-tab-title { font-size: .78rem; }
.tile-tabs-sm .tile-tab-n { font-size: .7rem; }

.sec-title { font-size: .78rem; font-weight: 700; color: #94a3b8; margin-bottom: .5rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.info-cell { background: #f8fafc; border: 1px solid #eef2f6; border-radius: .6rem; padding: .5rem .7rem; }
.info-k { display: block; font-size: .7rem; color: #94a3b8; }
.info-v { display: block; font-size: .9rem; font-weight: 600; color: #1e293b; }

/* ===== المعرض ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.g-thumb { position: relative; aspect-ratio: 3/4; border-radius: .7rem; overflow: hidden; cursor: pointer; border: 0; padding: 0; background: #eef2f6; }
.g-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.g-thumb:hover .g-thumb-img { transform: scale(1.06); }
.g-zoom { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; background: rgba(2,6,23,.35); transition: opacity .2s; }
.g-thumb:hover .g-zoom { opacity: 1; }
.g-play { position: absolute; inset: 0; margin: auto; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--brand-dark); }
.g-vtitle { position: absolute; inset-inline: 0; bottom: 0; padding: 1rem .6rem .5rem; color: #fff; font-size: .78rem; font-weight: 600; background: linear-gradient(to top, rgba(2,6,23,.8), transparent); text-align: start; }

/* ===== نافذة الحجز ===== */
.book-total { font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); }

/* ===== النافذة المنبثقة (Modal) ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); opacity: 0; transition: opacity .15s; overflow-y: auto; }
.modal-backdrop.open { opacity: 1; }
.modal-backdrop.closing { opacity: 0; }
.modal-box { width: 100%; max-width: 480px; background: #fff; border-radius: 1rem; box-shadow: 0 20px 50px rgba(15,23,42,.25);
  transform: translateY(-8px); transition: transform .15s; margin: auto; }
.modal-backdrop.open .modal-box { transform: none; }
.modal-wide { max-width: 720px; }
/* §10.365 — نافذةُ الموعد: أربعةُ حقولٍ في صفٍّ وحضورٌ ومرفقات. */
/* §10.543د — المقاسُ `xl` لجدولٍ بأعمدةٍ خمسة: ٩٠٠ بكسلٍ تترك هامشاً فارغاً يميناً وشمالاً
   ويقصّ الجدولُ عمودَه الأخيرَ في الوقت نفسِه (بلاغُه بصورة). *نافذةٌ تترك فراغاً حولها وتقصّ
   داخلَها تُضيّق على صاحبها بلا سبب.* فيتّسع بحدٍّ نسبيٍّ يترك هامشاً صغيراً ولا يزيد. */
.modal-xl { max-width: min(1200px, 94vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid #eef2f6; }
.modal-x { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .5rem; color: #64748b; border: 0; background: none; cursor: pointer; }
.modal-x:hover { background: #f1f5f9; color: #0f172a; }
.modal-body { padding: 1.2rem; max-height: 68vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.2rem; border-top: 1px solid #eef2f6; }

/* ===== عارض الوسائط (Lightbox) ===== */
.lb-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(2,6,23,.92); padding: 3vh; }
.lb-stage { max-width: 90vw; max-height: 82vh; display: grid; place-items: center; }
.lb-media { max-width: 90vw; max-height: 82vh; border-radius: .6rem; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-close { position: absolute; top: 1.2rem; inset-inline-end: 1.2rem; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer; }
.lb-close:hover { background: rgba(255,255,255,.25); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-prev { inset-inline-end: 1rem; } .lb-next { inset-inline-start: 1rem; }
.lb-caption { position: absolute; bottom: 1.2rem; inset-inline: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .85rem; }

/* ===== إشعار (Toast) ===== */
/* حاوية التنبيهات — أسفل الوسط، تتكدّس عموديّاً (الأحدث بالأسفل) */
.toast-wrap { position: fixed; bottom: 1.75rem; inset-inline: 0; z-index: 95; display: flex; flex-direction: column;
  align-items: center; gap: .6rem; pointer-events: none; padding: 0 1rem; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .9rem; min-width: 340px; max-width: min(94vw, 500px);
  background: #fff; color: #0f172a; border: 1px solid #e6ebf1; border-inline-start-width: 5px; border-radius: 1rem;
  padding: 1rem 1.15rem; font-weight: 650; font-size: .98rem; box-shadow: 0 20px 50px rgba(15,23,42,.24), 0 4px 12px rgba(15,23,42,.08);
  opacity: 0; transform: translateY(1.5rem) scale(.93); transition: opacity .26s ease, transform .32s cubic-bezier(.18,.9,.24,1.14); }
.toast.show { opacity: 1; transform: none; }
.toast-ico { width: 2.4rem; height: 2.4rem; border-radius: 999px; display: grid; place-items: center; flex: none; color: #fff; }
.toast-msg { flex: 1; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s ease; transform: none; } }
.toast-x { flex: none; background: none; border: 0; color: #94a3b8; cursor: pointer; padding: .2rem; border-radius: .4rem; display: grid; place-items: center; }
.toast-x:hover { background: #f1f5f9; color: #475569; }
/* ألوان حسب النوع: شريطٌ جانبيّ + دائرة الأيقونة */
.toast-green { border-inline-start-color: #16a34a; } .toast-green .toast-ico { background: #16a34a; }
.toast-red   { border-inline-start-color: #dc2626; } .toast-red .toast-ico { background: #dc2626; }
.toast-amber { border-inline-start-color: #f59e0b; } .toast-amber .toast-ico { background: #f59e0b; }
.toast-rose  { border-inline-start-color: #e11d48; } .toast-rose .toast-ico { background: #e11d48; }
.toast-blue  { border-inline-start-color: #2563eb; } .toast-blue .toast-ico { background: #2563eb; }
.toast-indigo{ border-inline-start-color: #4f46e5; } .toast-indigo .toast-ico { background: #4f46e5; }
.toast-teal  { border-inline-start-color: #0d9488; } .toast-teal .toast-ico { background: #0d9488; }
.toast-slate { border-inline-start-color: #64748b; } .toast-slate .toast-ico { background: #64748b; }

/* ===== الرئيسية ===== */
/* §10.169 — خلفيّةُ الترويسة يضبطها صاحبُ العلامة (الإعدادات ← الشركة والهوية).
   الاحتياطيُّ هو السلوكُ القديم نفسُه: تدرّجٌ ثلاثيّ. */
.dash-hero { position: relative; overflow: hidden; border: 0;
  background: var(--hero-bg, linear-gradient(120deg, var(--brand-dark), var(--brand) 55%, var(--brand-light))); }
.dash-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% -10%, rgba(255,255,255,.25), transparent 40%); }
/* شرائح «لمحة يومك» — عدّاد + وصف، قابلة للنقر (زجاجيّة على تدرّج الـhero) */
.dash-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .8rem; border-radius: .7rem; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: .82rem; font-weight: 600; text-decoration: none; transition: background .15s, transform .15s; }
.dash-chip:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.dash-chip-n { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: .5rem; background: rgba(255,255,255,.25); font-weight: 800; font-size: .8rem; }
.dash-chip-amber .dash-chip-n { background: #f59e0b; color: #422006; }
.dash-chip-red .dash-chip-n { background: #f43f5e; color: #fff; }
.dash-chip-blue .dash-chip-n { background: #fff; color: var(--brand-dark); }
.dash-feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; }
.dash-feat-card { display: block; border: 1px solid #eef2f6; border-radius: .8rem; overflow: hidden; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.dash-feat-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.1); transform: translateY(-2px); }
.dash-feat-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eef2f6; }
.dash-feat-info { padding: .5rem .6rem; }

/* ===== عرض العميل (Showcase) ===== */
.showcase-head { padding: 1.4rem; background: linear-gradient(120deg, #ffffff, #f0fdfa); }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
.sc-card { background: #fff; border: 2px solid #eef2f6; border-radius: 1rem; overflow: hidden; cursor: pointer; transition: all .18s; }
.sc-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,23,42,.13); }
.sc-card.picked { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.sc-cover { position: relative; aspect-ratio: 4/5; overflow: hidden; background: #eef2f6; }
.sc-img { width: 100%; height: 100%; object-fit: cover; }
.sc-overlay { position: absolute; inset-inline: 0; bottom: 0; padding: 1.8rem .8rem .7rem; color: #fff; background: linear-gradient(to top, rgba(2,6,23,.85), transparent); }
.sc-name { font-weight: 700; font-size: 1.05rem; }
.sc-meta { font-size: .78rem; color: rgba(255,255,255,.85); }
.sc-pick { position: absolute; top: .7rem; inset-inline-end: .7rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.9); color: #94a3b8; border: 0; cursor: pointer; transition: all .15s; }
.sc-pick:hover { color: #e11d48; }
.sc-pick.on { background: #e11d48; color: #fff; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; }
.sc-rate { font-weight: 700; color: var(--brand-dark); font-size: .82rem; }
.sc-rate-quote { font-weight: 600; color: #64748b; font-size: .78rem; }
.shortlist-bar { position: fixed; bottom: 1rem; inset-inline: 1rem; z-index: 40; max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; padding: .7rem 1rem; box-shadow: 0 14px 40px rgba(15,23,42,.18); }
.sl-thumb { width: 2.4rem; height: 2.4rem; border-radius: .6rem; overflow: hidden; flex: none; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.15); background: #eef2f6; }
.sl-thumb-img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 🔐 شاشة الدخول — تصميم مقسوم (صورة + فورم) ===== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-hero { position: relative; background: url('../images/loginBackground.jpg') center/cover no-repeat; display: grid; place-items: center; overflow: hidden; }
.login-hero-overlay { position: absolute; inset: 0; background: linear-gradient(140deg, rgba(4,120,87,.90) 0%, rgba(6,78,59,.82) 45%, rgba(15,23,42,.86) 100%); }
.login-hero-content { position: relative; z-index: 1; text-align: center; color: #fff; padding: 2.5rem; max-width: 480px; }
.login-hero-logo { height: 56px; width: auto; margin: 0 auto 2rem; display: block; filter: brightness(0) invert(1); opacity: .96; }
.login-hero-title { font-size: 2.15rem; font-weight: 800; margin-bottom: .9rem; letter-spacing: -.01em; }
.login-hero-tagline { font-size: 1.02rem; line-height: 2; color: rgba(255,255,255,.86); }

.login-form-side { display: grid; place-items: center; padding: 2rem 1.5rem; background: #f8fafc; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid #eef2f7; border-radius: 1.5rem; padding: 2.75rem 2.25rem; box-shadow: 0 20px 55px rgba(15,23,42,.09); }
.login-card-logo { height: 46px; width: auto; margin: 0 auto 1.5rem; display: block; }
.login-card-title { text-align: center; font-size: 1.4rem; font-weight: 800; color: #0f172a; }
.login-card-sub { text-align: center; color: #94a3b8; font-size: .85rem; margin-top: .3rem; margin-bottom: 1.75rem; }
.login-fields { display: flex; flex-direction: column; gap: 1rem; }
.login-card .btn { justify-content: center; }   /* الزرّ العريض: المحتوى في الوسط لا عند الحافة */
.login-note { font-size: 11px; color: #94a3b8; line-height: 1.9; border-top: 1px solid #f1f5f9; padding-top: 1rem; margin-top: 1.5rem; text-align: center; }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-form-side { background: #fff; padding: 1.5rem 1rem; }
  .login-card { box-shadow: none; border: none; padding: 1.5rem 1rem; }
}

/* ===== ⊞ مُشغّل التطبيقات (Office 365 style) — بديل الشريط الجانبيّ ===== */
.app-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }

/* صفّ 1 — عالميّ */
.appbar-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem 1.25rem; }
.app-waffle { width: 2.25rem; height: 2.25rem; border-radius: .6rem; display: grid; place-items: center; color: #475569; background: none; border: 0; cursor: pointer; transition: background .15s; }
.app-waffle:hover { background: #f1f5f9; color: var(--brand-dark); }

/* صفّ 2 — تبويبات التطبيق النشط */
.app-tabs { display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; border-top: 1px solid #f1f5f9; overflow-x: auto; scrollbar-width: none; }
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs-name { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .82rem; color: var(--app-color, #334155); padding: .55rem .2rem; flex: none; }
.app-tabs-list { display: flex; align-items: center; gap: .15rem; }
.app-tab { display: flex; align-items: center; gap: .4rem; padding: .55rem .7rem; border-bottom: 2px solid transparent; color: #64748b; font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s; }
.app-tab:hover { color: var(--ink); }
.app-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.app-tab svg { width: 1rem; height: 1rem; opacity: .85; flex: none; }

/* شبكة الوافل */
.app-launcher { position: absolute; top: calc(100% + .35rem); inset-inline-start: 1rem; z-index: 40; width: 420px; max-width: 92vw; background: #fff; border: 1px solid #e9eef3; border-radius: 1rem; box-shadow: 0 18px 44px rgba(15,23,42,.18); padding: 1rem; }
.app-launcher[hidden] { display: none; }
.app-launcher-head { font-size: .7rem; font-weight: 700; color: #94a3b8; padding: 0 .3rem .6rem; }
.app-launcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.app-launcher-grid[hidden] { display: none; }

/* ===== §10.339 — بحثُ الوجهات في لوحة التطبيقات =====
   🔴 والعرضُ **بمُحدِّدٍ من صنفين** (`.app-launcher .app-launcher-q`): `.inp` تفرض
   `width:100%` عند السطر ١٨٦، *وترتيبٌ يُعتمَد عليه يُكسَر بأوّل قاعدةٍ تُضاف بعده* (§10.324). */
.app-launcher .app-launcher-q { width: 100%; margin-bottom: .7rem; }
.app-launcher-res { display: flex; flex-direction: column; gap: .15rem; max-height: 22rem; overflow-y: auto; }
.app-launcher-res[hidden] { display: none; }
.app-launcher-row { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .55rem; border: 0; border-radius: .6rem; background: transparent; cursor: pointer; text-align: start; }
.app-launcher-row:hover, .app-launcher-row:focus-visible { background: #f1f5f9; }
.app-launcher-row-ic { flex: none; color: #64748b; display: grid; place-items: center; }
/* *نصٌّ بلا حدٍّ أدنى يدفع شارتَه خارجَ الصفّ* — والفائضُ يُقصَّر بنقاط. */
.app-launcher-row-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.app-launcher-row-t { font-size: .82rem; font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-launcher-row-p { font-size: .68rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-launcher-row-k { flex: none; font-size: .62rem; color: #64748b; background: #f1f5f9; border-radius: .4rem; padding: .1rem .4rem; }
.app-launcher-empty { font-size: .78rem; color: #64748b; line-height: 1.9; padding: .4rem .3rem; }
.app-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem .5rem; border: 1px solid #eef2f7; border-radius: .85rem; background: #fff; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; text-align: center; }
.app-tile:hover { transform: translateY(-2px); border-color: var(--app-color); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.app-tile-ico { width: 2.75rem; height: 2.75rem; border-radius: .75rem; display: grid; place-items: center; color: #fff; background: var(--app-color, #64748b); }
.app-tile-name { font-size: .78rem; font-weight: 600; color: #334155; line-height: 1.3; }
/* §10.455 — البلاطةُ النشطة: بالصيغة نفسِها لبطاقات الثيمات (§10.454) كي يتّحد شكلُ «المختار». */
.app-tile.is-active { border-color: var(--app-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-color) 18%, transparent); background: color-mix(in srgb, var(--app-color) 6%, #fff); }
.app-tile.is-active .app-tile-name { color: var(--app-color); }
.app-tile-ico { position: relative; }
.app-tile-check { position: absolute; top: -.35rem; left: -.35rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; color: var(--app-color); border: 1.5px solid var(--app-color); display: grid; place-items: center; }

@media (max-width: 768px) {
  .appbar-top { padding: .5rem .9rem; }
  .app-tabs { padding: 0 .9rem; }
  .app-launcher { inset-inline-start: .5rem; }
  .app-launcher-grid { grid-template-columns: repeat(2, 1fr); }
  .md-actions { width: 100%; }
}

/* ===== محادثات بأسلوب Gmail — جزءان متجاوران ===== */
.gm-split { display: grid; grid-template-columns: 320px 1fr; border: 1px solid #eef2f6; border-radius: .8rem; overflow: hidden; min-height: 440px; }
.gm-pane-list { border-inline-end: 1px solid #eef2f6; overflow-y: auto; max-height: 68vh; background: #fff; }   /* RTL: الحدّ على حافة البدء (يسار القائمة) */
.gm-list-head { display: flex; flex-direction: column; gap: .55rem; padding: .6rem; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; background: #fff; z-index: 1; }
.gm-pane-read { overflow-y: auto; max-height: 68vh; padding: 1rem; display: flex; flex-direction: column; }
.gm-empty { align-items: center; justify-content: center; text-align: center; }

.gm-row { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: start;
  padding: .65rem .8rem; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; cursor: pointer; transition: background .12s; }
.gm-row:last-child { border-bottom: 0; }
.gm-row:hover { background: #f8fafc; }
.gm-row.gm-sel { background: #eef2ff; }
.gm-row-dot { width: .5rem; flex: none; display: grid; place-items: center; }
.gm-dot { width: .5rem; height: .5rem; border-radius: 999px; background: var(--brand); display: inline-block; }
.gm-row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.gm-row-subj { font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.gm-row.gm-unread .gm-row-subj { font-weight: 800; color: #0f172a; }
.gm-row-snip { color: #94a3b8; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-row.gm-unread .gm-row-snip { font-weight: 700; color: #475569; }   /* غير المقروء: النصّ أوضح (Bold) */
.gm-row.gm-needs { border-inline-start: 3px solid #f59e0b; }           /* بحاجة لردّ: شريطٌ برتقاليّ */
.gm-needs-tag { display: inline-flex; align-items: center; gap: .15rem; font-size: .6rem; font-weight: 700;
  color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 999px; padding: .05rem .35rem; white-space: nowrap; }
.gm-search { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.gm-filters { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .5rem; }
.gm-chip { font-size: .7rem; font-weight: 600; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: .2rem .6rem; cursor: pointer; }
.gm-chip.on { background: var(--brand); color: #fff; border-color: transparent; }
.gm-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.gm-row-date { color: #94a3b8; font-size: .68rem; white-space: nowrap; }

.gm-thread-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; padding-bottom: .6rem; border-bottom: 1px solid #f1f5f9; }
.gm-thread-head h3 { min-width: 0; }
.gm-back { display: none; }              /* زرّ الرجوع للجوال فقط */
.gm-msgs { display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.gm-msg { border: 1px solid #eef2f6; border-radius: .7rem; padding: .7rem .9rem; background: #fff; }
.gm-msg-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.gm-msg-from { font-weight: 700; font-size: .82rem; color: #475569; }
.gm-msg-from.gm-me { color: var(--brand-dark); }
.gm-msg-date { font-size: .7rem; color: #94a3b8; }
.gm-msg-body { font-size: .9rem; color: #334155; line-height: 1.8; white-space: pre-line; }
.gm-reply { display: flex; align-items: flex-end; gap: .6rem; margin-top: .8rem; border-top: 1px solid #f1f5f9; padding-top: .8rem; }

/* الجوال: عرضٌ واحد — القائمة، ثم المحادثة كاملةً مع زرّ رجوع (متل Gmail موبايل) */
@media (max-width: 768px) {
  .gm-split { grid-template-columns: 1fr; min-height: 0; }
  .gm-pane-list { max-height: none; border-inline-end: 0; }
  .gm-pane-read { display: none; max-height: none; }
  .gm-split.gm-open .gm-pane-list { display: none; }
  .gm-split.gm-open .gm-pane-read { display: flex; }
  .gm-back { display: inline-flex; }
}

/* ===== صندوق الطلبات + جرس التنبيه ===== */
.req-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
  padding: .7rem .8rem; border: 1px solid #fde68a; background: #fffbeb; border-radius: .7rem; }
.req-item.req-done { border-color: #e2e8f0; background: #f8fafc; }
.bell-badge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem;
  display: grid; place-items: center; border-radius: 999px; background: #e11d48; color: #fff; font-size: .65rem; font-weight: 700; }

/* ===== منتقي التقييم بالنجوم ===== */
.star-btn { border: 0; background: none; cursor: pointer; padding: 0; color: #e2e8f0; }
.star-btn svg { fill: #e2e8f0; stroke: #e2e8f0; }
.star-btn.on { color: #f59e0b; }
.star-btn.on svg { fill: #f59e0b; stroke: #f59e0b; }

/* ===== البحث الشامل ===== */
.search-results { position: absolute; top: calc(100% + .4rem); left: 0; right: 0; z-index: 30; background: #fff;
  border: 1px solid #e9eef3; border-radius: .7rem; box-shadow: 0 8px 24px rgba(15,23,42,.12); overflow: hidden; max-height: 60vh; overflow-y: auto; }

/* ===== شعار العميل ===== */
.client-logo { width: 56px; height: 56px; border-radius: .8rem; overflow: hidden; flex: none; background: #eef2f6; border: 1px solid #e2e8f0; }
.client-logo-sm { width: 2rem; height: 2rem; border-radius: .5rem; overflow: hidden; flex: none; background: #eef2f6; border: 1px solid #e2e8f0; }
.client-logo-img { width: 100%; height: 100%; object-fit: cover; }

/* ===== مسار المبيعات (Pipeline) ===== */
/* §10.219 — **لوحةٌ تُمرَّر أفقيّاً تُخفي أعمدتَها.** كانت `grid-auto-flow: column` مع
   `overflow-x: auto`: صفٌّ واحدٌ أبداً بشريطِ تمريرٍ دائم، وتختفي «خسارة» و«تحوّل لعميل»
   خارج الإطار. *عمودٌ لا يُرى لا يُقرأ — والقمعُ كلُّه معنىً في المقارنة بين أعمدته.*

   🔴 والمحاولةُ الأولى `repeat(auto-fit, minmax(min(220px, 100%), 1fr))` **قسمَتها صفّين**:
   النسبةُ المئويّةُ داخل `min()` في تحجيم المسارات مقاسٌ غير محدَّد، فيسقط الحدُّ الأدنى إلى
   عرض المحتوى (نحو 400px) ⇒ أربعةُ أعمدةٍ لا خمسة. *حدٌّ يعتمد على قياسٍ غير محدَّد يُحسَب
   بغير ما كُتب.*

   الآن: **عددُ الأعمدة يأتي من عدد المراحل نفسِها** (`--pipe-cols` تضبطها الشاشة) —
   فصفٌّ واحدٌ دائماً بلا تمرير، ولا تخمينَ في العرض. و`minmax(0, 1fr)` تسمح للعمود
   بالانكماش تحت عرض محتواه (وإلّا فاضت الشبكةُ من جديد).
   وتحت 900px تلتفّ: خمسةُ أعمدةٍ بعرض 60px ليست عرضاً بل إخفاءٌ من نوعٍ آخر. */
.pipe-grid { display: grid; grid-template-columns: repeat(var(--pipe-cols, 5), minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 900px) { .pipe-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } }
.pipe-col { background: #f6f8fb; border: 1px solid #eef2f6; border-radius: .8rem; padding: .6rem; min-width: 0; }
.pipe-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
/* §10.219 — البطاقةُ تحجز محتواها: `min-width: 0` تمنع فيضانَ صفوفِ `flex` داخلَها،
   و`overflow: hidden` حارسٌ أخيرٌ لئلّا يخرج شيءٌ من الإطار فيُقصّ بلا أن يُلاحَظ.
   *زرٌّ خارج إطاره زرٌّ غير موجود.* */
.pipe-card { background: #fff; border: 1px solid #e9eef3; border-radius: .7rem; padding: .6rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); min-width: 0; overflow: hidden; }
.pipe-card .btn { max-width: 100%; }

/* ===== التقويم ===== */
/* §10.151 — الخطُّ الزمنيّ لبنود المشروع (تصميم ③): لا عمودَ يُكسَر — بطاقةُ البند نفسُها
   بحدٍّ جانبيٍّ (جهة القراءة) ملوّنٍ بالحالة + **شارةُ تاريخٍ** أعلاها ملوّنةٌ بالحالة. */
.acc { border-inline-start-width: 4px; border-inline-start-style: solid; }
.acc-brand { border-inline-start-color: var(--brand); }
.acc-red { border-inline-start-color: #dc2626; }
.acc-green { border-inline-start-color: #16a34a; }
.acc-amber { border-inline-start-color: #d97706; }
.dchip { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 800; border-radius: 7px; padding: .16rem .5rem; margin-bottom: .55rem; }
.dchip.t-brand { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.dchip.t-red { color: #dc2626; background: #fee2e2; }
.dchip.t-green { color: #16a34a; background: #dcfce7; }
.dchip.t-amber { color: #d97706; background: #fef3c7; }
/* §10.532 — لا نسخةَ داكنةً لشارة التاريخ: النظامُ فاتحٌ كلُّه، وقاعدةُ `prefers-color-scheme` كانت تُلوِّن «مُسلَّم» بأخضرَ باهتٍ على أبيضَ عند مَن نظامُه داكن (بلاغُه). */

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; font-size: .72rem; font-weight: 700; color: #94a3b8; padding: .3rem 0; }
.cal-cell { min-height: 90px; border: 1px solid #eef2f6; border-radius: .6rem; padding: .35rem; background: #fff; overflow: hidden; }
/* §10.539ج — يومٌ خارجَ فترةِ المشروع، وطرفا الفترة نفسُهما. */
.cal-cell.is-off { background: #fafafa; border-color: #f1f5f9; }
.cal-cell.is-off .cal-day { color: #b9b4cc; }
.cal-cell.is-edge { border-color: #c9bff0; box-shadow: inset 0 0 0 1px #ede9fb; }
.cal-empty { background: #fafcfd; border-style: dashed; }
.cal-unavail { background: repeating-linear-gradient(45deg, #fff5f5, #fff5f5 7px, #ffe9e9 7px, #ffe9e9 14px); border-color: #fecdd3; }
.cal-day { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; font-weight: 700; color: #475569; margin-bottom: .25rem; }
.cal-un { font-size: .6rem; font-weight: 700; color: #be123c; }
.cal-ev { display: flex; align-items: center; gap: .2rem; width: 100%; text-align: start; border: 0; cursor: pointer; border-radius: .35rem; padding: .12rem .35rem; margin-bottom: 3px; font-size: .68rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ===== §10.472 (الخطّة ٤) — الشهرُ بعدّادٍ ولوحةِ يوم · الأسبوعُ بساعاتٍ · اليومُ قائمةً ===== */
.cal-month { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .cal-month { grid-template-columns: minmax(0, 1fr); } }
.cal-cell-btn { display: block; width: 100%; text-align: start; cursor: pointer; font: inherit; }
.cal-cell-btn:hover { border-color: var(--brand); }
.cal-today { box-shadow: inset 0 0 0 2px #99f6e4; }
.cal-sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(13, 148, 136, .18); }
.cal-mini { display: block; font-size: .6rem; border-radius: .3rem; padding: .05rem .25rem; margin-top: .12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-counts { display: flex; gap: .2rem; flex-wrap: wrap; margin-top: .2rem; }
.cal-cnt { font-size: .6rem; font-weight: 700; border-radius: .25rem; padding: 0 .28rem; }
.cal-side { border: 1px solid #eef2f6; border-radius: .7rem; padding: .7rem; background: #fff; position: sticky; top: .5rem; max-height: 70vh; overflow: auto; }
.cal-ev-lg { padding: .3rem .4rem; font-size: .72rem; }
.cal-ev-sub { display: block; opacity: .75; font-size: .62rem; }
.cal-day-grp { border-inline-start: 3px solid #e2e8f0; padding-inline-start: .6rem; }
/* مُرشِّحاتُ الشريط الواحد: `.inp` عرضُها كامل — فتنزل كلُّ قائمةٍ سطراً وحدَها ويطول الرأسُ أربعةَ أسطر. */
.cal-f { width: auto; min-width: 8.5rem; max-width: 12rem; }
.cal-f .date-box, .cal-f .inp { width: auto; min-width: 7.5rem; }
/* ===== §10.475 (الخطّة ٥) — شريطُ اليوم ومجموعاتُ التنبيهات ===== */
.today-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.today-card { display: flex; flex-direction: column; gap: .05rem; background: #fff; border: 1px solid #eef2f6;
  border-radius: .75rem; padding: .7rem .9rem; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.today-card:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(15, 23, 42, .06); }
.today-hot { border-color: #fde68a; background: #fffdf5; }
.today-n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: #cbd5e1; }
.today-l { font-size: .78rem; font-weight: 600; color: #475569; }
.today-s { font-size: .66rem; color: #94a3b8; }
.alert-grp { border-top: 1px solid #f1f5f9; padding-top: .35rem; }
.alert-grp:first-child { border-top: 0; padding-top: 0; }
.alert-sum { display: flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none; padding: .15rem 0; font-size: .82rem; color: #334155; }
.alert-sum::-webkit-details-marker { display: none; }
.alert-dot { width: .5rem; height: .5rem; border-radius: 999px; display: inline-block; }
/* §10.473 — إحصاءُ ما يُعرَض الآن: رقمٌ لكلّ نوعٍ بلونه، يُضغَط فيُصبح مُرشِّحاً. */
.cal-stats { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.cal-stat { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 600;
  border: 1px solid transparent; border-radius: .45rem; padding: .12rem .4rem; cursor: pointer; }
.cal-stat b { font-size: .78rem; }
.cal-stat-on { border-color: currentColor; }
.cal-stat-all { background: #f8fafc; color: #475569; cursor: default; }
.cal-wk { overflow-x: auto; }
.cal-wk-row { display: grid; grid-template-columns: 58px repeat(7, minmax(78px, 1fr)); gap: 3px; }
.cal-wk-head { position: sticky; top: 0; background: #fff; z-index: 1; }
.cal-wk-h { text-align: center; font-size: .72rem; padding: .25rem 0; border-radius: .4rem; }
.cal-wk-t { font-size: .65rem; color: #94a3b8; text-align: center; padding-top: .3rem; }
.cal-wk-c { min-height: 34px; border-top: 1px solid #f1f5f9; padding: .1rem; display: flex; flex-direction: column; gap: .12rem; }
.cal-key { width: .85rem; height: .85rem; border-radius: .25rem; display: inline-block; }
.cal-key-un { background: repeating-linear-gradient(45deg, #fff5f5, #fff5f5 3px, #ffe9e9 3px, #ffe9e9 6px); border: 1px solid #fecdd3; }
@media (max-width: 640px) { .cal-cell { min-height: 64px; } .cal-ev { font-size: .6rem; } }

/* ===== سجلّ النشاط ===== */
.log-list { display: flex; flex-direction: column; }
.log-item { display: flex; gap: .75rem; padding: .7rem .2rem; border-bottom: 1px solid #f1f5f9; }
.log-item:last-child { border-bottom: 0; }
.log-ico { width: 2rem; height: 2rem; border-radius: .6rem; display: grid; place-items: center; flex: none; }
.log-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; font-size: .72rem; color: #94a3b8; }
.log-dot-sep { color: #cbd5e1; }

/* ===== أقسام النماذج ===== */
.form-section { padding-top: 1rem; margin-top: .75rem; border-top: 1px solid #eef2f6; }
.form-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.form-section-title { display: flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 700; color: var(--brand-dark); margin-bottom: .8rem; }
.form-section-title svg { color: var(--brand); }

/* ===== محرّرات الوسائط (رفع) ===== */
.media-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.media-cell { position: relative; width: 70px; height: 90px; border-radius: .5rem; overflow: hidden; background: #eef2f6; border: 1px solid #e2e8f0; }
.media-thumb { width: 100%; height: 100%; object-fit: cover; }
.media-x { position: absolute; top: 2px; inset-inline-end: 2px; width: 1.2rem; height: 1.2rem; display: grid; place-items: center;
  border-radius: 999px; background: rgba(2,6,23,.6); color: #fff; border: 0; cursor: pointer; }
.media-x:hover { background: #e11d48; }
.cover-prev { width: 56px; height: 56px; border-radius: .6rem; overflow: hidden; flex: none; background: #eef2f6; border: 1px solid #e2e8f0; }
.cover-prev-img { width: 100%; height: 100%; object-fit: cover; }

/* ===== تنبيه إلزامي (موافقة القُصّر) ===== */
.warn-banner { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-radius: .9rem;
  background: #fff1f2; border: 1px solid #fecdd3; color: #be123c; }

.warn-inline { display: flex; align-items: flex-start; gap: .5rem; padding: .5rem .7rem; border-radius: .6rem;
  background: #fffbeb; border: 1px solid #fde68a; color: #b45309; font-size: .8rem; }
/* §10.202 — أخوها الهادئ: خبرٌ تمّ بخير، لا إنذار. *لونُ الإنذار لما ليس إنذاراً يُفقِده معناه.* */
.note-inline { display: flex; align-items: flex-start; gap: .5rem; padding: .5rem .7rem; border-radius: .6rem;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; font-size: .8rem; }

/* ===== بانٍ عرض السعر (Showcase) ===== */
.offer-bar { flex-direction: column; align-items: stretch; gap: .6rem; max-height: 46vh; }
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.offer-list { display: flex; flex-direction: column; gap: .4rem; overflow-y: auto; max-height: 24vh; }
.offer-row { display: flex; align-items: center; gap: .6rem; }
.offer-name { flex: 1; min-width: 0; font-size: .85rem; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-price { width: 6rem; text-align: center; }
.offer-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; border-top: 1px solid #eef2f6; padding-top: .6rem; }

/* ===== بوابة الموديل ===== */
.portal-shell { min-height: 100vh; background: #f6f8fb; }
.portal-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.2rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }
.portal-main { min-height: calc(100vh - 60px); }

.pt-hero { position: relative; overflow: hidden; }
.pt-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(24px) saturate(1.2); opacity: .9; transform: scale(1.15); }
.pt-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, color-mix(in srgb, var(--brand-dark) 92%, transparent), color-mix(in srgb, var(--brand) 78%, transparent)); }
.pt-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.1rem; padding: 1.4rem; flex-wrap: wrap; }
.pt-avatar { width: 84px; height: 84px; border-radius: 1.1rem; overflow: hidden; flex: none; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 6px 20px rgba(0,0,0,.25); background: #eef2f6; }
.pt-avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* ===== ثييم «غير متاح» — يُطبَّق على جذر بوّابة الموديل حين لا يستقبل حجوزات ===== */
/* يُعيد تعريف لون العلامة داخل البوّابة إلى رماديّ (يهدّئ كل النبرة) + ترويسة رماديّة + بانر */
.pt-off { --brand: #64748b; --brand-dark: #475569; --brand-light: #94a3b8; }
.pt-off .pt-hero::after { background: linear-gradient(120deg, #475569, #64748b); }
.pt-off .pt-hero-bg { filter: blur(24px) grayscale(1); opacity: .45; }
.pt-off-banner { display: flex; align-items: center; gap: .6rem; background: #fffbeb; border: 1px solid #fde68a;
  color: #b45309; border-inline-start: 4px solid #f59e0b; border-radius: .8rem; padding: .7rem .9rem; margin-bottom: 1rem; }

.msg-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .7rem; border-radius: .6rem; background: #f8fafc; }
.msg-row.unread { background: color-mix(in srgb, var(--brand) 8%, white); }
.msg-dot { width: .55rem; height: .55rem; border-radius: 999px; background: var(--brand); flex: none; }
.msg-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem;
  border: 1px solid #eef2f6; border-radius: .7rem; background: #fff; cursor: pointer; transition: all .15s; text-align: start; }
.msg-item:hover { border-color: #cbd5e1; background: #fafcfd; }
.msg-item.unread { border-color: color-mix(in srgb, var(--brand) 30%, white); background: color-mix(in srgb, var(--brand) 6%, white); }

.date-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px;
  background: #fff1f2; color: #be123c; font-size: .8rem; font-weight: 600; border: 1px solid #fecdd3; }
.date-x { display: grid; place-items: center; color: #be123c; border: 0; background: none; cursor: pointer; padding: 0; }
.date-x:hover { color: #881337; }

.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.pk-card { display: flex; align-items: center; gap: .8rem; padding: .7rem; border: 1px solid #e9eef3; border-radius: .9rem; background: #fff; text-decoration: none; transition: all .15s; }
.pk-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.1); transform: translateY(-2px); }
.pk-img { width: 3.2rem; height: 3.2rem; border-radius: .7rem; object-fit: cover; flex: none; background: #eef2f6; }
.pk-info { min-width: 0; }
.pk-unread { display: inline-block; margin-top: .2rem; font-size: .7rem; font-weight: 700; color: var(--brand-dark); background: color-mix(in srgb, var(--brand) 12%, white); padding: .05rem .45rem; border-radius: 999px; }

/* ===== طباعة قائمة العرض ===== */
.print-shortlist { display: none; }
@media print {
  /* ⚠️ كان `body * {visibility:hidden}` يجعل Ctrl+P يطبع **صفحة بيضاء** في كل صفحات النظام.
     الآن: إمّا يوجد عنصر طباعة مخصّص (.printable) فيُطبع وحده، وإلا تُطبع الصفحة نفسها
     بعد إخفاء القشرة (شريط جانبي/علوي/أزرار) فقط. */
  .app-header, .appbar-top, .app-tabs, .app-launcher, .notif-menu, .toast, .toast-wrap, .modal-backdrop,
  .btn, .tabbar, .filter-bar, .fab, .no-print { display: none !important; }
  body { background: #fff !important; }
  main, #view { padding: 0 !important; margin: 0 !important; }
  .card, .panel { box-shadow: none !important; border: 1px solid #e2e8f0 !important; page-break-inside: avoid; }
  /* وضع الطباعة المخصّص: عنصر واحد يُطبع وحده.
     ⚠️ كانت هذه القاعدة تُغطّي `.printable` فقط، بينما الفاتورة وعرض الموديلز يستخدمان
     `.print-shortlist` — فكانت طباعة الفاتورة تُخرج **الفاتورة والتطبيق كلّه خلفها**،
     ومقصوصةً عند صفحة واحدة بسبب `position:absolute; inset:0`. الآن كلاهما تحت نفس الآلية. */
  body:has(.printable) > *:not(.printable),
  body:has(.print-shortlist) > *:not(.print-shortlist) { display: none !important; }
  .printable, .print-shortlist { display: block !important; position: static !important; padding: 1.5rem; }
  body * { visibility: visible; }
  .ps-head h1 { font-size: 1.4rem; font-weight: 700; color: #0f766e; }
  .ps-head p { color: #64748b; font-size: .9rem; margin-bottom: 1rem; }
  .ps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .ps-card { display: flex; gap: .8rem; border: 1px solid #e2e8f0; border-radius: .8rem; padding: .7rem; page-break-inside: avoid; }
  .ps-card img { width: 90px; height: 110px; object-fit: cover; border-radius: .5rem; }
  .ps-name { font-weight: 700; font-size: 1rem; }
  .ps-meta { color: #64748b; font-size: .82rem; }
  .ps-rate { font-size: .82rem; margin-top: .3rem; }
  .ps-skills { font-size: .78rem; color: #0f766e; margin-top: .3rem; }
  .ps-total { margin-top: 1rem; text-align: left; font-weight: 700; color: #0f172a; font-size: 1rem; }
  .ps-foot { margin-top: 1.2rem; text-align: center; color: #94a3b8; font-size: .82rem; }
}

/* ===== مُدرّج الحالات (Stepper) — دورة حياة الإنتاج ===== */
.stepper { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: .4rem; padding: .25rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.step-dot { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 999px; font-size: .7rem; flex: none;
  background: #e2e8f0; color: #64748b; border: 1px solid #cbd5e1; }
.step-label { white-space: nowrap; color: #94a3b8; }
.step-done .step-dot { background: #dcfce7; color: #15803d; border-color: #86efac; }
.step-done .step-label { color: #15803d; }
.step-current .step-dot { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, white); }
.step-current .step-label { color: var(--brand-dark); font-weight: 800; }
/* §10.141 — نوعُ المرحلة يميّزها بصريّاً بصرفِ النظر عن موضعها: بوّابةُ عميلٍ (عنبريّ متقطّع، لا موظّفَ
   يعمل — البندُ ينتظر قرارَ العميل) · نهائيّ (أخضر ثابت). النوعُ يغلب لونَ الموضع في النقطة فيُقرأ فوراً. */
.step-gate .step-dot { background: #fef3c7; color: #b45309; border-style: dashed; border-color: #fbbf24; }
.step-gate .step-label { color: #b45309; }
.step-terminal .step-dot { background: #dcfce7; color: #166534; border-color: #4ade80; }
.step-terminal .step-label { color: #166534; }
/* والبوّابة/النهائيّةُ حين تكون الحاليّةَ: حلقةُ التركيز باللون النوعيّ لا بلون العلامة التجاريّة */
.step-current.step-gate .step-dot { box-shadow: 0 0 0 3px color-mix(in srgb, #fbbf24 32%, white); }
.step-current.step-terminal .step-dot { box-shadow: 0 0 0 3px color-mix(in srgb, #4ade80 32%, white); }
/* §10.533ب — والبوّابةُ **بعد اجتيازها** خضراءُ كأخواتها المنجَزة (بلاغُه: «لما يكون معتمد خليه أخضر متل البقية»)؛
   العنبريُّ المتقطّع للانتظار وحدَه. */
.step-done.step-gate .step-dot { background: #dcfce7; color: #15803d; border-style: solid; border-color: #86efac; }
.step-done.step-gate .step-label { color: #15803d; }

/* §10.141 — صفُّ المحرّر: حدٌّ جانبيٌّ + رقاقةٌ تكشف نوعَ المرحلة وهو يحرّر */
.step-row { border-inline-start-width: 3px; }
.step-row.step-row-gate { border-inline-start-color: #fbbf24; }
.step-row.step-row-terminal { border-inline-start-color: #4ade80; }
.step-row.step-row-work { border-inline-start-color: #cbd5e1; }
.step-kind-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .68rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; white-space: nowrap; }
.step-kind-chip.step-row-gate { background: #fef3c7; color: #b45309; }
.step-kind-chip.step-row-terminal { background: #dcfce7; color: #166534; }
.step-kind-chip.step-row-work { background: #e2e8f0; color: #475569; }

/* سطر التدقيق (أُنشئ/عُدِّل بواسطة) في ذيل التفاصيل */
.audit-line { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; padding-top: .7rem; margin-top: .3rem; border-top: 1px dashed #e7ecf0; font-size: .74rem; color: #94a3b8; }
.audit-item { display: inline-flex; align-items: center; gap: .3rem; }

/* التحقّق الموحّد: نجمة المطلوب + خطأ سطريّ + حدّ أحمر */
.fld-req { color: #dc2626; font-weight: 800; }
.fld-err { display: block; color: #dc2626; font-size: .74rem; font-weight: 600; margin-top: .25rem; }
.inp-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

/* ===== 🔴 §10.320 — حقلٌ يُكتَب بالعربيّة ويُقرأ من اليسار =====
   رآه صاحبُ المشروع: «الـPlaceholder على اليسار والاسهم على اليمين — لازم بالعكس».
   والسببُ `dir="ltr"` كان يُوضَع على حقول الأرقام لتبقى الأرقامُ سليمةً — فجرّ معه
   **العنصرَ النائبَ العربيَّ إلى اليسار** وأسهمَ الزيادة إلى اليمين، حيث تقع العينُ أوّلاً.
   > **عزلُ اتّجاهٍ يُطلَب للأرقام يُطبَّق على الحقل فيُهجِّر نصَّه معها.**
   والعلاجُ: الحقلُ عربيٌّ (`rtl`) فالنائبُ يمينٌ والأسهمُ يسارٌ — والأرقامُ محارفُ قويّةُ
   الاتّجاه تُرسَم يساراً-يميناً في كلّ الحالات، فلا يضرّها. وما قد يحمل إشارةَ سالبٍ
   يُستثنى بـ`data-ltr` (والسالبُ في `rtl` يُقرأ «٥-»).
   ⚠️ وحقلُ الهاتف **يُستثنى**: هو `+962 78…` برمزِ نداءٍ بجانبه، ومبناه كلُّه من اليسار
   عن قصد (§10.241). *استثناءٌ قائمٌ لسببٍ لا يُجرَّ إلى قاعدةٍ عامّة.* */
.inp[type="number"] { direction: rtl; text-align: right; }
.inp[type="number"][data-ltr] { direction: ltr; text-align: left; }
/* §10.465 — البريدُ والرابطُ لاتينيّان دائماً: قاعدةٌ واحدةٌ هنا بدل `data-ltr` يُنسى في كلّ شاشة (كان ناقصاً في
   العملاء ٩/١ والموديلز ٥/٠ — ورقةُ الـUX البند ١٣). والنائبُ العربيُّ يبقى عربيّاً: القاعدةُ للقيمة المكتوبة فقط. */
.inp[type="email"]:not(:placeholder-shown), .inp[type="url"]:not(:placeholder-shown) { direction: ltr; text-align: left; }
/* والأسهمُ تُترَك مرئيّةً — طلبُه نقلُها لا حذفُها — ويُفسَح لها فلا تلتصق بالرقم. */
.inp[type="number"] { padding-inline-start: .45rem; }

/* مسار التنقّل (Breadcrumb) */
.crumb-from { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; color: #64748b;
  background: #f1f5f9; border-radius: .45rem; padding: .12rem .45rem; margin-inline-end: .5rem; text-decoration: none; }
.crumb-from:hover { background: #e2e8f0; color: var(--brand); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .05rem; font-size: .82rem; margin-bottom: 1.1rem; }
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--brand); text-decoration: none; padding: .18rem .45rem; border-radius: .45rem; white-space: nowrap; transition: background .12s; }
.crumb:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.crumb:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.crumb-cur { color: #475569; font-weight: 700; }
.crumb-mod { color: #94a3b8; }
.crumb-sep { color: #cbd5e1; margin: 0 .05rem; user-select: none; }
.crumb-wrap { display: inline-flex; align-items: center; }

/* ===== بطاقة بند إنتاج + معرض الأعمال ===== */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.work-card { border: 1px solid #e9eef3; border-radius: .8rem; overflow: hidden; background: #fff; cursor: pointer; transition: all .15s; }
.work-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.1); transform: translateY(-2px); }
.work-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #eef2f6; display: block; }
.work-cap { padding: .45rem .6rem; }
.qc-check { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; font-size: .85rem; color: #334155; }

/* ===== مُدرّج Workflow بأيقونات ووصلات (بوابة العميل) ===== */
.stepper-wf { gap: 0; align-items: flex-start; overflow: clip; overflow-clip-margin: 10px; }
.stepper-wf .step { flex-direction: column; align-items: center; gap: .35rem; padding: 0 2px; position: relative; flex: 1 1 0; min-width: 52px; text-align: center; }
.stepper-wf .step-dot { width: 2.4rem; height: 2.4rem; z-index: 1; }
.stepper-wf .step-label { white-space: normal; font-size: .68rem; line-height: 1.2; max-width: 5.5rem; }
/* الوصلة تمتدّ نحو الخطوة السابقة (يمين في RTL) فلا تتجاوز حافّة الحاوية */
.stepper-wf .step::before { content: ''; position: absolute; top: 1.2rem; left: 50%; width: 100%; height: 2px; background: #e2e8f0; z-index: 0; }
.stepper-wf .step:first-child::before { display: none; }
.stepper-wf .step-done::before, .stepper-wf .step-current::before { background: #86efac; }

/* ===== قائمة التنبيهات (الجرس) ===== */
.notif-menu { position: absolute; top: calc(100% + .5rem); left: 0; width: 320px; max-width: 88vw; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid #e9eef3; border-radius: .9rem; box-shadow: 0 16px 40px rgba(15,23,42,.16); z-index: 40; }
.notif-menu[hidden] { display: none; }
.notif-head { padding: .6rem .9rem; font-weight: 700; font-size: .8rem; color: #0f172a; border-bottom: 1px solid #f1f5f9; position: sticky; top: 0; background: #fff; }
.notif-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; text-decoration: none; border-bottom: 1px solid #f6f8fb; transition: background .12s; }
.notif-row:hover { background: #f8fafc; }
.notif-ico { flex: none; display: grid; place-items: center; }
.notif-text { font-size: .82rem; color: #1e293b; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-sub { font-size: .7rem; color: #94a3b8; }

/* ===== شريط الفلاتر النظيف ===== */
.filter-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.filter-bar-split { justify-content: space-between; }
.filter-bar-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.filters-adv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem 1rem; padding: 1rem; align-items: end;
  background: #f8fafc; border: 1px solid #eef2f6; border-radius: .9rem; }
.filters-adv[hidden] { display: none; }
.filters-adv .inp { width: 100%; }
.filters-adv .fld { gap: .3rem; }

/* ===== مكتبة الملفات (WorkDrive) ===== */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.folder-card { display: flex; flex-direction: column; padding: .8rem .85rem; border: 1px solid #e9eef3; border-radius: .8rem; background: #fff; cursor: pointer; transition: all .15s; }
.folder-card:hover { background: #f8fafc; box-shadow: 0 6px 16px rgba(15,23,42,.08); transform: translateY(-1px); }
.folder-ico { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .55rem; background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand-dark); flex: none; }
.file-card { border: 1px solid #e9eef3; border-radius: .8rem; background: #fff; overflow: hidden; transition: all .15s; }
.file-card:hover { box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.file-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f1f5f9; display: block; cursor: pointer; }
.file-ph { aspect-ratio: 4/3; display: grid; place-items: center; background: #f1f5f9; color: #94a3b8; cursor: pointer; }
.file-meta { padding: .5rem .6rem; }
.crumb-link { color: var(--brand-dark); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0 .2rem; }
.crumb-link:hover { text-decoration: underline; }

/* ===== شريط معاينة الصلاحيات ===== */
.role-banner { display: flex; align-items: center; gap: .6rem; padding: .5rem 1.5rem; background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; font-size: .82rem; font-weight: 600; }

/* ===== عناصر صلاحيات الأدوار ===== */
.perm-item { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: #475569; cursor: pointer; padding: .3rem .35rem; border-radius: .45rem; min-width: 0; }
.perm-item:hover { background: #f8fafc; }
.perm-item input { width: 1rem; height: 1rem; accent-color: var(--brand); flex: none; }
.perm-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== قوالب العقود (الامتثال) ===== */
.tmpl-body { white-space: pre-wrap; font-family: inherit; font-size: .8rem; line-height: 1.7; color: #475569; background: #fff; border: 1px solid #eef2f6; border-radius: .5rem; padding: .75rem; margin-top: .5rem; }

/* ===== تقويم المحتوى + معرض الأعمال ===== */
.cal-add { width: 1.15rem; height: 1.15rem; line-height: 1; border: 0; background: #f1f5f9; color: #64748b; border-radius: .3rem; cursor: pointer; font-size: .95rem; font-weight: 700; display: grid; place-items: center; }
/* الأجهزة اللمسيّة: كبّر هدف «إضافة منشور» ليكون قابلاً للنقر بالإصبع */
@media (pointer: coarse) { .cal-add { width: 1.9rem; height: 1.9rem; border-radius: .45rem; } }
.cal-add:hover { background: var(--brand); color: #fff; }
.port-cell { display: flex; flex-direction: column; }
.btn-active { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }

/* ===== سجلّ المخاطر ===== */
.risk-matrix { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 5px; }
.rm-corner { font-size: .6rem; font-weight: 700; color: #94a3b8; display: grid; place-items: center; text-align: center; padding: .2rem; }
.rm-head { font-size: .72rem; color: #64748b; display: grid; place-items: center; text-align: center; padding: .2rem; }
.rm-row-head { min-width: 2.2rem; }
.rm-cell { border: 0; border-radius: .45rem; aspect-ratio: 1/1; min-height: 42px; cursor: default; display: grid; place-items: center; font-weight: 800; font-size: .95rem; transition: transform .12s; }
.rm-cell:hover { transform: scale(1.05); }
.rm-count { font-size: 1.05rem; }
.rm-score { opacity: .35; font-size: .8rem; font-weight: 600; }
.risk-row { display: flex; align-items: flex-start; gap: .6rem; background: #f8fafc; border: 1px solid transparent; border-radius: .6rem; padding: .6rem .7rem; transition: background .15s, border-color .15s; }
.risk-row-hl { background: #fffbeb; border-color: #fcd34d; }
.risk-score-chip { min-width: 2rem; height: 2rem; border-radius: .5rem; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.risk-evidence { display: flex; align-items: flex-start; gap: .3rem; font-size: .72rem; color: #0f766e; background: #f0fdfa; border-radius: .4rem; padding: .25rem .45rem; margin-top: .35rem; line-height: 1.6; }

/* ===== مكتبة القوالب ===== */
.tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.tmpl-card { border: 1px solid #eef2f6; border-radius: .7rem; padding: .8rem; background: #fff; transition: box-shadow .15s, border-color .15s; }
.tmpl-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
.tab-count { font-size: .65rem; font-weight: 700; background: #f1f5f9; color: #64748b; border-radius: 999px; padding: .05rem .35rem; min-width: 1.1rem; text-align: center; }
.tab.active .tab-count { background: var(--brand); color: #fff; }

/* ===== طبقة الذكاء الاصطناعي ===== */
/* ===== §10.389 — لونُ الذكاء **ليس لونَ العلامة** =====
   كان `.btn-ai` نيليّاً باهتاً يُقرأ زرّاً ثانويّاً عاديّاً. وقال صاحبُ النظام:
   «خليها مميزة». وأوّلُ ما يُغري: اشتقاقُها من `--brand`. وهذا خطأ:
   > **لونٌ يُشتَقُّ من لون العلامة لا يُميّز شيئاً — لأنّه لونُ كلّ شيء.**
   والنظامُ يُباع لوكالاتٍ أخرى، ولكلٍّ علامتُها: فلونُ الذكاء **علامةُ المزوّد** لا
   علامةُ المشترك — يبقى واحداً عبر كلّ التركيبات. وهو **رموزٌ (`tokens`)** لا قيمٌ
   محفورة، فمشتركٌ علامتُه من العائلة نفسِها يُزيحه بسطر. */
:root { --ai: #4f46e5; --ai-2: #9333ea; --ai-ring: #ddd6fe; --ai-soft: #f5f3ff;
        --ai-dark: #4338ca; --ai-2-dark: #7e22ce; }

/* الطبقةُ الأولى — زرُّ ذكاءٍ مصاحبٌ لحقلٍ أو داخلَ صفّ (اقترحْ · اكتبْ · ملخّص) */
.btn-ai {
  background: linear-gradient(135deg, var(--ai-soft), #eef2ff);
  color: var(--ai); border-color: var(--ai-ring);
}
.btn-ai:hover { background: linear-gradient(135deg, #e0e7ff, #ede9fe); border-color: #c4b5fd; }
/* والطبقةُ الثانية — الفعلُ الرئيسُ في نافذته (استخرِجْ · عبِّئ من نصٍّ أو ملفّ):
   *فعلٌ رئيسٌ بلون ثانويٍّ يُقرأ اختياراً* — فيَملأ اللونُ ويَبيَضُّ النصّ. */
.btn-ai-lead {
  background: linear-gradient(135deg, var(--ai), var(--ai-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .28);
}
/* 🔴 §10.404 — **كان يَبيَضُّ كلَّه عند التحويم.** `button()` يُعطي كلَّ زرٍّ بلا
   `variant` صنفَ `btn-ghost` (سطرٌ واحدٌ في `ui.js`)، و`.btn-ghost:hover` يضبط
   `background: #f8fafc`. وتخصيصُه (صنفٌ + صنفٌ زائف) **أعلى** من `.btn-ai-lead`،
   وهذا التحويمُ كان يضبط `filter` و`box-shadow` **ولا يضبط الخلفيّة** — فتغلب خلفيّةُ
   الشبح، والنصُّ أبيضُ كما هو ⇒ **زرٌّ أبيضُ فارغ**: لا نصَّ ولا أيقونةَ ولا وسم.
   > **تحويمٌ لا يضبط خلفيّتَه يورث خلفيّةَ الصنف الافتراضيِّ الذي تحت يده.**
   ولا `filter: brightness` هنا: *ترشيحٌ يُفتِّح اللونَ يُفتِّح النصَّ الأبيضَ معه.* */
.btn-ai-lead:hover {
  background: linear-gradient(135deg, var(--ai-dark), var(--ai-2-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .34);
}

/* ===== §10.389 — وسمُ «AI» في الزرّ نفسِه =====
   أكثرُ عناوينِ أزرار الذكاء أفعالٌ لا تقول ما تفعله بأيّ شيء: «اقترحْ» · «اكتبْ» ·
   «كابشن» · «ملخّص». والأيقونةُ وحدَها تحتاج تعلُّماً.
   > **عنوانٌ يقول الفعلَ ولا يقول مَن يفعله يُقرأ فعلاً يدويّاً.**
   والوسمُ في `::after` لا في شيفرةِ كلّ موضع: *وسمٌ يُكتَب في كلّ نداءٍ ينحرف في
   الثاني ويُنسى في الثالث.* وهو **في ذيل الزرّ** (والأيقونةُ في رأسه) لأنّ الصفحةَ
   من اليمين. ويُنطَق مع العنوان فيقول القارئُ الصوتيُّ «ملخّص AI» — وهذا صحيحٌ ونافع. */
.btn-ai::after, .btn-ai-lead::after {
  content: 'AI';
  font-size: .6rem; font-weight: 800; letter-spacing: .04em; line-height: 1;
  padding: .2em .34em; border-radius: .3rem; flex: none;
  font-family: ui-sans-serif, system-ui, sans-serif;   /* *وسمٌ لاتينيٌّ بخطٍّ عربيٍّ يُقرأ ركيكاً* */
}
.btn-ai::after { background: var(--ai); color: #fff; }
.btn-ai-lead::after { background: rgba(255, 255, 255, .22); color: #fff; }

.ai-out { font-family: inherit; line-height: 1.9; white-space: pre-wrap; }
/* §10.528 — حقلُ التوجيه قبل التوليد: يُشبه ملاحظةً لا نتيجةً. */
.ai-guidance { font-family: inherit; line-height: 1.7; background: #fffbeb; border-color: #fde68a; }
.ai-guidance:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
/* §10.529 — خيطُ الملاحظات فوق الناتج. */
.ai-thread { display: flex; flex-direction: column; gap: .3rem; }
.ai-turn { display: flex; align-items: flex-start; gap: .5rem; font-size: .8rem; color: #78350f; background: #fffbeb; border-inline-start: 3px solid #f59e0b; border-radius: .5rem; padding: .35rem .6rem; line-height: 1.6; }
.ai-turn-n { flex: none; font-weight: 700; font-family: 'Space Grotesk', system-ui, sans-serif; color: #b45309; }
/* §10.530 — مساحةُ المحادثة: عمودان (المحادثةُ يميناً · الناتجُ يساراً) في نافذة xl، يتكدّسان على الضيّق. */
.ai-studio { display: grid; grid-template-columns: minmax(16rem, 2fr) minmax(0, 3fr); gap: 1rem; align-items: stretch; min-height: 24rem; }
.ai-col-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; font-weight: 700; color: #334155; margin-bottom: .5rem; }
.ai-col-title > :first-child { display: inline-flex; align-items: center; gap: .35rem; }
.ai-chat { display: flex; flex-direction: column; background: #f8fafc; border: 1px solid #eef2f6; border-radius: .85rem; padding: .75rem; min-height: 0; }
.ai-chat-log { flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; gap: .4rem; min-height: 8rem; max-height: 22rem; padding-inline-end: .15rem; }
.ai-chat-log .ai-thread { display: flex; }
.ai-turn-sys { background: #fff; border-inline-start-color: #cbd5e1; color: #475569; }
.ai-composer { margin-top: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.ai-composer .ai-guidance { width: 100%; min-height: 4.2rem; resize: vertical; }
.ai-composer-acts { display: flex; gap: .5rem; flex-wrap: wrap; }
.ai-composer-acts .btn { flex: 1 1 auto; justify-content: center; }
.ai-result { display: flex; flex-direction: column; min-width: 0; }
.ai-result .ai-out { flex: 1 1 auto; min-height: 18rem; }
@media (max-width: 860px) { .ai-studio { grid-template-columns: 1fr; } .ai-chat-log { max-height: 12rem; } }
/* §10.532 — نافذةُ الذكاء أعرضُ وأطولُ من `xl` (بطلبه): ١٢٠٠px وجسمٌ ٧٤vh، والمحادثةُ والناتجُ يمتدّان معه. */
.modal-box.modal-ai { max-width: 1200px; }
.modal-ai .modal-body { max-height: 74vh; }
.modal-ai .ai-studio { min-height: 30rem; }
.modal-ai .ai-chat-log { max-height: 32rem; }
.modal-ai .ai-result .ai-out { min-height: 26rem; }
@media (max-width: 860px) { .modal-ai .ai-chat-log { max-height: 14rem; } .modal-ai .ai-result .ai-out { min-height: 16rem; } }
/* §10.531 — محادثةٌ بفقاعات (B + لمساتُ A من تصاميمه): رسائلُه بنفسجيّةٌ يميناً، وردودُ المساعد بيضاءُ يساراً، ومُرسِلٌ دائريّ، وشرائح. */
.ai-chat { background: #f4f2fa; }
.ai-chat-log { gap: .55rem; }
.ai-thread { display: flex; flex-direction: column; gap: .55rem; }
.ai-row { display: flex; align-items: flex-end; gap: .45rem; }
.ai-row-me { flex-direction: row-reverse; }
.ai-av { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.ai-bub { position: relative; max-width: 82%; padding: .55rem .8rem; border-radius: 1rem; font-size: .86rem; line-height: 1.75; }
.ai-bub-ai { background: #fff; border: 1px solid #e7e5f0; border-bottom-right-radius: .3rem; color: #1f2233; }
.ai-bub-me { background: var(--brand); color: #fff; border-bottom-left-radius: .3rem; white-space: pre-wrap; }
.ai-bub-tx { white-space: pre-wrap; word-break: break-word; }
.ai-bub-t { display: block; font-size: .66rem; opacity: .6; margin-top: .2rem; font-family: 'Space Grotesk', system-ui, sans-serif; direction: ltr; text-align: left; }
.ai-typing { display: inline-flex; gap: .25rem; align-items: center; padding: .15rem .1rem; }
.ai-typing i { width: .42rem; height: .42rem; border-radius: 50%; background: #b9b2d6; display: block; animation: ai-bounce 1.2s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .18s; } .ai-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes ai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.ai-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.ai-chip { border: 1px solid #e7e5f0; background: #fff; color: var(--brand); border-radius: 999px; padding: .25rem .7rem; font-size: .76rem; cursor: pointer; transition: .15s; font-family: inherit; }
.ai-chip:hover { background: #f1eefb; border-color: var(--brand); }
.ai-cbox { display: flex; align-items: flex-end; gap: .5rem; background: #fff; border: 1.5px solid #e7e5f0; border-radius: 1.1rem; padding: .4rem .6rem; transition: .15s; }
.ai-cbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.ai-cbox .ai-guidance { flex: 1; border: 0; outline: 0; box-shadow: none; background: transparent; padding: .25rem 0; min-height: 3.4rem; max-height: 10.5rem; resize: none; line-height: 1.7; overflow-y: hidden; }   /* §10.531ب — سطران بلا تمرير */
.ai-cbox .ai-guidance:focus { border: 0; box-shadow: none; }
.ai-send { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; transition: .15s; }
.ai-send:hover { filter: brightness(.92); } .ai-send:disabled { opacity: .45; cursor: default; }
.ai-composer-acts .btn { flex: 0 0 auto; }
.ai-composer-acts { justify-content: flex-start; }
.ai-review { display: flex; align-items: flex-start; gap: .5rem; font-size: .75rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: .5rem; padding: .5rem .65rem; line-height: 1.7; }
.ai-status { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: #64748b; min-height: 1.5rem; }

/* ===== §10.388 — أيقونةُ الذكاء الاصطناعيّ: إطاراتٌ تُكتَب مرّةً واحدةً ===== */
/* الإطاراتُ (`keyframes`) هنا لا في موضع النداء: *إطارٌ يُنسَخ مع كلّ زرٍّ يُحمَّل
   الصفحةَ N نسخةً من الحركة نفسِها.* والأيقونةُ تأتي من `icon('ai', …)` وحدَها. */
.ai-sparkle { flex: none; }        /* *أيقونةٌ تنضغط حين يلتفّ النصُّ تُقرأ عطباً* */
.ai-sparkle path {
  transform-box: fill-box;
  transform-origin: center;
  animation: ai-sparkle-tw 2.6s ease-in-out infinite;
  /* ===== §10.389 — تتحرّك من نفسِها، **لا على التحويم** =====
     علّقتُها في §10.388 على التحويم لأنّ الشاشةَ قد تحمل عشرةَ أزرار. وقال صاحبُ
     النظام: «القصد من الانيميشن انو يبين انو هاي ذكاء اصطناعي» — والحركةُ إذن
     **دلالةٌ لا زينة**، ودلالةٌ لا تُرى إلّا بعد التحويم لا تدلّ على شيء.
     > **إشارةٌ تُشرَط بفعلِ المستعمِل تُعرَف بعد أن يُستغنى عنها.**
     ولا يُهمَل الضجيجُ مع ذلك: عشرُ أيقوناتٍ تلمع **بنَفَسٍ واحد** نبضةٌ تُنذِر.
     > **حركةٌ متزامنةٌ في مواضعَ كثيرةٍ تُقرأ تنبيهاً، ومُبعثَرةٌ تُقرأ حياة.**
     فلكلّ نسخةٍ **طَورُها** (`--ai-i` من `icon()`)، والتأخيرُ **سالبٌ** كلُّه: القيمةُ
     الموجبةُ تُجمِّد الأيقونةَ على أوّل إطارٍ (شفافيّةُ ٥٥٪) قبل أن تبدأ —
     *تأخيرٌ موجبٌ يُري ما قبل الحركة لا الحركة.* */
  animation-delay: calc(var(--ai-i, 0) * -0.37s);
}
.ai-sparkle path:nth-child(2) { animation-delay: calc(var(--ai-i, 0) * -0.37s - 0.6s); }
.ai-sparkle path:nth-child(3) { animation-delay: calc(var(--ai-i, 0) * -0.37s - 1.1s); }
@keyframes ai-sparkle-tw {
  0%, 100% { transform: scale(.86) rotate(0deg); opacity: .55; }
  50%      { transform: scale(1.08) rotate(10deg); opacity: 1; }
}
/* 🔒 ومَن طلب سكونَ الحركة يُسكَن له — والأيقونةُ تبقى مرئيّةً كاملةَ الوضوح. */
@media (prefers-reduced-motion: reduce) {
  .ai-sparkle path { animation: none; opacity: 1; }
}
.toast-link { flex: none; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff;
  font-size: .75rem; font-weight: 700; border-radius: .45rem; padding: .18rem .5rem; text-decoration: none; }
.toast-link:hover { background: rgba(255,255,255,.28); }
.toast-undo { flex: none; background: #0f172a; border: 0; color: #fff; font-size: .75rem; font-weight: 700; border-radius: .5rem; padding: .3rem .7rem; cursor: pointer; }
.toast-undo:hover { background: #1e293b; }

/* ===== الجرس الجديد: مجمَّع بالفئة + أزرار إجراء ===== */
.notif-menu { width: 400px; }
.notif-group { display: flex; align-items: center; justify-content: space-between; padding: .45rem .75rem .25rem; font-size: .68rem; font-weight: 800; color: #94a3b8; letter-spacing: .02em; background: #f8fafc; border-top: 1px solid #eef2f6; }
.notif-group-n { background: #e2e8f0; color: #475569; border-radius: 999px; padding: 0 .35rem; font-size: .62rem; }
.notif-row { position: relative; display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; }
.notif-row:hover { background: #f8fafc; }
.notif-new::before { content: ''; position: absolute; inset-inline-start: 0; top: .55rem; bottom: .55rem; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.notif-acts { display: flex; align-items: center; gap: .15rem; opacity: 0; transition: opacity .12s; shrink: 0; }
.notif-row:hover .notif-acts { opacity: 1; }
.notif-act { font-size: .65rem; font-weight: 700; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: .35rem; padding: .12rem .3rem; cursor: pointer; white-space: nowrap; }
.notif-act:hover { background: #e2e8f0; color: #0f172a; }
.notif-act-wa { color: #128c7e; background: #dcfce7; border-color: #bbf7d0; display: grid; place-items: center; padding: .18rem; }
.notif-act-wa:hover { background: #bbf7d0; }
.notif-clear { font-size: .65rem; font-weight: 700; color: var(--brand); background: none; border: 0; cursor: pointer; }
.notif-clear:hover { text-decoration: underline; }
.bell-badge-new { animation: pulseBadge 1.6s ease-in-out infinite; }
@keyframes pulseBadge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* مفتاح تشغيل/إيقاف (switch) — تحكّم أنواع تنبيهات الجرس */
.sw { position: relative; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: #cbd5e1; border: 0; cursor: pointer; padding: 0; transition: background .18s ease; flex: none; }
.sw-on { background: var(--brand); }
.sw-dot { position: absolute; top: 2px; right: 2px; width: 1.05rem; height: 1.05rem; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s ease; }
.sw-on .sw-dot { transform: translateX(-1.05rem); }
.sw:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.notif-lock { display: inline-flex; align-items: center; gap: .25rem; font-size: .62rem; font-weight: 800; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: .1rem .45rem; white-space: nowrap; }

/* ===== ربحية العملاء ===== */
.prof-row { display: flex; align-items: center; gap: .75rem; background: #f8fafc; border-inline-start: 3px solid var(--pt, #94a3b8); border-radius: .6rem; padding: .6rem .75rem; }
.prof-row:hover { background: #f1f5f9; }

/* ===== عروض الأسعار ===== */
.prop-row { display: flex; align-items: center; gap: .75rem; background: #f8fafc; border-radius: .6rem; padding: .65rem .75rem; }
.prop-row:hover { background: #f1f5f9; }
.accept-step { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: #334155; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: .5rem; padding: .5rem .65rem; }
.accept-step svg { color: #16a34a; flex: none; }

/* ===== التقارير ===== */
.rep-metrics, .rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.rep-metrics > div, .rep-kpis > div { text-align: center; background: #f8fafc; border-radius: .5rem; padding: .5rem; }
.rep-metrics b, .rep-kpis b { display: block; font-size: 1.15rem; color: #0f172a; }
.rep-metrics span, .rep-kpis span { font-size: .68rem; color: #94a3b8; }
.rep-body { margin-top: 1rem; line-height: 1.9; color: #334155; font-size: .9rem; }

/* ===== المرحلة 21: سحب وإفلات · لوحة أوامر · رسوم · جوال ===== */

/* --- السحب والإفلات (Sortable) --- */
.pipe-drop { min-height: 3.5rem; border-radius: .75rem; transition: background .15s, box-shadow .15s; }
.pipe-drop.is-sortable .pipe-card { cursor: grab; }
.pipe-drop.is-sortable .pipe-card:active { cursor: grabbing; }
.drag-ghost { opacity: .35; background: #ecfeff !important; border-style: dashed !important; }
.drag-chosen { box-shadow: 0 8px 24px rgba(15,23,42,.16); }
.drag-active { transform: rotate(1.5deg); }
.pipe-col.drop-hot { background: #f0fdfa; }

/* --- لوحة الأوامر (Ctrl+K) --- */
.cmdk-trigger { display: inline-flex; align-items: center; gap: .45rem; height: 2.25rem; padding: 0 .6rem;
  border: 1px solid #e2e8f0; border-radius: .6rem; background: #f8fafc; color: #64748b; font-size: .8rem; }
.cmdk-trigger:hover { background: #f1f5f9; color: #334155; }
.cmdk-trigger-text { display: none; }
.cmdk-kbd { display: none; font-size: .65rem; background: #fff; border: 1px solid #e2e8f0; border-radius: .35rem; padding: .05rem .3rem; color: #94a3b8; }
@media (min-width: 768px) { .cmdk-trigger-text, .cmdk-kbd { display: inline; } .cmdk-trigger { width: 15rem; justify-content: flex-start; } .cmdk-kbd { margin-inline-start: auto; } }
.cmdk-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(15,23,42,.4); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; }
.cmdk-box { width: 100%; max-width: 40rem; background: #fff; border-radius: 1rem; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,.28); display: flex; flex-direction: column; max-height: 70vh; animation: pop .16s ease; }
.cmdk-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid #eef2f6; }
.cmdk-input { flex: 1; border: 0; outline: none; font-size: 1rem; font-family: inherit; background: transparent; color: #0f172a; }
.cmdk-list { overflow-y: auto; padding: .35rem; }
.cmdk-row { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 0; background: none;
  border-radius: .6rem; text-align: start; cursor: pointer; font-family: inherit; }
.cmdk-row.is-on { background: #f1f5f9; }
.cmdk-ico { color: #94a3b8; display: grid; place-items: center; flex: none; }
.cmdk-label { font-size: .88rem; color: #0f172a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-sub { font-size: .72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cmdk-kind { margin-inline-start: auto; font-size: .65rem; color: #94a3b8; background: #f8fafc; border: 1px solid #eef2f6;
  border-radius: 999px; padding: .1rem .45rem; flex: none; }
.cmdk-empty { padding: 1.5rem; text-align: center; color: #94a3b8; font-size: .85rem; }
.cmdk-hint { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid #eef2f6; font-size: .7rem; color: #94a3b8; }

/* --- الرسوم البيانية --- */
.chart-wrap { position: relative; width: 100%; }

/* ===== الجوال: النظام كان بـ3 استعلامات وسائط فقط ===== */
/* أنت في الميدان تزور المطاعم — الجوال ليس ترفاً. */
@media (max-width: 640px) {
  .modal-box { max-height: 92vh; width: 100%; border-radius: 1rem 1rem 0 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; }
  .modal-foot .btn { flex: 1; justify-content: center; }

  /* الجداول: بطاقات بدل تمرير أفقي أعمى — كل خلية تحمل عنوان عمودها */
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { border: 1px solid #e2e8f0; border-radius: .75rem; margin-bottom: .6rem; padding: .35rem .1rem; background: #fff; }
  .tbl-cards td { border: 0; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .4rem .75rem; }
  .tbl-cards td::before { content: attr(data-label); font-size: .7rem; color: #94a3b8; font-weight: 600; flex: none; }
  .tbl-cards td:only-child::before { display: none; }

  .pipe-grid { grid-auto-flow: row; grid-template-columns: 1fr; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; justify-content: center; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .inp { width: 100% !important; }
  .stepper { overflow-x: auto; }
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* --- مجموعة تنقّل قابلة للطيّ (الإعدادات وحدها كانت 9 عناصر = 30% من الشريط) --- */
.nav-group-btn { display: flex; align-items: center; justify-content: space-between; width: 100%;
  border: 0; background: none; cursor: pointer; font-family: inherit; }
.nav-chev { width: 1rem; height: 1rem; transition: transform .18s; transform: rotate(-90deg); }
.nav-group.is-collapsed .nav-chev { transform: rotate(0deg); }
.nav-group.is-collapsed .nav-group-body { display: none; }

/* حقل رقميّ برقم مرفوض — كان النظام يقبل راتباً سالباً بلا اعتراض */
.inp-err { border-color: #f43f5e !important; background: #fff1f2; }

/* دوّار انتظار الرفع — كان الرفع بلا أي إشارة، فيضغط المستخدم مرّتين */
.spin { width: 1rem; height: 1rem; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* T-1.1 — بانر فقدان البيانات: ثابت لا يزول (رسالة عابرة كانت تُفوَّت والعمل يضيع) */
.persist-banner { display:flex; align-items:center; gap:.75rem; background:#fef2f2; border-bottom:2px solid #fecaca; color:#991b1b; padding:.65rem 1.25rem; }

/* ===== §10.164 — تخطيطُ «القوائم والتعدادات»: شريطٌ جانبيٌّ ومحرّر ===== */
/* 🔴 **لماذا هنا لا بأصنافِ Tailwind:** جُرِّبت مرّتين بأصناف (`lg:grid-cols-[15rem_1fr]`
   ثمّ `lg:flex lg:w-72`)، و**كلتاهما ظهرت للمالك كقائمةٍ بعرضٍ كامل**. السببُ واحد:
   `assets/css/tailwind.css` **مُولَّدٌ ومُلتزَم** منذ §10.158، فأيُّ صنفٍ جديدٍ لا وجودَ
   له حتّى يُعاد البناء — والشيفرةُ تُحدَّث فوراً بينما التنسيقُ يتأخّر خطوةً.
   فالتخطيطُ الذي **يجب أن يعمل لحظةَ فتح الصفحة** لا يُبنى على أصنافٍ مؤجّلة.
   وهذا الملفُّ يُخدَم كما هو بلا بناء — ومكانُ الهويّة والمكوّنات أصلاً (`.card` · `.inp`
   · `.nav-link`). *تنسيقٌ يتأخّر عن شيفرته يُقرأ عطلاً، لا انتظاراً.* */
.enum-layout { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 1024px) { .enum-layout { grid-template-columns: 18rem minmax(0, 1fr); } }
/* حدُّ الارتفاع يمنع شريطاً بسبعةٍ وأربعين بنداً من دفع المحرّر خارج الشاشة */
.enum-nav { max-height: 60vh; overflow-y: auto; }
/* عنوانُ المجموعة: يفصل ولا يُنافس أسماءَ القوائم على الانتباه */
.enum-group { padding: .75rem .5rem .25rem; font-size: .7rem; font-weight: 700; color: #94a3b8; }

/* ===== §10.165 — حقولٌ محتواها لاتينيّ دائماً: بريد · هاتف · رابط · IBAN ===== */
/* الواجهةُ RTL، والحقلُ يرث اتّجاهَها — فيُرسَم البريدُ والرقمُ والرابطُ **من اليمين**.
   والنتيجةُ ليست قبحاً فقط: `+962 7…` تُعرَض وعلامةُ الزائد في غير موضعها، و
   `https://sketch.center` يقفز جزؤها، والمؤشّرُ يتحرّك عكسَ ما يتوقّع الكاتب.
   *حقلٌ يعرض ما كتبتَه بترتيبٍ آخرَ يجعلك تشكّ فيما كتبت.*
   الاتّجاهُ خاصّيّةُ **المحتوى** لا اللغة، فيُثبَّت هنا مرّةً بالنوع — لا بصنفٍ يُنسى
   عند كل حقلٍ جديد — و`.inp-ltr` مخرجٌ لما لا يحمل نوعاً دلاليّاً (IBAN مثلاً). */
.inp[type="email"], .inp[type="tel"], .inp[type="url"], .inp-ltr {
  direction: ltr; text-align: left;
}
/* والعنصرُ النائب يبقى عربيّاً مقروءاً من اليمين */
.inp[type="email"]::placeholder, .inp[type="tel"]::placeholder,
.inp[type="url"]::placeholder, .inp-ltr::placeholder { direction: rtl; text-align: right; }

/* ===== §10.165 — صفُّ عنصرِ القائمة: أعمدةٌ ثابتةٌ لا صفٌّ ينزلق ===== */
/* 🔴 كان الصفُّ `flex flex-wrap`، وفيه **شارةُ معاينةٍ عرضُها بطول التسمية**
   («فيديو» مقابل «شعار / هوية»). فكلُّ صفٍّ يزيح ما بعده بمقدارٍ مختلف: حقلُ التسمية
   وقائمةُ اللون لا يصطفّان من سطرٍ إلى سطر، والعينُ التي تمسح عموداً تلاحق حافّةً
   متعرّجة. *ما يتكرّر يجب أن يقع في المكان نفسِه — وإلّا صار المسحُ قراءةً.*
   الشبكةُ تُثبّت المسارات، والشارةُ تُقصّ داخل مسارها بدل أن تدفع جيرانها. */
/* 🔴 §10.248 — **`auto` في آخر مسارٍ جعل الصفَّين شبكتين مختلفتين.** صفُّ العناوين
   وصفُّ البيانات شبكتان مستقلّتان بالقالب نفسِه — لكنّ المسارَ الأخيرَ `auto` يُقاس
   **بمحتواه**: في الصفّ ثلاثةُ أزرارٍ (١٠٨px) وفي العنوان خانةٌ فارغة (صفر). فيبتلع
   `1fr` الفرقَ، **وينزاح كلُّ عمودٍ من الثالث فصاعداً ١٠٨ بكسل** — فيقف «المفتاح» فوق
   خانة «الافتراضيّة». (قيس في متصفّحٍ حقيقيّ: الفرقُ ١٠٨ في كلّ الأعمدة الستّة.)

   > **قالبان متطابقان لا يُنتجان شبكتين متطابقتين ما دام فيهما مسارٌ يقيسه محتواه.**

   فالمسارُ الأخيرُ صار **مقاساً ثابتاً**: الأزرارُ الثلاثةُ لا تتغيّر، والعنوانُ الفارغُ
   يحجز عرضَها نفسَه. *صفُّ عناوينَ لا يُقاس بما يقيس صفَّ البيانات ليس عنواناً — هو تضليل.* */
.enum-row { display: grid; gap: .5rem; align-items: center;
  grid-template-columns: 9rem minmax(0, 1fr) 6.5rem 7rem 7rem; }
/* §10.241 — قائمةٌ تحمل بيانةً زائدة (مفتاحُ اتّصال الدولة) تكسب مساراً سادساً وحدَها. */
.enum-row-x1 { grid-template-columns: 8rem minmax(0, 1fr) 6rem 6.5rem 6.5rem 7rem; }
.enum-row-x2 { grid-template-columns: 7rem minmax(0, 1fr) 5rem 5rem 6rem 6rem 7rem; }
.enum-row-x3 { grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem 4.5rem 4.5rem 5.5rem 5.5rem 7rem; }
.enum-row > .enum-badge { min-width: 0; overflow: hidden; }
.enum-row > .enum-badge > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enum-row > .enum-acts { display: flex; gap: .35rem; justify-content: flex-end; }
@media (max-width: 760px) {
  .enum-row { grid-template-columns: 1fr 1fr; }
  .enum-row > .enum-acts { grid-column: 1 / -1; justify-content: flex-end; }
}
/* عناصرُ الشريط الجانبيّ تبدأ من حافّة القراءة — الزرُّ يُوسّط نصَّه افتراضاً */
.enum-nav .nav-link { text-align: start; }

/* ===== §10.165 — بطاقاتُ اختيار المرحلة داخل نافذة «إضافة مرحلة» ===== */
.stage-pick { display:flex; align-items:flex-start; gap:.75rem; width:100%; text-align:start;
  padding:.75rem; border:1px solid #e2e8f0; border-radius:.85rem; background:#fff; cursor:pointer;
  transition:border-color .15s, box-shadow .15s; }
.stage-pick:hover { border-color: var(--brand); box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.stage-pick.is-taken { background:#f8fafc; border-color:#f1f5f9; opacity:.62; cursor:not-allowed; box-shadow:none; }
.stage-pick-ic { display:grid; place-items:center; width:2.25rem; height:2.25rem; flex:none;
  border-radius:.6rem; background:#eef2ff; color:#4338ca; }
.stage-pick-tx { min-width:0; flex:1; }
.stage-pick-hd { display:flex; align-items:center; gap:.5rem; }
.stage-pick-hd b { font-size:.9rem; color:#0f172a; }
.stage-pick-hint { display:block; font-size:.78rem; color:#64748b; line-height:1.75; margin-top:.15rem; }

/* ===== §10.165 — المرحلةُ المُضافةُ للتوّ: تُرى في مكانها ===== */
/* تُدرَج في موضعها المحسوب (التسليم آخراً، خطوةُ الإنتاج قبل أوّل دور) فتظهر وسطَ
   الجدول حيث لا ينظر الضاغط. العلامةُ تبقى حتّى الحفظ — لا وميضٌ لثانيتين يفوته
   من كان ينظر إلى الزرّ. *أَرِ التغييرَ في مكانه، لا تصفه.* */
.step-row.stage-new {
  border-color: var(--brand) !important;
  background: color-mix(in srgb, var(--brand) 7%, #fff) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.step-row.stage-new::before {
  content: 'جديدة'; position: absolute; inset-block-start: -.6rem; inset-inline-start: .75rem;
  background: var(--brand); color: #fff; font-size: .65rem; font-weight: 700;
  padding: .05rem .5rem; border-radius: 1rem; letter-spacing: .02em;
}
.step-row.stage-new { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .step-row.stage-new { animation: stage-in .45s ease-out; }
  @keyframes stage-in { from { transform: translateY(-4px); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* ===== §10.169 — اختيارُ لون ترويسة الرئيسيّة (الإعدادات ← الشركة والهوية) =====
   في styles.css لا في Tailwind: الملفُّ المولَّد يتأخّر عن الشيفرة حتى يُبنى، وقد كلّفنا
   ذلك ثلاثَ محاولاتٍ ظاهرةٍ للمستخدم (§10.164). ما يجب أن يعمل فورَ فتح الصفحة يُكتب هنا. */
.hero-pick { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.hero-pick-b { display: block; width: 100%; text-align: start; cursor: pointer;
  background: #fff; border: 1px solid #e2e8f0; border-radius: .8rem; padding: .7rem; }
.hero-pick-b:hover { border-color: #cbd5e1; background: #f8fafc; }
.hero-pick-b.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.hero-pick-bar { display: block; height: 1.6rem; border-radius: .5rem; margin-bottom: .5rem; }
.hero-pick-l { display: block; font-weight: 700; font-size: .85rem; color: #0f172a; }
.hero-pick-b.on .hero-pick-l::after { content: " ✓"; color: var(--brand); }
.hero-pick-h { display: block; font-size: .72rem; color: #94a3b8; line-height: 1.5; margin-top: .15rem; }
.hero-prev { border-radius: 1rem; padding: 1.4rem 1.2rem; color: #fff; min-height: 6rem;
  display: flex; flex-direction: column; justify-content: center; }
.hero-prev-t { font-family: 'El Messiri', system-ui, sans-serif; font-size: 1.3rem; font-weight: 800; }
.hero-prev-s { font-size: .82rem; opacity: .88; margin-top: .2rem; }

/* ===== §10.171 — نافذةُ قصّ الصورة =====
   في styles.css لا Tailwind: ما يجب أن يعمل فورَ فتح النافذة لا ينتظر بناءً (§10.164). */
.crop-view { position: relative; width: 260px; height: 260px; overflow: hidden; flex: none;
  border-radius: 1rem; background: #0f172a; cursor: grab; touch-action: none; user-select: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 6px 20px rgba(15,23,42,.18); }
.crop-view:active { cursor: grabbing; }
/* `left` لا `inset-inline-start`: التحويلاتُ (transform) لا تنعكس مع RTL، فلو
   انعكس الإسنادُ وحدَه لاختلّت المعادلةُ ولم تُطابق ما يُرسَم على canvas. */
.crop-img { position: absolute; top: 50%; left: 50%; max-width: none; pointer-events: none;
  transform: translate(-50%, -50%); }
.crop-zoom { width: 100%; accent-color: var(--brand); }

/* ===== §10.183 — نموذجُ التعريف: تمهيدُ القسم · سببُ السؤال · شريطُ «المطلوب لنبدأ» =====
   في styles.css لا Tailwind: يجب أن تعمل فورَ فتح رابط العميل بلا انتظار بناء (§10.164). */
.brief-intro { font-size: .82rem; line-height: 1.9; color: #475569; background: #f8fafc;
  border-inline-start: 3px solid var(--brand); border-radius: .6rem; padding: .6rem .8rem; }
.brief-why { display: flex; align-items: flex-start; gap: .35rem; margin-top: .3rem;
  font-size: .72rem; line-height: 1.7; color: #0f766e; }
.brief-why svg { flex: none; margin-top: .18rem; }
.brief-bar { height: .5rem; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.brief-bar-in { height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }

/* محرّرُ الأسئلة في الإعدادات — صفٌّ واحدٌ لكلّ سؤال، والشاراتُ لا تُزيح جيرانها. */
.bq-row { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .2rem;
  border-bottom: 1px solid #f1f5f9; }
.bq-row:last-child { border-bottom: 0; }
.bq-main { flex: 1 1 auto; min-width: 0; }
.bq-label { font-weight: 600; font-size: .87rem; color: #0f172a; }
.bq-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; align-items: center; }
.bq-acts { display: flex; gap: .25rem; flex: none; }
.bq-sys { font-size: .68rem; background: #eef2ff; color: #4338ca; border-radius: 99px; padding: .05rem .45rem; }
.bq-free { font-size: .68rem; background: #f1f5f9; color: #64748b; border-radius: 99px; padding: .05rem .45rem; }
.bq-blk { font-size: .68rem; background: #fef3c7; color: #b45309; border-radius: 99px; padding: .05rem .45rem; }
.bq-scope { font-size: .68rem; background: #ecfdf5; color: #047857; border-radius: 99px; padding: .05rem .45rem; }
.bq-hint { font-size: .72rem; color: #94a3b8; margin-top: .15rem; line-height: 1.6; }

/* ===== §10.548 — نظرةُ المشروع عمودان: عملٌ عريضٌ ومرجعٌ على الحافّة (الخيار «ب» من مخطوطته) =====
   كانت اللوحاتُ عموداً واحداً كلُّها بالوزن البصريِّ نفسِه.
   > **حين تتساوى اللوحاتُ كلُّها في الوزن، لا شيءَ منها مهمّ.**
   فالتمييزُ **بالوزن لا باللون** (حذفٌ لا إضافة): ما تعمل عليه يبقى بطاقةً في العمود العريض،
   وما تراجعه أحياناً يغدو قسماً مسطَّحاً بفاصلٍ في عمودٍ ضيّق. ودون 1100 بكسلٍ يعود العمودان
   واحداً وترجع بطاقاتُ المرجع إطاراتِها — *قسمٌ مسطَّحٌ في عمودٍ عريضٍ يُقرأ سطراً ضائعاً لا قسماً.* */
.ovw { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
@media (max-width: 1100px) { .ovw { grid-template-columns: 1fr; } }
.ovw-ref > .card { background: transparent; box-shadow: none; border: 0; border-radius: 0;
  border-top: 1px solid #e2e8f0; padding-inline: 0; padding-block: 1.1rem; }
.ovw-ref > .card:first-child { border-top: 0; padding-top: .25rem; }
@media (max-width: 1100px) {
  .ovw-ref > .card { background: #fff; border: 1px solid #e9eef3; border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04); padding: 1.25rem; }
  .ovw-ref > .card:first-child { padding-top: 1.25rem; }
}
/* واللوحةُ التي فيها ما ينتظرك تُميَّز بحدٍّ من لون العلامة — **واحدةٌ فقط**، فلو تميّزت اثنتان لم تتميّزْ أيٌّ منهما. */
.pnl-act { border-color: color-mix(in srgb, var(--brand) 26%, transparent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 10%, transparent); }

/* §10.547ب — شجرةُ مجلّدات العميل في الإعدادات: صفٌّ لكلِّ مجلّد، والعمقُ إزاحةٌ في الابتداء،
   وخطٌّ رأسيٌّ على حافّة المُزاح يقول «هذا ابنُ ما فوقه» — *إزاحةٌ بلا خطٍّ تُقرأ صدفةً لا نسباً.* */
.fld-tree { display: flex; flex-direction: column; gap: .4rem; }
.fld-row { display: flex; align-items: center; gap: .5rem; }
.fld-row[style*="margin-inline-start"] { border-inline-start: 2px solid #e2e8f0; padding-inline-start: .6rem; }

/* §10.186 — خياراتُ الدعوة: صفٌّ لكلّ طريقة، والزرُّ لا يُزيحه طولُ الوصف. */
.inv-opt { display: flex; align-items: center; gap: .75rem; padding: .75rem;
  border: 1px solid #e2e8f0; border-radius: .8rem; background: #fff; }
.inv-opt .btn { flex: none; }

/* ===== §10.200 — بطاقاتُ اختيار الصفة =====
   ⚠️ في `styles.css` لا في Tailwind: هذه الشاشةُ تُرسَم **قبل أيّ شيءٍ من النظام**،
   وصنفٌ ينتظر بناءَ Tailwind يظهر بلا تنسيقٍ في أوّل لحظةٍ يراها المستخدم (درسُ §10.164). */
.idn-list { display: flex; flex-direction: column; gap: .65rem; margin-top: .25rem; }
.idn-card {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: start;
  padding: .85rem .9rem; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.idn-card:hover { border-color: var(--brand-dark, #533F99); box-shadow: 0 8px 24px rgba(15,23,42,.07); }
.idn-card:active { transform: scale(.995); }
.idn-card.is-busy { opacity: .6; pointer-events: none; }
.idn-ico {
  width: 2.75rem; height: 2.75rem; border-radius: .85rem; display: grid; place-items: center;
  background: #f1f5f9; color: var(--brand-dark, #533F99); flex: 0 0 auto;
}
.idn-tx { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.idn-name { font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idn-desc { font-size: .72rem; color: #94a3b8; }
.idn-kind {
  font-size: .68rem; padding: .15rem .5rem; border-radius: 999px;
  background: #f1f5f9; color: #475569; flex: 0 0 auto;
}

/* ===== §10.201 — مؤشّرُ العمل ملءَ الشاشة =====
   في `styles.css` المكتوبِ باليد لا في Tailwind: قد يُعرَض **قبل** أن يكتمل أيُّ شيءٍ
   من النظام (تبديلُ الصفة يبدأ من شاشة الاختيار نفسِها) — §10.164. */
.bsy-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: color-mix(in srgb, #0f172a 55%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s ease;
}
.bsy-screen.is-on { opacity: 1; }
.bsy-screen:focus { outline: none; }
.bsy-box {
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
  padding: 2rem 2.6rem; border-radius: 1rem; text-align: center; max-width: min(90vw, 24rem);
  background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  animation: bsyIn .22s ease both;
}
@keyframes bsyIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.bsy-spin {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 3px solid #e2e8f0; border-top-color: var(--brand, #533F99);
  animation: spin .8s linear infinite;
}
.bsy-tx { margin: 0; font-weight: 700; color: #0f172a; font-size: 1rem; }
.bsy-sub { margin: 0; font-size: .78rem; color: #64748b; }
.bsy-note { margin: 0; font-size: .72rem; color: #94a3b8; }

/* ===== §10.390 — صيغةُ الذكاء من المؤشّر: تقول مَن يعمل لا أنّ شيئاً يعمل =====
   > **دوّارٌ رماديٌّ واحدٌ لكلّ الأعمال يقول إنّ شيئاً يعمل ولا يقول مَن.**
   فالعلامةُ كبيرةٌ في وسط الشاشة: حلقةٌ تدور بألوان الذكاء · هالةٌ تتنفّس ·
   والأيقونةُ نفسُها في المركز (ثلاثُ نجماتٍ لأنّ القياسَ فوق ٢٢px — §10.388). */
.bsy-box.is-ai { padding: 2.2rem 2.8rem; max-width: min(92vw, 25rem); }
.bsy-ai { position: relative; width: 5.5rem; height: 5.5rem; display: grid; place-items: center; }
/* الحلقةُ الدوّارة: تدرُّجٌ مخروطيٌّ يُقنَّع فيبقى إطاراً — *حلقةٌ بحدٍّ صلبٍ تُقرأ تحميلاً عاديّاً.* */
.bsy-ai-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--ai-2) 78%, var(--ai) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: bsy-ai-spin 1.5s linear infinite;
}
/* الهالةُ: تتنفّس خلفَ الأيقونة — *حركةٌ واحدةٌ تُقرأ تحميلاً، وحركتان تُقرآن تفكيراً.* */
.bsy-ai-halo {
  position: absolute; inset: .7rem; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--ai) 22%, transparent), transparent 70%);
  animation: bsy-ai-breathe 2.2s ease-in-out infinite;
}
.bsy-ai-glyph { width: 2.6rem; height: 2.6rem; color: var(--ai); position: relative; }
.bsy-box.is-ai .bsy-tx { color: var(--ai); }
.bsy-secs { margin: 0; font-size: .7rem; color: #94a3b8; font-variant-numeric: tabular-nums; min-height: 1rem; }
@keyframes bsy-ai-spin { to { transform: rotate(360deg); } }
@keyframes bsy-ai-breathe {
  0%, 100% { transform: scale(.92); opacity: .55; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* ♿ من يطلب تقليلَ الحركة يرى المؤشّرَ ساكناً — لا غائباً. */
@media (prefers-reduced-motion: reduce) {
  .bsy-screen, .bsy-box { transition: none; animation: none; }
  .bsy-spin { animation-duration: 2.4s; }
  /* 🔒 والحلقةُ تبقى **مرئيّةً كاملةً** ساكنةً، والهالةُ ثابتةٌ لا تختفي. */
  .bsy-ai-ring { animation-duration: 6s; }
  .bsy-ai-halo { animation: none; opacity: 1; transform: none; }
}

/* ===== §10.223 — قائمةُ خياراتٍ («⋯») ===== */
/* `fixed` لأنّ المستدعيَ قد يكون داخل `overflow:hidden` (بطاقةُ الأنبوب §10.219):
   قائمةٌ مقصوصةٌ تبدو مفتوحةً وهي ناقصة — أخطرُ من زرٍّ مقصوصٍ يُرى غيابُه. */
.menu-pop {
  position: fixed; z-index: 9500; min-width: 11.5rem; max-width: min(17rem, 92vw);
  background: #fff; border: 1px solid #e2e8f0; border-radius: .7rem; padding: .3rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .17);
  display: flex; flex-direction: column; gap: 0;
  animation: menuIn .12s ease both;
  overflow-y: auto; overscroll-behavior: contain;   /* §10.541ج — تُمرَّر إن ضاق المتاح، ولا تقفز بعيداً */
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: start;
  padding: .3rem .5rem; border: 0; border-radius: .5rem; background: transparent;
  color: #334155; font-size: .8rem; font-family: inherit; line-height: 1.35; cursor: pointer;
}
/* §10.541د — عنوانُ مجموعةٍ داخلَ القائمة: يُقال مرّةً بدل ملاحظةٍ تحت كلّ سطر. */
.menu-head { padding: .3rem .55rem .15rem; font-size: .66rem; color: #94a3b8; line-height: 1.3; }
.menu-item > svg { flex: none; margin-top: .12rem; }
.menu-item-tx { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.menu-note { font-size: .66rem; color: #94a3b8; line-height: 1.45; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: #f1f5f9; color: #0f172a; outline: none; }
.menu-item:disabled { color: #94a3b8; cursor: not-allowed; }
.menu-item-danger { color: #e11d48; }
.menu-item-danger:hover:not(:disabled) { background: #fff1f2; color: #be123c; }
.menu-sep { height: 1px; background: #eef2f6; margin: .15rem .3rem; }
/* §10.544 — لوحةٌ تُطوى: العنوانُ صفٌّ يُنقَر، والسهمُ يدور، والمحتوى تحته. */
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.fold > summary::-webkit-details-marker { display: none; }
.fold .fold-t { font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: .5rem; }
.fold .fold-note { font-size: .72rem; color: #94a3b8; }
.fold .fold-ch { margin-inline-start: auto; color: #94a3b8; transition: transform .15s ease; }
.fold[open] .fold-ch { transform: rotate(-90deg); }
.fold > .fold-b { margin-top: 1rem; }
.fold:not([open]) { padding-top: 1rem; padding-bottom: 1rem; }
/* زرُّ «⋯» نفسُه: مربّعٌ صغيرٌ لا يزاحم الزرَّ الأساسيَّ بجانبه. */
.btn-menu { padding-inline: .45rem; flex: none; }
@media (prefers-reduced-motion: reduce) { .menu-pop { animation: none; } }

/* ===== §10.227 — هيئةُ نافذة المساعدة ===== */
/* ثلاثةُ مواضعَ ثابتة: جملةُ الغرض · الخطوات · ما يوقفك. والهيئةُ نفسُها في كلّ شاشة —
   *شرحٌ بلا هيئةٍ ثابتةٍ يُقرأ مرّةً ولا يُرجَع إليه.* */
.help-lead { font-size: .95rem; line-height: 1.85; color: #334155; background: #f8fafc;
  border-inline-start: 3px solid var(--brand, #533F99); border-radius: .5rem; padding: .6rem .85rem; margin: 0; }
.help-steps { margin: .1rem 0 0; padding-inline-start: 1.35rem; display: grid; gap: .35rem; }
.help-steps li { line-height: 1.8; }
.help-steps li::marker { color: var(--brand, #533F99); font-weight: 700; }
.help-stops { list-style: none; margin: .1rem 0 0; padding: 0; display: grid; gap: .4rem; }
.help-stops li { background: #fffbeb; border: 1px solid #fde68a; border-radius: .55rem;
  padding: .5rem .7rem; line-height: 1.7; }
.help-stop-t { display: block; color: #92400e; font-weight: 700; font-size: .88rem; }
.help-stop-t::before { content: "🔒 "; }
.help-stop-w { display: block; color: #78716c; font-size: .84rem; }
/* الرسم: يقرأ ألوانَ النظام، ويُمرَّر أفقيّاً في إطاره وحدَه فلا يفيض على النافذة. */
.help-fig { overflow-x: auto; padding: .2rem 0 .1rem; }
.help-fig svg { display: block; min-width: 560px; width: 100%; height: auto; color: #475569;
  font-family: inherit; }
.help-fig text { fill: currentColor; }
.hf-box { fill: #fff; stroke: #cbd5e1; stroke-width: 1.4; }
.hf-box-b { fill: #f5f3ff; stroke: var(--brand, #533F99); stroke-width: 1.6; }
.hf-box-g { fill: #ecfdf5; stroke: #10b981; stroke-width: 1.6; }
.hf-box-r { fill: #fff1f2; stroke: #f43f5e; stroke-width: 1.4; }
.hf-box-w { fill: #fffbeb; stroke: #d97706; stroke-width: 1.4; }
.hf-t { font-size: 12.5px; font-weight: 600; }
.hf-s { font-size: 10.5px; opacity: .72; }
.hf-l { stroke: #94a3b8; stroke-width: 1.4; fill: none; }
.hf-ar { fill: #94a3b8; }
.hf-dash { stroke: #cbd5e1; stroke-width: 1.3; fill: none; stroke-dasharray: 5 4; }
.hf-lock { stroke: #d97706; stroke-width: 1.7; fill: none; }
.hf-lock-t { font-size: 11.5px; fill: #b45309; font-weight: 700; }
.hf-cap { font-size: 11px; opacity: .7; }

/* ===== §10.228 — لسانان في نافذة المساعدة ===== */
.help-seg { display: inline-flex; gap: .2rem; background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: .6rem; padding: .2rem; }
.help-seg-b { font: inherit; font-size: .82rem; font-weight: 600; color: #64748b; background: transparent;
  border: 0; border-radius: .45rem; padding: .3rem .95rem; cursor: pointer; }
.help-seg-b:hover { color: #334155; }
.help-seg-b.is-on { background: #fff; color: var(--brand, #533F99);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.help-seg-b:focus-visible { outline: 2px solid var(--brand, #533F99); outline-offset: 1px; }
.help-seg-body { margin-top: .8rem; }
.help-simple { display: grid; gap: .85rem; }
/* الحكاية: نصٌّ أكبرُ وأوسعُ سطراً — تُقرأ لا تُمسَح. */
.help-plain { margin: 0; padding-inline-start: 1.5rem; display: grid; gap: .55rem;
  font-size: .95rem; line-height: 1.9; color: #334155; }
.help-plain li::marker { color: var(--brand, #533F99); font-weight: 700; font-size: 1rem; }
.help-heads { display: flex; gap: .6rem; align-items: flex-start; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: .6rem; padding: .7rem .85rem;
  font-size: .9rem; line-height: 1.8; color: #78350f; }
.help-heads-i { flex: none; }
.help-remember { background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: .7rem;
  padding: .75rem .95rem; display: grid; gap: .15rem; }
.help-remember-h { font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: var(--brand, #533F99); }
.help-remember p { font-size: 1rem; line-height: 1.8; color: #1e1b4b; margin: 0; }

/* ===== §10.229 — شريطُ رحلة العميل ===== */
/* سبعُ محطّاتٍ في سطر: ما تمّ · أين أنت · وما التالي. يلتفّ على الهاتف ولا يُقصّ. */
.jrn { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.jrn-s { display: flex; align-items: center; gap: .4rem; border-radius: 999px;
  padding: .28rem .7rem .28rem .5rem; font-size: .78rem; border: 1px solid transparent; min-width: 0; }
.jrn-dot { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.25rem; height: 1.25rem; border-radius: 50%; font-size: .68rem; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.jrn-lb { white-space: nowrap; }
.jrn-s.is-ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.jrn-s.is-ok .jrn-dot { background: #10b981; color: #fff; }
.jrn-s.is-now { background: color-mix(in srgb, var(--brand, #533F99) 12%, #fff);
  border-color: var(--brand, #533F99); color: var(--brand, #533F99); font-weight: 700; }
.jrn-s.is-now .jrn-dot { background: var(--brand, #533F99); color: #fff; }
.jrn-s.is-next { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }
.jrn-s.is-next .jrn-dot { background: #e2e8f0; color: #94a3b8; }
/* سطرُ «التالي» — الفعلُ الواحدُ المطلوبُ الآن، بزرٍّ يذهب إليه. */
.jrn-next { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: color-mix(in srgb, var(--brand, #533F99) 7%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand, #533F99) 22%, transparent);
  border-radius: .7rem; padding: .6rem .85rem; }
.jrn-next-h { font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: var(--brand, #533F99); background: #fff; border-radius: .35rem; padding: .12rem .45rem; flex: none; }
.jrn-next-t { font-size: .9rem; color: #1e1b4b; flex: 1 1 12rem; min-width: 0; line-height: 1.7; }
.jrn-next .btn { flex: none; }
.jrn-done { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; font-size: .88rem; }

/* ===== §10.231 — المرحلةُ تطلب ما يلزمها ===== */
/* لافتةُ السبب: النافذةُ فُتحت بفعلٍ من النظام لا بنقرةِ تعديل — فتقول لماذا. */
.lead-why { display: flex; gap: .6rem; align-items: flex-start; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: .7rem; padding: .7rem .9rem;
  font-size: .88rem; line-height: 1.8; color: #78350f; }
.lead-why svg { color: #d97706; margin-top: .1rem; }
/* الحقلُ المقصود يُومض مرّةً ثمّ يهدأ — يُدَلُّ عليه ولا يُصرَخ فيه. */
.inp-seek { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #533F99) 28%, transparent) !important;
  border-color: var(--brand, #533F99) !important; transition: box-shadow .25s ease; }
@media (prefers-reduced-motion: reduce) { .inp-seek { transition: none; } }
/* شارةٌ تُنقَر: هي الطريقُ إلى إصلاح ما تقوله. */
/* 🐛 كان فيها `line-height: 0` — فانطبق سطرُ الزرّ على صفرٍ وفاضت الشارةُ منه، فقُصّت مع
   `overflow:hidden` للبطاقة وبدت كأنّها اختفت. **زرٌّ يلفُّ شارةً يجب ألّا يغيّر صندوقَها**:
   `inline-flex` يجعل الزرَّ حاوياً بلا سطرٍ نصّيٍّ يفرض ارتفاعاً. */
.badge-act { display: inline-flex; align-items: center; padding: 0; border: 0;
  background: transparent; cursor: pointer; font: inherit; }
.badge-act:hover { filter: brightness(.94); }
.badge-act:focus-visible { outline: 2px solid var(--brand, #533F99); outline-offset: 2px; border-radius: 999px; }

/* §10.239 — اللوحةُ المقصودةُ تومض مرّةً ثمّ تهدأ: يُدَلُّ عليها ولا يُصرَخ فيها. */
.jrn-seek { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #533F99) 30%, transparent);
  border-color: var(--brand, #533F99) !important; transition: box-shadow .3s ease; }
@media (prefers-reduced-motion: reduce) { .jrn-seek { transition: none; } }

/* ===== §10.241 · §10.242 — حقلُ الهاتف: المفتاحُ يساراً والرقمُ يميناً =====
   🔴 **الخطأُ الأوّل: `flex: 0 0 9.5rem` على المنتقي.** والحقلُ يعيش في خليّةِ شبكةٍ
   ثُلاثيّةٍ داخل نافذة — عرضُها ٢١٥ بكسل لا ٢٩٠ — فيأخذ المنتقي ١٥٢ ويبقى للصندوق ٥٧
   يبتلعها المفتاحُ وحدَه، **فيصبح صندوقُ الرقم صفراً**: دولةٌ تُختار ولا مكانَ للرقم.
   > **مقاسٌ ثابتٌ يفترض عرضاً لم يقسه أحد.**
   ولا يُصلَح بـ`@media`: *استعلامُ الشاشة لا يعرف عرضَ الخليّة.*

   🔴 **والثاني: العلاجُ الأوّلُ التفّ فالتفّ دائماً.** `flex-wrap` منعت السحقَ لكنّها
   أنزلت المنتقيَ سطراً في كلّ خليّةٍ دون ٢٥٤ — أي في كلّ النوافذ. *علاجٌ يعمل في الحالة
   القصوى ويحكم على الحالة العاديّة بها.*

   العلاج: **المفتاحُ خرج من الخيار إلى لصيقته**، فاحتاج المنتقي اسمَ الدولة وحدَه (٥ ريمات
   لا ٩)، فاتّسع السطرُ للاثنين في ٢١٥. والاتّجاهُ `ltr` على السطر — **المفتاحُ يسبق الرقمَ
   في كلّ لغات العالم** — فيقع المنتقي والمفتاحُ يساراً والكتابةُ يميناً. ويبقى `flex-wrap`
   حارساً أخيراً لأضيقِ الشاشات، وأرضيّةٌ صريحةٌ تحتها لا ينزل صندوقُ الرقم.
   (قيست ستّةُ عروضٍ في متصفّحٍ حقيقيّ: ١٧٠ · ٢٠٠ · ٢٣٠ · ٢٧٠ · ٣٠٠ · ٣٨٠.)
   *حدٌّ أدنى مكتوبٌ خيرٌ من افتراضٍ أنّ المكان يكفي.* */
.phone-fld { display: block; }
.phone-inp { display: flex; align-items: stretch; gap: .35rem; flex-wrap: wrap; }
.phone-inp > .phone-cc { flex: 0 1 4.5rem; min-width: 3.75rem; padding-inline: .35rem; }
.phone-inp > .phone-box { flex: 1 1 6.5rem; min-width: 6.5rem; display: flex; align-items: center; gap: .3rem;
  direction: ltr; border: 1px solid #e2e8f0; border-radius: .6rem; background: #fff; padding-inline-start: .5rem;
  transition: border .15s, box-shadow .15s; }
.phone-box:focus-within { border-color: var(--brand, #533F99); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #533F99) 14%, transparent); }
.phone-box.is-bad { border-color: #f59e0b; }
.phone-dial { flex: 0 0 auto; font-size: .8rem; color: #64748b; font-variant-numeric: tabular-nums; user-select: none; }
.phone-inp > .phone-box > .phone-num { flex: 1 1 auto; width: 100%; min-width: 3.5rem; border: 0; background: transparent;
  box-shadow: none; padding-inline-start: 0; text-align: start; font-variant-numeric: tabular-nums; }
.phone-inp > .phone-box > .phone-num:focus { border: 0; box-shadow: none; }
/* §10.242 — «باقٍ ٣ من ٩ أرقام» تحت الحقل: تُقال أثناء الكتابة لا بعد محاولةِ الحفظ.
   *تحقُّقٌ لا يظهر إلّا عند الحفظ يجعل المستخدمَ يكتشف خطأَه بعد أن نسي ما كتب.* */
.phone-note { display: block; font-size: .7rem; margin-top: .2rem; color: #94a3b8; }
.phone-note.is-short { color: #b45309; }
.phone-note.is-long { color: #dc2626; }
/* خطأُ `checkForm` يقع على العقدة الحاوية — فيُنقَل إلى الإطار المرئيّ لا يضيع عليها. */
.phone-fld.inp-invalid { border: 0 !important; box-shadow: none !important; }
.phone-fld.inp-invalid .phone-box { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

/* ===== §10.350 — حقلُ التاريخ: نصٌّ نملكه + تقويمُ الجهاز ===== */
/* الاتّجاهُ `ltr` على الصندوق: التاريخُ يُقرأ من اليسار في كلّ اللغات — والعنوانُ فوقَه
   يبقى عربيّاً، فالاتّجاهُ على السطر وحدَه لا على الحقل كلِّه (§10.320). */
.date-fld { display: block; }
.date-box { display: flex; align-items: center; gap: .35rem; background: #fff;
  border: 1px solid #cbd5e1; border-radius: .65rem; padding-inline-end: .3rem; position: relative; }
.date-box:focus-within { border-color: var(--brand, #533F99); box-shadow: 0 0 0 3px rgba(83,63,153,.12); }
.date-box.is-bad { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
/* ⚠️ صنفان في المُحدِّد كي يغلبا `.inp { width: 100% }` المكتوبةَ قبلهما (§10.324):
   *ترتيبٌ يُعتمَد عليه يُكسَر بأوّل قاعدةٍ تُضاف بعده.* */
.date-box > .date-txt { flex: 1 1 auto; min-width: 0; border: 0; background: transparent;
  box-shadow: none; text-align: start; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.date-box > .date-txt:focus { border: 0; box-shadow: none; }
.date-cal { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem;
  border: 0; border-radius: .45rem; background: transparent; color: #64748b; cursor: pointer; }
.date-cal:hover { background: #f1f5f9; color: var(--brand, #533F99); }
/* المنتقي الأصليُّ: **شفّافٌ بحجمِ نقطةٍ لا محذوف** — `showPicker()` لا تعمل على
   عنصرٍ مُزال من الرسم، والتقويمُ يُفتَح عنده فيبدو خارجاً من الزرّ. */
.date-native { position: absolute; inset-inline-end: .3rem; bottom: 0; width: 1px; height: 1px;
  padding: 0; border: 0; opacity: 0; pointer-events: none; }
/* «باقٍ ٥ من ٨ أرقام» تحت الحقل — تُقال أثناء الكتابة لا بعد محاولة الحفظ (§10.242). */
.date-note { display: block; font-size: .7rem; margin-top: .2rem; color: #94a3b8; }
.date-note.is-short { color: #b45309; }
.date-note.is-bad { color: #dc2626; }
/* خطأُ `checkForm` يقع على العقدة الحاوية — فيُنقَل إلى الإطار المرئيّ لا يضيع عليها. */
.date-fld.inp-invalid { border: 0 !important; box-shadow: none !important; }
.date-fld.inp-invalid .date-box { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }
/* المقاسُ الصغيرُ لأشرطة الأدوات — `inp-sm` كان يُمرَّر إلى حقلٍ لم يعد موجوداً. */
.date-fld.inp-sm .date-box { border-radius: .55rem; }
.date-fld.inp-sm > .date-box > .date-txt { padding: .35rem .7rem; font-size: .8rem; }
.date-fld.inp-sm .date-cal { width: 1.6rem; height: 1.6rem; }

/* ===== §10.355 — بطاقاتُ التكاملات ===== */
/* البندُ غيرُ الجاهز **يُرى ولا يُلمَس**: بلا مؤشّرِ نقرٍ وبلا تفاعلِ تمرير — فلا يَعِد بفعل. */
.integ-grid { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .integ-grid { grid-template-columns: 1fr 1fr; } }
.integ-slot { border: 1px dashed #cbd5e1; border-radius: .8rem; padding: .75rem .85rem;
  background: #f8fafc; cursor: default; }
.integ-ic { width: 2.1rem; height: 2.1rem; border-radius: .6rem; display: grid; place-items: center;
  flex: none; background: #e2e8f0; color: #64748b; }
.integ-ic.tone-green { background: #dcfce7; color: #15803d; }
.integ-ic.tone-blue { background: #dbeafe; color: #1d4ed8; }
.integ-ic.tone-indigo { background: #e0e7ff; color: #4338ca; }
.integ-ic.tone-amber { background: #fef3c7; color: #b45309; }
.integ-ic.tone-rose { background: #ffe4e6; color: #be123c; }
.integ-ic.tone-teal { background: #ccfbf1; color: #0f766e; }
.integ-ic.tone-slate { background: #e2e8f0; color: #475569; }
.integ-soon { font-size: .65rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px;
  background: #e2e8f0; color: #475569; white-space: nowrap; }

/* قيمةٌ إنجليزيّةٌ في سطرها وحدَها داخلَ نافذة الشرح — *سطرٌ يخلط اتّجاهين يُقرأ نصفَ قراءة.* */
.howto-val { direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; background: #0f172a; color: #e2e8f0; border-radius: .45rem;
  padding: .35rem .6rem; margin: .25rem 0; overflow-x: auto; white-space: nowrap; }

/* §10.243 ② — «أضِف تقديراً»: دعوةٌ لا تعليق.
   الخطُّ المنقّطُ تحت نصٍّ رماديٍّ ١١px لا يُرى بين شاراتٍ ملوّنة — *قابليّةُ النقر ليست
   ظهوراً*. الإطارُ المتقطّعُ وعلامةُ الزائد نمطٌ مفهومٌ عالميّاً: **هنا يُضاف شيء**. */
/* §10.368 — سطرُ الموعد على بطاقة المحتمَل: **يبدو مضغوطاً** لأنّه كذلك.
   *سطرٌ يُفتَح ولا يبدو قابلاً للفتح لا يُضغَط.* */
.appt-line { display: inline-flex; align-items: center; gap: .25rem; font-size: 11px; font-weight: 600;
  color: #4f46e5; border: 0; background: color-mix(in srgb, #4f46e5 7%, #fff);
  border-radius: 999px; padding: .12rem .5rem; cursor: pointer; text-align: start;
  transition: background .15s, color .15s; }
.appt-line:hover { background: color-mix(in srgb, #4f46e5 15%, #fff); color: #3730a3; }
.appt-line:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }
.est-add { display: inline-flex; align-items: center; gap: .2rem; font-size: 11px; font-weight: 600;
  color: var(--brand, #533F99); border: 1px dashed color-mix(in srgb, var(--brand, #533F99) 45%, #cbd5e1);
  border-radius: 999px; padding: .1rem .45rem; background: color-mix(in srgb, var(--brand, #533F99) 5%, #fff);
  transition: background .15s, border-color .15s; }
.badge-act:hover .est-add { background: color-mix(in srgb, var(--brand, #533F99) 12%, #fff);
  border-color: var(--brand, #533F99); }

/* §10.245 — عناوينُ أعمدة المحرِّر: تظهر للقوائم ذات الأعمدة الزائدة وحدَها. */
/* الحشوةُ نفسُها التي في `.inp` — فيبدأ العنوانُ من حيث يبدأ نصُّ حقلِه لا من حافّة المسار. */
.enum-head { font-size: .7rem; font-weight: 600; color: #94a3b8; margin-bottom: -.15rem; }
.enum-head > span { padding-inline: .7rem; }
.enum-head > .enum-head-c { padding-inline: 0; text-align: center; }
@media (max-width: 760px) { .enum-head { display: none; } }

/* §10.247 — شريطُ الاكتمال في نافذة المحتمَل.
   *عدٌّ بلا مقامٍ لا يقيس شيئاً* — فالنصُّ يقول «اكتمل ٧ من ١٥ — ٤٧٪» لا «٧» وحدَها.
   واللونُ يتدرّج فلا يُقرأ خطأً وهو نقصٌ مشروع: أكثرُ الحقول اختياريّةٌ بالتصميم. */
.lm-bar { display: flex; align-items: center; gap: .6rem; }
.lm-bar-track { flex: 1 1 auto; height: .4rem; border-radius: 999px; background: #e2e8f0; overflow: hidden; display: block; }
.lm-bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: #94a3b8; transition: width .25s ease, background .25s ease; }
.lm-bar-fill.is-mid { background: var(--brand, #533F99); }
.lm-bar-fill.is-full { background: #16a34a; }
.lm-bar-text { flex: 0 0 auto; font-size: .72rem; color: #64748b; }
.lm-bar-text b { color: #334155; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .lm-bar-fill { transition: none; } }

/* ===== §10.347 — سطرُ «ما بعد آخرِ حقل» في تبويب البيانات ===== */
/* نبرةٌ أهدأُ من `lead-why`: هذه **دعوةٌ** لا تحذير — فلا لونَ إنذارٍ فيها. */
.lm-next-hint { display: flex; gap: .55rem; align-items: flex-start;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: .7rem;
  padding: .6rem .8rem; font-size: .8rem; line-height: 1.9; color: #4c1d95; }
.lm-next-hint svg { color: var(--brand, #533F99); margin-top: .25rem; }
.lm-next-hint b { font-weight: 700; }

/* زرُّ التقدّم: موضعُه أوّلُ التذييل، ومظهرُه ثانويٌّ — *لا يُنازِع الحفظَ على العين.* */
.btn-advance { background: #f5f3ff; border: 1px solid #ddd6fe; color: #4c1d95; }
.btn-advance:hover { background: #ede9fe; }

/* §10.252 — حقلُ المدى وحقلُ النسبة: شكلُ السؤال هو شكلُ الجواب. */
.rng-fld { display: block; }
.rng-row { display: flex; align-items: center; gap: .4rem; }
.rng-row > .rng-n { flex: 1 1 0; min-width: 3.5rem; text-align: start; }
.rng-sep { flex: 0 0 auto; color: #94a3b8; font-size: .85rem; user-select: none; }
.rng-unit { flex: 0 0 auto; color: #64748b; font-size: .85rem; font-weight: 600; user-select: none; }
.rng-legacy { font-size: .7rem; color: #b45309; margin-top: .25rem; line-height: 1.6; }
.rng-fld.inp-invalid .rng-n { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

/* §10.253 ② — بطاقةٌ يُهبَط عليها: وميضٌ **لا يُخطئه النظر** ثمّ يهدأ.
   `.jrn-seek` صُمّمت للوحاتٍ عريضةٍ في ملفّ العميل؛ والبطاقةُ صغيرةٌ داخل عمودٍ ملوَّن،
   فحلقةٌ رقيقةٌ عليها تُشبه ظلَّها الأصليَّ فلا تُرى. *إشارةٌ تُشبه ما حولها ليست إشارة.* */
.pipe-seek { border-color: var(--brand, #533F99) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #533F99) 32%, transparent),
              0 6px 16px rgba(15,23,42,.10) !important;
  animation: pipeSeek 1.1s ease-in-out 2; }
@keyframes pipeSeek { 0%, 100% { transform: none; } 50% { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .pipe-seek { animation: none; } }

/* §10.260 — شارةُ الرقم: عقدةٌ لكلّ رقمٍ وكلمةٌ عربيّةٌ بينها.
   الاتّجاهُ يُحسَم بالمعنى لا بمحارف عزلٍ خفيّة — فما يُنسَخ من الشاشة يخرج نظيفاً. */
.numch {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  padding: 0 .34em;
  border-radius: .4em;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.text-lg .numch, .text-xl .numch { padding: 0 .28em; }

/* ═══════════════════════════════════════════════════════════════════════
   §10.266 — جلدُ المطبوعات: قالبُ سكتش للوثائق
   ───────────────────────────────────────────────────────────────────────
   مأخوذٌ حرفيّاً من «قالب سكتش للمطبوعات» (docx/pdf): الألوانُ السبعة،
   شريطُ الأرباع، ترويسةٌ وتذييلٌ في كلّ صفحة، جداولُ برأسٍ بنفسجيّ وتظليلٍ
   متناوب، بطاقاتُ أرقام، صناديقُ تنبيه/ملاحظة/قرار، وبلوكُ التواقيع.
   🔑 **جلدٌ واحدٌ لكلّ ما يُطبَع** — لا نسخةَ لكلّ وثيقة (§12.6): الملحقُ اليوم،
   وعرضُ السعر والعقدُ والفاتورةُ غداً بالفئات نفسِها.
   ═══════════════════════════════════════════════════════════════════════ */
/* 🔑 الألوانُ **من إعدادات الهوية** لا من هذا الملفّ: التطبيقُ يضع
   `--brand`/`--brand-dark`/`--brand-light`/`--accent` على الجذر عند الإقلاع من
   «الشركة والهوية». وقيمُ القالب المطبوع بذرةٌ احتياطيّةٌ إن لم تُضبَط.
   *وكالةٌ تغيّر هويّتها تغيّرها مرّةً واحدة* (§12.6). والتظليلُ يُشتَقّ بـ`color-mix`
   لا يُكتَب حَرفاً — لئلّا يبقى بنفسجيّاً بعد تبديل اللون. */
:root {
  --pr-purple: var(--brand, #533F99);
  --pr-teal:   var(--brand-dark, #2E9481);
  --pr-yellow: var(--brand-light, #FDD700);
  --pr-orange: var(--accent, #F04923);
  --pr-green: #359A3E;
  --pr-tint: color-mix(in srgb, var(--pr-purple) 7%, #fff);
  --pr-line: color-mix(in srgb, var(--pr-purple) 18%, #fff);
  --pr-ink-soft: color-mix(in srgb, var(--pr-purple) 45%, #6b6b76);
}
.pr { font-family: "Readex Pro", "El Messiri", "Segoe UI", Tahoma, sans-serif;
  color: #2b2b33; font-size: 10.5pt; line-height: 1.75; }
.pr * { font-family: inherit; }

/* الترويسةُ والتذييلُ يتكرّران في كلّ صفحة (`fixed` داخل الطباعة). */
.pr-top { padding-bottom: .35rem; }
.pr-top-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.pr-co { color: var(--pr-purple); font-weight: 700; font-size: 11pt; letter-spacing: .12em; }
.pr-co-sub { color: var(--pr-ink-soft); font-size: 8pt; margin-top: .1rem; }
.pr-logo { height: 34px; width: auto; object-fit: contain; }
.pr-logo-txt { color: var(--pr-purple); font-weight: 700; font-size: 13pt; line-height: 1; }
.pr-logo-txt small { display: block; font-size: 6pt; letter-spacing: .34em; color: var(--pr-ink-soft); font-weight: 500; }
/* القالبُ يضع البنفسجيَّ يساراً — والصفُّ يرث RTL فينقلب. *شريطُ هويّةٍ مقلوبٌ يُقرأ
   هويّةً أخرى.* */
.pr-bar { display: flex; direction: ltr; height: 5px; margin-top: .3rem; }
.pr-bar i { flex: 1; }
.pr-bar i:nth-child(1) { background: var(--pr-purple); }
.pr-bar i:nth-child(2) { background: var(--pr-teal); }
.pr-bar i:nth-child(3) { background: var(--pr-yellow); }
.pr-bar i:nth-child(4) { background: var(--pr-orange); }

.pr-foot { border-top: 1px solid var(--pr-line); padding-top: .3rem; display: flex;
  justify-content: space-between; gap: 1rem; font-size: 7.6pt; color: #7a7488; }
.pr-foot-c { text-align: center; flex: 1; }
.pr-foot em { font-style: italic; display: block; color: #9a94ab; }

/* العناوين — «عنوان 1» بنفسجيٌّ بخطٍّ تحته، و«عنوان 2» تركوازيّ. */
.pr-h1 { color: var(--pr-purple); font-size: 14pt; font-weight: 700; margin: 1rem 0 .5rem;
  padding-bottom: .2rem; border-bottom: 1px solid var(--pr-line); }
.pr-h2 { color: var(--pr-teal); font-size: 11.5pt; font-weight: 700; margin: .85rem 0 .3rem; }
.pr-h3 { color: #6e6688; font-size: 8.5pt; font-weight: 700; letter-spacing: .06em; margin: .7rem 0 .25rem; }
.pr-lead { color: #3f3a52; font-size: 10.5pt; margin: 0 0 .5rem; }
.pr-title { color: var(--pr-purple); font-size: 17pt; font-weight: 700; margin: .5rem 0 .15rem; }
.pr-meta { color: #6e6688; font-size: 9pt; }
.pr-meta b { color: #3f3a52; }

/* الجداول */
.pr-t { width: 100%; border-collapse: collapse; margin-top: .35rem; page-break-inside: avoid; }
.pr-t thead th { background: var(--pr-purple); color: #fff; font-weight: 600; font-size: 9.5pt;
  padding: .4rem .6rem; text-align: start; }
.pr-t td { padding: .36rem .6rem; border-bottom: 1px solid color-mix(in srgb, var(--pr-purple) 10%, #fff); font-size: 10pt; vertical-align: top; }
.pr-t tbody tr:nth-child(even) td { background: var(--pr-tint); }
.pr-t .pr-src { color: #7a7488; font-size: 8.4pt; }
.pr-t .pr-tot td { background: color-mix(in srgb, var(--pr-purple) 12%, #fff); font-weight: 700; border-bottom: 0; }
.pr-cap { font-size: 8.2pt; color: #8b85a0; margin-top: .25rem; }

/* بطاقاتُ الأرقام — ثلاثُ خاناتٍ أو أربع */
.pr-cards { display: flex; border: 1px solid var(--pr-line); margin-top: .4rem; page-break-inside: avoid; }
.pr-card { flex: 1; background: var(--pr-tint); padding: .55rem .4rem; text-align: center;
  border-inline-start: 1px solid var(--pr-line); }
.pr-card:first-child { border-inline-start: 0; }
.pr-card span { display: block; font-size: 8.4pt; color: #6e6688; }
.pr-card b { display: block; color: var(--pr-purple); font-size: 16pt; line-height: 1.3; }

/* الصناديق — حدٌّ سميكٌ على الجانب المبتدَأ به */
.pr-box { border-inline-start: 4px solid; padding: .5rem .7rem; margin: .5rem 0; page-break-inside: avoid; }
.pr-box .pr-box-t { font-weight: 700; font-size: 10pt; margin-bottom: .15rem; }
.pr-box p { margin: 0; font-size: 9.6pt; line-height: 1.8; }
.pr-warn { background: #fef8e3; border-color: var(--pr-orange); }
.pr-warn .pr-box-t { color: var(--pr-orange); }
/* §10.329 — فقرةُ بنودٍ في المطبوع: تُقرأ متراصّةً ولا تُقسَم بين صفحتين في منتصفها. */
.pr-p { margin: 0 0 .45em; line-height: 1.75; break-inside: avoid; }

.pr-note { background: #eaf6f3; border-color: var(--pr-teal); }
.pr-note .pr-box-t { color: var(--pr-teal); }
.pr-ok { background: #eaf5ec; border-color: var(--pr-green); }
.pr-ok .pr-box-t { color: var(--pr-green); }

/* بلوكُ التواقيع */
.pr-sign { display: flex; gap: 2.4rem; margin-top: 1.6rem; page-break-inside: avoid; }
.pr-sign > div { flex: 1; }
.pr-sign-h { color: var(--pr-purple); font-weight: 700; font-size: 10pt; margin-bottom: .6rem; }
.pr-sign-f { font-size: 9.5pt; margin-bottom: .35rem; color: #3f3a52; }
.pr-blank { display: inline-block; min-width: 9rem; border-bottom: 1px solid #b9b2d2; }
.pr-sign-l { border-top: 1px solid color-mix(in srgb, var(--pr-purple) 35%, #fff); margin: 1.6rem 0 .4rem; }

@media print {
  @page { size: A4; margin: 12mm 14mm 16mm; }
  .pr { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* الترويسةُ والتذييلُ يتكرّران على كلّ ورقة — *ورقةٌ بلا ترويسةٍ تُقتطَع من ملفٍّ ولا يُعرَف لمن.* */
  .pr-top { position: fixed; top: 0; inset-inline: 0; background: #fff; }
  .pr-foot { position: fixed; bottom: 0; inset-inline: 0; background: #fff; }
  .pr-body { padding-top: 64px; padding-bottom: 54px; }
  .printable.pr { padding: 0 !important; }
}

/* §10.270 — مُدرَّجٌ من مرحلتين داخل تبويب: صغيرٌ لا يزاحم تبويباتِ الصفحة. */
.seg { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: .7rem;
  background: #f1f5f9; border: 1px solid #e2e8f0; flex-wrap: wrap; }
.seg-b { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem;
  border: 0; border-radius: .55rem; background: transparent; color: #475569;
  font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.seg-b:hover { color: #0f172a; }
.seg-b.seg-on { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.seg-n { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 999px;
  background: #e2e8f0; color: #475569; font-size: .7rem; font-weight: 700; }
.seg-b.seg-on .seg-n { background: var(--brand); color: #fff; }
.seg-c { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
  border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .68rem; font-weight: 700; }
.seg-b.seg-on .seg-c { background: color-mix(in srgb, var(--brand) 15%, #fff); color: var(--brand); }
/* §10.280 — عدّادٌ يعدّ «ما بقي» لا «ما فيه»: لونٌ مختلفٌ يمنع قراءتَه عدّاً محايداً. */
.seg-c-warn { background: #fef3c7; color: #b45309; }
.seg-b.seg-on .seg-c-warn { background: #fde68a; color: #92400e; }

/* ===== §10.284 — قسمٌ داخل لوحة: رأسٌ مظلَّلٌ وحدٌّ يغلقه ===== */
/* *عنوانٌ صغيرٌ ليس حدّاً* — ثلاثةُ جداولَ متتابعةٍ بلا صندوقٍ تُقرأ جدولاً واحداً. */
.sub-sec { border: 1px solid #e2e8f0; border-radius: .75rem; overflow: hidden; background: #fff; }
.sub-sec-h { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap; padding: .55rem .85rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.sub-sec-t { font-size: .8rem; font-weight: 700; color: #334155; }
.sub-sec-n { font-size: .7rem; color: #64748b; margin-top: .1rem; }
.sub-sec-b { padding: 0; }
.sub-sec-b > .overflow-x-auto > .tbl { font-size: .82rem; }
/* قسمٌ محتواه ليس جدولاً يلزمه هامشٌ — والجدولُ يملأ الصندوقَ بلا هامش. */
.sub-sec-b.is-pad { padding: .85rem; }
/* 🔴 ورأسُ الجدول كان بلا خلفيّةٍ فيُقرأ صفّاً — الآن يُقرأ رأساً. */
.tbl thead th { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.sub-sec .tbl thead th { background: #fff; }
.sub-sec .tbl tr:last-child td { border-bottom: 0; }

/* ===== §10.287 — شبكةُ أجوبة النموذج ===== */
/* *جوابٌ من كلمةٍ يأخذ عرضَ الشاشة يُطيل الطريقَ ولا يزيد الوضوح* — ثلاثةٌ في الصفّ،
   والطويلُ يأخذ الصفَّ كلَّه. وهي هنا لا في Tailwind: تلزم أوّلَ رسمةٍ قبل `npm run css`. */
.brf-grid { display: grid; gap: .5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .brf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .brf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.brf-wide { grid-column: 1 / -1; }
/* §10.290 — حرفٌ مرفوضٌ يُمنَع ويُقال: *منعٌ صامتٌ يُقرأ لوحةً معطّلة.* */
.inp-reject { border-color: #fda4af !important; background: #fff1f2; transition: background .12s, border-color .12s; }

/* ===== §10.291 — شريحةُ اختيار: الحدُّ يفصل حيث لا يفصل الفراغ ===== */
/* *تجاورٌ يفصله فراغٌ يصبح التصاقاً حين يغيب الفراغ — والحدُّ لا يغيب.* */
.chk-wrap { display: flex; flex-wrap: wrap; gap: .45rem; }
.chk-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem;
  border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #475569;
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.chk-chip:hover { border-color: #cbd5e1; background: #f8fafc; }
.chk-chip input { width: .95rem; height: .95rem; accent-color: var(--brand); margin: 0; flex: none; }
.chk-chip.on { border-color: var(--brand); color: var(--brand-dark, var(--brand));
  background: color-mix(in srgb, var(--brand) 8%, #fff); }
/* §10.293 — اسمٌ مطبوعٌ فوق خطّ التوقيع لا بدلاً منه: الورقةُ تبقى قابلةً للتوقيع بخطّ اليد. */
.pr-blank { padding: 0 .35rem .05rem; font-weight: 600; color: #2b2540; }

/* ===== §10.382 — رقاقةُ مرفقٍ في نافذة «عبِّئ من نصٍّ أو ملفّ» ===== */
/* تُكتَب هنا لا في `tailwind.css` المولَّد (§10.291 · §10.377): *صنفٌ يُكتَب بيدٍ في
   بيانةٍ مولَّدةٍ لا يخرج أبداً*. */
.upl-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%;
  padding: .2rem .5rem; border: 1px solid #e2e8f0; border-radius: .6rem;
  background: #f8fafc; font-size: 12px; color: #334155; }
.upl-chip .upl-x { padding: .1rem; border: 0; background: transparent; color: #94a3b8; }
.upl-chip .upl-x:hover { color: #e11d48; }

/* ===== §10.452 — نافذةُ الخامّ بثلاثة مداخل: نصٌّ · تسجيلُ صوت · مرفقات =====
   بطاقةٌ لكلّ مدخلٍ بعنوانٍ وسطرٍ شارح، والمسجّلُ زرٌّ كبيرٌ يحمرّ وينبض أثناء التسجيل —
   *زرٌّ صغيرٌ لفعلٍ يستغرق دقيقةً يُقرأ خياراً ثانويّاً.* */
.fill-src { border: 1px solid #e2e8f0; border-radius: .85rem; padding: .7rem .8rem; background: #fff; display: flex; flex-direction: column; gap: .5rem; }
.fill-src-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: #0f172a; }
.fill-src textarea { margin: 0; }
.rec-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rec-btn {
  display: inline-flex; align-items: center; gap: .55rem; padding: .65rem 1.1rem; min-height: 3rem;
  border-radius: 999px; border: 1px solid #fecdd3; background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #be123c; font-weight: 700; font-size: .95rem; cursor: pointer; transition: background .15s, box-shadow .15s;
}
.rec-btn:hover:not(:disabled) { background: linear-gradient(135deg, #ffe4e6, #fecdd3); box-shadow: 0 2px 8px rgba(190, 18, 60, .18); }
.rec-btn:disabled { opacity: .55; cursor: not-allowed; }
.rec-btn.is-recording { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; border-color: transparent; animation: rec-pulse 1.4s ease-in-out infinite; }
@keyframes rec-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .45); } 50% { box-shadow: 0 0 0 .55rem rgba(225, 29, 72, 0); } }
.rec-time { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; font-size: .95rem; color: #be123c; font-weight: 700; }
.upl-chip-rec { border-color: #fecdd3; background: #fff1f2; }

/* ===== §10.454 — شاشةُ تحميل الذكاء الاصطناعيّ (ثيماتٌ وخلفيّات) =====
   منقولةٌ من مثال صاحب العمل بقياسات الحاوية (`cqmin`/`cqw`) — الشكلُ نفسُه في إبهامٍ وملءِ شاشة.
   ألوانُ جيميناي محصورةٌ هنا داخل `.ldr` وحدَه؛ واجهةُ الإعدادات ببنفسجيّ العلامة. */
/* 🔴 الحاويةُ لا تضبط `position`: كانت `relative` فغلبت `fixed` في `.bsy-screen` (الصنفان بوزنٍ واحد
   والمتأخّرُ يفوز) ⇒ المؤشّرُ بثيمٍ صار عنصراً بلا ارتفاعٍ في ذيل الصفحة — **لا يُرى**. رآه صاحبُ
   العمل («ما طلع الـLoading»)، وjsdom لا يحسب تخطيطاً. *صنفٌ مساعدٌ يضبط الموضعَ يغلب صاحبَه.* */
.ldr-host { container-type: size; overflow: hidden; }
.ldr { position: absolute; inset: 0; display: grid; place-items: center; background: #06060C; overflow: hidden; direction: rtl;
  --blue: #4285F4; --cyan: #1BA1E3; --violet: #9168C0; --rose: #D96570; --amber: #F2A60C;
  --txt: #F2F2F7; --txt-2: rgba(242,242,247,.55); --line-bg: rgba(242,242,247,.14); --shim: #5A5A6B; }
.ldr.light { background: #FFFFFF; --txt: #15131F; --txt-2: rgba(21,19,31,.55); --line-bg: rgba(21,19,31,.1); --shim: #C3C3CE; }
.ldr .stage { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 6cqmin; padding: 4cqmin; text-align: center; color: var(--txt); font-family: inherit; }
.ldr .title { margin: 0; font-size: clamp(8px, 6.4cqmin, 30px); font-weight: 600; line-height: 1.5; }
.ldr .status { margin: 0; font-size: clamp(6px, 3.6cqmin, 17px); font-weight: 400; color: var(--txt-2); transition: opacity .3s ease; }
.ldr .meta { margin: 0; font-size: clamp(5px, 3.1cqmin, 14px); color: var(--txt-2); font-variant-numeric: tabular-nums; }
@keyframes ldr-spin { to { transform: rotate(360deg); } }
.ldr .veil { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, rgba(6,6,12,.6) 0%, rgba(6,6,12,.8) 55%, rgba(6,6,12,.94) 100%); }
.ldr.light .veil { background: radial-gradient(ellipse at 50% 48%, rgba(255,255,255,.5) 0%, rgba(255,255,255,.72) 55%, rgba(255,255,255,.92) 100%); }
.ldr .bg { position: absolute; inset: 0; z-index: 1; }
.ldr .bg-aurora { filter: blur(13cqmin); }
.ldr .bg-aurora span { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: .85; }
.ldr .bg-aurora span:nth-child(1) { width: 62cqmin; height: 62cqmin; top: -12cqmin; right: 2cqmin; background: radial-gradient(circle, var(--blue), transparent 68%); animation: ldr-d1 22s ease-in-out infinite; }
.ldr .bg-aurora span:nth-child(2) { width: 54cqmin; height: 54cqmin; bottom: -12cqmin; left: -4cqmin; background: radial-gradient(circle, var(--violet), transparent 68%); animation: ldr-d2 26s ease-in-out infinite; }
.ldr .bg-aurora span:nth-child(3) { width: 46cqmin; height: 46cqmin; top: 22cqmin; left: 26cqmin; background: radial-gradient(circle, var(--rose), transparent 68%); animation: ldr-d3 19s ease-in-out infinite; }
.ldr .bg-aurora span:nth-child(4) { width: 40cqmin; height: 40cqmin; bottom: 2cqmin; right: 22cqmin; background: radial-gradient(circle, var(--cyan), transparent 68%); animation: ldr-d4 24s ease-in-out infinite; }
.ldr .bg-aurora span:nth-child(5) { width: 32cqmin; height: 32cqmin; top: 4cqmin; left: 8cqmin; background: radial-gradient(circle, var(--amber), transparent 66%); opacity: .6; animation: ldr-d5 30s ease-in-out infinite; }
@keyframes ldr-d1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-12cqmin,10cqmin,0) scale(1.18); } }
@keyframes ldr-d2 { 0%,100% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(11cqmin,-12cqmin,0) scale(.88); } }
@keyframes ldr-d3 { 0%,100% { transform: translate3d(0,0,0) scale(.95); } 50% { transform: translate3d(13cqmin,8cqmin,0) scale(1.2); } }
@keyframes ldr-d4 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-10cqmin,-11cqmin,0) scale(1.14); } }
@keyframes ldr-d5 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(8cqmin,12cqmin,0) scale(1.1); } }
.ldr .bg-flow { background: linear-gradient(120deg, var(--blue), var(--cyan), var(--violet), var(--rose), var(--amber), var(--blue)); background-size: 420% 420%; animation: ldr-creep 18s ease infinite; }
@keyframes ldr-creep { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ldr .bg-swirl::before { content: ""; position: absolute; inset: -45%; background: conic-gradient(from 0deg, var(--blue), var(--violet), var(--rose), var(--amber), var(--cyan), var(--blue)); filter: blur(11cqmin); animation: ldr-spin 26s linear infinite; }
.ldr .bg-stripes::before { content: ""; position: absolute; inset: -60%; background: repeating-linear-gradient(115deg, rgba(66,133,244,.55) 0 12cqmin, rgba(27,161,227,.55) 12cqmin 24cqmin, rgba(145,104,192,.55) 24cqmin 36cqmin, rgba(217,101,112,.55) 36cqmin 48cqmin, rgba(242,166,12,.55) 48cqmin 60cqmin); filter: blur(8cqmin); animation: ldr-slide 16s linear infinite; }
@keyframes ldr-slide { from { transform: translateX(0); } to { transform: translateX(-60cqmin); } }
.ldr .bg-soft::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(48cqmin 44cqmin at 20% 18%, rgba(66,133,244,.32), transparent 62%), radial-gradient(46cqmin 42cqmin at 82% 76%, rgba(217,101,112,.3), transparent 62%), radial-gradient(42cqmin 38cqmin at 74% 16%, rgba(242,166,12,.28), transparent 62%), radial-gradient(44cqmin 38cqmin at 16% 84%, rgba(145,104,192,.28), transparent 62%); filter: blur(5cqmin); animation: ldr-floaty 16s ease-in-out infinite; }
@keyframes ldr-floaty { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(5cqmin,-4cqmin,0) scale(1.1); } }
.ldr .spark { width: 32cqmin; height: 32cqmin; overflow: visible; animation: ldr-breathe 3.4s ease-in-out infinite; }
.ldr .spark .core { transform-origin: 50% 50%; animation: ldr-spin 14s linear infinite; }
@keyframes ldr-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.ldr .halo { position: absolute; top: 2cqmin; width: 44cqmin; height: 44cqmin; border-radius: 50%; background: conic-gradient(from 0deg, var(--blue), var(--violet), var(--rose), var(--amber), var(--cyan), var(--blue)); filter: blur(8cqmin); opacity: .5; animation: ldr-spin 8s linear infinite; }
.ldr .grid { display: grid; gap: 3.1cqmin; }
.ldr .grid span { width: 2.2cqmin; height: 2.2cqmin; border-radius: 50%; animation: ldr-ripple 2.6s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes ldr-ripple { 0%,70%,100% { transform: scale(.7); opacity: .16; } 22% { transform: scale(1.7); opacity: 1; } }
.ldr .shimmer { margin: 0; font-size: clamp(9px, 9cqmin, 44px); font-weight: 700; line-height: 1.45; background: linear-gradient(115deg, var(--shim) 18%, var(--blue) 33%, var(--violet) 45%, var(--rose) 57%, var(--amber) 67%, var(--shim) 84%); background-size: 280% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ldr-sweep 3.1s linear infinite; }
@keyframes ldr-sweep { 0% { background-position: 280% 0; } 100% { background-position: -60% 0; } }
.ldr .line { width: 70cqmin; height: max(2px, .55cqmin); border-radius: 99px; background: var(--line-bg); overflow: hidden; direction: ltr; }
.ldr .line b { display: block; width: 38%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--violet), var(--rose), var(--amber)); animation: ldr-shuttle 1.8s cubic-bezier(.65,0,.35,1) infinite; }
@keyframes ldr-shuttle { 0% { transform: translateX(-110%); } 100% { transform: translateX(370%); } }
.ldr .edgeglow { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.ldr .edgeglow::before { content: ""; position: absolute; inset: -18cqmin; background: conic-gradient(from 0deg, var(--blue), var(--violet), var(--rose), var(--amber), var(--cyan), var(--blue)); filter: blur(8cqmin); animation: ldr-spin 7s linear infinite; }
.ldr .edgeglow::after { content: ""; position: absolute; inset: 4cqmin; border-radius: 6cqmin; background: #06060C; }
.ldr .dots { display: flex; gap: 1.8cqmin; }
.ldr .dots i { width: 1.8cqmin; height: 1.8cqmin; border-radius: 50%; background: var(--txt); opacity: .3; animation: ldr-blink 1.4s ease-in-out infinite; }
.ldr .dots i:nth-child(2) { animation-delay: .2s; } .ldr .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ldr-blink { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1cqmin); } }
.ldr .bars { display: flex; align-items: center; gap: 2.7cqmin; height: 20cqmin; }
.ldr .bars i { width: 2.7cqmin; height: 6cqmin; border-radius: 99px; animation: ldr-wave 1.15s ease-in-out infinite; }
.ldr .bars i:nth-child(1) { background: var(--blue); } .ldr .bars i:nth-child(2) { background: var(--cyan); animation-delay: .11s; }
.ldr .bars i:nth-child(3) { background: var(--violet); animation-delay: .22s; } .ldr .bars i:nth-child(4) { background: var(--rose); animation-delay: .33s; }
.ldr .bars i:nth-child(5) { background: var(--amber); animation-delay: .44s; }
@keyframes ldr-wave { 0%,100% { height: 6cqmin; opacity: .55; } 50% { height: 19cqmin; opacity: 1; } }
.ldr .orbit { position: relative; width: 44cqmin; height: 44cqmin; display: grid; place-items: center; }
.ldr .orbit .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg, var(--blue) 70deg, var(--violet) 150deg, var(--rose) 220deg, var(--amber) 290deg, transparent 340deg); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .8cqmin), #000 calc(100% - .8cqmin)); mask: radial-gradient(farthest-side, transparent calc(100% - .8cqmin), #000 calc(100% - .8cqmin)); animation: ldr-spin 2.6s linear infinite; }
.ldr .orbit .ring.inner { inset: 7cqmin; animation-duration: 4.2s; animation-direction: reverse; opacity: .7; }
.ldr .orbit .pct { font-size: clamp(7px, 4.6cqmin, 21px); font-weight: 600; font-variant-numeric: tabular-nums; }
.ldr .blob { position: absolute; z-index: 1; width: 46cqmin; height: 46cqmin; top: 12cqmin; background: linear-gradient(135deg, var(--blue), var(--violet), var(--rose), var(--amber)); background-size: 300% 300%; animation: ldr-morph 8s ease-in-out infinite, ldr-hue 11s ease infinite; }
.ldr .blob.two { width: 30cqmin; height: 30cqmin; opacity: .55; filter: blur(6cqmin); animation-direction: reverse; }
@keyframes ldr-morph { 0%,100% { border-radius: 62% 38% 45% 55%/48% 60% 40% 52%; transform: rotate(0) scale(1); } 33% { border-radius: 38% 62% 60% 40%/58% 42% 58% 42%; transform: rotate(120deg) scale(1.06); } 66% { border-radius: 52% 48% 35% 65%/40% 55% 45% 60%; transform: rotate(240deg) scale(.96); } }
@keyframes ldr-hue { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.ldr[data-theme-id="blob"] .stage { margin-top: 36cqmin; }
.ldr .ribbon { width: 86cqw; height: 36cqmin; overflow: hidden; }
.ldr .ribbon path { fill: none; stroke-width: 5; stroke-linecap: round; animation: ldr-flow 5s linear infinite; }
.ldr .ribbon path:nth-child(2) { animation-duration: 6.6s; opacity: .7; } .ldr .ribbon path:nth-child(3) { animation-duration: 8.4s; opacity: .45; }
@keyframes ldr-flow { from { transform: translateX(0); } to { transform: translateX(-800px); } }
.ldr .skcard { width: 60cqw; background: #fff; border-radius: 4.5cqmin; padding: 6cqmin 5.5cqmin; box-shadow: 0 4cqmin 10cqmin rgba(21,19,31,.12); text-align: right; }
.ldr .skcard h3 { margin: 0 0 .6cqmin; font-size: clamp(6px, 4cqmin, 18px); font-weight: 600; color: #15131F; }
.ldr .skcard .hint { margin: 0 0 4cqmin; font-size: clamp(5px, 3.1cqmin, 13px); color: rgba(21,19,31,.45); }
.ldr .skrow { display: flex; align-items: center; gap: 3cqmin; padding: 2.6cqmin 0; border-top: 1px solid rgba(21,19,31,.07); animation: ldr-riseloop 6s ease-in-out infinite; }
.ldr .skrow:nth-child(4) { animation-delay: .2s; } .ldr .skrow:nth-child(5) { animation-delay: .4s; } .ldr .skrow:nth-child(6) { animation-delay: .6s; }
@keyframes ldr-riseloop { 0%,6% { opacity: 0; transform: translateY(1.6cqmin); } 16%,92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.ldr .skrow .tag { width: 2.2cqmin; height: 2.2cqmin; border-radius: 50%; flex: none; }
.ldr .skrow .sk { height: 2.4cqmin; border-radius: 99px; flex: 1; background: linear-gradient(90deg, #E9E9F0 25%, #F7F7FB 50%, #E9E9F0 75%); background-size: 220% 100%; animation: ldr-shine 1.5s linear infinite; }
.ldr .skrow .sk.short { flex: 0 0 32%; }
@keyframes ldr-shine { from { background-position: 220% 0; } to { background-position: -20% 0; } }
.ldr .steps { display: flex; flex-direction: column; width: 52cqw; text-align: right; }
.ldr .step { display: flex; align-items: center; gap: 3cqmin; padding: 3cqmin .8cqmin; font-size: clamp(6px, 3.8cqmin, 17px); color: var(--txt); opacity: .3; animation: ldr-stepOn 10s linear infinite; }
.ldr .step .mark { position: relative; width: 5.2cqmin; height: 5.2cqmin; border-radius: 50%; flex: none; border: max(1.5px, .55cqmin) solid currentColor; }
.ldr .step .mark::after { content: ""; position: absolute; inset: -.5cqmin; border-radius: 50%; background: var(--c); opacity: 0; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 13l4 4 10-10' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/70% no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 13l4 4 10-10' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/70% no-repeat; animation: ldr-markOn 10s linear infinite; }
.ldr .step:nth-child(2), .ldr .step:nth-child(2) .mark::after { animation-delay: 2s; } .ldr .step:nth-child(3), .ldr .step:nth-child(3) .mark::after { animation-delay: 4s; }
.ldr .step:nth-child(4), .ldr .step:nth-child(4) .mark::after { animation-delay: 6s; } .ldr .step:nth-child(5), .ldr .step:nth-child(5) .mark::after { animation-delay: 8s; }
@keyframes ldr-stepOn { 0% { opacity: .28; } 1%,19% { opacity: 1; } 20%,100% { opacity: .55; } }
@keyframes ldr-markOn { 0%,19% { opacity: 0; } 20%,100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ldr *, .ldr *::before, .ldr *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* المؤشّرُ ملءَ الشاشة بثيمٍ: الحاجزُ نفسُه حاويةٌ للقياس. */
.bsy-screen.is-ldr { container-type: size; background: #06060C; backdrop-filter: none; -webkit-backdrop-filter: none; }
.bsy-screen.is-ldr .bsy-ldr-note { position: absolute; bottom: 1.2rem; inset-inline: 0; text-align: center; font-size: .75rem; color: rgba(242,242,247,.6); z-index: 4; margin: 0; }
/* واجهةُ الإعدادات — بنفسجيُّ العلامة. */
.ldr-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; }
.ldr-theme { position: relative; padding: 0; background: none; border: 0; cursor: pointer; text-align: right; border-radius: .9rem; font-family: inherit; }
.ldr-theme .thumb { position: relative; width: 100%; aspect-ratio: 16/10; border-radius: .8rem; overflow: hidden; border: 2px solid #e2e8f0; transition: border-color .2s, transform .2s; }
.ldr-theme:hover .thumb { transform: translateY(-2px); }
.ldr-theme[aria-pressed="true"] .thumb { border-color: var(--brand, #533F99); box-shadow: 0 0 0 4px rgba(83,63,153,.12); }
.ldr-theme .name { display: block; margin-top: .45rem; font-size: .85rem; font-weight: 600; color: #0f172a; }
.ldr-theme .tag { display: block; font-size: .72rem; color: #64748b; line-height: 1.5; }
.ldr-theme .check { position: absolute; top: .5rem; left: .5rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--brand, #533F99); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.7); transition: .2s; }
.ldr-theme[aria-pressed="true"] .check { opacity: 1; transform: none; }
.ldr-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .85rem .4rem .6rem; border-radius: 999px; cursor: pointer; background: none; border: 1.5px solid #e2e8f0; color: #0f172a; font-size: .85rem; font-family: inherit; transition: .18s; }
.ldr-chip:hover { border-color: rgba(83,63,153,.35); }
.ldr-chip[aria-pressed="true"] { border-color: var(--brand, #533F99); background: rgba(83,63,153,.08); }
.ldr-chip:disabled { opacity: .4; cursor: not-allowed; }
.ldr-chip .swatch { width: 1.1rem; height: 1.1rem; border-radius: 50%; flex: none; border: 1px solid #e2e8f0; }
.ldr-preview { position: relative; width: 100%; aspect-ratio: 16/10; border-radius: .9rem; overflow: hidden; border: 1px solid #e2e8f0; }
.ldr-full { position: fixed; inset: 0; z-index: 9998; }
.ldr-full .exit { position: absolute; z-index: 10; top: 1.2rem; left: 1.2rem; background: rgba(120,120,140,.28); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.1rem; font-size: .85rem; cursor: pointer; font-family: inherit; }

/* ===== §10.486 (الخطّة ٧.٤) — ابنُ الشبكة يستطيع أن يضيق =====
   🔴 القياسُ بمتصفّحٍ حقيقيٍّ على عرض ٣٩٠px: إحدى وثلاثون شاشةً نظيفة، **والرئيسيّة تدفع الصفحةَ
   ٢٦px**. والسببُ ليس عرضاً مكتوباً: شبكةٌ عرضُها ٣٥٨px حَسَبت عمودَها **٣٩٩٫٥px**، لأنّ
   `min-width` لابن الشبكة `auto` افتراضاً فلا ينزل تحت محتواه، فيتمدّد العمودُ ليسعَه.
   > **ابنٌ لا يستطيع أن يضيق يُوسِّع أباه، والأبُ يُوسِّع الصفحةَ فتُمرَّر أفقيّاً.**
   والعلاجُ سطرٌ واحدٌ عامّ: `min-width: 0`. وقد جُرِّب الاثنان (هذا · و`minmax(0,1fr)` للعمود)
   فأعادا ٢٦ إلى صفر — واختير هذا لأنّه **لا يفرض عدداً للأعمدة** فلا يُعطِّل `grid-cols-*`.
   ⚠️ وما يجب أن **يُمرَّر داخلَه** (جدولٌ عريضٌ · شريطُ تبويبات) له `overflow-x` بنفسِه، فيبقى
   على حاله: *قاعدةٌ تمنع التمريرَ حيث يلزم تُخفي بياناتٍ بدل أن تُظهرها.* */
.grid > * { min-width: 0; }

/* ===== §10.487 (الخطّة ٧.٤) — الصفُّ الذي ينقر يقول إنّه ينقر =====
   *مِقبَضٌ لا يبدو مِقبَضاً لا يُمسَك* — فالصفُّ ذو الوجهة يُظهِر مؤشّرَ اليد ويستجيب للمرور.
   ⚠️ ولا يُبدَّل لونُ نصّه: *صفٌّ يُصبَغ كلُّه رابطاً يُلغي تمييزَ الرابط الذي فيه.* */
.tbl-row-link { cursor: pointer; }
.tbl tbody tr.tbl-row-link:hover { background: #f8fafc; }
@media (max-width: 640px) {
  /* وعلى الهاتف الصفُّ بطاقةٌ — فالاستجابةُ للمسّ لا للمرور. */
  .tbl-cards tr.tbl-row-link:active { background: #f1f5f9; }
}

/* §10.502 — حقلُ المرفق: منطقةٌ تقول ما تقبل وتُسحَب إليها */
.drop-zone { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem .9rem;
  border: 1.5px dashed #cbd5e1; border-radius: .75rem; background: #f8fafc; transition: border-color .12s, background .12s; }
.drop-zone:hover, .drop-zone:focus-within { border-color: var(--brand); background: #f1f5f9; }
.drop-zone.is-over { border-color: var(--brand); background: #eef2ff; border-style: solid; }
.drop-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem;
  border-radius: .6rem; background: #e2e8f0; color: #475569; flex: 0 0 auto; }
.drop-zone:hover .drop-ico, .drop-zone.is-over .drop-ico { background: var(--brand); color: #fff; }
.drop-tx { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.drop-main { font-weight: 700; color: #0f172a; font-size: .9rem; }
.drop-sub { font-size: .78rem; color: #64748b; }
.drop-hint { font-size: .72rem; color: #94a3b8; }
/* §10.509 — مصفوفةُ الأدوار: الأدوارُ أعمدةٌ والموديولاتُ صفوف */
.perm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e2e8f0; border-radius: .75rem; }
.perm-matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .8rem; }
.perm-matrix th, .perm-matrix td { border-bottom: 1px solid #f1f5f9; }
.perm-matrix thead th { position: sticky; top: 0; background: #f8fafc; z-index: 2; vertical-align: bottom; padding: .4rem .3rem; }
.perm-th-in { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 4.6rem; }
.perm-th-name { font-weight: 700; color: #334155; font-size: .72rem; line-height: 1.2; text-align: center; white-space: normal; }
.perm-mod { text-align: start; font-weight: 500; color: #475569; padding: .3rem .6rem; white-space: nowrap; position: sticky; inset-inline-start: 0; background: #fff; z-index: 1; }
.perm-corner { background: #f8fafc; z-index: 3; }
.perm-group th { text-align: start; background: #f1f5f9; color: #64748b; font-size: .7rem; font-weight: 700; padding: .25rem .6rem; letter-spacing: .02em; }
.perm-cell { text-align: center; padding: .15rem; }
.perm-cell input { width: 1rem; height: 1rem; accent-color: var(--brand); cursor: pointer; }
.perm-row:hover td, .perm-row:hover .perm-mod { background: #fafafa; }
/* §10.520 — جدولُ الذكاء للدور: صفٌّ لكلّ دورٍ وعمودٌ لكلّ ضبط، كأخيه جدولِ الشاشات. */
.ai-roles .ai-th { text-align: center; font-weight: 700; color: #334155; font-size: .74rem; padding: .45rem .5rem; white-space: nowrap; }
.ai-roles .perm-mod { vertical-align: middle; min-width: 9rem; }
.ai-roles .perm-mod b { display: block; }
.ai-roles .ai-cell { text-align: center; vertical-align: middle; padding: .35rem .5rem; white-space: nowrap; }
.ai-roles .ai-cell .perm-item { display: inline-flex; margin: 0 .15rem; }
.ai-roles .ai-cell .btn-sm { white-space: nowrap; }
.ai-roles .ai-cell select.inp { width: auto; min-width: 9.5rem; }
.ai-role-row:hover td, .ai-role-row:hover .perm-mod { background: #fafafa; }
/* §10.525 — بطاقةُ المزوّد في «المزوّدُ والمفتاح»: شعارٌ (أو حرفٌ) · اسمٌ وحالةٌ · حقلٌ وزرٌّ في صفٍّ واحدٍ على العريض. */
.provider-card { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; background: #f8fafc; border: 1px solid #eef2f6; border-radius: .85rem; padding: .65rem .85rem; }
.provider-head { display: flex; align-items: center; gap: .7rem; flex: 0 1 17rem; min-width: 0; }
.provider-form { display: flex; align-items: center; gap: .5rem; flex: 1 1 18rem; min-width: 0; }
.provider-tile { position: relative; flex: none; width: 2.6rem; height: 2.6rem; border-radius: .7rem; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid #e2e8f0; }
.provider-mono { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1; color: #fff; }
.provider-tile-amber { background: #c2410c; border-color: #c2410c; }
.provider-tile-blue { background: #1d4ed8; border-color: #1d4ed8; }
.provider-tile-emerald { background: #0f172a; border-color: #0f172a; }
.provider-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: .35rem; background: #fff; display: none; }
.provider-tile.has-logo { background: #fff; border-color: #e2e8f0; }
.provider-tile.has-logo .provider-logo { display: block; }
.provider-tile.has-logo .provider-mono { visibility: hidden; }

/* §10.533 — سجلُّ البند (خطٌّ رأسيٌّ بنقاطٍ ملوّنةٍ بنوع الحدث) وجدولُ جدولة البنود دفعةً. */
.item-log { display: flex; flex-direction: column; gap: .1rem; }
.item-log-row { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; position: relative; }
.item-log-row + .item-log-row { border-top: 1px dashed #eef2f6; }
.item-log-dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; margin-top: .35rem; background: #cbd5e1; box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e2e8f0; }
.item-log-row.t-brand .item-log-dot { background: var(--brand); }
.item-log-row.t-green .item-log-dot { background: #16a34a; }
.item-log-row.t-amber .item-log-dot { background: #d97706; }
.item-log-row.t-red .item-log-dot { background: #dc2626; }
.bulk-sched { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.bulk-sched th { text-align: start; font-size: .72rem; color: #64748b; font-weight: 700; padding: .4rem .5rem; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.bulk-sched td { padding: .4rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.bulk-sched .bulk-all th { background: #f8fafc; }
.bulk-sched input, .bulk-sched select { min-width: 9rem; }
/* 🔴 §10.543ج — حقلُ التاريخ كان ينضغط حتّى يُقرأ «07/0»: القاعدةُ العامّةُ أعلاه تصيب `input`
   بينما `.date-box > .date-txt` تحمل `min-width:0` بأسبقيّةٍ أعلى، فينكمش النصُّ إلى لا شيء
   حين يضيق العمود (وقد ضاق بإضافة عمود «من» في §10.543ب). الحدُّ يُوضَع على **الغلاف**:
   *حدٌّ يُوضَع حيث لا يُقرأ لا يحرس شيئاً.* */
.bulk-sched .date-fld { min-width: 9.5rem; }
.bulk-sched td:first-child, .bulk-sched th:first-child { min-width: 8rem; }
.bulk-sched .bulk-closed td { opacity: .6; }

/* §10.534 — عارضُ النشاط الواحد (A + B + D من تصاميمه): فواصلُ أيّامٍ لاصقة · أيقونةٌ بلون النوع · شارةُ مرحلة ·
   صندوقُ ملاحظة · مجموعاتٌ بحسب البند بشريط مراحل · لوحةُ أرقامٍ جانبيّة. */
.af { display: flex; flex-direction: column; gap: .75rem; }
.af-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.af-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.af-chip { border: 1px solid #e7e5f0; background: #fff; color: #6c7086; border-radius: 999px; padding: .28rem .8rem; font-size: .78rem; font-family: inherit; cursor: pointer; transition: .15s; }
.af-chip:hover { border-color: var(--brand); color: var(--brand); }
.af-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.af-search { width: 11rem; margin-inline-start: auto; }
.af-split { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .af-split { grid-template-columns: 1fr; } }
.af-list { min-width: 0; }
.af-rows { display: flex; flex-direction: column; }
.af-day { display: flex; align-items: center; gap: .75rem; margin: .9rem 0 .5rem; position: sticky; top: 0; z-index: 2; background: linear-gradient(#fff 72%, rgba(255,255,255,0)); padding: .35rem 0 .3rem; }
.af-day span { font-size: .76rem; font-weight: 800; color: var(--brand); background: #f3f0fc; border-radius: 999px; padding: .2rem .8rem; }
.af-day i { flex: 1; height: 1px; background: #e7e5f0; display: block; }
.af-row { display: flex; gap: .7rem; position: relative; padding: .35rem 0 .85rem; }
.af-row::before { content: ""; position: absolute; inset-inline-start: .9rem; top: 2.2rem; bottom: 0; width: 2px; background: #eeebf6; }
.af-rows > :last-child .af-row::before, .af-grp .af-rows > .af-row:last-child::before { display: none; }
.af-ico { width: 1.85rem; height: 1.85rem; border-radius: .55rem; display: grid; place-items: center; flex: none; background: #f1f5f9; color: #475569; }
.af-ico.t-green { background: #e5f5ee; color: #2f9e71; } .af-ico.t-teal { background: #e6f7f2; color: #1f7d68; }
.af-ico.t-amber { background: #fff8dc; color: #8a6d00; } .af-ico.t-orange { background: #fdede8; color: #f04923; }
.af-ico.t-blue { background: #e8f1fa; color: #3b82c4; } .af-ico.t-indigo, .af-ico.t-brand { background: #f3f0fc; color: var(--brand); }
.af-ico.t-red, .af-ico.t-rose { background: #fee2e2; color: #b91c1c; } .af-ico.t-slate { background: #f1f5f9; color: #475569; }
.af-line { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .9rem; line-height: 1.6; }
.af-row > div > span:first-child { font-size: .9rem; line-height: 1.6; color: #1f2233; }
.af-arrow { color: #9a94b5; font-family: 'Space Grotesk', system-ui, sans-serif; }
.af-pill { border-radius: 999px; padding: .1rem .6rem; font-size: .74rem; font-weight: 700; white-space: nowrap; background: #e8f1fa; color: #3b82c4; }
.af-pill.t-green { background: #e5f5ee; color: #2f9e71; } .af-pill.t-teal { background: #e6f7f2; color: #1f7d68; }
.af-pill.t-amber { background: #fff8dc; color: #8a6d00; } .af-pill.t-orange { background: #fdede8; color: #f04923; }
.af-pill.t-red { background: #fee2e2; color: #b91c1c; } .af-pill.t-slate { background: #f1f5f9; color: #475569; }
.af-note { margin-top: .4rem; background: #fbfafe; border: 1px solid #e7e5f0; border-inline-start: 3px solid #f04923; border-radius: .6rem; padding: .45rem .7rem; font-size: .82rem; line-height: 1.75; color: #6c7086; }
.af-note-edit { border-inline-start-color: #d97706; }
.af-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .2rem; font-size: .74rem; color: #9a94b5; }
.af-time { font-family: 'Space Grotesk', system-ui, sans-serif; direction: ltr; }
.af-sep { opacity: .7; }
.af-side { display: flex; flex-direction: column; gap: .5rem; background: #fbfafe; border: 1px solid #e7e5f0; border-radius: .9rem; padding: .8rem; }
.af-stat { background: #fff; border: 1px solid #e7e5f0; border-radius: .75rem; padding: .6rem .75rem; }
.af-stat-k { font-size: .74rem; color: #6c7086; margin-bottom: .15rem; }
.af-stat-v { font-size: 1.3rem; font-weight: 700; font-family: 'Space Grotesk', system-ui, sans-serif; direction: ltr; text-align: start; color: #1f2233; }
.af-stat-v.t-amber { color: #8a6d00; } .af-stat-v.t-orange { color: #f04923; }
.af-bar { height: 6px; border-radius: 99px; background: #e7e5f0; overflow: hidden; margin-top: .45rem; }
.af-bar i { display: block; height: 100%; background: var(--brand); }
.af-groups { display: flex; flex-direction: column; }
.af-grp { border-bottom: 1px solid #e7e5f0; }
.af-grp:last-child { border-bottom: 0; }
.af-grp-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .2rem; cursor: pointer; flex-wrap: wrap; transition: .15s; }
.af-grp-head:hover { background: #fbfafe; }
.af-grp-head b { font-size: .92rem; }
.af-chev { color: #9a94b5; transition: .2s; display: inline-flex; }
.af-grp.open .af-chev { transform: rotate(180deg); }
.af-grp-body { display: none; padding: 0 .2rem .8rem 2.6rem; }
.af-grp.open .af-grp-body { display: block; }
.af-rail { margin: .2rem 0 .7rem; overflow-x: auto; }

/* §10.535 — سجلُّ البند بتصميم A + B: شريطُ ملخّص · شريطُ مراحل · فواصلُ مدّة · عمودُ نسخ الملفّ. */
.il { display: flex; flex-direction: column; gap: .7rem; }
/* §10.545 — نافذةُ السجلّ: مقاسُها هي (قائمةٌ رأسيّةٌ تُقرأ)، لا مقاسُ جدولِ الجدولة. */
.modal-box.modal-log { max-width: min(880px, 94vw); }
/* والعناصرُ تُمسَك في صندوقَين: ترويسةٌ ثمّ لوحُ أحداثٍ له سقفٌ يُمرَّر داخلَه. */
.il-head { background: #fbfafe; border: 1px solid #e7e5f0; border-radius: .9rem; padding: .75rem .85rem; display: flex; flex-direction: column; gap: .7rem; }
.il-head .il-summary { border: 0; background: #e7e5f0; }
.il-main { margin-top: .9rem; display: flex; flex-direction: column; gap: .6rem; }
/* 🔴 §10.545ب — **ممرّانِ رأسيّان في نافذةٍ واحدة.** `.modal-body` تُمرَّر أصلاً (68vh)، فسقفٌ
   ثانٍ على لوح الأحداث أنتج شريطَي تمريرٍ متجاورَين: أيُّهما يُحرَّك؟ (بلاغُه بصورة).
   *ممرّان متداخلان يجعلان القارئَ يجرّب أيَّهما يستجيب.* فالممرُّ واحدٌ (ممرُّ النافذة)،
   **والترويسةُ تلتصق في أعلاه** فتبقى ممسوكةً وهي الغايةُ من صندوقها. */
.il-scroll { padding-inline-end: .2rem; }
.il-head { position: sticky; top: -1.2rem; z-index: 2; }
.il-crumb { font-size: .78rem; color: #9a94b5; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.il-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #e7e5f0; border: 1px solid #e7e5f0; border-radius: .8rem; overflow: hidden; }
@media (max-width: 700px) { .il-summary { grid-template-columns: repeat(2, 1fr); } }
.il-sm { background: #fbfafe; padding: .6rem .85rem; }
.il-k { font-size: .74rem; color: #6c7086; margin-bottom: .15rem; }
.il-v { font-size: 1rem; font-weight: 700; color: #1f2233; }
.il-v small { font-size: .72rem; font-weight: 400; color: #6c7086; }
.il-rail { overflow-x: auto; padding: .1rem 0; }
.il-split { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 1rem; align-items: start; }
@media (max-width: 820px) { .il-split { grid-template-columns: 1fr; } }
.il-list { min-width: 0; }
.il-list .af-row + .af-row::before, .il-list .af-row::before { display: none; }
.il-gap { display: flex; align-items: center; gap: .5rem; margin: -.3rem 0 .6rem; padding-inline-start: 2.6rem; font-size: .72rem; color: #9a94b5; }
.il-gap i { flex: 1; height: 0; border-top: 1px dashed #e7e5f0; display: block; }
.il-gap b { background: #fbfafe; border: 1px solid #e7e5f0; border-radius: 999px; padding: .1rem .6rem; font-family: 'Space Grotesk', system-ui, sans-serif; direction: ltr; font-weight: 500; color: #6c7086; }
.il-gap.slow b { background: #fdede8; border-color: #f6c8b8; color: #f04923; }
.il-att { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #e7e5f0; background: #fff; border-radius: .6rem; padding: .25rem .6rem; font-size: .76rem; margin-top: .35rem; color: #1f2233; text-decoration: none; }
a.il-att:hover { border-color: var(--brand); color: var(--brand); }
.il-client { color: #1f7d68; font-weight: 700; }
.il-side { background: #fbfafe; border: 1px solid #e7e5f0; border-radius: .9rem; padding: .7rem; display: flex; flex-direction: column; gap: .45rem; }
.il-side-h { font-size: .76rem; font-weight: 700; color: #6c7086; }
.il-ver { background: #fff; border: 1px solid #e7e5f0; border-radius: .7rem; padding: .5rem .65rem; cursor: pointer; transition: .15s; }
.il-ver:hover { border-color: var(--brand); }
.il-ver-t { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .82rem; }
.il-ver-s { font-size: .72rem; color: #6c7086; margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.il-flash { animation: il-flash 1.2s ease-out; border-radius: .6rem; }
@keyframes il-flash { 0% { background: #f3f0fc; } 100% { background: transparent; } }

/* §10.536 — عروضُ البنود الأربعة (A خطٌّ زمنيّ · B قائمةٌ مضغوطة · C لوح · D تقويم) وشريطُ التقدّم ومبدّلُ العرض. */
.iv-strip { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: #6c7086; background: #fbfafe; border: 1px solid #e7e5f0; border-radius: .8rem; padding: .5rem .9rem; margin-bottom: .75rem; }
.iv-strip b { font-family: 'Space Grotesk', system-ui, sans-serif; color: #1f2233; font-weight: 700; }
.iv-strip .t-amber, .iv-strip .t-amber b { color: #8a6d00; } .iv-strip .t-red, .iv-strip .t-red b { color: #b91c1c; } .iv-strip .t-orange, .iv-strip .t-orange b { color: #f04923; }
.iv-seg { display: inline-flex; background: #f4f2fa; border-radius: .75rem; padding: 3px; gap: 2px; }
.iv-seg button { border: 0; background: transparent; font-family: inherit; font-size: .84rem; color: #6c7086; padding: .35rem .8rem; border-radius: .6rem; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: .35rem; }
.iv-seg button.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.iv-av { width: 1.45rem; height: 1.45rem; border-radius: 50%; background: #d9d4ea; color: #4a4460; display: inline-grid; place-items: center; font-size: .68rem; font-weight: 700; flex: none; }
.iv-av.none { background: #fff; border: 1.5px dashed #e7e5f0; color: #9a94b5; }
.iv-av.pool { background: #e6f7f2; color: #1f7d68; }   /* §10.538 — حوضُ الدور */
.iv-av.ex { box-shadow: 0 0 0 2px #f04923; }   /* استثناءٌ خارجَ الدور */
.bulk-sched tr.is-cur td { background: #f8f6fd; }
/* §10.539ب — صفٌّ مجدولٌ خارجَ فترةِ المشروع يُرى قبل أن يُقرأ. */
.bulk-sched tr.is-outside td { background: #fff7ed; }
.af-pill.t-brand { background: #f3f0fc; color: var(--brand); } .af-pill.t-plan { background: #f1f0f5; color: #9a94b5; }
/* A — Gantt */
.gt-wrap { overflow-x: auto; border: 1px solid #e7e5f0; border-radius: .9rem; }
.gt { min-width: 760px; }
.gt-head, .gt-row { display: grid; grid-template-columns: 250px 1fr; }
.gt-head { background: #fbfafe; border-bottom: 1px solid #e7e5f0; position: sticky; top: 0; z-index: 3; }
.gt-l { padding: .55rem 1rem; font-size: .78rem; color: #6c7086; border-inline-end: 1px solid #e7e5f0; }
.gt-days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.gt-days > div { text-align: center; padding: .4rem 0; font-size: .74rem; color: #6c7086; border-inline-end: 1px solid #f1eff8; font-family: 'Space Grotesk', system-ui, sans-serif; }
.gt-days > div small { display: block; font-family: 'El Messiri', system-ui, sans-serif; font-size: .62rem; color: #9a94b5; }
.gt-days > div.today { color: var(--brand); font-weight: 700; background: rgba(83,63,153,.06); }
.gt-days > div.we { background: #fbfafe; }
.gt-row { border-bottom: 1px solid #f1eff8; }
.gt-row:hover .gt-name { background: #fbfafe; }
.gt-name { padding: .45rem .8rem; display: flex; align-items: center; gap: .45rem; border-inline-end: 1px solid #e7e5f0; position: sticky; inset-inline-start: 0; background: #fff; z-index: 2; min-width: 0; }
.gt-nm { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-track { position: relative; height: 2.7rem; }
.gt-cols { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; pointer-events: none; }
.gt-cols i { border-inline-end: 1px solid #f1eff8; }
.gt-cols i.we { background: #fbfafe; }
/* §10.539ج — ما خارجَ فترةِ المشروع في النافذة المتدحرجة: مُطفأٌ لا مخفيّ — الحدُّ يُرى ولا يمنع. */
.gt-days > div.off-per { color: #b9b4cc; background: repeating-linear-gradient(135deg, #fbfafc, #fbfafc 4px, #f4f2f8 4px, #f4f2f8 8px); }
.gt-cols i.off-per { background: repeating-linear-gradient(135deg, rgba(148,163,184,.05), rgba(148,163,184,.05) 4px, rgba(148,163,184,.11) 4px, rgba(148,163,184,.11) 8px); }
.gt-cols i.today { background: rgba(83,63,153,.06); border-inline-start: 1.5px solid #6b54be; }
.gt-bar { position: absolute; top: .55rem; height: 1.6rem; border-radius: .5rem; display: flex; align-items: center; padding: 0 .55rem; font-size: .74rem; font-family: inherit; color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12); border: 0; z-index: 1; }
.gt-bar.t-blue { background: #3b82c4; } .gt-bar.t-amber { background: #fdd700; color: #6b5400; } .gt-bar.t-green { background: #2f9e71; } .gt-bar.t-orange { background: #f04923; } .gt-bar.t-slate { background: #cbd5e1; color: #475569; }
.gt-bar.t-plan, .gt-bar.unsched { background: repeating-linear-gradient(45deg, #e4e0f1, #e4e0f1 6px, #efecf9 6px, #efecf9 12px); color: #6c7086; border: 1px dashed #cfc8e6; box-shadow: none; }
.gt-bar.unsched.t-blue { background: repeating-linear-gradient(45deg, #dbeafe, #dbeafe 6px, #eff6ff 6px, #eff6ff 12px); color: #1d4ed8; border-color: #93c5fd; }
.gt-bar.late { outline: 2px solid #f04923; outline-offset: 1px; }
.gt-bar:hover { filter: brightness(.95); }
.gt-ms { position: absolute; top: .85rem; width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px; background: var(--brand); box-shadow: 0 0 0 3px #fff; z-index: 2; pointer-events: none; }
.gt-ms.late { background: #f04923; }
.gt-off { position: absolute; top: .8rem; font-size: .72rem; color: #9a94b5; font-family: 'Space Grotesk', system-ui, sans-serif; }
.gt-off.before { inset-inline-start: .5rem; } .gt-off.after { inset-inline-end: .5rem; }
.gt-off.late { color: #f04923; font-weight: 700; }
.gt-legend { display: flex; gap: .9rem; padding: .55rem 1rem; border-top: 1px solid #e7e5f0; font-size: .74rem; color: #6c7086; flex-wrap: wrap; background: #fbfafe; align-items: center; }
.gt-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.gt-legend b { width: 11px; height: 11px; border-radius: 4px; display: block; }
.gt-legend b.t-blue { background: #3b82c4; } .gt-legend b.t-amber { background: #fdd700; } .gt-legend b.t-orange { background: #f04923; } .gt-legend b.t-green { background: #2f9e71; }
.gt-legend b.t-plan { background: repeating-linear-gradient(45deg, #e4e0f1, #e4e0f1 4px, #efecf9 4px, #efecf9 8px); border: 1px dashed #cfc8e6; }
.gt-legend b.ms { background: var(--brand); transform: rotate(45deg); border-radius: 2px; }
.gt-hint { margin-inline-start: auto; color: #9a94b5; }
/* B — القائمةُ المضغوطة */
.iv-bulk { display: none; align-items: center; gap: .6rem; padding: .5rem .9rem; background: var(--brand); color: #fff; font-size: .84rem; border-radius: .7rem; margin-bottom: .5rem; flex-wrap: wrap; }
.iv-bulk.on { display: flex; }
.iv-bulk .btn { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }
.iv-bulk .btn:hover { background: rgba(255,255,255,.25); }
.iv-list { border: 1px solid #e7e5f0; border-radius: .9rem; overflow: hidden; }
.iv-grp { display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; background: #fbfafe; border-bottom: 1px solid #e7e5f0; font-size: .8rem; font-weight: 700; color: #6c7086; }
.iv-grp .cnt, .iv-board .cnt { background: #fff; border: 1px solid #e7e5f0; border-radius: 999px; padding: 0 .5rem; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: .72rem; color: #6c7086; }
.iv-board .cnt.jam { background: #fdede8; color: #f04923; border-color: #f6c8b8; }
.pipe-col.jam { border-color: #f6c8b8; }
.iv-row { display: flex; align-items: center; gap: .55rem; padding: .5rem .9rem; border-bottom: 1px solid #f1eff8; flex-wrap: wrap; transition: .12s; }
.iv-row:hover { background: #fbfafe; }
.iv-row.open { background: #f8f6fd; }
.iv-row input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }
.iv-nm { border: 0; background: none; font-family: inherit; font-weight: 600; font-size: .88rem; color: #1f2233; cursor: pointer; padding: 0; text-align: start; }
.iv-nm:hover { color: var(--brand); }
.iv-mini { display: inline-flex; align-items: center; gap: 3px; }
.iv-mini i { width: 17px; height: 5px; border-radius: 99px; background: #e7e5f0; display: block; }
.iv-mini i.done { background: #2f9e71; } .iv-mini i.cur { background: var(--brand); box-shadow: 0 0 0 2px #f3f0fc; } .iv-mini i.blk { background: #fdd700; }
.iv-mini span { font-size: .7rem; color: #6c7086; margin-inline-start: .4rem; font-family: 'Space Grotesk', system-ui, sans-serif; }
.iv-hrs { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; color: #6c7086; font-family: 'Space Grotesk', system-ui, sans-serif; }
.iv-due { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; color: #6c7086; }
.iv-due.late { color: #f04923; font-weight: 700; } .iv-due.warn { color: #8a6d00; }
.iv-detail { padding: .5rem .9rem .8rem; background: #fcfbfe; border-bottom: 1px solid #f1eff8; }
.iv-detail[hidden] { display: none; }
/* D — التقويم: الحدثُ زرُّ قائمة */
.cal-ev-menu { display: block; width: 100%; text-align: start; background: #e7f2f0; color: #0f766e; border: 0; }
.cal-ev-menu.is-late { background: #fee2e2; color: #b91c1c; }
.cal-ev-menu > svg { display: none; }
.iv-unsched { margin-top: .75rem; font-size: .8rem; color: #f04923; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
/* §10.539ب — شريطُ «خارجَ الفترة» **فوق** العروض لا تحتها: تحذيرٌ يُقرأ بعد التمرير لا يُقرأ. */
.iv-unsched.is-outside { margin: 0 0 .75rem; padding: .5rem .75rem; border-radius: .6rem; background: #fff7ed; border: 1px solid #fed7aa; }

/* §10.537 — نظرةُ المشروع العامّة (أصنافٌ جديدةٌ فقط من مقترحه؛ لا صنفَ قائمٌ أُعيد تعريفُه). */
.hero-add { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .85rem; padding-top: .8rem; border-top: 1px solid #f1f5f9; }
/* §10.549ب — أرقامُ الترويسة **خاناتٌ مسمّاةٌ مؤطَّرة** لا رقاقاتٌ سائبة (شكلُ مخطوطته).
   *رقاقةٌ تقول «باقٍ 8 يوم» تترك القارئَ يستنتج اسمَ الرقم؛ والخانةُ تُسمّيه فيُقرأ بلا استنتاج.*
   والخاناتُ من نفس `info-cell` المستعملةِ في كلّ اللوحات — لا هيئةَ جديدةً في النظام. */
.hc { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; margin-top: .85rem; }
.hc .info-cell { display: flex; flex-direction: column; justify-content: center; }

/* ===== §10.550 — تبويبُ «التكاليف والأرباح»: من أين تأتي الكلفة ===== */
/* شريطٌ مكدَّسٌ يقول **نِسَبَ** المصادر في لمحة، وجدولٌ يقول أرقامَها.
   > **جدولان لهما الصفوفُ نفسُها جدولٌ واحدٌ بعمودٍ إضافيّ** — فلا لوحةَ ثانيةٌ تعيد الصفوف. */
.cst-bar { display: flex; height: .85rem; border-radius: 999px; overflow: hidden; background: #eef2f6; }
.cst-bar i { display: block; height: 100%; }
.cst-lg { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .55rem; font-size: .72rem; color: #64748b; }
.cst-lg span { display: inline-flex; align-items: center; gap: .35rem; }
.cst-lg b { width: .6rem; height: .6rem; border-radius: .2rem; display: block; }
.cst-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.cst-tbl th { text-align: start; font-size: .68rem; color: #94a3b8; font-weight: 700; padding: .4rem .5rem;
  border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.cst-tbl td { padding: .5rem; border-bottom: 1px solid #f4f7fa; vertical-align: middle; }
.cst-tbl tr:last-child td { border-bottom: 0; }
.cst-tbl tbody tr:hover { background: #fafcfd; }
.cst-tbl tfoot td { border-top: 1px solid #e2e8f0; border-bottom: 0; font-weight: 700; color: #0f172a; padding-top: .6rem; }
.cst-src { display: flex; align-items: center; gap: .5rem; }
.cst-ic { width: 1.8rem; height: 1.8rem; border-radius: .5rem; display: grid; place-items: center; flex: none; }
.cst-src b { font-weight: 600; color: #1e293b; display: block; font-size: .84rem; }
.cst-src span { font-size: .68rem; color: #94a3b8; display: block; }
.cst-num { font-weight: 600; color: #1e293b; white-space: nowrap; }
/* *رقمٌ غائبٌ يُكتَب شرطةً باهتةً لا صفراً* — الصفرُ يُقرأ قياساً، والشرطةُ تُقرأ «لم يُقَسْ». */
.cst-num.is-mute { color: #cbd5e1; font-weight: 400; }
/* سطرُ الحصيلة: إيرادٌ − كلفةٌ = هامش. */
.cst-sum { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: #f8fafc;
  border: 1px solid #eef2f6; border-radius: .7rem; padding: .7rem .9rem; margin-top: .9rem; }
.cst-sum .u { display: flex; flex-direction: column; gap: .05rem; }
.cst-sum .u span { font-size: .68rem; color: #94a3b8; }
.cst-sum .u b { font-size: 1rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.cst-sum .op { font-size: 1rem; color: #cbd5e1; font-weight: 700; }
.cst-sum .u.is-good b { color: #15803d; }
.cst-sum .u.is-bad b { color: #be123c; }
/* تنبيهُ نقصٍ — نقصٌ لا خطأ، فكهرمانٌ لا أحمر (قياساً على `.btn-warn`). */
.cst-warn { display: flex; gap: .5rem; align-items: flex-start; margin-top: .8rem; padding: .55rem .7rem;
  border-radius: .55rem; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: .75rem; line-height: 1.75; }
.cst-warn svg { flex: none; margin-top: .15rem; }
/* §10.553 — درجتان فوق الكهرمان: خسارةٌ محقَّقةٌ حمراء، وسلامةٌ خضراء.
   *لونٌ واحدٌ للحالات الثلاث يجعل القارئَ يقرأ النصَّ ليعرف أيَّ حالةٍ هو فيها.* */
.cst-warn.cap-loss { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cst-warn.cap-ok { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.hero-prog { flex: 0 1 20rem; min-width: 13rem; }
.hero-prog-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .75rem; color: #64748b; margin-bottom: .3rem; }
.hero-prog-h b { font-size: .85rem; color: #1e293b; font-variant-numeric: tabular-nums; }
.fnl { display: flex; gap: .25rem; align-items: flex-end; height: 5rem; }
.fnl-s { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25rem; cursor: pointer; }
.fnl-b { width: 100%; border-radius: .4rem .4rem .15rem .15rem; min-height: .28rem; background: #eef2f6; }
.fnl-s:hover .fnl-b { filter: brightness(.94); }
.fnl-n { font-size: .76rem; font-weight: 700; color: #475569; font-variant-numeric: tabular-nums; }
.fnl-s.is-zero .fnl-n { color: #cbd5e1; }
.fnl-l { font-size: .62rem; color: #94a3b8; text-align: center; line-height: 1.2; height: 1.5rem; }
.mtr + .mtr { margin-top: .6rem; }
.mtr-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; margin-bottom: .25rem; }
.mtr-h b { font-weight: 600; color: #334155; }
.mtr-h span { font-size: .72rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.lrow { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; border-bottom: 1px solid #f4f7fa; font-size: .82rem; }
.lrow:last-child { border-bottom: 0; }
.lrow-ico { width: 1.9rem; height: 1.9rem; border-radius: .55rem; display: grid; place-items: center; flex: none; }
.lrow-t { flex: 1; min-width: 0; }
.lrow-t b { font-weight: 600; color: #1e293b; }
.lrow-s { font-size: .7rem; color: #94a3b8; }
.band { position: relative; height: 5.4rem; border-radius: .6rem; background: #f8fafc; border: 1px solid #eef2f6; overflow: hidden; }
.band-c { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); }
.band-c i { border-inline-start: 1px solid #f1f5f9; }
.band-b { position: absolute; height: 1.15rem; border-radius: .35rem; font-size: .64rem; color: #fff; display: flex; align-items: center; padding: 0 .45rem; white-space: nowrap; overflow: hidden; }
.band-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); opacity: .45; }
.band-ax { display: flex; justify-content: space-between; font-size: .65rem; color: #94a3b8; margin-top: .35rem; }
/* §10.548ج — «اليوم» على المحور **في موضعه من المدى** لا في منتصفه.
   كان سطرَ ثلاثةٍ يوزّعها `space-between`، فيقع «اليوم» في الوسط دائماً مهما كان موضعُه
   الحقيقيُّ — *علامةٌ في غير موضعها تكذب أكثرَ ممّا تُفيد*، والخطُّ فوقها في موضعه الصحيح
   فيتناقض السطرُ مع الشريط. الآن المحورُ نسبيٌّ والعلامةُ مُزاحةٌ بنصف عرضها. */
.band-ax { position: relative; }
.band-ax .ax-now { position: absolute; transform: translateX(50%); color: var(--brand); font-weight: 700; white-space: nowrap; }
/* وحالةُ «بلا نهاية»: تحذيرٌ يقول ما ينقص وما يترتّب عليه، لا صمتٌ ولا صفر. */
.band-warn { display: flex; align-items: flex-start; gap: .5rem; margin-top: .6rem; padding: .6rem .75rem;
  border: 1px solid #fde68a; background: #fffbeb; border-radius: .6rem; font-size: .72rem; color: #92400e; line-height: 1.8; }
.swatch { display: flex; gap: .35rem; }
.swatch i { width: 1.9rem; height: 1.9rem; border-radius: .5rem; display: block; box-shadow: inset 0 0 0 1px rgba(15,23,42,.07); }
.swatch i.is-empty { background: #fff; box-shadow: inset 0 0 0 1px #e2e8f0; }
.jrn-next.is-warn { background: #fffbeb; border-color: #fde68a; } .jrn-next.is-warn .jrn-next-h { color: #b45309; }
.jrn-next.is-mute { background: #f8fafc; border-color: #e2e8f0; } .jrn-next.is-mute .jrn-next-h { color: #64748b; }
/* §10.537ب — تحسينُ الهيئة (بطلبه): لوحاتُ الصفّ الواحد بارتفاعٍ واحد، شبكةُ الأرقام ٢×٢، وعمودُ المسار لا يغطّي رقمَه. */
.ov-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fnl { height: 4.4rem; }
.fnl-b { max-height: 2.9rem; }
.md-hero + .card .grid > .card, .grid.lg\:grid-cols-2 > .card, .grid.lg\:grid-cols-3 > .card { height: 100%; }
.band-b { box-shadow: 0 1px 2px rgba(15,23,42,.15); }
