/* =====================================================================
   نظام التصميم — إحراز · من الفرصة إلى الإنجاز
   عربي أولًا (RTL) · تنفيذي هادئ · بلا خطوط خارجية · وضع داكن · متجاوب
   القواعد: البطاقات المتجاورة متساوية ومحاذاة؛ الشارات لون + نقطة + نص (لا لون فقط)؛
   الأرقام لاتينية بعرض ثابت؛ نوافذ التفصيل بنفس الهيكل دائمًا (.modal-bg > .modal).
   ===================================================================== */
/* ---------- الخطوط ----------
   IBM Plex Sans Arabic (SIL OFL) مضمّن محليًا — لا CDN.
   خطّ حديث إنساني، لا كوفي هندسي. العناوين تستعمل الوزن ٧٠٠ من العائلة
   نفسها: التباين بالوزن لا بالعائلة، وهو أنظف في العربية من خلط خطّين.
   المسارات نسبةً إلى ملف الأنماط لا إلى الصفحة. */
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-ar-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-ar-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-ar-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-ar-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-latin-400.woff2") format("woff2"); font-weight: 400; unicode-range: U+0000-024F, U+2000-206F, U+20A0-20BF; font-display: swap; }
@font-face { font-family: "Ihraz Sans"; src: url("fonts/plex-latin-700.woff2") format("woff2"); font-weight: 700 900; unicode-range: U+0000-024F, U+2000-206F, U+20A0-20BF; font-display: swap; }

:root {
  --ink: #12355B; --ink2: #1E4F82; --ink-soft: #E6EDF5;
  --accent: #0F8B8D; --accent-soft: #DDF3F2; --accent-ink: #0B6466;
  --paper: #F3F5F8; --card: #FFFFFF; --line: #E2E7EE; --line2: #CBD3DD;
  --txt: #1B2430; --muted: #5B6675; --faint: #8A94A3;
  --ok: #1E8E5A; --ok-bg: #DFF3E8; --ok-ink: #14633E;
  --warn: #C98A12; --warn-bg: #FBF0D6; --warn-ink: #7A5400;
  --danger: #C0392B; --danger-bg: #FBE2DD; --danger-ink: #8E2418;
  --info: #2B6FB8; --info-bg: #E1EBF6; --info-ink: #1F5891;
  --slate: #6F7A89; --slate-bg: #EEF1F5; --slate-ink: #47505C;
  --pipe-1: #8AAACD; --pipe-2: #5585B5; --pipe-3: #2E5F93; --pipe-4: #12355B;
  --brand-ink: #07111F; --brand-blue: #2563EB;   /* هوية «إحراز» — للعلامة فقط */
  --r: 16px; --rc: 12px; --rs: 8px;
  --sh: 0 1px 2px rgba(18,53,91,.06), 0 8px 24px rgba(18,53,91,.08);
  --sh-lg: 0 12px 40px rgba(18,53,91,.18);
  --ff: "Ihraz Sans", "IBM Plex Sans Arabic", "Segoe UI", "Tajawal", "Dubai", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ff-display: "Ihraz Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --fz: 14.5px; --fz-sm: 12.5px; --fz-lg: 17px; --fz-h1: 24px; --fz-kpi: 28px;
  --hdr-h: 60px; --nav-h: 48px;
  --t: 160ms cubic-bezier(.2,.7,.3,1);
}
body.dark {
  --ink: #8FB3DA; --ink2: #A9C6E6; --ink-soft: #1B2A3C;
  --accent: #3FB6B3; --accent-soft: #10302F; --accent-ink: #7FDAD7;
  --paper: #0D1117; --card: #161C24; --line: #263040; --line2: #34405180;
  --txt: #E8ECF2; --muted: #A3ADBA; --faint: #74808F;
  --ok: #4FC38A; --ok-bg: #12301F; --ok-ink: #8FE2B6;
  --warn: #E0A62A; --warn-bg: #3A2B0C; --warn-ink: #F2C766;
  --danger: #E5665A; --danger-bg: #3F1712; --danger-ink: #F4A199;
  --info: #6AA6E8; --info-bg: #14273C; --info-ink: #A9CBF2;
  --slate: #97A3B3; --slate-bg: #1F2732; --slate-ink: #C2CAD4;
  --pipe-1: #33526F; --pipe-2: #48719A; --pipe-3: #6396C2; --pipe-4: #93B7DC;
  --brand-ink: #07111F; --brand-blue: #3B82F6;
  --sh: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -8px rgba(0,0,0,.6);
  --sh-lg: 0 24px 60px -12px rgba(0,0,0,.7);
}

/* ---------- الأساس ---------- */
* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--paper); color: var(--txt); font-family: var(--ff); font-size: var(--fz); line-height: 1.55; font-variant-numeric: tabular-nums lining-nums; direction: rtl; }
body[dir=ltr] { direction: ltr; }
a { color: var(--ink2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { vertical-align: middle; }
.num, .mono, [data-num] { font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fz-sm); }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; top: -48px; inset-inline-start: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: var(--rs); z-index: 1000; }
.skip-link:focus { top: 8px; }
::selection { background: var(--accent-soft); }

/* ---------- الهيكل ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--hdr-h); display: flex; align-items: center; gap: 12px; padding: 0 18px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-ink); display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.brand.lg .mark { width: 52px; height: 52px; border-radius: 14px; }
/* داخل اللوحة الداكنة تُعرض العلامة بلا مربّع — نفس خلفية اللوحة */
.lh-brand .mark { background: none; width: auto; height: auto; border-radius: 0; }
.brand .slogan { font-size: 12.5px; color: #B9C7D9; letter-spacing: .01em; white-space: nowrap; margin-top: 2px; }
.brand .titles { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand .name { font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dark .brand .name { color: var(--txt); }
.brand .company { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gsearch { flex: 1 1 auto; max-width: 560px; position: relative; margin-inline: 8px; }
.gsearch input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 40px 0 14px; background: var(--paper); color: var(--txt); transition: border-color var(--t), box-shadow var(--t); }
body[dir=ltr] .gsearch input { padding: 0 14px 0 40px; }
.gsearch input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); outline: none; }
.gsearch .ic { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.gsearch .results { position: absolute; top: 44px; inset-inline: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--rc); box-shadow: var(--sh-lg); max-height: 70vh; overflow: auto; z-index: 60; padding: 6px; }
.gsearch .results .grp { padding: 8px 10px 4px; font-size: 11.5px; color: var(--faint); font-weight: 700; letter-spacing: .02em; }
.gsearch .results .it { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--rs); cursor: pointer; }
.gsearch .results .it:hover, .gsearch .results .it.sel { background: var(--ink-soft); }
.gsearch .results .it .t { flex: 1; min-width: 0; }
.gsearch .results .it .s { font-size: var(--fz-sm); color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .tools { display: flex; align-items: center; gap: 6px; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-grid; place-items: center; position: relative; transition: background var(--t), color var(--t); }
.iconbtn:hover { background: var(--paper); color: var(--txt); }
.iconbtn .badge { position: absolute; top: 4px; inset-inline-end: 4px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; line-height: 1; }
.langbtn { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--txt); font-weight: 700; font-size: 13px; }
.langbtn:hover { border-color: var(--line2); }
.usermenu { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; max-width: 260px; }
body[dir=ltr] .usermenu { padding: 4px 10px 4px 6px; }
.usermenu .av { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-soft); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.usermenu .nm { font-weight: 700; font-size: 13px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu .rl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.classif { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; text-align: center; font-size: 11px; color: var(--faint); padding: 3px 0; background: linear-gradient(to top, var(--paper) 70%, transparent); pointer-events: none; }

.mainnav { position: sticky; top: var(--hdr-h); z-index: 35; background: var(--card); border-bottom: 1px solid var(--line); }
.mainnav .scroller { display: flex; gap: 4px; padding: 6px 14px; overflow-x: auto; scrollbar-width: none; }
.mainnav .scroller::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; white-space: nowrap; transition: background var(--t), color var(--t); }
.pill:hover { background: var(--paper); color: var(--txt); }
.pill[aria-current=page] { background: var(--ink); color: #fff; }
body.dark .pill[aria-current=page] { background: var(--ink-soft); color: var(--ink2); border-color: var(--ink); }
.pill .cnt { min-width: 20px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.22); color: inherit; font-size: 11.5px; display: grid; place-items: center; padding: 0 6px; font-weight: 800; }
.pill:not([aria-current=page]) .cnt { background: var(--danger-bg); color: var(--danger-ink); }

.demo-banner { display: flex; align-items: center; gap: 10px; padding: 7px 18px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; border-bottom: 1px solid #eadcb5; }
body.dark .demo-banner { border-color: #4a3a12; }
.demo-banner .spacer { flex: 1; }
.demo-banner button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 3px 10px; font-size: 12px; }

main.content { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 18px 18px 40px; min-width: 0; }
@media (max-width: 760px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .brand .titles { display: none; }
  .usermenu .nm, .usermenu .rl { display: none; }
  .usermenu { padding: 3px; border-radius: 50%; }
  .langbtn { padding: 0 8px; }
  .gsearch { margin-inline: 0; min-width: 0; flex: 1 1 120px; }
  .gsearch input { padding-inline-start: 10px; font-size: 13px; }
  .iconbtn { width: 34px; height: 34px; }
  .page-head .actions { width: 100%; }
  .btngroup .btn { padding: 0 10px; font-size: 13px; }
}
@media (max-width: 700px) { main.content { padding: 12px 12px 40px; } }

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: var(--fz-h1); color: var(--ink); }
body.dark .page-head h1 { color: var(--txt); }
.page-head .sub { color: var(--muted); margin-top: 2px; font-size: 13.5px; white-space: normal; }
.page-head > div:first-child { min-width: 0; max-width: 100%; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--rc); border: 1px solid var(--line2); background: var(--card); color: var(--txt); font-weight: 700; font-size: 14px; white-space: nowrap; transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t); }
.btn:hover { background: var(--paper); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink2); border-color: var(--ink2); }
body.dark .btn.primary { background: var(--ink2); border-color: var(--ink2); color: #0D1117; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(1.06); }
.btn.danger { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger-ink); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--ink-soft); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btngroup { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--rc); overflow: hidden; }
.btngroup .btn { border: 0; border-radius: 0; height: 36px; }
.btngroup .btn + .btn { border-inline-start: 1px solid var(--line2); }
.btngroup .btn[aria-pressed=true] { background: var(--ink-soft); color: var(--ink); }
body.dark .btngroup .btn[aria-pressed=true] { color: var(--ink2); }

/* ---------- البطاقات ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
.card-h h3 { font-size: 15.5px; flex: 1; min-width: 0; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; display: block; margin-top: 1px; }
.card-h .act { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.card-b { padding: 16px 18px; }
.card-b.tight { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid > .card { min-width: 0; display: flex; flex-direction: column; }
.grid > .card > .card-b { flex: 1; }
@media (max-width: 1200px) { .grid.c4, .grid.c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid.c3, .grid.c4, .grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.c2, .grid.c3, .grid.c4, .grid.c6 { grid-template-columns: 1fr; } }
.section { margin-bottom: 18px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.sec-head .k { color: var(--accent); font-weight: 800; font-size: 12.5px; letter-spacing: .04em; }
.sec-head h2 { font-size: 17px; }
.sec-head .note { color: var(--muted); font-size: 12.5px; margin-inline-start: auto; }

/* ---------- بطاقات المؤشرات (KPI) ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { .kpis, .kpis.c5 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis, .kpis.c4, .kpis.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpis, .kpis.c4, .kpis.c5 { grid-template-columns: 1fr; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 14px 16px; min-height: 104px; display: flex; flex-direction: column; gap: 6px; text-align: start; cursor: pointer; position: relative; transition: transform var(--t), box-shadow var(--t), border-color var(--t); width: 100%; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); border-color: var(--line2); }
.kpi.static { cursor: default; }
.kpi.static:hover { transform: none; box-shadow: var(--sh); }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: var(--fz-kpi); font-weight: 800; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
body.dark .kpi .v { color: var(--txt); }
.kpi .s { font-size: 12px; color: var(--faint); margin-top: auto; }
.kpi.warn .v { color: var(--warn-ink); } .kpi.danger .v { color: var(--danger-ink); } .kpi.ok .v { color: var(--ok-ink); } .kpi.accent .v { color: var(--accent-ink); }
.kpi .info-ic { color: var(--faint); font-size: 11px; border: 1px solid var(--line2); border-radius: 50%; width: 15px; height: 15px; display: inline-grid; place-items: center; line-height: 1; }
.kpi .info-ic:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- الشارات ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--slate-bg); color: var(--slate-ink); line-height: 1; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; opacity: .85; }
.chip.nodot::before { display: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.danger { background: var(--danger-bg); color: var(--danger-ink); }
.chip.info { background: var(--info-bg); color: var(--info-ink); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.ink { background: var(--ink-soft); color: var(--ink); }
body.dark .chip.ink { color: var(--ink2); }
.chip.slate { background: var(--slate-bg); color: var(--slate-ink); }
.chip.sm { height: 20px; font-size: 11px; padding: 0 8px; }
.chip.lg { height: 28px; font-size: 13px; padding: 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- التصفية ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .search { position: relative; flex: 1 1 240px; max-width: 380px; }
.filters .search input { width: 100%; }
.sel, .inp, .txta, .filters select, .filters input[type=text], .filters input[type=search], .filters input[type=date], .filters input[type=number] { height: 36px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 10px; background: var(--card); color: var(--txt); min-width: 0; transition: border-color var(--t), box-shadow var(--t); }
.sel:focus, .inp:focus, .txta:focus, .filters select:focus, .filters input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.filters select { max-width: 220px; }
.filters .spacer { flex: 1; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.active-filters .af { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--ink-soft); color: var(--ink); font-size: 12px; font-weight: 700; }
body[dir=ltr] .active-filters .af { padding: 0 10px 0 4px; }
body.dark .active-filters .af { color: var(--ink2); }
.active-filters .af button { border: 0; background: transparent; color: inherit; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.active-filters .af button:hover { background: rgba(0,0,0,.08); }
.count-note { color: var(--muted); font-size: 12.5px; }

/* ---------- الجداول ---------- */
.tbl-wrap { overflow: auto; border-radius: var(--r); }
.card .tbl-wrap { border-radius: 0 0 var(--r) var(--r); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13.5px; }
table.tbl th { position: sticky; top: 0; z-index: 2; background: var(--ink); color: #fff; text-align: start; font-weight: 700; font-size: 12.5px; padding: 10px 12px; white-space: nowrap; border-bottom: 2px solid var(--ink); }
body.dark table.tbl th { background: var(--ink-soft); color: var(--ink2); border-bottom-color: var(--ink); }
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { filter: brightness(1.15); }
table.tbl th .si { opacity: .6; font-size: 10px; margin-inline-start: 4px; }
table.tbl th[aria-sort] .si { opacity: 1; }
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tbl td.wrap { white-space: normal; }
table.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 55%, var(--card)); }
table.tbl tbody tr.click { cursor: pointer; }
table.tbl tbody tr.click:hover td { background: var(--ink-soft); }
/* المحاذاة: كل الأعمدة في المنتصف — عدا العمود الأول (الاسم/الوصف) والأعمدة متعددة الأسطر،
   لتبقى قراءة النص العربي/الإنجليزي من بدايته. الترويسة والخلية دائمًا بنفس المحاذاة. */
table.tbl th, table.tbl td { text-align: center; vertical-align: middle; }
table.tbl th:first-child, table.tbl td:first-child,
table.tbl th.wrap, table.tbl td.wrap,
table.tbl th.start, table.tbl td.start { text-align: start; }
table.tbl td.num, table.tbl th.num, table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl th.end, table.tbl td.end { text-align: end; }
table.tbl tfoot td { font-weight: 700; background: var(--paper); border-top: 2px solid var(--line2); }
.sub { display: block; font-size: 11.5px; color: var(--muted); }
table.tbl .sub, .list .sub, .bcard .sub, .gsearch .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.kpi .v.long { font-size: 20px; }
table.tbl .lnk { color: var(--ink2); font-weight: 700; }
.tbl-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .tbl-wrap.responsive table.tbl, .tbl-wrap.responsive tbody, .tbl-wrap.responsive tr, .tbl-wrap.responsive td { display: block; }
  .tbl-wrap.responsive thead, .tbl-wrap.responsive tfoot { display: none; }
  .tbl-wrap.responsive colgroup { display: none; }
  .tbl-wrap.responsive tr { border: 1px solid var(--line); border-radius: var(--rc); margin: 10px; padding: 8px 12px; background: var(--card); box-shadow: var(--sh); }
  .tbl-wrap.responsive td { border: 0; padding: 4px 0; white-space: normal; display: flex; gap: 10px; justify-content: space-between; text-align: start !important; }
  .tbl-wrap.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; flex: 0 0 38%; }
  .tbl-wrap.responsive td:empty, .tbl-wrap.responsive td.hide-sm { display: none; }
  .tbl-wrap.responsive tbody tr:nth-child(even) td { background: transparent; }
}

/* ---------- النماذج ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form.c1 { grid-template-columns: 1fr; }
.form.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .form, .form.c3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.field.fhide { display: none; }
.field.custom { gap: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.field label .req { color: var(--danger); }
.field .ctl { height: 38px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 10px; background: var(--card); color: var(--txt); width: 100%; transition: border-color var(--t), box-shadow var(--t); }
.field textarea.ctl { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.field .ctl:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.field.err .ctl { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.field .msg { font-size: 12px; color: var(--danger-ink); }
.field .hint { font-size: 11.5px; color: var(--faint); }
.field .hijri { font-size: 11.5px; color: var(--accent-ink); }
.field input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; height: 38px; font-weight: 600; cursor: pointer; }
.multisel { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.multisel label { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12.5px; cursor: pointer; color: var(--txt); font-weight: 600; }
.multisel label.on { background: var(--ink-soft); border-color: var(--ink); color: var(--ink); }
body.dark .multisel label.on { color: var(--ink2); }
.multisel input { position: absolute; opacity: 0; pointer-events: none; }
.form-sec { grid-column: 1 / -1; font-size: 13px; font-weight: 800; color: var(--accent-ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-top: 6px; }
.form-note { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); background: var(--paper); border-radius: var(--rs); padding: 8px 10px; }

/* مجموعة حقول قابلة للطي داخل النموذج */
.form-group { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; margin-top: 4px; cursor: pointer; text-align: start;
  font-size: 13px; font-weight: 700; color: var(--txt);
  transition: border-color var(--t), background var(--t); }
.form-group:hover { border-color: var(--accent); }
.form-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-group.open { background: transparent; border-color: var(--line2); }
.form-group .gchev { display: inline-flex; color: var(--muted); transition: transform var(--t); }
[dir="rtl"] .form-group .gchev { transform: rotate(180deg); }
.form-group.open .gchev, [dir="rtl"] .form-group.open .gchev { transform: rotate(90deg); }
.form-group .gl { flex: 0 0 auto; }
.form-group .gh-hint { flex: 1; font-size: 12px; font-weight: 400; color: var(--muted); }
.form-group .gcount { flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 999px;
  display: none; align-items: center; justify-content: center; padding: 0 7px;
  font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.form-group .gcount.on { display: inline-flex; }
.field.gh { display: none; }
.sensitive-lock { display: inline-flex; gap: 6px; align-items: center; color: var(--faint); font-size: 12px; }

/* ---------- النوافذ (الهيكل الموحد) ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(12, 20, 32, .48); display: flex; align-items: center; justify-content: center; padding: 14px; animation: fade var(--t) both; }
.modal { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-lg); width: min(840px, 96vw); max-height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; animation: rise 200ms cubic-bezier(.2,.7,.3,1) both; border: 1px solid var(--line); }
.modal.sm { width: min(560px, 96vw); }
.modal.lg { width: min(1240px, 96vw); }
.modal.full { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: move; user-select: none; }
.modal-head .ttl { flex: 1; min-width: 0; }
.modal-head h2 { font-size: 17px; color: var(--ink); }
body.dark .modal-head h2 { color: var(--txt); }
.modal-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-head .hb { display: flex; gap: 4px; flex: 0 0 auto; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; overscroll-behavior: contain; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: flex-start; flex-wrap: wrap; background: var(--card); }
.modal-foot .spacer { flex: 1; }
.modal-foot .hint { font-size: 12px; color: var(--faint); }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* الدرج الجانبي */
.drawer-bg { position: fixed; inset: 0; z-index: 95; background: rgba(12,20,32,.35); animation: fade var(--t) both; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(520px, 96vw); background: var(--card); box-shadow: var(--sh-lg); z-index: 96; display: flex; flex-direction: column; animation: slide 200ms cubic-bezier(.2,.7,.3,1) both; border-inline-start: 1px solid var(--line); }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
body[dir=ltr] @keyframes slide { from { transform: translateX(24px); } }
.drawer .modal-head { cursor: default; }

/* ---------- التنبيهات (Toast) ---------- */
.toasts { position: fixed; bottom: 28px; inset-inline-start: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 90vw); }
.toast { background: var(--txt); color: var(--paper); border-radius: var(--rc); padding: 10px 14px; box-shadow: var(--sh-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: rise 200ms both; }
body.dark .toast { background: #E8ECF2; color: #0D1117; }
.toast.ok { border-inline-start: 4px solid var(--ok); }
.toast.err { border-inline-start: 4px solid var(--danger); }
.toast.warn { border-inline-start: 4px solid var(--warn); }
.toast button { background: transparent; border: 0; color: inherit; opacity: .7; font-size: 16px; }

/* ---------- الحالات ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { font-size: 34px; opacity: .35; margin-bottom: 8px; }
.empty h4 { color: var(--txt); margin-bottom: 4px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spin { width: 20px; height: 20px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--paper) 25%, var(--line) 50%, var(--paper) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--rs); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.errbox { border: 1px solid var(--danger-bg); background: var(--danger-bg); color: var(--danger-ink); border-radius: var(--rc); padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.warnbox { border: 1px solid #eadcb5; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--rc); padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.infobox { border: 1px solid var(--info-bg); background: var(--info-bg); color: var(--info-ink); border-radius: var(--rc); padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.okbox { background: var(--ok-bg); color: var(--ok-ink); border-radius: var(--rc); padding: 10px 14px; font-size: 13px; }
.denied { padding: 50px 20px; text-align: center; color: var(--muted); }
.denied .lock { font-size: 40px; opacity: .4; }

/* ---------- قوائم/سجلات ---------- */
.list { display: flex; flex-direction: column; }
.list .row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.list .row.click { cursor: pointer; }
.list .row.click:hover { background: var(--ink-soft); }
.list .row .main { flex: 1; min-width: 0; }
.list .row .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .row .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .row .end { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
@media (max-width: 700px) { .list .row { flex-wrap: wrap; } .list .row .main { flex-basis: calc(100% - 50px); } .list .row .end { flex-basis: 100%; justify-content: flex-start; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-soft); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex: 0 0 auto; }
body.dark .avatar { color: var(--ink2); }
.avatar.sq { border-radius: 10px; }
.avatar.ok { background: var(--ok-bg); color: var(--ok-ink); } .avatar.warn { background: var(--warn-bg); color: var(--warn-ink); } .avatar.danger { background: var(--danger-bg); color: var(--danger-ink); } .avatar.info { background: var(--info-bg); color: var(--info-ink); } .avatar.accent { background: var(--accent-soft); color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: minmax(120px, 32%) 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.c2 { grid-template-columns: minmax(120px, 32%) 1fr minmax(120px, 32%) 1fr; }
@media (max-width: 900px) { .kv.c2 { grid-template-columns: minmax(120px, 32%) 1fr; } }
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .ev { position: relative; padding: 0 0 16px; }
.timeline .ev::before { content: ""; position: absolute; inset-inline-start: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--accent); }
.timeline .ev.stage::before { border-color: var(--ink); } .timeline .ev.proposal::before { border-color: var(--warn); } .timeline .ev.contract::before { border-color: var(--ok); } .timeline .ev.greeting::before { border-color: var(--slate); } .timeline .ev.future::before { border-style: dashed; }
.timeline .ev .d { font-size: 12px; color: var(--faint); }
.timeline .ev .t { font-weight: 700; }
.timeline .ev .s { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--txt); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); }
body.dark .tabs button[aria-selected=true] { color: var(--ink2); border-bottom-color: var(--ink2); }
.tabs button .cnt { background: var(--paper); border-radius: 999px; font-size: 11px; padding: 1px 7px; color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: var(--paper); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 300ms; }
.progress.ok > i { background: var(--ok); } .progress.warn > i { background: var(--warn); } .progress.danger > i { background: var(--danger); } .progress.ink > i { background: var(--ink); }
.stage-track { display: flex; gap: 3px; align-items: center; }
.stage-track i { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.stage-track i.done { background: var(--ink); } .stage-track i.cur { background: var(--accent); } .stage-track i.lost { background: var(--danger); }
body.dark .stage-track i.done { background: var(--ink2); }

/* ---------- مسار المراحل القابل للطي ---------- */
.spath-head { display: flex; align-items: center; gap: 12px; }
.spath-head .stage-track { flex: 1; }
.btn.spath-tog { flex: none; white-space: nowrap; }
.btn.spath-tog.on { background: var(--ink-soft); color: var(--ink); }
.spath-body { margin-top: 12px; }
.spath-body[hidden] { display: none; }
.spath-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 0; }
.spath-col { padding: 0 12px; border-inline-start: 1px dashed var(--line); min-width: 0; }
.spath-col:first-child { border-inline-start: 0; padding-inline-start: 0; }
.spath-ch { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.spath-ch b { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.spath-ch s { text-decoration: none; font-size: 11px; color: var(--faint); font-weight: 700; }
.spath-st { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; min-height: 31px;
  padding: 4px 7px; border-radius: 9px; margin-bottom: 3px; border: 1px solid transparent; background: none;
  font-family: inherit; cursor: pointer; transition: background var(--t), border-color var(--t); }
.spath-st u { text-decoration: none; flex: none; width: 19px; height: 19px; border-radius: 999px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; border: 1.5px solid var(--line2); color: var(--faint); background: var(--card); }
.spath-st span { font-size: 12.3px; color: var(--faint); font-weight: 500; }
.spath-st:hover, .spath-st.open { background: var(--slate-bg); border-color: var(--line2); }
.spath-st:hover span, .spath-st.open span { color: var(--muted); }
.spath-st:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.spath-st.done u { background: var(--ink); border-color: var(--ink); color: #fff; }
.spath-st.done span { color: var(--ink); font-weight: 600; }
.spath-st.cur { background: var(--accent-soft); border-color: var(--accent); }
.spath-st.cur u { background: var(--accent); border-color: var(--accent); color: #fff; }
.spath-st.cur span { color: var(--accent-ink); font-weight: 800; }
.spath-st.next { border: 1.5px dashed var(--accent); background: var(--card); }
.spath-st.next u { border-color: var(--accent); color: var(--accent-ink); }
.spath-st.next span { color: var(--accent-ink); font-weight: 700; }
.spath-nb { margin-inline-start: auto; align-self: flex-start; margin-top: 3px; font-style: normal; font-size: 10px; font-weight: 800; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; }
.spath-lg { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.spath-lg i { font-style: normal; display: inline-flex; align-items: center; gap: 7px; }
.spath-lg .sw { width: 14px; height: 14px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--card); }
.spath-lg .sw.d { background: var(--ink); border-color: var(--ink); }
.spath-lg .sw.c { background: var(--accent); border-color: var(--accent); }
.spath-lg .sw.n { border: 1.5px dashed var(--accent); background: var(--card); }
body.dark .spath-st.done u { background: var(--ink2); border-color: var(--ink2); color: var(--paper); }
body.dark .spath-lg .sw.d { background: var(--ink2); border-color: var(--ink2); }

/* نافذة شرح المرحلة */
.spop { position: fixed; z-index: 90; width: min(390px, calc(100vw - 24px)); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--rc); box-shadow: var(--sh-lg); padding: 14px 16px 13px; }
.spop-arw { position: absolute; width: 12px; height: 12px; background: var(--card);
  border-inline-start: 1px solid var(--line); border-block-start: 1px solid var(--line); transform: rotate(45deg); top: -7px; }
.spop.above .spop-arw { top: auto; bottom: -7px; transform: rotate(225deg); }
.spop h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.spop h4 u { text-decoration: none; width: 21px; height: 21px; border-radius: 999px; display: grid; place-items: center;
  font-size: 11px; background: var(--slate-bg); border: 1.5px solid var(--line2); color: var(--muted); font-weight: 700; }
.spop-sub { font-size: 11.5px; color: var(--faint); margin-bottom: 9px; }
.spop h5 { margin: 10px 0 5px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.spop ul { margin: 0; padding-inline-start: 16px; font-size: 12.6px; }
.spop li { margin-bottom: 3px; }
.spop-req { display: flex; gap: 6px; flex-wrap: wrap; }
.spop-req i { font-style: normal; font-size: 11.5px; font-weight: 700; background: var(--ink-soft); color: var(--ink);
  border-radius: 7px; padding: 2px 9px; }
.spop-none { font-size: 12.3px; color: var(--faint); }
.spop-skip { margin-top: 10px; font-size: 12.2px; background: var(--info-bg); color: var(--info-ink);
  border-radius: 9px; padding: 7px 10px; line-height: 1.5; }
.spop-blocked { margin-top: 10px; font-size: 12px; color: var(--warn-ink); }
.spop-kv { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px;
  padding-top: 9px; border-top: 1px solid var(--line); }
.spop-kv b { color: var(--txt); }
.spop-act { display: flex; gap: 8px; margin-top: 12px; }
.warn-txt { color: var(--warn-ink); font-weight: 700; }

@media (max-width: 900px) {
  .spath-col { padding: 0 8px 10px; }
  .spath-col:first-child { padding-inline-start: 8px; }
}

/* ---------- لوحة المسار ---------- */
.board { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 14px; align-items: flex-start; min-height: 420px; scroll-snap-type: x proximity; }
.bcol { flex: 0 0 272px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 320px); min-height: 200px; scroll-snap-align: start; }
.bcol.over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bcol.empty-col { flex-basis: 150px; }
.bcol-h { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; background: var(--paper); border-radius: var(--r) var(--r) 0 0; z-index: 1; }
.bcol-h .n { font-weight: 800; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.bcol-h .n .ord { width: 20px; height: 20px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.bcol-h .m { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; }
.bcol-b { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.bcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--rc); padding: 10px 12px; box-shadow: var(--sh); cursor: grab; transition: box-shadow var(--t), transform var(--t); }
.bcard:hover { box-shadow: var(--sh-lg); transform: translateY(-1px); }
.bcard.dragging { opacity: .5; }
.bcard .t { font-weight: 700; font-size: 13.5px; line-height: 1.35; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bcard .c { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard .v { font-weight: 800; color: var(--ink); font-size: 13px; margin-top: 6px; }
body.dark .bcard .v { color: var(--ink2); }
.bcard .f { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.bcard .f .sp { flex: 1; }
.bcard .na { font-size: 11.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard .na.over { color: var(--danger-ink); }
.bcard .flags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.bcard .flags i { display: inline-block; font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
.bcard .flags i.d { background: var(--danger-bg); color: var(--danger-ink); }
.mini-av { width: 22px; height: 22px; border-radius: 50%; background: var(--ink-soft); color: var(--ink); font-size: 10px; font-weight: 800; display: inline-grid; place-items: center; }
body.dark .mini-av { color: var(--ink2); }

/* ---------- التقويم ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dh { background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; text-align: center; padding: 8px 4px; }
body.dark .cal .dh { background: var(--ink-soft); color: var(--ink2); }
.cal .dc { background: var(--card); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.cal .dc.out { background: var(--paper); color: var(--faint); }
.cal .dc.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .dc .dn { font-weight: 800; font-size: 12.5px; display: flex; justify-content: space-between; }
.cal .dc .dn .hj { font-weight: 400; color: var(--faint); font-size: 10.5px; }
.cal .dc .ev { border-radius: 6px; padding: 2px 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--info-bg); color: var(--info-ink); cursor: pointer; border-inline-start: 3px solid var(--info); }
.cal .dc .ev.done { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok); text-decoration: line-through; opacity: .8; }
.cal .dc .ev.over { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger); }
.cal .dc .ev.occ { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.cal .dc .ev.dl { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn); }
.cal .dc .more { font-size: 11px; color: var(--muted); cursor: pointer; }
@media (max-width: 800px) { .cal .dc { min-height: 64px; } .cal .dc .ev { font-size: 10px; padding: 1px 4px; } }

/* ---------- الرسوم ---------- */
.chart { width: 100%; overflow: visible; }
.chart text { font-family: var(--ff); fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--ink); transition: opacity var(--t); cursor: pointer; }
.chart .bar:hover { opacity: .75; }
.chart .bar.accent { fill: var(--accent); } .chart .bar.warn { fill: var(--warn); } .chart .bar.danger { fill: var(--danger); } .chart .bar.ok { fill: var(--ok); } .chart .bar.slate { fill: var(--slate); } .chart .bar.info { fill: var(--info); }
.chart .grid line { stroke: var(--line); }
.chart .axis line, .chart .axis path { stroke: var(--line2); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .area { fill: var(--accent-soft); opacity: .7; }
.chart .pt { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.chart .lbl { fill: var(--txt); font-weight: 700; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .b { height: 14px; background: var(--paper); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.hbar .b > i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.hbar .b > i.accent { background: var(--accent); } .hbar .b > i.warn { background: var(--warn); } .hbar .b > i.danger { background: var(--danger); } .hbar .b > i.ok { background: var(--ok); }
.hbar .v { font-weight: 700; white-space: nowrap; }
.hbar.click { cursor: pointer; } .hbar.click:hover .n { color: var(--ink); text-decoration: underline; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 4px; vertical-align: middle; }
.donut-wrap { display: flex; gap: 18px; align-items: center; }
.donut { width: 140px; height: 140px; flex: 0 0 auto; }

/* ---------- تسجيل الدخول ---------- */
/* ---------- صفحة الدخول: هبوط بواجهة واحدة ---------- */
.lpage { background: var(--paper); }
.lh { min-height: 100vh; display: flex; flex-direction: column; color: #fff; padding: 0 clamp(16px, 4vw, 54px) 40px;
  background:
    radial-gradient(900px 520px at 84% 4%, rgba(37,99,235,.42) 0%, transparent 60%),
    radial-gradient(760px 520px at 8% 92%, rgba(15,139,141,.24) 0%, transparent 62%),
    linear-gradient(152deg, #14275C 0%, #10306A 34%, #0E2148 68%, #0A1730 100%); }
.lh-top { display: flex; align-items: center; gap: 18px; padding: 22px 0 0; }
/* الشعار النصّي أطول من الاسم بكثير، فلو وُضع تحت الاسم وحده خرج عن الكتلة.
   يوضع تحت الشعار والاسم معًا: أوسع العنصرين يحدّد عرض المربّع، والباقي
   يُحاذيه من الحافة نفسها — فلا شيء يخرج مهما طال الشعار عند عميل آخر. */
.lh-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.lh-brand .lockup { display: flex; align-items: center; gap: 13px; align-self: stretch; }
.lh-brand .name { font-size: 33px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.lh-brand .slogan { font-size: 12px; opacity: .62; letter-spacing: .1px; line-height: 1.3; white-space: nowrap; }
.lh-nav { display: flex; align-items: center; gap: 6px; margin-inline: auto; }
.lh-nav a { color: #fff; opacity: .82; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; transition: background var(--t), opacity var(--t); }
.lh-nav a:hover { opacity: 1; background: rgba(255,255,255,.1); text-decoration: none; }
.lh-nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lh-act { display: flex; align-items: center; gap: 12px; }
.lh-lang, .lh-signin { font-family: inherit; cursor: pointer; border-radius: 999px; transition: background var(--t), border-color var(--t); }
.lh-lang { background: none; border: 0; color: #fff; opacity: .78; font-size: 13px; font-weight: 600; padding: 8px 10px; }
.lh-lang:hover { opacity: 1; background: rgba(255,255,255,.09); }
.lh-signin { background: none; border: 1px solid rgba(255,255,255,.42); color: #fff; font-size: 13.5px; font-weight: 700; padding: 10px 26px; }
.lh-signin:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.lh-lang:focus-visible, .lh-signin:focus-visible, .lh-primary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.lh-main { flex: 1; display: grid; grid-template-columns: 1fr 1.5fr; align-items: center; gap: clamp(24px, 5vw, 70px); padding: clamp(20px, 4vh, 48px) 0 clamp(10px, 4vh, 40px); }
.lh-copy { max-width: 42rem; min-width: 0; }
/* عنوان البطل: تمهيد خفيف فوق سطر عريض بخط العناوين.
   بلا تباعد سالب — العربية تفقد اتّصال حروفها معه ويبدو الخط مضغوطًا. */
.lh-copy h1 { margin: 0; font-size: clamp(30px, 5.2vw, 74px); letter-spacing: 0; font-weight: 700; }
.lh-copy h1 .l1, .lh-copy h1 .l2 { display: block; white-space: nowrap; }
.lh-copy h1 .l1 { font-family: var(--ff); font-size: .4em; font-weight: 500; line-height: 1.5;
  opacity: .66; letter-spacing: .01em; }
.lh-copy h1 .l2 { font-family: var(--ff-display); font-size: 1em; font-weight: 700; line-height: 1.36; letter-spacing: -.005em; }
/* خطّ رفيع يمهّد للعنوان — بنية لا زخرفة */
.lh-copy h1::before { content: ""; display: block; width: 58px; height: 3px; border-radius: 999px;
  background: var(--accent); margin-bottom: 20px; }
.lh-copy > p { margin: 20px 0 0; font-size: clamp(16px, 1.55vw, 21px); line-height: 1.7; opacity: .86; font-weight: 500; max-width: 34rem; }
.lh-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; font-size: 15.5px; font-weight: 500; opacity: .93; }
.lh-points li { display: flex; align-items: center; gap: 13px; }
.lh-points li .ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.lh-points li .ic svg { width: 21px; height: 21px; }
.lh-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
.lh-primary { background: #fff; color: var(--brand-ink); border: 0; border-radius: 999px; font-family: inherit;
  font-size: 15px; font-weight: 800; padding: 14px 42px; cursor: pointer; box-shadow: 0 10px 30px -12px rgba(0,0,0,.6); }
.lh-primary:hover { background: var(--accent-soft); }
.lh-note { font-size: 12.5px; opacity: .6; margin: 26px 0 0; }

/* معاينة المنصة */
/* هامش داخلي يستوعب ميلان البطاقتين وإزاحتهما: بدونه تخرج الأمامية
   عن حافة الصفحة وتلتصق بحافة النافذة. */
.lh-shot { display: flex; justify-content: center; padding-inline: clamp(8px, 2.4vw, 36px); }
.lh-stack { position: relative; display: grid; width: min(820px, 100%); }
.lh-card { grid-area: 1 / 1; }
/* الفصل الرأسي بينهما يجب أن يتجاوز ارتفاع صفّ المؤشّرات في الخلفية،
   وإلا غطّت الأمامية أرقام معاينة المواهب وضاع معنى البطاقتين. */
.lh-card.back { transform: translate(6%, -40%) rotate(-4deg); }
.lh-card.back .lp { box-shadow: 0 30px 70px -28px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.07); }
.lh-card.front { transform: translate(-4%, 30%) rotate(1.5deg); }
/* معاينة المنصة: كل مقاييسها بوحدة em نسبةً إلى font-size هنا، فتكبيرها
   أو تصغيرها رقم واحد لا اثنا عشر رقمًا متفرّقة. */
.lp { width: 100%; font-size: 18px; background: var(--card); border-radius: 1.25em; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.08); }
.lp-bar { display: flex; gap: .38em; padding: .8em 1.05em; background: var(--paper); border-bottom: 1px solid var(--line); }
.lp-bar i { width: .62em; height: .62em; border-radius: 999px; background: var(--line2); }
.lp-body { padding: 1.1em 1.2em 1.35em; display: flex; flex-direction: column; gap: 1em; }
.lp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55em; }
.lp-tile { background: var(--paper); border: 1px solid var(--line); border-radius: .72em; padding: .68em .75em;
  display: flex; flex-direction: column; gap: .18em; }
.lp-tile span { font-size: .68em; color: var(--faint); }
.lp-tile b { font-size: 1.12em; color: var(--ink); font-weight: 800; }
.lp-rail { display: flex; gap: .22em; }
.lp-rail u { flex: 1; height: .36em; border-radius: 999px; background: var(--line); }
.lp-rail u.done { background: var(--ink); }
.lp-rail u.cur { background: var(--accent); }
/* نكهة معاينة المواهب: الفيروزي للمنجَز والكحلي للحالية — عكس معاينة العملاء */
.lp-ta .lp-rail u.done { background: var(--accent); }
.lp-ta .lp-rail u.cur { background: var(--ink); }
.lp-ta .lp-tile b { color: var(--accent-ink); }
.lp-list { display: flex; flex-direction: column; gap: .52em; }
.lp-row { display: flex; align-items: center; gap: .55em; }
.lp-row i { height: .44em; border-radius: 999px; background: var(--line); }
.lp-row i:last-child { background: var(--ink-soft); }
.lp-row.on i:first-child { background: var(--accent); }

.login-msg:not(:empty) { margin-bottom: 12px; }
.modal.sm .demo-users { max-height: 52vh; overflow-y: auto; }

/* ---- شاشة التحويل: مستخدم منصة المواهب بعد دخوله من إحراز ---- */
.lh.launch { min-height: 100vh; }
.launch-main { display: flex; align-items: center; justify-content: center; padding: 8vh 0 12vh; }
.launch-card { width: min(430px, 100%); display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 12px; padding: 40px 32px 30px; border-radius: 22px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); }
.launch-card .ic { color: #fff; }
.launch-card .ic svg { width: 34px; height: 34px; }
.launch-card h1 { margin: 0; font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.launch-card .who { margin: 0; font-size: 15px; font-weight: 700; color: #fff;
  display: flex; flex-direction: column; gap: 3px; }
.launch-card .who .role { font-size: 12.5px; font-weight: 600; opacity: .62; }
.launch-card .muted { color: #C6D3E4; margin: 0; }
.launch-card .small { font-size: 13px; line-height: 1.7; }
.launch-card .xs { font-size: 11.5px; line-height: 1.6; opacity: .72; max-width: 34ch; }
/* الزر على خلفية داكنة، فألوان الزر الأساسي العادية تذوب فيها — يُصرَّح بها */
.launch-card .btn.lg { margin-top: 6px; height: auto; padding: 13px 34px; font-size: 14.5px;
  border-radius: 999px; text-decoration: none; display: inline-flex; }
/* أزرق العلامة صراحةً لا --accent: لون التأكيد في المنصة أخضر مزرق،
   وهذه الشاشة على كحلي العلامة فيجب أن يكون الزر من اللون نفسه. */
.launch-card .btn.primary { background: #2563EB; border-color: #2563EB; color: #fff; }
.launch-card .btn.primary:hover { background: #1D53CE; border-color: #1D53CE; }
.launch-card .btn.primary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.launch-card .btn:disabled { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #C6D3E4; }
.launch-card .linkbtn { margin-top: 4px; background: none; border: 0; color: #C6D3E4; opacity: .8;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px; }
.launch-card .linkbtn:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 900px) {
  .lh-main { grid-template-columns: 1fr; padding-top: 26px; gap: 34px; }
  .lh-shot { order: 2; }
  /* على الشاشات الضيّقة تُصغَّر المعاينة برقم واحد، ويبقى الفصل الرأسي
     كافيًا لئلا تغطّي الأمامية أرقام بطاقة المواهب. */
  .lp { font-size: 15px; }
  .lh-card.back { transform: translate(4%, -38%) rotate(-4deg); }
  .lh-card.front { transform: translate(-3%, 31%) rotate(1.5deg); }
  .lh-brand .slogan { display: none; }
  /* البطاقتان مائلتان وزخرفيتان — قصّ ميلانهما بدل أن يدفع الصفحة أفقيًا */
  .lh-shot { overflow-x: hidden; }
}
.demo-users { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .demo-users { grid-template-columns: 1fr; } }
.demo-users button { display: flex; gap: 10px; align-items: center; text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--card); transition: border-color var(--t), background var(--t); }
.demo-users button:hover { border-color: var(--accent); background: var(--accent-soft); }
.demo-users .nm { font-weight: 700; font-size: 13px; line-height: 1.15; }
.demo-users .rl { font-size: 11.5px; color: var(--muted); }

/* ---------- متفرقات ---------- */
.danger-ink { color: var(--danger-ink); }
.ok-ink { color: var(--ok-ink); }
.warn-ink { color: var(--warn-ink); }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-inline { display: inline-flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stat-inline b { color: var(--txt); }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.two > *, .grid > *, .kpis > * { min-width: 0; }
.chart { max-width: 100%; min-width: 0; display: block; }
.two.eq { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two, .two.eq { grid-template-columns: 1fr; } }
.sticky-actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0; border-top: 1px solid var(--line); }
.audit-diff { font-size: 12.5px; display: grid; grid-template-columns: auto 1fr 1fr; gap: 4px 10px; }
.audit-diff .k { color: var(--muted); font-weight: 700; }
.audit-diff .b { color: var(--danger-ink); text-decoration: line-through; opacity: .8; }
.audit-diff .a { color: var(--ok-ink); }
.print-only { display: none; }
@media print {
  .topbar, .mainnav, .demo-banner, .classif, .no-print, .page-head .actions, .toasts { display: none !important; }
  main.content { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ---------- جدول المسار حسب المرحلة (مجموعات قابلة للطي) ---------- */
.stbl { width: 100%; }
.stbl table { width: 100%; border-collapse: collapse; }
.stbl th { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 0 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stbl th, .stbl td { text-align: center; vertical-align: middle; }
.stbl th.l, .stbl td.l, .stbl td.nm { text-align: start; }
.stbl th.b { width: 34%; }
.stbl td { padding: 0 10px; height: 28px; font-size: 13px; vertical-align: middle; }
.stbl td.r { white-space: nowrap; }
.stbl td.nm { color: var(--txt); padding-inline-start: 24px; max-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stbl td.v { font-weight: 600; }
.stbl td.pct { color: var(--muted); font-size: 12px; }

.stbl tr.grp { cursor: pointer; }
.stbl tr.grp td { background: var(--paper); font-weight: 700; font-size: 12.5px; color: var(--txt); height: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stbl tr.grp:hover td { background: var(--ink-soft); }
.stbl tr.grp td.l { padding-inline-start: 4px; }
.stbl .g-tog { background: none; border: 0; padding: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); vertical-align: middle; }
.stbl .g-tog .ic { transition: transform var(--t); }
.stbl tr.grp.closed .g-tog .ic { transform: rotate(90deg); }
body[dir=ltr] .stbl tr.grp.closed .g-tog .ic { transform: rotate(-90deg); }
.stbl .g-name { background: none; border: 0; padding: 2px 4px; font: inherit; font-weight: 700; color: var(--txt); display: inline-flex; align-items: center; gap: 8px; border-radius: var(--rs); vertical-align: middle; }
.stbl .g-name:hover { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.stbl .g-name:focus-visible { outline: 2px solid var(--ink2); outline-offset: 1px; }
.stbl .g-name .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.stbl .g-note { font-size: 11.5px; font-weight: 400; color: var(--faint); }

.stbl tr.stg { cursor: pointer; }
.stbl tr.stg:hover td { background: var(--ink-soft); }
.stbl tr.stg.empty { cursor: default; color: var(--faint); }
.stbl tr.stg.empty td, .stbl tr.stg.empty td.nm { color: var(--faint); font-weight: 400; }
.stbl tr.stg.empty:hover td { background: transparent; }
.stbl .tr-bar { display: block; height: 9px; background: var(--slate-bg); border-radius: 5px; overflow: hidden; width: 100%; }
.stbl .tr-bar i { display: block; height: 100%; border-radius: 4px 0 0 4px; }
body[dir=ltr] .stbl .tr-bar i { border-radius: 0 4px 4px 0; }
.stbl + .card-f, .stbl .foot { font-size: 11.5px; color: var(--faint); }
@media (max-width: 720px) {
  .stbl th.b, .stbl td.b { display: none; }
  .stbl td.nm { padding-inline-start: 20px; }
}

/* ---------- بطاقات المناسبات ---------- */
.crow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cbtn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: none;
  border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.cbtn:hover { border-color: var(--brand-blue); transform: translateY(-2px); }
.cbtn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.cthumb { display: block; line-height: 0; }
.cthumb svg { display: block; width: 100%; height: auto; }
.cfull { display: block; max-width: 420px; margin: 0 auto; line-height: 0; border-radius: 14px; overflow: hidden; }
.cfull svg { display: block; width: 100%; height: auto; }
.cprev { display: flex; gap: 14px; align-items: center; margin: 12px 0 4px; }
.cprev .cthumb { width: 132px; flex: 0 0 132px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 720px) { .crow { grid-template-columns: 1fr; } }

/* ---------- سحب منافسة من منصة اعتماد ---------- */
.etm { border: 1px solid var(--accent); background: var(--paper); border-radius: 12px; padding: 12px 14px; margin: 2px 0 4px; }
.etm-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.etm-head b { font-size: 13px; }
.etm textarea.ctl { width: 100%; min-height: 64px; height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.etm-actions { display: flex; gap: 8px; margin-top: 8px; }
.etm-done { display: flex; align-items: center; gap: 10px; }
.etm-msg { display: flex; flex-direction: column; gap: 8px; }
.etm-msg:not(:empty) { margin-top: 10px; }
.etm-agency { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.etm-agency .ok-txt { color: var(--ok-ink); font-weight: 700; }


/* ---------- أقسام صفحة الهبوط ---------- */
.lp-sec { padding: clamp(46px, 7vw, 84px) clamp(16px, 4vw, 54px); background: var(--card); scroll-margin-top: 10px; }
.lp-sec.alt { background: var(--paper); border-block-start: 1px solid var(--line); }
.lp-head { max-width: 58ch; margin: 0 auto clamp(26px, 4vw, 44px); text-align: center; }
.lp-head h2 { font-size: clamp(23px, 3vw, 31px); margin: 0; color: var(--ink); font-weight: 800; letter-spacing: -.5px; text-wrap: balance; }
.lp-head p { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.lp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 1000px; margin: 0 auto; }
.lp-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px 24px 22px;
  box-shadow: var(--sh); display: flex; flex-direction: column; gap: 10px; }
.lp-sec.alt .lp-card { background: var(--card); }
.lp-card h3 { margin: 0; font-size: 18px; color: var(--ink); font-weight: 800; letter-spacing: -.3px; }
.lp-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.lp-card ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px;
  font-size: 13.5px; color: var(--txt); }
.lp-card li { display: flex; align-items: flex-start; gap: 9px; }
.lp-card li::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 999px; background: var(--accent); margin-top: 8px; }
.lp-go { margin-top: auto; align-self: flex-start; background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 11px 30px; cursor: pointer; }
.lp-go:hover { background: var(--ink2); }
.lp-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* الزر قد يكون <a> حين يُضبط رابط منصة المواهب — يبقى شكله زرًّا */
.lp-go { display: inline-block; text-decoration: none; text-align: center; }
.lp-go.off { background: var(--line); color: var(--muted); cursor: help; }
.lp-go.off:hover { background: var(--line); }

/* ---- اختيار المنصة (نافذة زر الدخول) ---- */
.lp-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.lp-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 20px 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  font-family: inherit; color: inherit; text-decoration: none; cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s; }
.lp-pick:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
/* المربّع قد يكون <a> — يبقى بطاقةً لا وصلةً مسطّرة */
.lp-pick, .lp-pick:hover, .lp-pick * { text-decoration: none; }
.lp-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-pick .ic { color: var(--ink); }
.lp-pick .nm { font-size: 14.5px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.lp-pick .nt { font-size: 11.5px; color: var(--muted); }
.lp-pick.off { cursor: help; opacity: .62; }
.lp-pick.off:hover { border-color: var(--line); background: var(--card); transform: none; }
@media (max-width: 560px) { .lp { font-size: 12.5px; } }
@media (max-width: 460px) { .lp-picks { grid-template-columns: 1fr; } }
.pick-back { display: block; margin: 14px auto 0; background: none; border: 0; padding: 6px 10px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 7px; }
.pick-back:hover { color: var(--ink); background: var(--paper); }
.pick-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick-back::before { content: "→"; margin-inline-end: 6px; }
[dir="ltr"] .pick-back::before { content: "←"; }
.lp-contact { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--sh); }
.lp-crow { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 20px; border-block-end: 1px solid var(--line); font-size: 14px; }
.lp-crow:last-child { border-block-end: 0; }
.lp-crow span { color: var(--muted); }
.lp-crow b { color: var(--txt); font-weight: 700; }
.lp-crow b.pending { color: var(--warn-ink); background: var(--warn-bg); border-radius: 7px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; }
.lp-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 20px clamp(16px, 4vw, 54px); background: var(--brand-ink); color: rgba(255,255,255,.55); font-size: 12.5px; }

@media (max-width: 780px) {
  .lh-top { flex-wrap: wrap; row-gap: 12px; }
  .lh-nav { order: 3; width: 100%; margin: 0; justify-content: center; }
  .lh-brand { margin-inline-end: auto; }
}

/* ============ مصمّم مسارات الخدمات (SVCUI) وإضافات مسار الخدمة ============ */
.spath-cust { margin-inline-start: 8px; }
.spath-svc { color: var(--accent-ink); font-weight: 700; }
.spath-st.custom u { border: 1px dashed var(--accent); }
.svcd { display: flex; flex-direction: column; gap: 12px; min-height: 320px; }
.svcd-list { display: flex; flex-direction: column; gap: 8px; }
.svcd-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: start;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; }
.svcd-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.svcd-name { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.svcd-name .field { min-width: 200px; flex: 1; }
.svcd-name .field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.svcd-hint { line-height: 1.7; }
.svcd-strip { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; row-gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.svcd-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--card);
  border-radius: 999px; padding: 5px 10px; font-size: 12.5px; max-width: 100%; }
.svcd-chip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.svcd-chip u { text-decoration: none; font-weight: 800; font-size: 11px; color: var(--muted); min-width: 16px; text-align: center; }
.svcd-chip.won { border-color: var(--ok-ink); }
.svcd-chip.off { opacity: .45; }
.svcd-chip.off .nm { text-decoration: line-through; }
.svcd-chip.custom { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); cursor: pointer; }
.svcd-chip.custom .grip { cursor: grab; color: var(--accent-ink); font-style: normal; }
.svcd-chip.custom.sel { box-shadow: 0 0 0 3px var(--accent-soft); border-style: solid; }
.svcd-chip.custom.dragging { opacity: .5; }
.svcd-chip.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.svcd-chip .bdg { font-size: 10px; font-weight: 800; color: var(--accent-ink); }
.svcd-chip .sla { font-size: 10.5px; color: var(--warn-ink); font-weight: 700; }
.svcd-chip .op { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; padding: 0 2px; color: var(--muted); }
.svcd-chip .op:hover { color: var(--ink); }
.svcd-chip .op.danger:hover { color: var(--danger-ink); }
.svcd-chip .lock { font-style: normal; font-size: 11px; cursor: help; }
.svcd-plus { align-self: center; width: 20px; height: 20px; border-radius: 50%; border: 1px dashed var(--line2);
  background: transparent; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; flex: none; }
.svcd-plus:hover, .svcd-plus.over { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.svcd-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.svcd-ed h4 { margin: 0 0 10px; font-size: 13.5px; }
.svcd-ed-grid { display: grid; grid-template-columns: 1fr 1fr 140px; gap: 10px; }
.svcd-ed-grid .field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.svcd-ed-grid .field .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.svcd-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 720px) { .svcd-ed-grid { grid-template-columns: 1fr; } .svcd-chip .nm { max-width: 110px; } }

/* ============ سير العمل: طلبات العمل والإشعارات ============ */
.hidden-file { display: none; }
.wrq-details { margin: 0 0 10px; line-height: 1.8; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; white-space: pre-wrap; }
.wrq-files { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.wrq-fh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wrq-fh h5 { margin: 0; font-size: 13px; flex: 1; }
.wrq-fl { display: flex; flex-direction: column; gap: 6px; }
.wrf { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.wrf:last-child { border-bottom: 0; }
.wrf .main { flex: 1; min-width: 0; }
.wrf .t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrf .s { font-size: 11.5px; color: var(--muted); }
.wrf .end { display: flex; align-items: center; gap: 6px; }
.wrq-tlh { margin: 14px 0 6px; font-size: 13px; }
.wrq-tl { border-inline-start: 2px solid var(--line2); padding-inline-start: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.wrq-tl .ev .d { font-size: 11px; color: var(--muted); }
.wrq-tl .ev .t { font-size: 12.5px; font-weight: 600; }
.wrq-tl .ev .s { font-size: 12px; color: var(--muted); }
.wrq-newfiles { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px dashed var(--line2); border-radius: 10px; padding: 10px 12px; }
.modal-actrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.nt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.nt-head h5 { margin: 0; font-size: 13px; flex: 1; }
.nt-sec { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.nt-unread .t { font-weight: 800; }
.nt-read { opacity: .72; }

/* ---------- الفوترة (INVUI) ---------- */
.pgbar{position:relative;height:16px;border-radius:9px;background:var(--line);overflow:hidden;min-width:90px;flex:1}
.pgbar .fill{position:absolute;inset-block:0;inset-inline-start:0;background:var(--ink);border-radius:9px;transition:width .3s}
.pgbar .fill.accent{background:var(--accent)}
.pgbar .v{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:800;color:var(--txt);text-shadow:0 0 4px var(--card)}
.ok-t{color:var(--ok)} .warn-t{color:var(--warn)}
.inv-stats{display:flex;gap:14px;flex-wrap:wrap;padding:10px 14px;border-block-end:1px solid var(--line)}
.inv-stats .st{display:flex;flex-direction:column;gap:4px;min-width:130px;flex:1}
.inv-stats .st .l{font-size:11.5px;color:var(--muted);font-weight:700}
.inv-stats .st .v{font-weight:800}
.inv-reqs{display:flex;flex-direction:column;gap:6px;margin-block-end:10px}
.inv-req{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid var(--line);border-radius:9px;cursor:pointer;font-size:13px}
.inv-req.done{opacity:.72;text-decoration:line-through}
.inv-req input{accent-color:var(--accent)}
.inv-attach{display:inline-flex;gap:6px;align-items:center}
.inv-plan-rows{display:flex;flex-direction:column;gap:10px;margin-block-start:8px}
.inv-plan-row{border:1px solid var(--line);border-radius:10px;padding:10px}
.inv-plan-row .r1{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}
.inv-plan-row .r1 .seq{font-weight:800;color:var(--muted);align-self:center;min-width:18px;text-align:center}
.inv-plan-row .f{display:flex;flex-direction:column;gap:3px}
.inv-plan-row .f label{font-size:10.5px;color:var(--muted);font-weight:700}
.inv-plan-row .f .ctl{padding:6px 8px}
.inv-plan-row .f.grow{flex:1;min-width:180px}
.inv-plan-row .f .ctl.num{width:110px}
.inv-plan-row .r2{display:flex;flex-direction:column;gap:3px;margin-block-start:8px}
.inv-plan-row .r2 label{font-size:10.5px;color:var(--muted);font-weight:700}
.inv-lockrow{display:flex;gap:10px;align-items:center;padding:7px 10px;border:1px dashed var(--line);border-radius:9px;margin-block-end:6px;opacity:.8}
.inv-lockrow .seq{font-weight:800;color:var(--muted)}
.inv-lockrow .ttl{flex:1}
.inv-lockrow .amt{font-weight:700}
.inv-now{border-inline-start:3px solid var(--accent);margin-block-end:14px}
.inv-now-h{display:flex;align-items:center;gap:14px;margin-block-end:8px}
.inv-now-h h4{margin:0;font-size:14px}
.inv-now-h .pgbar{max-width:220px}
.inv-now-row{display:flex;gap:10px;align-items:center;padding:8px 10px;border:1px solid var(--line);border-radius:10px;margin-block-start:6px;cursor:pointer}
.inv-now-row:hover{border-color:var(--accent)}
.inv-now-row .lbl{font-size:10.5px;font-weight:800;color:var(--muted);min-width:74px}
.inv-now-row .main{flex:1;min-width:0}
.inv-now-row .main .t{font-weight:700;font-size:13px}
.inv-now-row .main .s{font-size:11.5px;color:var(--muted)}
.inv-now-row .end{display:flex;gap:6px;align-items:center}

/* ===== صفحة الدخول المختصرة (تحت /crm/) =====
   بوابة إحراز هي صفحة التسويق؛ هذه صفحة دخول فقط: بطاقة واحدة موسّطة
   بعلامة إحراز وحقلين. لا بطل ولا أقسام — المنصة خلف الباب لا أمامه. */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--paper); position: relative; }
.signin-act { position: absolute; inset-block-start: 18px; inset-inline-start: 22px; }
/* زر اللغة هنا على خلفية فاتحة لا على البطل الكحلي: يرث شكل الوصلة الهادئة */
.signin .lh-lang { background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-family: inherit; font-size: 13px; cursor: pointer; }
.signin .lh-lang:hover { color: var(--txt); border-color: var(--line2); }
.signin-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 30px 26px; box-shadow: var(--sh-lg); }
.signin-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.signin-brand .nm { font-family: var(--ff-display); font-weight: 800; font-size: 30px;
  color: var(--brand-ink); line-height: 1.15; }
.signin-brand .tag { font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 12px; }
.signin-card .mid { text-align: center; }
.signin-card > .mid.small { margin: 2px 0 0; }
.signin-card .login-msg:empty { display: none; }
.signin-card form { margin-top: 18px; }
.signin-card .btn.block { margin-top: 6px; }
.signin-card .linkbtn { display: block; margin: 14px auto 2px; background: none; border: 0;
  color: var(--accent-ink); font-family: inherit; font-size: 13.5px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.signin-card .linkbtn:hover { color: var(--ink); }
.signin-card .linkbtn[disabled] { opacity: .5; cursor: default; text-decoration: none; }
/* الحقلان كلاهما إلزامي — نجمة على كليهما ضوضاء لا معلومة */
.signin-card .req, .signin-card label .req, .signin-card .field-req { display: none; }
.signin-card .xs { margin-top: 14px; }
@media (max-width: 480px) { .signin-card { padding: 26px 20px 20px; } .signin-brand .nm { font-size: 26px; } }
