/* ==========================================================================
   Paseer Strategy — إدارة وتطوير الاستراتيجية | Design System
   RTL-first · logical properties · light/dark · WCAG 2.2 AA
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --font: 'Tajawal', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'SFMono-Regular', monospace;

  /* neutrals */
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --surface-3: #EEF2F7;
  --border: #E6EBF2;
  --border-strong: #D3DBE6;
  --text: #14202E;
  --text-2: #4A5668;
  --text-3: #5F6B7C;
  --text-inv: #FFFFFF;

  /* brand */
  --primary: #0B6BC0;
  --primary-hover: #0A5CA6;
  --primary-press: #094E8C;
  --primary-50: #EAF3FC;
  --primary-100: #D4E7F9;
  --primary-200: #A9CEF1;
  /* ADR-DEC-129 (الخيار ب): تعبئة منفصلة عن لون النص لكل خلفية صلبة تحت نص أبيض؛ في الفاتح تساوي اللون نفسه */
  --primary-fill: #0B6BC0; --danger-fill: #B42318;
  --accent: #F29A45;
  --accent-50: #FEF2E6;
  --accent-ink: #A85709; /* نص بلون التمييز فوق الأبيض أو accent-50: ‎4.7:1 (التمييز نفسه 2.0:1 يبقى للتعبئة) */

  /* semantic */
  --success: #13795B; --success-bg: #E7F5EF; --success-bd: #B5E0CE;
  --warning: #A95A06; --warning-bg: #FEF4E6; --warning-bd: #F5D19E;
  --danger:  #B42318; --danger-bg:  #FDECEA; --danger-bd:  #F4B8B1;
  --info:    #1F5FBF; --info-bg:    #EAF1FC; --info-bd:    #B9CFF2;
  --violet:  #5B45B8; --violet-bg:  #F0EDFB; --violet-bd:  #CFC6F1;

  /* sidebar */
  --side-bg: #0A5596;
  --side-bg-2: #0A5596;
  --side-text: #E4EEF8;
  --side-text-strong: #FFFFFF;
  --side-muted: #C4D8EC;
  --side-active: #FFC48E;
  --side-border: rgba(255,255,255,.12);

  /* chart */
  --c1: #0B6BC0; --c2: #4FA3E8; --c3: #F29A45; --c4: #6D5BD0; --c5: #9AA7B3;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-xs: 0 1px 2px rgba(15,50,95,.04);
  --shadow-sm: 0 6px 18px -10px rgba(15,60,120,.18);
  --shadow-md: 0 14px 34px -14px rgba(15,60,120,.22);
  --shadow-lg: 0 24px 48px -12px rgba(16,24,40,.22);
  --ring: 0 0 0 3px rgba(11,107,192,.22);

  --side-w: 268px;
  --top-h: 62px;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0A1320;
  --surface: #0F1B2A;
  --surface-2: #132234;
  --surface-3: #18293E;
  --border: #21344B;
  --border-strong: #2D4561;
  --text: #E8EEF0;
  --text-2: #AFBEC4;
  --text-3: #83959C;
  --primary: #3D9BEA;
  --primary-hover: #5AAEF0;
  --primary-press: #2B86D4;
  --primary-50: #0F2842;
  --primary-100: #143557;
  --primary-200: #1E4C7A;
  --primary-fill: #1F74C2; --danger-fill: #C4473B; /* الأبيض عليهما 4.84 و4.87 */
  --accent: #F7A55E;
  --accent-50: #2E2112;
  --accent-ink: #F7A55E;
  --success: #3CC293; --success-bg: #0F2A21; --success-bd: #1C4D3C;
  --warning: #F0A54A; --warning-bg: #2E2110; --warning-bd: #563B18;
  --danger:  #F47C70; --danger-bg:  #33130F; --danger-bd:  #5E231C;
  --info:    #74A6F2; --info-bg:    #111F36; --info-bd:    #213B63;
  --violet:  #A898F0; --violet-bg:  #1E1834; --violet-bd:  #372D60;
  --side-bg: #073A68;
  --side-bg-2: #073A68;
  --c1: #3D9BEA; --c2: #86C2F4; --c3: #F7A55E; --c4: #A898F0; --c5: #5E717A;
  --shadow-md: 0 8px 22px -6px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6);
  --ring: 0 0 0 3px rgba(61,155,234,.35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.35; font-weight: 600; color: var(--text); }
h1 { font-size: 22px; letter-spacing: -.2px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13.5px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: 12.5px; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.mono, code { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 5px; color: var(--text-2); direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
::selection { background: var(--primary-100); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 999; background: var(--primary-fill); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* icons */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
[dir="rtl"] .i.flip { transform: scaleX(-1); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-text); display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--side-border);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #16899C, #0B5160); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 12px rgba(0,0,0,.25);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { color: var(--side-text-strong); font-weight: 700; font-size: 15.5px; line-height: 1.2; letter-spacing: .2px; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); }

.org-switch {
  margin: 4px 14px 10px; padding: 9px 11px; border-radius: 10px; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.045); border: 1px solid var(--side-border); cursor: pointer; color: var(--side-text-strong);
  width: calc(100% - 28px); font: inherit; text-align: start; transition: background .15s;
}
.org-switch:hover { background: rgba(255,255,255,.08); }
.org-logo { width: 30px; height: 30px; border-radius: 8px; background: #E9D8B4; color: #5B4212; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.org-switch .t { flex: 1; min-width: 0; }
.org-switch .t b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch .t span { font-size: 11.5px; color: var(--side-muted); }

.nav { padding: 6px 10px 18px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--side-muted); padding: 0 12px 6px; letter-spacing: .3px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 8px; margin: 1px 0;
  color: var(--side-text); font-size: 13.5px; font-weight: 500; text-decoration: none; position: relative;
  transition: background .12s, color .12s;
}
.nav a .i { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: var(--side-text-strong); }
.nav a.active { background: rgba(19,121,139,.28); color: #fff; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #3FC1D6; }
[dir="rtl"] .nav a.active::before { border-radius: 3px 0 0 3px; }
.nav a .count { margin-inline-start: auto; background: rgba(255,255,255,.1); color: var(--side-text-strong); font-size: 11px; padding: 0 7px; border-radius: 99px; line-height: 19px; font-weight: 600; }
.nav a .count.hot { background: #C2410C; color: #fff; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid var(--side-border); font-size: 11.5px; color: var(--side-muted); display: flex; align-items: center; gap: 8px; }
.side-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,.15); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 24px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; min-width: 340px; max-width: 460px; flex: 0 1 460px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-3); cursor: pointer; font: inherit; font-size: 13.5px;
  transition: border-color .15s, background .15s;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.search-trigger span { flex: 1; text-align: start; }
kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--text-3); background: var(--surface); line-height: 18px; direction: ltr; display: inline-block; }
.top-spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; position: relative; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .badge-dot { position: absolute; top: 1px; inset-inline-end: -3px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; background: var(--danger-fill); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; border: 2px solid var(--surface); box-sizing: content-box; text-align: center; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; font: inherit; color: var(--text); }
[dir="rtl"] .user-chip { padding: 4px 10px 4px 6px; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .t { text-align: start; line-height: 1.25; white-space: nowrap; }
.user-chip .t b { font-size: 13px; font-weight: 600; display: block; }
.user-chip .t span { font-size: 11.5px; color: var(--text-3); }
.top-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.env-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--accent-50); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; }

/* sidebar tabs */
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 4px 14px 6px; padding: 4px; border-radius: 11px; background: rgba(0,0,0,.25); border: 1px solid var(--side-border); }
.side-tab { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--side-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.side-tab:hover { color: var(--side-text-strong); background: rgba(255,255,255,.05); }
.side-tab.on { background: var(--side-active); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nav-panel { display: none; padding-top: 6px; }
.nav-panel.on { display: block; animation: fade .18s var(--ease); }
.nav-panel a { padding: 10px 12px; font-size: 14px; }
.nav-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--side-border); }
.nav-extra a { font-size: 13px; color: var(--side-muted); }

/* hub tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 124px; padding: 18px 12px; border-radius: 14px; background: var(--primary-fill); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s, background .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--primary-hover); }
.tile .i { width: 34px; height: 34px; stroke-width: 1.5; }

/* ---------- page header ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { opacity: .5; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .t { min-width: 0; }
.page-head p { color: var(--text-3); margin-top: 4px; max-width: 760px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.req-tag { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); padding: 0 6px; border-radius: 5px; direction: ltr; display: inline-block; line-height: 18px; vertical-align: middle; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; text-decoration: none !important;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--primary-press); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--danger-fill); border-color: var(--danger-fill); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; }
.btn-soft { background: var(--primary-50); border-color: transparent; color: var(--primary); box-shadow: none; }
.btn-soft:hover { background: var(--primary-100); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group .btn:first-child { border-start-start-radius: 9px; border-end-start-radius: 9px; margin: 0; }
.btn-group .btn:last-child { border-start-end-radius: 9px; border-end-end-radius: 9px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.card-head h2, .card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; font-weight: 400; }
.card-body { padding: 4px 18px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-3); }
.card.flush .card-body { padding: 0; }
.card-divider { border-top: 1px solid var(--border); }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; }
.g-side { grid-template-columns: 300px minmax(0,1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.grow { flex: 1; min-width: 0; }

/* KPI tile */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.kpi .lbl { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 13px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.kpi .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.kpi .ico { position: absolute; top: 16px; inset-inline-end: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; padding: 0 6px; border-radius: 6px; line-height: 20px; }
.delta.up { color: var(--success); background: var(--success-bg); }
.delta.down { color: var(--danger); background: var(--danger-bg); }
.delta.flat { color: var(--text-3); background: var(--surface-3); }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 0 8px; border-radius: 99px; line-height: 22px; white-space: nowrap; border: 1px solid transparent; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: none; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.b-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.b-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-bd); }
.b-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-bd); }
.b-violet  { background: var(--violet-bg);  color: var(--violet);  border-color: var(--violet-bd); }
.b-primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.b-neutral { background: var(--surface-3);  color: var(--text-2);  border-color: var(--border); }
.b-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.b-square { border-radius: 6px; }
.prio { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 5px; line-height: 19px; direction: ltr; display: inline-block; }
.prio.p0 { background: var(--danger-bg); color: var(--danger); }
.prio.p1 { background: var(--warning-bg); color: var(--warning); }
.prio.p2 { background: var(--info-bg); color: var(--info); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field .req { color: var(--danger); }
.help { font-size: 12px; color: var(--text-3); }
.err { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 5px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13.5px; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.invalid { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7885' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 11px center; }
[dir="ltr"] .select { background-position: right 11px center; }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; border-radius: 8px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .i { position: absolute; inset-inline-start: 11px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-inline-start: 36px; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.input-affix:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.input-affix .input { border: 0; box-shadow: none !important; border-radius: 0; }
.input-affix .affix { display: grid; place-items: center; padding: 0 11px; background: var(--surface-2); color: var(--text-3); font-size: 12.5px; border-inline-start: 1px solid var(--border); white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 20px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section > h3 { margin-bottom: 4px; }
.form-section > .help { margin-bottom: 16px; display: block; }

/* bilingual pair  (N-D10-01 / N-V4-04) */
.bi { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.bi:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.bi > div { position: relative; }
.bi > div + div { border-inline-start: 1px solid var(--border); }
.bi .input { border: 0; border-radius: 0; box-shadow: none !important; padding-inline-start: 42px; }
.bi .lang { position: absolute; inset-inline-start: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-weight: 700; color: var(--text-3); background: var(--surface-3); border-radius: 5px; padding: 0 5px; line-height: 18px; font-family: var(--mono); }
.bi .input[dir="ltr"] { text-align: left; }

/* checkbox / radio / switch */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: 5px; margin: 0; display: grid; place-items: center; background: var(--surface); cursor: pointer; transition: all .12s; flex: none; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--primary-fill); border-color: var(--primary-fill); }
.check input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.check input[type="radio"]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.check input:focus-visible { box-shadow: var(--ring); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .18s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .18s var(--ease); }
.switch input:checked { background: var(--primary-fill); }
.switch input:checked::after { inset-inline-start: 18px; }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible { box-shadow: var(--ring); }

/* segmented */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0 12px; height: 28px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text-3); padding: 10px 14px 11px; cursor: pointer; position: relative; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); }
.tab.on::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--primary-fill); }
.tab .n { font-size: 11px; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 0 7px; line-height: 18px; }
.tab.on .n { background: var(--primary-50); color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fade .18s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input-group { flex: 0 1 300px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 8px; border: 1px dashed var(--border-strong); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.set { border-style: solid; background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); font-weight: 600; }
.chip .x { opacity: .6; }
.views { display: flex; align-items: center; gap: 4px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.view-tab { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding: 6px 11px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; font-family: inherit; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.view-tab.on { background: var(--surface-3); color: var(--text); }
.view-tab:hover { color: var(--text); }
.bulk-bar { display: none; align-items: center; gap: 10px; padding: 9px 16px; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); font-size: 13px; color: var(--primary); font-weight: 600; }
.bulk-bar.on { display: flex; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: start; font-weight: 600; font-size: 12px; color: var(--text-3); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.sel { background: var(--primary-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .w-check { width: 44px; padding-inline-end: 0; }
.table .actions { text-align: end; white-space: nowrap; width: 1%; }
.table .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-main b { font-weight: 600; display: block; line-height: 1.35; }
.table .cell-main span { font-size: 12px; color: var(--text-3); }
.table .cell-main span.av { color: #fff; } /* الصورة الرمزية داخل الخلية تبقى بنص أبيض فوق لونها */
.table.compact td { padding: 8px 14px; }
.table.dense th, .table.dense td { padding: 8px 10px; font-size: 12.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); gap: 12px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager .pg { min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.pager .pg.on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; font-weight: 600; }

/* avatar */
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; background: var(--c1); letter-spacing: 0; }
.av-sm { width: 26px; height: 26px; font-size: 10.5px; }
.av-lg { width: 48px; height: 48px; font-size: 16px; }
.av-xl { width: 72px; height: 72px; font-size: 24px; }
.av.a2 { background: #3A78A6; } .av.a3 { background: #946C25; } .av.a4 { background: #5B45B8; } .av.a5 { background: #13795B; } .av.a6 { background: #B4453A; } .av.a7 { background: #4A5A66; }
.av-stack { display: inline-flex; }
.av-stack .av { border: 2px solid var(--surface); margin-inline-start: -8px; }
.av-stack .av:first-child { margin-inline-start: 0; }

/* status dot */
.sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sdot.ok { background: var(--success); } .sdot.warn { background: var(--warning); } .sdot.bad { background: var(--danger-fill); } .sdot.off { background: var(--text-3); } .sdot.info { background: var(--info); }

/* progress */
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--primary-fill); }
.progress.warn > span { background: var(--warning); }
.progress.bad > span { background: var(--danger-fill); }
.progress.ok > span { background: var(--success); }
.progress.lg { height: 9px; }

/* list */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.list .li-main { flex: 1; min-width: 0; }
.list .li-main b { font-weight: 600; display: block; font-size: 13.5px; }
.list .li-main span { font-size: 12.5px; color: var(--text-3); }
.list-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.list-ico.p { background: var(--primary-50); color: var(--primary); }
.list-ico.w { background: var(--warning-bg); color: var(--warning); }
.list-ico.d { background: var(--danger-bg); color: var(--danger); }
.list-ico.s { background: var(--success-bg); color: var(--success); }
.list-ico.v { background: var(--violet-bg); color: var(--violet); }
.list-ico.n { background: var(--info-bg); color: var(--info); }

/* key-value */
.kv { display: grid; grid-template-columns: minmax(92px, 132px) 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding-inline-start: 30px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 8px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; inset-inline-start: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); display: grid; place-items: center; }
.timeline .tl-dot.ok { border-color: var(--success); background: var(--success); }
.timeline .tl-dot.warn { border-color: var(--warning); }
.timeline .tl-dot.bad { border-color: var(--danger); }
.timeline .tl-dot.off { border-color: var(--border-strong); }
.timeline .tl-dot.ok::after { content: ""; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.timeline b { font-weight: 600; font-size: 13.5px; }
.timeline .when { font-size: 12px; color: var(--text-3); }
.timeline .note { margin-top: 6px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; font-size: 13px; color: var(--text-2); }

/* stepper (wizard UX-TEST-001) */
.stepper { display: flex; gap: 0; counter-reset: st; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; position: relative; font-size: 13px; color: var(--text-3); font-weight: 500; }
.step:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border); margin-inline: 10px; border-radius: 2px; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-3); flex: none; }
.step.done .n { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.step.done:not(:last-child)::after { background: var(--primary-fill); }
.step.cur { color: var(--text); font-weight: 600; }
.step.cur .n { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }

/* tree */
.tree { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.tree ul { list-style: none; margin: 0; padding-inline-start: 20px; position: relative; }
.tree ul::before { content: ""; position: absolute; inset-inline-start: 11px; top: 0; bottom: 12px; width: 1px; background: var(--border); }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; position: relative; }
.tree .node:hover { background: var(--surface-3); }
.tree .node.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.tree .tog { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-3); border: 0; background: none; padding: 0; cursor: pointer; transition: transform .15s; flex: none; }
.tree .tog.leaf { visibility: hidden; }
.tree li.closed > ul { display: none; }
[dir="rtl"] .tree li.closed > .node .tog { transform: rotate(90deg); }
[dir="ltr"] .tree li.closed > .node .tog { transform: rotate(-90deg); }
.tree .node .cnt { margin-inline-start: auto; font-size: 11.5px; color: var(--text-3); font-weight: 500; }

/* alerts */
.alert { display: flex; gap: 12px; padding: 13px 15px; border-radius: 10px; border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.alert .i { margin-top: 2px; }
.alert b { font-weight: 600; }
.alert.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--text); } .alert.info > .i { color: var(--info); }
.alert.warn { background: var(--warning-bg); border-color: var(--warning-bd); color: var(--text); } .alert.warn > .i { color: var(--warning); }
.alert.danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--text); } .alert.danger > .i { color: var(--danger); }
.alert.success { background: var(--success-bg); border-color: var(--success-bd); color: var(--text); } .alert.success > .i { color: var(--success); }
.alert .grow p { color: var(--text-2); margin-top: 2px; }

/* provenance (UX-PRIV-001 transparency) */
.prov { position: relative; display: inline-flex; }
.prov-btn { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; padding: 0; }
.prov-btn:hover, .prov.open .prov-btn { background: var(--surface-3); color: var(--primary); }
.prov-pop { display: none; position: absolute; top: calc(100% + 6px); inset-inline-start: -10px; z-index: 30; width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px; font-size: 12.5px; font-weight: 400; color: var(--text); text-align: start; }
.prov.open .prov-pop { display: block; animation: fade .15s; }
.prov-pop h5 { font-size: 12.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.prov-pop dl { display: grid; grid-template-columns: 88px 1fr; gap: 5px 10px; margin: 0; }
.prov-pop dt { color: var(--text-3); }
.prov-pop dd { margin: 0; font-weight: 500; }

/* dropdown */
.dd { position: relative; }
.dd-menu { display: none; position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.dd.start .dd-menu { inset-inline-end: auto; inset-inline-start: 0; }
.dd.open .dd-menu { display: block; animation: fade .14s var(--ease); }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; border: 0; background: none; width: 100%; font-family: inherit; text-align: start; text-decoration: none !important; }
.dd-item:hover { background: var(--surface-3); }
.dd-item .i { color: var(--text-3); }
.dd-item.danger { color: var(--danger); } .dd-item.danger .i { color: var(--danger); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 8px 10px 6px; font-size: 11.5px; color: var(--text-3); font-weight: 600; }

/* product switcher */
.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 372px; padding: 6px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border-radius: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; text-decoration: none !important; position: relative; }
.app-tile:hover { background: var(--surface-3); }
.app-tile .ai { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.app-tile.off { opacity: .45; }
.app-tile.off::after { content: "غير مفعّل"; font-size: 10px; font-weight: 500; color: var(--text-3); }
.app-tile.cur { background: var(--primary-50); }

/* notification panel */
.notif-panel { width: 400px; padding: 0; }
.notif-panel .np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--primary-50) 55%, transparent); }
.notif-item .when { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* drawer / modal */
.scrim { position: fixed; inset: 0; background: rgba(8,18,23,.48); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(2px); }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100vw); background: var(--surface); z-index: 100; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .26s var(--ease); }
[dir="ltr"] .drawer { transform: translateX(102%); }
.drawer.on { transform: none !important; }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); border-radius: 16px; z-index: 100; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .2s var(--ease); display: flex; flex-direction: column; }
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 20px 22px 6px; display: flex; gap: 14px; align-items: flex-start; }
.modal-body { padding: 10px 22px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.modal-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }

/* command palette */
.cmdk { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%) scale(.98); width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 110; opacity: 0; visibility: hidden; pointer-events: none; transition: all .16s var(--ease), visibility 0s linear .16s; overflow: hidden; border: 1px solid var(--border); }
.cmdk.on { opacity: 1; visibility: visible; transition: all .16s var(--ease), visibility 0s; pointer-events: auto; transform: translateX(-50%) scale(1); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.cmdk-scope { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--text); text-decoration: none !important; }
.cmdk-item:hover, .cmdk-item.on { background: var(--primary-50); }
.cmdk-item .sub { font-size: 12px; color: var(--text-3); }
.cmdk-item .go { margin-inline-start: auto; color: var(--text-3); font-size: 11.5px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); background: var(--surface-2); }

/* toast */
.toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 130; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: #0F1B24; color: #fff; padding: 11px 14px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px; min-width: 280px; animation: toastIn .25s var(--ease); }
.toast .i { color: #5FD4A8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* empty / skeleton / states */
.empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .e-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); margin-bottom: 4px; }
.empty p { color: var(--text-3); max-width: 380px; }
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; height: 12px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* dual date (N-D3-04) */
.ddate { display: inline-flex; flex-direction: column; line-height: 1.3; }
.ddate .h { font-size: 11.5px; color: var(--text-3); }
.topbar .ddate { white-space: nowrap; }

/* matrix (RBAC / SoD) */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; width: 100%; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 200px; }
.matrix thead th { font-size: 11.5px; color: var(--text-3); font-weight: 600; background: var(--surface-2); vertical-align: bottom; white-space: nowrap; }
.matrix thead th:first-child { background: var(--surface-2); }
.matrix tr.grp td { background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--text-2); text-align: start; }
.perm { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; }
.perm.y { background: var(--success-bg); color: var(--success); }
.perm.c { background: var(--warning-bg); color: var(--warning); }
.perm.n { color: var(--border-strong); }
.perm.x { background: var(--danger-bg); color: var(--danger); }

/* mini charts */
.spark { width: 100%; height: 40px; display: block; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars > div { flex: 1; background: var(--primary-100); border-radius: 5px 5px 2px 2px; position: relative; min-height: 4px; transition: background .15s; }
.bars > div:hover { background: var(--primary-fill); }
.bars > div.hi { background: var(--primary-fill); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ring { --v: 70; --c: var(--primary); width: 92px; height: 92px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-label); width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 18px; }

/* quota meter */
.meter-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.meter-row .progress { grid-column: 1 / -1; }

/* state flow (workflow designer) */
.flow { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 18px 4px 8px; }
.flow-node { min-width: 148px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); position: relative; flex: none; cursor: pointer; }
.flow-node:hover { border-color: var(--primary); }
.flow-node.sel { border-color: var(--primary); box-shadow: var(--ring); }
.flow-node .k { font-size: 11px; color: var(--text-3); font-weight: 600; }
.flow-node b { display: block; font-size: 13.5px; margin-top: 2px; }
.flow-node .meta { font-size: 11.5px; color: var(--text-3); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.flow-node.start { border-color: var(--success); }
.flow-node.end { border-color: var(--text-3); background: var(--surface-2); }
.flow-arrow { flex: none; width: 46px; height: 2px; background: var(--border-strong); position: relative; }
.flow-arrow::after { content: ""; position: absolute; inset-inline-end: -1px; top: -4px; border: 5px solid transparent; }
[dir="rtl"] .flow-arrow::after { border-right-color: var(--border-strong); inset-inline-end: -6px; }
[dir="ltr"] .flow-arrow::after { border-left-color: var(--border-strong); inset-inline-end: -6px; }
.flow-arrow span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

/* code block */
.codeblock { background: #0C1A20; color: #CFE3E8; border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; direction: ltr; text-align: left; overflow-x: auto; }
.codeblock .k { color: #7FD1E0; } .codeblock .s { color: #E7C27D; } .codeblock .c { color: #6A8791; }

/* auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-side { background: radial-gradient(1200px 600px at 100% 0%, #13798B 0%, transparent 55%), radial-gradient(900px 500px at 0% 100%, #0E3F4A 0%, transparent 60%), #08171C; color: #D7E6EA; padding: 44px 52px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); pointer-events: none; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 410px; }

/* utilities */
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.end { text-align: end; }
.bold { font-weight: 600; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.section-title { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .2px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.box-dashed { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 16px; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) { .topbar .ddate { display: none; } }
@media (max-width: 1440px) { .g-side .g-2 { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); z-index: 120; transform: translateX(105%); transition: transform .25s var(--ease); }
  [dir="ltr"] .sidebar { transform: translateX(-105%); }
  .sidebar.on { transform: none !important; }
  .menu-btn { display: inline-grid; }
  .search-trigger { min-width: 0; flex: 1 1 auto; }
  .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-side { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 16px 16px 40px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .search-trigger span, .search-trigger kbd, .user-chip .t, .env-pill, .top-divider, .topbar [aria-label="المساعدة"], .topbar [aria-label="مساعد الاستخدام"], .topbar > [data-pxhelp="panel"] { display: none; }
  .search-trigger { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; }
  .g-2, .g-3, .g-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  h1 { font-size: 19px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .apps-grid { width: calc(100vw - 40px); }
  .notif-panel { width: calc(100vw - 24px); }
  .bi { grid-template-columns: 1fr; }
  .bi > div + div { border-inline-start: 0; border-top: 1px solid var(--border); }
  .stepper .step .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar { display: none; } .app { display: block; } }


/* ==========================================================================
   Paseer Blue theme — component overrides
   ========================================================================== */
body { font-size: 14.5px; }
h1, h2, h3, h4, .bold, b, strong { font-weight: 700; }
.num, .kpi .val { font-feature-settings: "tnum"; }

/* sidebar: solid blue, orange active */
.sidebar { background: var(--side-bg); border-inline-end: 0; box-shadow: -6px 0 24px -12px rgba(10,60,110,.35); }
.brand { padding: 22px 22px 14px; }
.brand-mark { background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); border-radius: 12px; }
.brand-name { font-size: 18px; font-weight: 800; }
.brand-sub { color: var(--side-muted); }
.org-switch { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); border-radius: 14px; }
.org-switch:hover { background: rgba(255,255,255,.14); }
.side-tabs { background: rgba(0,0,0,.14); border-color: rgba(255,255,255,.1); border-radius: 14px; }
.side-tab { border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--side-text); }
.side-tab.on { background: #fff; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.nav { padding: 8px 12px 18px; }
.nav a { font-size: 16px; font-weight: 500; padding: 12px 14px; gap: 16px; border-radius: 12px; color: var(--side-text); }
.nav a .i { width: 23px; height: 23px; opacity: 1; stroke-width: 1.9; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: transparent; color: var(--side-active); font-weight: 700; }
.nav a.active::before { display: none; }
.nav a.active .i { color: var(--side-active); }
.nav-extra a { font-size: 14px; color: var(--side-muted); padding: 9px 14px; }
.nav a .count { background: rgba(255,255,255,.18); }
.nav a .count.hot { background: #F29A45; color: #1B1206; }
.side-foot { color: var(--side-muted); }

/* topbar */
.topbar { height: 74px; background: var(--surface); backdrop-filter: none; border-bottom: 0; box-shadow: 0 1px 0 var(--border); padding: 0 28px; }
.search-trigger { height: 46px; border-radius: 16px; background: var(--surface-2); border-color: var(--border); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; color: var(--text); }
.icon-btn .i { width: 22px; height: 22px; }
.icon-btn.ai-btn { background: var(--primary-fill); color: #fff; box-shadow: 0 6px 16px -6px rgba(11,107,192,.7); }
.icon-btn.ai-btn:hover { background: var(--primary-hover); color: #fff; }
.icon-btn.lang-btn { border: 1.5px solid var(--text); font: inherit; font-size: 14px; font-weight: 600; width: 42px; height: 42px; }
.user-chip { border-radius: 14px; }

/* page hero (replaces the plain page head) */
.content { padding: 28px 30px 56px; }
.page-head {
  position: relative; overflow: hidden; align-items: center; margin-bottom: 26px; padding: 26px 30px; border-radius: 36px; color: #fff;
  background: linear-gradient(to left, #0F7CD4 0%, #0A63B0 45%, #084C8C 100%);
  box-shadow: 0 22px 40px -22px rgba(11,107,192,.75);
}
.page-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(600px 180px at 85% -20%, rgba(255,255,255,.16), transparent 70%); }
.page-head > * { position: relative; z-index: 1; }
.hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 420px; }
.hero-ico { width: 74px; height: 74px; border-radius: 20px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); color: #fff; }
.hero-ico .i { width: 34px; height: 34px; stroke-width: 1.9; }
.page-head h1, .page-head h2 { color: #fff; font-size: 27px; font-weight: 800; letter-spacing: 0; }
.page-head p { color: rgba(255,255,255,.86); font-size: 14.5px; margin-top: 6px; }
.page-head .crumbs { display: none; }
.page-head .req-tag { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }
.page-head .badge { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.24); }
.page-head .btn { height: 50px; padding: 0 24px; border-radius: 999px; font-size: 15px; font-weight: 700; border: 0; box-shadow: none;
  background: rgba(255,255,255,.12); color: #fff; }
.page-head .btn:hover { background: rgba(255,255,255,.2); }
.page-head .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); }
.page-head .btn-primary:hover { background: #F2F8FF; color: var(--primary-hover); }
.page-head .btn .i { width: 20px; height: 20px; }
.page-head .btn .badge { background: #fff; color: var(--primary); }
.page-head .seg { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); border-radius: 999px; padding: 4px; }
.page-head .seg button { color: rgba(255,255,255,.85); border-radius: 999px; height: 38px; padding: 0 16px; font-size: 13.5px; }
.page-head .seg button.on { background: #fff; color: var(--primary); }
.page-head .select { height: 50px; border-radius: 999px; border: 0; background-color: rgba(255,255,255,.95); }
.page-head .row h1 + .badge, .page-head .row .badge { font-size: 12px; }

/* cards */
.card { border-radius: var(--radius); border-color: #EDF1F6; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .card { border-color: var(--border); }
.card-head { padding: 20px 22px 14px; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 800; }
.card-body { padding: 4px 22px 22px; }
.card-foot { padding: 14px 22px; }

/* KPI tiles: tinted icon square at start, big number */
.kpi { padding: 22px 24px; }
.kpi:has(.ico) { padding-inline-start: 104px; min-height: 108px; justify-content: center; }
.kpi .ico { inset-inline-end: auto; inset-inline-start: 22px; top: 22px; width: 64px; height: 64px; border-radius: 18px;
  background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-100); }
.kpi .ico .i { width: 28px; height: 28px; }
.grid > .kpi:nth-child(4n+2) .ico { background: var(--violet-bg); color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet-bd); }
.grid > .kpi:nth-child(4n+3) .ico { background: var(--success-bg); color: var(--success); box-shadow: inset 0 0 0 1px var(--success-bd); }
.grid > .kpi:nth-child(4n+4) .ico { background: #E6F6F7; color: #0E8A94; box-shadow: inset 0 0 0 1px #BDE6E9; }
:root[data-theme="dark"] .grid > .kpi:nth-child(4n+4) .ico { background: #0E2A2E; color: #4FC6CF; box-shadow: inset 0 0 0 1px #1C4A50; }
.kpi .val { font-size: 32px; font-weight: 800; letter-spacing: 0; }
.kpi .lbl { font-size: 14px; }

/* buttons */
.btn { height: 42px; border-radius: 12px; font-weight: 700; border-color: var(--border-strong); }
.btn-sm { height: 36px; border-radius: 11px; }
.btn-xs { height: 28px; border-radius: 8px; }
.btn-primary { box-shadow: 0 8px 18px -10px rgba(11,107,192,.8); }
.btn-soft { border-radius: 12px; }

/* table: roomy rows, pastel square actions */
.table th { background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 700; padding: 16px 18px; border-bottom-color: #EEF1F6; }
.table td { padding: 16px 18px; border-bottom-color: #EEF1F6; }
.table .cell-main b { font-size: 15px; font-weight: 700; }
.table .cell-main span { font-size: 13px; }
.table .actions .btn, .table td > .btn { height: 42px; min-width: 42px; border-radius: 13px; border: 0; box-shadow: none; background: var(--primary-50); color: var(--primary); }
.table .actions .btn:hover, .table td > .btn:hover { background: var(--primary-100); }
.table .actions .btn-primary { background: var(--primary-fill); color: #fff; }
.table .actions .dd .btn { background: var(--violet-bg); color: var(--violet); }
.table.compact td, .table.dense td { padding: 11px 16px; }
.table.dense th { padding: 11px 16px; }
.pager { padding: 14px 20px; }
.pager .pg { border-radius: 10px; min-width: 34px; height: 34px; }

/* list icons, badges */
.list > li { padding: 14px 22px; }
.list-ico { width: 42px; height: 42px; border-radius: 13px; }
.badge { border-radius: 999px; line-height: 26px; padding: 0 12px; font-size: 12.5px; font-weight: 700; }
.b-primary { background: var(--primary-50); border-color: var(--primary-200); }
.b-neutral, .b-outline { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); }
.prio, .req-tag { border-radius: 6px; }

/* inputs: soft pill search */
.input, .select, .textarea { border-radius: 13px; border-color: var(--border); background-color: var(--surface-2); height: 44px; }
.input:focus, .select:focus, .textarea:focus { background-color: var(--surface); }
.input-sm, .select.input-sm { height: 40px; border-radius: 12px; }
.toolbar { padding: 16px 20px; }
.toolbar .input-group { flex: 0 1 380px; }
.toolbar .input-group .input { border-radius: 999px; }
.chip { height: 36px; border-radius: 999px; padding: 0 14px; }
.bi, .input-affix { border-radius: 13px; }

/* tabs & segmented */
.tab { font-size: 14.5px; padding: 12px 16px 13px; }
.tab.on::after { height: 3px; }
.seg { border-radius: 12px; }
.seg button { border-radius: 9px; }
.view-tab { border-radius: 999px; padding: 7px 14px; font-size: 13.5px; }
.view-tab.on { background: var(--primary-50); color: var(--primary); }

/* tree: tinted letter squares feel */
.tree .node { padding: 9px 10px; border-radius: 12px; }
.tree .node.on { background: var(--primary-50); }

/* drawers/modals */
.drawer { border-start-end-radius: 0; }
.modal { border-radius: 24px; }
.modal-foot { border-radius: 0 0 24px 24px; }
.dd-menu { border-radius: 16px; }
.alert { border-radius: 16px; }
.box { border-radius: 14px; }
.av { background: var(--primary-fill); }

/* auth panel matches the blue */
.auth-side { background: radial-gradient(1000px 520px at 100% 0%, #1E8BE0 0%, transparent 55%), radial-gradient(900px 500px at 0% 100%, #083E73 0%, transparent 60%), #0A5596; }

@media (max-width: 720px) {
  .page-head { padding: 20px; border-radius: 26px; }
  .hero-ico { width: 56px; height: 56px; border-radius: 16px; }
  .page-head h1 { font-size: 21px; }
  .page-head .btn { height: 44px; padding: 0 18px; }
  .kpi:has(.ico) { padding-inline-start: 90px; }
  .kpi .ico { width: 54px; height: 54px; }
  .topbar { height: 64px; padding: 0 12px; }
  .icon-btn.lang-btn { display: none; }
}
.search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1024px) { .search-trigger kbd, .topbar [aria-label="المساعدة"], .topbar [aria-label="تحديث"], .topbar > [data-pxhelp="panel"], .topbar > [id="reloadBtn"], .topbar > [data-reload] { display: none; } }  /* language-independent twins: the English edition shares this stylesheet */
.kpi .meta { flex-wrap: wrap; row-gap: 6px; }
.kpi:has(.ico) { padding-inline-start: 94px; }
.kpi .ico { width: 56px; height: 56px; border-radius: 16px; }
@media (max-width: 1440px) { .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* sidebar tabs: icon over label */
.side-tabs { grid-template-columns: repeat(3, 1fr); }
.side-tab { flex-direction: column; gap: 3px; height: 54px; font-size: 11.5px; line-height: 1.2; padding: 0 2px; white-space: normal; text-align: center; }
.side-tab .i { width: 18px; height: 18px; }


/* ==========================================================================
   Paseer Performance — inherited product components
   ========================================================================== */
.brand-mark.st-mark { background: linear-gradient(135deg, #1E8BE0, #3B3FB8); box-shadow: 0 6px 14px -6px rgba(0,0,0,.45); }
.page-head { background: linear-gradient(to left, #0E86D4 0%, #0B5CAD 50%, #2B3A9E 100%); }

/* directive banner (manager guidance) */
.directive { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; border-radius: 20px; color: #fff; background: linear-gradient(to left, #0F1B3D, #1B2A6B); box-shadow: var(--shadow-md); }
.directive .lbl { font-size: 12px; color: #8CC8FF; font-weight: 700; }
.directive p { color: #D9E3F5; font-size: 13.5px; margin-top: 2px; }
.directive .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
.directive .btn:hover { background: rgba(255,255,255,.18); }
.window-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--warning-bg); border: 1px solid var(--warning-bd); font-size: 13px; }
.window-bar.closed { background: var(--surface-3); border-color: var(--border); }

/* stage strip — STRAT-V10-10 */
.stages { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }
.stage { border-radius: 16px; padding: 12px 14px; border: 1.5px solid var(--border); background: var(--surface); position: relative; }
.stage .n { font-size: 11px; font-weight: 800; color: var(--text-3); }
.stage b { display: block; font-size: 13.5px; margin: 2px 0 8px; }
.stage .st { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.stage.done { border-color: var(--success-bd); background: var(--success-bg); } .stage.done .st { color: var(--success); }
.stage.cur { border-color: var(--primary); box-shadow: var(--ring); } .stage.cur .st { color: var(--primary); }
.stage.reopened { border-color: var(--warning-bd); background: var(--warning-bg); } .stage.reopened .st { color: var(--warning); }
.stage.todo .st { color: var(--text-3); }
@media (max-width: 900px) { .stages { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* tool list (studio aside) */
.tool-item { width: 100%; text-align: start; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, background .12s; }
.tool-item:hover { border-color: var(--primary-200); background: var(--surface-2); }
.tool-item.on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 6px 14px -10px rgba(11,107,192,.6); }
.tool-item.locked { opacity: .6; cursor: not-allowed; }
.tool-item .nm { font-weight: 700; font-size: 13.5px; }
.tool-item .sub { font-size: 11.5px; color: var(--text-3); }
.tcode { background: var(--primary-fill); color: #fff; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; direction: ltr; display: inline-block; }
.mode { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; display: inline-block; border: 1px solid; }
.mode.collab { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.mode.direct { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-bd); }
.mode.imported { background: var(--accent-50); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.mode.off { background: var(--surface-3); color: var(--text-3); border-color: var(--border); }
.progress-card { border-radius: 20px; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, #0F1B3D, #23307E); }
.progress-card .progress { background: rgba(255,255,255,.15); }
.progress-card .progress > span { background: linear-gradient(to left, #5FD4F4, #2AA3E8); }

/* axis stepper */
.axes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.axis { text-align: start; border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; transition: all .12s; }
.axis:hover { border-color: var(--primary-200); }
.axis .k { font-size: 10.5px; font-weight: 800; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 6px; align-self: flex-start; direction: ltr; }
.axis b { font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.axis .meta { font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; }
.axis.on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; box-shadow: 0 8px 18px -10px rgba(11,107,192,.8); }
.axis.on .k { background: rgba(255,255,255,.2); color: #fff; } .axis.on .meta { color: rgba(255,255,255,.85); }
.axis.ok { background: var(--success-bg); border-color: var(--success-bd); } .axis.ok .meta b { color: var(--success); }

/* space tabs */
.space-tabs { display: flex; gap: 6px; flex-wrap: wrap; background: var(--surface-3); padding: 5px; border-radius: 14px; }
.space-tabs button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--text-2); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.space-tabs button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.space-tabs button[disabled] { opacity: .5; cursor: not-allowed; }

/* participant boxes & contributions */
.pbox { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.pbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.pbox-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.contrib { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.contrib.picked { border-color: var(--warning-bd); background: var(--warning-bg); }
.contrib p { font-weight: 600; font-size: 13.5px; line-height: 1.75; }
.votes { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vote-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-2); }
.vote-btn.on { background: var(--primary-fill); border-color: var(--primary-fill); color: #fff; }
.vote-btn[disabled] { opacity: .45; cursor: not-allowed; }
.voter { font-size: 11px; color: var(--text-3); }
.thread { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 6px; }
.cmt { font-size: 12.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.cmt b { color: var(--primary); }
.cmt-form { display: flex; gap: 6px; }
.cmt-form .input { height: 34px; font-size: 12.5px; }

/* leader panel & proposals */
.leader-panel { border: 1.5px solid var(--violet-bd); background: var(--violet-bg); border-radius: 18px; padding: 16px; }
.leader-panel h4 { color: var(--violet); display: flex; align-items: center; gap: 8px; }
.proposal { border: 1.5px solid var(--border); border-radius: 18px; padding: 16px; background: var(--surface); }
.proposal.chosen { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.stars { display: inline-flex; gap: 2px; direction: ltr; }
.stars button { border: 0; background: none; padding: 0 1px; cursor: pointer; color: var(--border-strong); font-size: 20px; line-height: 1; }
.stars button.on { color: #F2A93B; }
.stars button[disabled] { cursor: not-allowed; }
.agg { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.decision { border: 1.5px solid var(--success-bd); background: var(--success-bg); border-radius: 18px; padding: 16px; }
.opt-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.opt { border: 1.5px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px; cursor: pointer; font: inherit; text-align: start; color: inherit; }
.opt.on { border-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
.opt b { display: block; font-size: 13px; } .opt span { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 900px) { .opt-grid { grid-template-columns: 1fr 1fr; } }

/* risk heatmap */
.heat { display: grid; grid-template-columns: 34px repeat(5, minmax(0,1fr)); gap: 6px; direction: ltr; }
.heat .ax { font-size: 11px; color: var(--text-3); display: grid; place-items: center; font-weight: 700; }
.heat .cell { height: 58px; border-radius: 10px; border: 1px solid; display: flex; flex-direction: column; justify-content: space-between; padding: 5px 7px; font-size: 11px; direction: rtl; }
.heat .cell b { font-size: 13px; text-align: center; }
.heat .lo { background: var(--success-bg); border-color: var(--success-bd); color: var(--success); }
.heat .mid { background: #FFF8E1; border-color: #F3DE9A; color: #8A6A00; }
.heat .hi { background: var(--warning-bg); border-color: var(--warning-bd); color: var(--warning); }
.heat .crit { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger); font-weight: 800; }
:root[data-theme="dark"] .heat .mid { background: #2A2410; border-color: #54481B; color: #E8C45A; }
input[type=range] { width: 100%; accent-color: var(--primary); }

/* cycle cards */
.cycle { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.cycle h3 { font-size: 16px; line-height: 1.5; }
.cycle .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cycle .mini div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px; text-align: center; }
.cycle .mini b { display: block; font-size: 16px; } .cycle .mini span { font-size: 11px; color: var(--text-3); }
.fab { position: fixed; bottom: 28px; inset-inline-end: 28px; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1E8BE0, #3B3FB8); box-shadow: 0 16px 30px -10px rgba(40,60,180,.7); z-index: 50; text-decoration: none !important; transition: transform .15s; }
.fab:hover { transform: scale(1.06); }
.fab .i { width: 28px; height: 28px; stroke-width: 2.4; }

/* wizard tool picker & dependency matrix */
.tpick { border: 1.5px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.tpick.sel { border-color: var(--primary); background: var(--primary-50); }
.tpick.blocked { border-color: var(--danger-bd); background: var(--danger-bg); }
.tpick .modes { display: inline-flex; gap: 3px; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.tpick .modes button { border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.tpick .modes button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.dep { font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.dep.req { color: var(--danger); } .dep.warn { color: var(--warning); } .dep.ok { color: var(--success); }
.depmx { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
.depmx th, .depmx td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.depmx th:first-child, .depmx td:first-child { text-align: start; white-space: nowrap; }
.depmx thead th { font-size: 10.5px; color: var(--text-3); direction: ltr; }
.dm { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }
.dm.r { background: var(--danger-bg); color: var(--danger); } .dm.w { background: var(--warning-bg); color: var(--warning); }

/* group builder */
.gb { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .gb { grid-template-columns: minmax(0,1fr); } }
.pool { position: sticky; top: 90px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.pool-list { overflow-y: auto; padding: 8px 12px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.chip-p { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: grab; user-select: none; transition: box-shadow .12s, border-color .12s; }
.chip-p:hover { border-color: var(--primary-200); box-shadow: var(--shadow-sm); }
.chip-p.dragging { opacity: .45; }
.chip-p .who { flex: 1; min-width: 0; line-height: 1.35; }
.chip-p .who b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-p .who span { font-size: 11px; color: var(--text-3); }
.chip-p.leader { border-color: var(--violet-bd); background: var(--violet-bg); }
.chip-p.boundary { border-style: dashed; border-color: var(--accent); }
.chip-p .tagb { font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 6px; line-height: 17px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.gcard { border: 1.5px solid var(--border); border-radius: 20px; background: var(--surface); display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s; }
.gcard.over, .pool.over { border-color: var(--primary); box-shadow: var(--ring); }
.gcard.bad { border-color: var(--danger-bd); }
.gcard-head { padding: 14px 14px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.gcard-head input { border: 0; background: none; font: inherit; font-weight: 800; font-size: 15px; color: var(--text); flex: 1; min-width: 0; padding: 2px 4px; border-radius: 6px; }
.gcard-head input:focus { outline: none; box-shadow: var(--ring); }
.gnum { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--primary-50); color: var(--primary); flex: none; }
.gcard-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; min-height: 110px; flex: 1; }
.gcard-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; }
.drop-hint { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 12px; text-align: center; font-size: 12px; color: var(--text-3); }
.rule { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.rule:first-child { border-top: 0; }
.rule .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.rule.ok .ic { background: var(--success-bg); color: var(--success); }
.rule.bad .ic { background: var(--danger-bg); color: var(--danger); }
.rule.warn .ic { background: var(--warning-bg); color: var(--warning); }
.rule small { display: block; color: var(--text-3); font-size: 11.5px; }
.sizerule { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sizerule div { border: 1.5px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 12px; background: var(--surface); }
.sizerule div.on { border-color: var(--primary); background: var(--primary-50); }
.sizerule b { display: block; font-size: 13px; }
@media (max-width: 720px) { .sizerule { grid-template-columns: 1fr 1fr; } }

/* document */
.doc { max-width: 980px; margin: 0 auto; }
.doc-sec { padding: 26px 0; border-top: 1px solid var(--border); }
.doc-sec:first-child { border-top: 0; padding-top: 0; }
.doc-sec h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 14px; }
.doc-sec h3 .n { width: 30px; height: 30px; border-radius: 10px; background: var(--primary-fill); color: #fff; display: grid; place-items: center; font-size: 13px; }
.vmv { border-radius: 18px; padding: 16px; border: 1px solid var(--primary-100); background: linear-gradient(135deg, var(--primary-50), var(--surface)); }
.vmv .k { font-size: 12px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.vmv p { font-weight: 700; line-height: 1.85; }
.prov-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }

.chip-p { flex-wrap: wrap; row-gap: 6px; }
.chip-tags { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-inline-start: 35px; }
.chip-tags:empty { display: none; }
.chip-p .who b { white-space: normal; }

/* ==========================================================================
   Paseer PMO — product components
   ========================================================================== */
.brand-mark.pmo-mark { background: linear-gradient(135deg, #7B61E0, #3B3FB8); box-shadow: 0 6px 14px -6px rgba(0,0,0,.45); }
.page-head { background: linear-gradient(to left, #6A52D6 0%, #3F46B8 52%, #1F5FBF 100%); }
.fab { background: linear-gradient(135deg, #7B61E0, #3B3FB8); }

/* role chip */
.role-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--violet-bd); background: var(--violet-bg); color: var(--violet); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.role-chip b { font-weight: 800; }
.role-opt.on { background: var(--violet-bg); color: var(--violet); font-weight: 700; }
@media (max-width: 1180px) { .role-chip > span { display: none; } }

/* RAG */
.rag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.rag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.rag.g { background: var(--success-bg); color: var(--success); }
.rag.a { background: var(--warning-bg); color: var(--warning); }
.rag.r { background: var(--danger-bg); color: var(--danger); }
.rag.n { background: var(--surface-3); color: var(--text-3); }
/* UXR-005 (5.24): المشروع المعلّق بحالة محايدة مكتوبة لا بلون محسوب */
.rag.h { background: var(--surface-3); color: var(--text-2); outline: 1px dashed var(--border-strong); outline-offset: -1px; }
.rag.h::before { border-radius: 2px; }
.rdots { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 4px; }
.rdots i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.rdots .g { background: var(--success); } .rdots .a { background: #E8A13A; } .rdots .r { background: var(--danger-fill); } .rdots .n { background: var(--border-strong); }
/* UXR-004: بعد الحالة باسمه ورمزه بجانب اللون */
.rdots .rd { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.rdots .rd b { font-size: 11px; }
.rdots .rd.g { background: var(--success-bg); color: var(--success); } .rdots .rd.a { background: var(--warning-bg); color: var(--warning); } .rdots .rd.r { background: var(--danger-bg); color: var(--danger); } .rdots .rd.n { background: var(--surface-3); color: var(--text-3); }
.why { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* health tiles */
.htiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.htile { border-radius: 18px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.htile .row-between b { font-size: 13px; }
.htile .big { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.htile .dist { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.htile .dist span { height: 100%; }
@media (max-width: 1100px) { .htiles { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* gantt / roadmap */
.gantt { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.gh, .gr { display: grid; grid-template-columns: 260px minmax(0,1fr); }
.gh { background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.gh > div:first-child, .gr > div:first-child { padding: 10px 14px; border-inline-end: 1px solid var(--border); }
.gmonths { display: grid; }
.gmonths span { padding: 10px 4px; text-align: center; border-inline-start: 1px dashed var(--border); }
.gr { border-top: 1px solid var(--border); }
.gr:first-of-type { border-top: 0; }
.gr.prog { background: var(--surface-2); }
.gr .nm b { font-size: 13px; display: block; } .gr .nm span { font-size: 11px; color: var(--text-3); }
.gtrack { position: relative; min-height: 46px; background-image: linear-gradient(to left, var(--border) 1px, transparent 1px); }
.gbar { position: absolute; top: 12px; height: 22px; border-radius: 7px; background: var(--primary-100); border: 1px solid var(--primary-200); overflow: hidden; }
.gbar > span { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--primary-fill); opacity: .85; }
.gbar.a { background: var(--warning-bg); border-color: var(--warning-bd); } .gbar.a > span { background: #E8A13A; }
.gbar.r { background: var(--danger-bg); border-color: var(--danger-bd); } .gbar.r > span { background: var(--danger-fill); }
.gbar.g > span { background: var(--success); } .gbar.g { background: var(--success-bg); border-color: var(--success-bd); }
.gbase { position: absolute; top: 36px; height: 3px; border-radius: 2px; background: var(--text-3); opacity: .45; }
.gms { position: absolute; top: 15px; width: 14px; height: 14px; transform: translateX(50%) rotate(45deg); background: var(--violet); border: 2px solid var(--surface); border-radius: 3px; z-index: 2; }
.gms.done { background: var(--success); } .gms.late { background: var(--danger-fill); }
.gms.gate { background: #111; }
.today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger-fill); z-index: 3; }
.today::after { content: "اليوم"; position: absolute; top: 2px; inset-inline-start: 4px; font-size: 10px; font-weight: 800; color: var(--danger); white-space: nowrap; }

/* stage-gate strip */
.gates { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; }
.gstep { position: relative; padding: 12px 10px 10px; text-align: center; font-size: 12px; }
.gstep .dm2 { width: 34px; height: 34px; margin: 0 auto 6px; transform: rotate(45deg); border-radius: 8px; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-weight: 800; }
.gstep .dm2 > * { transform: rotate(-45deg); }
.gstep::after { content: ""; position: absolute; top: 29px; inset-inline-start: calc(50% + 22px); inset-inline-end: calc(-50% + 22px); height: 2px; background: var(--border); }
.gstep:last-child::after { display: none; }
.gstep.done .dm2 { background: var(--success); border-color: var(--success); color: #fff; }
.gstep.done::after { background: var(--success); }
.gstep.cur .dm2 { border-color: var(--violet); color: var(--violet); box-shadow: 0 0 0 4px var(--violet-bg); }
.gstep.cond .dm2 { background: #E8A13A; border-color: #E8A13A; color: #fff; }
.gstep b { display: block; font-size: 12.5px; } .gstep span { color: var(--text-3); font-size: 11px; }

/* evidence / criteria list */
.crit { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.crit:first-child { border-top: 0; }
.crit .st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.crit .st.ok { background: var(--success-bg); color: var(--success); } .crit .st.no { background: var(--danger-bg); color: var(--danger); } .crit .st.wa { background: var(--warning-bg); color: var(--warning); }
.crit small { display: block; color: var(--text-3); font-size: 11.5px; }

/* reviewers & votes */
.rev { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rev.coi { border-color: var(--danger-bd); background: var(--danger-bg); }
.vote { font-size: 11.5px; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.vote.y { background: var(--success-bg); color: var(--success); } .vote.c { background: var(--warning-bg); color: var(--warning); } .vote.n { background: var(--danger-bg); color: var(--danger); } .vote.p { background: var(--surface-3); color: var(--text-3); }

/* scoring table */
.score-tbl td.sc { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-tbl td.sc.h { background: var(--success-bg); color: var(--success); } .score-tbl td.sc.m { background: var(--surface-2); } .score-tbl td.sc.l { background: var(--danger-bg); color: var(--danger); }
.score-tbl tr.cut td { border-top: 2px dashed var(--danger); }
.score-tbl tr.out { opacity: .55; }
.score-tbl tr.forced td:first-child { box-shadow: inset -4px 0 0 var(--warning); }
.total { font-weight: 800; font-size: 15px; color: var(--violet); font-variant-numeric: tabular-nums; }
.wrow { display: grid; grid-template-columns: minmax(0,1fr) 150px 52px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.wsum { font-weight: 800; font-variant-numeric: tabular-nums; }
.wsum.bad { color: var(--danger); } .wsum.ok { color: var(--success); }
.cons { display: flex; flex-direction: column; gap: 4px; }
.cons .progress { height: 12px; }
.cons .progress.over > span { background: var(--danger-fill); }

/* heat grid (resources) */
.heatgrid { display: grid; gap: 4px; font-size: 12px; }
.heatgrid .hd { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: center; padding: 4px; }
.heatgrid .rl { font-weight: 600; padding: 8px 4px; display: flex; align-items: center; gap: 6px; }
.heatgrid .cell { border-radius: 8px; text-align: center; padding: 8px 2px; font-weight: 800; font-variant-numeric: tabular-nums; }
.c0 { background: var(--success-bg); color: var(--success); } .c1 { background: #FFF8E1; color: #8A6A00; } .c2 { background: var(--warning-bg); color: var(--warning); } .c3 { background: var(--danger-bg); color: var(--danger); }
:root[data-theme="dark"] .c1 { background: #2A2410; color: #E8C45A; }

/* misc */
.hbar { display: grid; grid-template-columns: 150px minmax(0,1fr) 56px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.hbar .progress { height: 10px; } .hbar b { text-align: end; font-variant-numeric: tabular-nums; }
/* الجوال: أعمدة الأشرطة والخريطة الحرارية تنكمش بدل تجاوز عرض الشاشة */
@media (max-width: 640px) { .hbar { grid-template-columns: minmax(0, 1fr) minmax(56px, .7fr) auto !important; } .heatgrid { grid-template-columns: 76px repeat(var(--hg-n, 6), minmax(0, 1fr)) !important; gap: 3px; } .heatgrid .cell { padding: 8px 0; font-size: 11px; } .heatgrid .rl { font-size: 11.5px; } }
.lock-note { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface-3); border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--text-2); }
.src-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.src-pill .sd { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.src-pill .sd.w { background: var(--warning); }
.locked { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 6px, var(--surface-3) 6px, var(--surface-3) 12px); }
.ptag { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 6px; background: var(--violet-bg); color: var(--violet); white-space: nowrap; }
.pcard { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.pcard h2, .pcard h3 { font-size: 15px; line-height: 1.5; }
.kvs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.kvs div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.kvs b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; } .kvs span { font-size: 11px; color: var(--text-3); }
@media (max-width: 900px) { .kvs { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.evm { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.evm div { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; text-align: center; }
.evm b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.evm span { font-size: 11.5px; color: var(--text-3); }
.dnode { border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 12px; background: var(--surface); font-size: 12.5px; min-width: 180px; }
.dnode b { display: block; font-size: 13px; }
.darrow { flex: 1; min-width: 60px; height: 2px; background: var(--border-strong); position: relative; }
.darrow.r { background: var(--danger-fill); } .darrow.p { background: repeating-linear-gradient(to left, var(--border-strong) 0 6px, transparent 6px 10px); }
.darrow::after { content: ""; position: absolute; inset-inline-end: -1px; top: -4px; border: 5px solid transparent; border-inline-end-color: inherit; }
.darrow span { position: absolute; top: -20px; inset-inline-start: 50%; transform: translateX(50%); font-size: 10.5px; font-weight: 700; white-space: nowrap; color: var(--text-3); }

[hidden] { display: none !important; }

.today.nolbl::after { display: none; }

/* portfolio compaction */
.wrow { grid-template-columns: minmax(0,1fr) 46px; row-gap: 2px; padding: 6px 0; }
.wrow input[type=range] { grid-column: 1 / -1; grid-row: 2; }
.score-tbl th, .score-tbl td { padding: 9px 7px; }
.score-tbl td:nth-child(2) { min-width: 210px; }
.score-tbl thead th { white-space: normal; line-height: 1.3; vertical-align: bottom; }

@media (max-width: 1560px) { .topbar .ddate, .topbar .ddate + .top-divider { display: none; } }
.topbar { min-width: 0; } .search-trigger { min-width: 0; }
@media (max-width: 1560px) { .search-trigger { flex: 1 1 240px; min-width: 180px; } }

/* language switch rendered as a link */
a.icon-btn.lang-btn { display: grid; place-items: center; text-decoration: none; color: var(--text); }
@media (max-width: 720px) { a.icon-btn.lang-btn { display: none; } }

/* audit: mobile overflow */
@media (max-width: 1024px) {
  html, body { overflow-x: clip; }            /* القائمة الجانبية خارج الشاشة لا تُنشئ تمريراً أفقياً */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .card, .card-body { min-width: 0; }
}

/* audit: language-independent top bar */
@media (max-width: 720px) {
  .topbar { height: auto; min-height: var(--top-h); flex-wrap: wrap; row-gap: 6px; padding-block: 8px; }
  .topbar .t-help { display: none; }              /* بديل مستقل عن اللغة لإخفاء أزرار المساعدة */
}

/* audit: single column on phones */
@media (max-width: 720px) {
  .grid { grid-template-columns: minmax(0, 1fr) !important; }   /* لا عمود يتمدد بعرض محتواه على الجوال */
  .heat, .matrix, .bubble-wrap, .gantt { overflow-x: auto; }
}

/* audit: narrow-screen strips */
@media (max-width: 720px) {
  .cal, .week, .strip { overflow-x: auto; }
  .row-between > * { min-width: 0; }
}

/* audit: long words on phones */
@media (max-width: 720px) {
  .badge, .pri, .sec, .chip { white-space: normal; }
  b, strong, h1, h2, h3, .t-name { overflow-wrap: anywhere; }
}

/* audit: wrapping rows and buttons on phones */
@media (max-width: 720px) {
  .row, .seg, .card-head, .page-actions, .row-between { flex-wrap: wrap; }
  .btn, .chip, .tab { white-space: normal; }
}

/* audit: controls and media fit the screen */
@media (max-width: 720px) {
  .select, select, .input, textarea, .page-actions > *, .card-head > * { max-width: 100%; }
  svg:not(.i):not([class*="icon"]) { max-width: 100%; height: auto; }
}

/* ---------- البالونة الإرشادية (i) — معيار المنصة: حرف i في دائرة صفراء فاتحة ---------- */
.hint-i { flex: none; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--hint-bd, #F0C24B); background: var(--hint-bg, #FEF3C7); color: var(--hint-fg, #92400E);
  font: 700 11.5px/1 Georgia, "Times New Roman", serif; font-style: italic; cursor: pointer;
  display: inline-grid; place-items: center; vertical-align: middle; margin-inline-start: 5px; transition: .15s; }
.hint-i:hover { background: var(--hint-bg-h, #FDE68A); border-color: var(--hint-bd-h, #E0A82E); }
.hint-i.on { background: var(--hint-bd-h, #E0A82E); border-color: var(--hint-bd-h, #E0A82E); color: #fff; }
.hint-i:focus-visible { outline: 2px solid var(--hint-bd-h, #E0A82E); outline-offset: 2px; }
.hint-i-pop { position: absolute; z-index: 90; background: var(--hint-pop-bg, #FFFBEB);
  border: 1px solid var(--hint-bd, #F0C24B); border-radius: 10px;
  box-shadow: 0 12px 30px -10px rgba(120, 80, 10, .3); padding: 10px 12px; }
.hint-i-txt { font-size: 12.5px; line-height: 1.75; color: var(--hint-txt, #713F12); }
.hint-i-arrow { position: absolute; top: -6px; width: 11px; height: 11px; transform: rotate(45deg);
  background: var(--hint-pop-bg, #FFFBEB); border-inline-start: 1px solid var(--hint-bd, #F0C24B);
  border-top: 1px solid var(--hint-bd, #F0C24B); border-radius: 2px; }
.hint-i-pop.up .hint-i-arrow { top: auto; bottom: -6px; transform: rotate(225deg); }
[data-theme="dark"] {
  --hint-bg: #3A2E10; --hint-bd: #7A6320; --hint-fg: #FBD96B; --hint-bg-h: #4B3C14; --hint-bd-h: #A88A2E;
  --hint-pop-bg: #2B2208; --hint-txt: #F3DFA4;
}
@media (max-width: 767px) { .hint-i-pop { max-width: calc(100vw - 24px); } }

/* زر ذكاء اصطناعي معطّل: رمادي باهت بسبب مقروء بدل أن يبدو متاحاً ثم يفشل */
.ai-off, .icon-btn.ai-btn.ai-off, .btn.ai-off { background: var(--surface-2, #EEF1F5) !important; color: var(--text-3, #6B7280) !important;
  border-color: var(--border, #D8E0E8) !important; box-shadow: none !important; cursor: not-allowed; opacity: .75; filter: grayscale(1); }
.ai-off svg { opacity: .8; }

/* مراجعة الجودة (الدفعة 2): أهداف لمس لا تقل عن 32 بكسل على الجوال، والشرائط تلتف أو تتمرر داخل حاويتها (مطابق للدفعة 1) */
@media (max-width: 768px) {
  :root { --h-xs: 36px; }
  .search-trigger, .cmdk-input input { min-height: 36px; }
  .seg button, .btn-xs, .btn-sm, .chip, .tabs > button { min-height: 36px; }
  .btn-xs, .btn-sm, .seg button { min-width: 36px; }
  .input-sm, .select.input-sm { min-height: 36px; }
  input[type="range"] { min-height: 32px; }
  /* مربع الاختيار يبقى بحجمه المرئي، ومساحة النقر حوله 32 بكسل */
  .check input { width: 32px; height: 32px; margin: -7px; border: 0; background: transparent; position: relative; }
  .check input::before { content: ""; position: absolute; inset: 7px; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); transition: all .12s; }
  .check input[type="radio"]::before { border-radius: 50%; }
  .check input:checked { background: transparent; }
  .check input:checked::before { background: var(--primary-fill); border-color: var(--primary-fill); }
  .check input:checked::after { position: relative; z-index: 1; }
  .check { min-height: 32px; }
  /* المفتاح: المسار بارتفاعه المرئي 20 بكسل ومساحة النقر 32 */
  .switch input, .switch input:checked { height: 32px; margin: -6px 0; background: transparent; }
  .switch input::before { content: ""; position: absolute; inset: 6px 0; border-radius: 99px; background: var(--border-strong); transition: background .18s; }
  .switch input:checked::before { background: var(--primary-fill); }
  .switch input::after { top: 8px; }
  .switch { min-height: 32px; }
  /* شريط المراحل يلتف أسطراً داخل بطاقته */
  .lc { flex-wrap: wrap; row-gap: 8px; overflow-x: visible; }
  .lc .s { flex: 1 0 72px; min-width: 72px; }
  .lc .s::after { display: none; }
  /* أزرار الأيقونة الصغيرة: الرسم بحجمه ومساحة النقر 32 بكسل */
  .tree .tog { width: 32px; height: 32px; margin: -7px; }
  .prov-btn { width: 32px; height: 32px; margin: -6px; }
  .chip .x { min-width: 32px; min-height: 32px; margin-block: -8px; margin-inline-end: -10px; }
}
@media (max-width: 768px) {
  /* الخارطة الزمنية تتمرر أفقياً داخل حاويتها بعرض يكفي لقراءة الأشهر */
  .gantt > .gh, .gantt > .gr { min-width: 760px; grid-template-columns: 170px minmax(0,1fr); }
}
@media (max-width: 768px) {
  /* مربعات الاختيار والدوائر الأصلية داخل تسمية نصية: الرسم 16 بكسل ومساحة النقر 32 */
  .hy-opt > input[type="radio"], label.fs-12 > input[type="checkbox"], label.fs-12 > input[type="radio"], label.fs-13 > input[type="checkbox"], label.fs-13 > input[type="radio"], label.row > input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 32px !important; height: 32px !important; margin: -8px -6px -8px -8px; flex: none; position: relative; border: 0; background: transparent; cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle; }
  .hy-opt > input[type="radio"]::before, label.fs-12 > input::before, label.fs-13 > input::before, label.row > input[type="checkbox"]::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--surface); }
  .hy-opt > input[type="radio"]::before, label.fs-12 > input[type="radio"]::before, label.fs-13 > input[type="radio"]::before { border-radius: 50%; }
  .hy-opt > input[type="radio"]:checked::before, label.fs-12 > input:checked::before, label.fs-13 > input:checked::before, label.row > input[type="checkbox"]:checked::before { background: var(--primary-fill); border-color: var(--primary-fill); }
  .hy-opt > input[type="radio"]:checked::before, label.fs-12 > input[type="radio"]:checked::before, label.fs-13 > input[type="radio"]:checked::before { box-shadow: inset 0 0 0 3px var(--surface); }
  label.fs-12 > input[type="checkbox"]:checked::after, label.fs-13 > input[type="checkbox"]:checked::after, label.row > input[type="checkbox"]:checked::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); position: relative; z-index: 1; }
  .hy-opt > input[type="radio"]:disabled, label.fs-12 > input:disabled, label.fs-13 > input:disabled, label.row > input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .6; }
  .hy-opt > input[type="radio"]:focus-visible, label.fs-12 > input:focus-visible, label.fs-13 > input:focus-visible, label.row > input[type="checkbox"]:focus-visible { outline: none; }
  .hy-opt > input[type="radio"]:focus-visible::before, label.fs-12 > input:focus-visible::before, label.fs-13 > input:focus-visible::before, label.row > input[type="checkbox"]:focus-visible::before { box-shadow: var(--ring); }
}
@media (max-width: 768px) {
  /* التسمية التي تحمل مربع الاختيار هي هدف اللمس: لا تقل عن 32 بكسل طولاً وعرضاً */
  .check { min-width: 32px; }
  label.fs-12:has(> input[type="checkbox"]), label.fs-12:has(> input[type="radio"]), label.fs-13:has(> input[type="checkbox"]), label.fs-13:has(> input[type="radio"]) { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; min-width: 32px; }
  label.row:has(> input[type="checkbox"]) { min-height: 32px; }
}

/* النسخة الإنجليزية على الجوال: أطول خيار في قائمة «العرض بصفة» كان يمدّ أزرار الترويسة خارج الشاشة، فتأخذ الأزرار سطراً كاملاً لا يتجاوزه عنصر */
@media (max-width: 720px) {
  .page-head > .page-actions { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .page-actions > .select, .page-actions > select { min-width: 0; width: 100%; }
  .tp { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- تباين الألوان القادمة من وحدات البيانات (WCAG AA · 2026-09-25) ----------
   لون الاتصالات الإدارية #A87B2A يبقى كما هو للتعبئة والأيقونات والأشرطة، لكنه أفتح من أن يكون نصاً صغيراً
   (3.8:1 على الأبيض) أو خلفيةً لنص أبيض صغير؛ فيُعتم هنا دون تغيير البيانات. في الوضع الداكن يبقى الأصل (4.6:1). */
:root:not([data-theme="dark"]) [style*=";color:#A87B2A"], :root:not([data-theme="dark"]) [style^="color:#A87B2A"] { color: #836021 !important; }
:root:not([data-theme="dark"]) .acard[style*="--c:#A87B2A"] .go { color: #8F6A24; }
.src[style*="#A87B2A"], .sp-stack > [style*="#A87B2A"], .dot[style*="#A87B2A"] { background-color: #946C25 !important; }

/* ================= UX الدفعة 4 · سلوك الغلاف الموحد (UXR-016 · 019 · 020 · 022 · 025 · 026 · 027 · 055 · 057 · 062) ================= */
/* الرسائل العابرة: النوع بأيقونته ولونه، والخطأ يبقى حتى يُغلق */
.toast { align-items: flex-start; max-width: min(460px, calc(100vw - 32px)); }
.toast > .grow { flex: 1; min-width: 0; line-height: 1.6; }
.toast.t-ok > .i { color: #5FD4A8; }
.toast.t-info { background: #0F2A44; } .toast.t-info > .i { color: #8CC8FF; }
.toast.t-warn { background: #4A3505; color: #FFF7E0; border: 1px solid #B7791F; } .toast.t-warn > .i { color: #FBBF24; }
.toast.t-err { background: #5C1414; color: #fff; border: 1px solid #D14343; } .toast.t-err > .i { color: #FCA5A5; }
.toast > .i { flex: none; margin-top: 2px; }
.toast-x { flex: none; border: 0; background: transparent; color: inherit; cursor: pointer; width: 30px; height: 30px; margin: -5px -6px -5px 0; border-radius: 8px; display: grid; place-items: center; }
.toast-x:hover, .toast-x:focus-visible { background: rgba(255,255,255,.16); outline: none; }
/* خطأ الحقل تحته، والحقل معلَّم */
.fld-err { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: 12.5px; margin-top: 5px; line-height: 1.6; font-weight: 600; }
.fld-err .i { flex: none; margin-top: 3px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], textarea[aria-invalid="true"], input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-bg) !important; }
/* الأرقام والرموز المعزولة داخل النص العربي لا تنقلب ولا تنكسر */
.px-num { unicode-bidi: isolate; white-space: nowrap; }

/* الشريط العلوي: الدور مقروء دائماً، و«المزيد» يجمع ما يختفي على الشاشة الضيقة */
.top-more { display: none; }
.role-chip > b { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.role-chip > .rc-pre { font-weight: 500; }
@media (max-width: 1440px) { .role-chip > .rc-pre { display: none; } }
.user-chip .t b, .user-chip .t span { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.lang-btn { flex: none; min-width: 36px; }
@media (max-width: 720px) {
  .topbar .top-more { display: block; }
  .role-chip { padding: 0 9px; gap: 4px; }
  .role-chip > b { max-width: 104px; font-size: 12px; }
}

/* رأس الصفحة على الجوال: جملة الغرض ظاهرة، والباقي خلف «المزيد» */
.hero-more { display: none; }
@media (max-width: 720px) {
  .page-head .t .hero-p { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page-head .t.open .hero-p { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
  .hero-more { display: inline-block; background: transparent; border: 0; color: #fff; text-decoration: underline; font: inherit; font-size: 13px; font-weight: 700; padding: 4px 0; min-height: 32px; cursor: pointer; }
}

/* التبويبات تلتف سطراً ثانياً بدل أن تختفي خارج الحافة (UXR-027) */
.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
.tabs .tab { flex: none; }

/* الجداول الرئيسية (table.rtable): العمود الأول لا يُعصر عند 1280، وتصير بطاقات تحت 768 (UXR-026) */
table.rtable td:first-child { min-width: 200px; }
table.rtable .mono { white-space: nowrap; }
@media (max-width: 767px) {
  table.rtable, table.rtable tbody, table.rtable tr, table.rtable td { display: block; width: 100%; }
  table.rtable thead { display: none; }
  table.rtable tr { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; background: var(--surface); }
  table.rtable td { border: 0 !important; padding: 5px 0 !important; display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; text-align: start; min-width: 0 !important; }
  table.rtable td::before { content: attr(data-label); flex: none; max-width: 42%; color: var(--text-3); font-size: 12px; font-weight: 600; }
  table.rtable td > * { min-width: 0; }
  table.rtable td:first-child { display: block; }
  table.rtable td:first-child::before, table.rtable td[data-label=""]::before { display: none; }
  .table-wrap:has(> table.rtable) { overflow: visible; }
  .card.flush > .table-wrap:has(> table.rtable) { padding: 0 12px 4px; }
}

/* قائمة «⋯» داخل بطاقة (أدوات ثانوية مثل الأرشفة بسببها) */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > .more-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 40; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* البوابات عند 1280 (UXR-026 · PP-28): عمودان بدل ثلاثة حتى لا ينضغط التفصيل كلمة في كل سطر، وعمود المراجعين والقرار تحت التفصيل */
@media (max-width: 1500px) and (min-width: 721px) {
  #gg { grid-template-columns: 280px minmax(0, 1fr) !important; }
  #gg > #side { grid-column: 2; position: static !important; }
}
/* صحة المشاريع: العمودان SPI وCPI أرقام بعرض ثابت */
#healthT td[data-spi], #healthT td[data-cpi] { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* قائمة «المزيد» على الجوال لا تخرج عن الشاشة */
@media (max-width: 720px) { .top-more .dd-menu { position: fixed; top: 64px; inset-inline: 12px; min-width: 0 !important; width: auto !important; } }
@media (max-width: 1440px) { .user-chip .t b, .user-chip .t span { max-width: 124px; } }


/* ADR-DEC-129 · الوضع الداكن: حالات المرور والضغط للأزرار الصلبة أغمق من التعبئة لا أفتح، فيبقى النص الأبيض مقروءاً */
:root[data-theme="dark"] .btn-primary:hover, :root[data-theme="dark"] .btn-primary:active { background: color-mix(in srgb, var(--primary-fill) 86%, #000); border-color: color-mix(in srgb, var(--primary-fill) 86%, #000); }
:root[data-theme="dark"] .btn-danger:hover { background: color-mix(in srgb, var(--danger-fill) 86%, #000); }

/* ADR-DEC-128 · ADR-DEC-130: وسوم المتطلبات (شارات الرأس ورموز المتطلبات داخل البطاقات) لمدير النظام (منصة بصير) وحده؛ تبقى في الصفحة للتتبع */
html:not(.px-show-reqs) .req-tag, html:not(.px-show-reqs) .hero-reqs, html:not(.px-show-reqs) .req-row { display: none !important; }
.px-ro { align-items: center; }
.px-ro[hidden] { display: none !important; }
/* ADR-DEC-129: العناصر البيضاء الخلفية في الوضعين (التبويب النشط في الشريط الجانبي، وأزرار رأس الصفحة) نصها بلون التعبئة (4.84 على الأبيض) لا بلون النص الفاتح للوضع الداكن */
:root[data-theme="dark"] .side-tab.on, :root[data-theme="dark"] .page-head .btn-primary, :root[data-theme="dark"] .page-head .btn .badge, :root[data-theme="dark"] .page-head .seg button.on { color: var(--primary-fill); }
