/* ==========================================================================
   Paseer Correspondence — الاتصالات الإدارية | 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;
  --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;

  /* ADR-DEC-129: تعبئة منفصلة عن الحبر: خلفيات صلبة تحمل نصاً أبيض (أزرار وشارات وصور رمزية) تستعمل -fill، والنص والروابط تبقى على --primary و--danger */
  --primary-fill: #0B6BC0; --primary-fill-hover: #0A5CA6; --primary-fill-press: #094E8C; --danger-fill: #B42318;
}

: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;
  --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;

  /* ADR-DEC-129 (الخيار ب): تعبئة داكنة يقرأ عليها النص الأبيض بتباين 4.8 فأكثر */
  --primary-fill: #1F74C2; --primary-fill-hover: #1A66AE; --primary-fill-press: #175C9C; --danger-fill: #C4473B;
}

/* ---------- 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-fill-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-fill-hover); border-color: var(--primary-fill-hover); }
.btn-primary:active { background: var(--primary-fill-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-teal    { background: #0F766E14; color: #0F766E; border-color: #0F766E38; text-decoration: none; }
a.b-teal:hover { background: #0F766E24; }
[data-theme="dark"] .b-teal { background: #14A39B1F; color: #5EC8C0; border-color: #14A39B45; }
.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); border-color: var(--primary); }
.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); }
.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); }
.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); } .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); }
.progress.warn > span { background: var(--warning); }
.progress.bad > span { background: var(--danger); }
.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); }
.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); }
.bars > div.hi { background: var(--primary); }
.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-fill); 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-fill-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-fill); box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); }
.page-head .btn-primary:hover { background: #F2F8FF; color: var(--primary-fill-hover); }
.page-head .btn .i { width: 20px; height: 20px; }
.page-head .btn .badge { background: #fff; color: var(--primary-fill); }
.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 Correspondence — product accents & components
   ========================================================================== */
.brand-mark.co-mark { background: linear-gradient(135deg, #1E8BE0, #0B5C6E); box-shadow: 0 6px 14px -6px rgba(0,0,0,.45); }
.page-head { background: linear-gradient(to left, #0E86D4 0%, #0A64A8 50%, #0B4E6E 100%); }

/* reference-list chips (COR-V6-16) */
.sec { font-size: 11.5px; font-weight: 800; padding: 1px 9px; border-radius: 6px; border: 1px solid; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sec.s0 { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.sec.s1 { background: #FFF4E5; color: #A35A00; border-color: #F3CD95; }
.sec.s2 { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.sec.s3 { background: #3A0A0A; color: #FFD9D4; border-color: #3A0A0A; }
:root[data-theme="dark"] .sec.s1 { background: #2E2110; color: #F0A54A; border-color: #563B18; }
.pri { font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pri::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pri.p1::before { background: var(--warning); } .pri.p2::before { background: #E0501F; } .pri.p3::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.dir { font-size: 11px; font-weight: 800; width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; }
.dir.in { background: var(--info-bg); color: var(--info); } .dir.out { background: var(--success-bg); color: var(--success); } .dir.int { background: var(--violet-bg); color: var(--violet); } .dir.circ { background: var(--accent-50); color: var(--accent-ink); }
.txno { font-family: var(--mono); font-size: 12.5px; font-weight: 700; direction: ltr; unicode-bidi: isolate; color: var(--text); }

/* inbox layout */
.inbox { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .inbox { grid-template-columns: minmax(0,1fr); } }
.folders { padding: 8px; }
.folder { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: start; }
.folder:hover { background: var(--surface-3); }
.folder.on { background: var(--primary-50); color: var(--primary); font-weight: 700; }
.folder .n { margin-inline-start: auto; font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.folder.on .n { color: var(--primary); }
.folder .n.hot { background: var(--danger-fill); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.row-tx { cursor: pointer; }
.row-tx.unread td:first-child { box-shadow: inset -3px 0 0 var(--primary); }
[dir="ltr"] .row-tx.unread td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.row-tx.unread b { font-weight: 800; }
.sla { font-size: 12px; font-weight: 700; }
.sla.late { color: var(--danger); } .sla.soon { color: var(--warning); } .sla.ok { color: var(--text-3); }

/* transaction page */
.tx-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.statebar { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; }
.statebar .st { flex: 1; min-width: 88px; text-align: center; font-size: 11.5px; font-weight: 700; padding: 8px 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-3); position: relative; }
.statebar .st.done { background: var(--success-bg); color: var(--success); }
.statebar .st.cur { background: var(--primary-fill); color: #fff; box-shadow: 0 6px 14px -8px rgba(11,107,192,.8); }
.letter { background: #fff; color: #1B1B1B; border: 1px solid var(--border); border-radius: 12px; padding: 36px 40px; position: relative; overflow: hidden; font-size: 14.5px; line-height: 2; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .letter { filter: brightness(.92); }
.letter .lh { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #0B5C6E; padding-bottom: 12px; margin-bottom: 18px; font-size: 12.5px; }
.letter .lh .org { text-align: center; font-weight: 800; font-size: 14px; color: #0B5C6E; }
.letter .marks { position: absolute; top: 18px; inset-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.letter .wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 22px; font-weight: 800; color: rgba(11,92,110,.07); transform: rotate(-24deg); white-space: pre; text-align: center; line-height: 3; }
.letter .sect { font-size: 10.5px; font-weight: 800; color: #667787; font-family: var(--mono); letter-spacing: .3px; }
.proof { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; border: 1.5px solid; }
.proof.a1 { color: var(--success); border-color: var(--success-bd); background: var(--success-bg); }
.proof.a2 { color: var(--info); border-color: var(--info-bd); background: var(--info-bg); }
.proof.a3 { color: var(--text-2); border-color: var(--border-strong); background: var(--surface-3); border-style: dashed; }
.purpose { font-size: 11.5px; font-weight: 800; padding: 1px 9px; border-radius: 999px; }
.purpose.u1 { background: var(--surface-3); color: var(--text-2); } .purpose.u2 { background: var(--info-bg); color: var(--info); } .purpose.u3 { background: var(--primary-50); color: var(--primary); } .purpose.u4 { background: var(--violet-bg); color: var(--violet); } .purpose.u5 { background: var(--accent-50); color: var(--accent-ink); }
.layer-tabs .tab .lay { font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-3); }

/* deliberation */
.dlb { display: flex; flex-direction: column; gap: 12px; }
.dmsg { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; background: var(--surface); }
.dmsg .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dmsg .txt { font-size: 13.5px; line-height: 1.9; margin-top: 6px; }
.dmsg.reply { margin-inline-start: 36px; background: var(--surface-2); }
.dmsg.ext { border-color: var(--accent); border-style: dashed; }
.react { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 1px 10px; font: inherit; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.react.on { background: var(--primary-50); color: var(--primary); border-color: var(--primary-200); }
.quar { border: 1.5px dashed var(--warning-bd); background: var(--warning-bg); border-radius: 16px; padding: 12px 14px; }

/* directive box (COR-V5-04) */
.dirbox { border: 1.5px solid var(--border-strong); border-radius: 16px; background: var(--surface); padding: 12px; }
.dirbox:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.dirbox textarea { width: 100%; border: 0; outline: none; resize: vertical; background: transparent; font: inherit; font-size: 14.5px; color: var(--text); min-height: 76px; line-height: 1.9; }
.parsed { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.pchip small { font-weight: 500; color: var(--text-3); }
.mention-list { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); max-height: 220px; overflow: auto; }
.mention-list button { display: flex; width: 100%; gap: 8px; align-items: center; border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; text-align: start; color: var(--text); }
.mention-list button:hover { background: var(--surface-3); }

/* compliance checklist */
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.chk:first-child { border-top: 0; }
.chk .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chk.ok .ic { background: var(--success-bg); color: var(--success); } .chk.bad .ic { background: var(--danger-bg); color: var(--danger); } .chk.warn .ic { background: var(--warning-bg); color: var(--warning); }
.chk small { display: block; color: var(--text-3); font-size: 11.5px; }

/* pipeline (register) */
.pipe { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pipe .p { flex: 1; min-width: 104px; border-radius: 12px; padding: 9px 10px; background: var(--surface-3); font-size: 11.5px; font-weight: 700; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.pipe .p .i { width: 16px; height: 16px; }
.pipe .p.done { background: var(--success-bg); color: var(--success); } .pipe .p.cur { background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.scan { background: repeating-linear-gradient(0deg, #FBFBF8, #FBFBF8 30px, #F3F3EE 31px); border: 1px solid var(--border); border-radius: 12px; min-height: 420px; padding: 28px; position: relative; color: #333; font-size: 13px; line-height: 2.1; }
:root[data-theme="dark"] .scan { filter: brightness(.88); }
.hl { background: rgba(255, 214, 0, .35); border-radius: 4px; padding: 0 2px; }
.conf { font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 999px; }
.conf.h { background: var(--success-bg); color: var(--success); } .conf.m { background: var(--warning-bg); color: var(--warning); }
.qual { border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; cursor: pointer; background: var(--surface); text-align: start; font: inherit; color: inherit; }
.qual.on { border-color: var(--primary); box-shadow: var(--ring); }
.qual b { display: block; } .qual span { font-size: 12px; color: var(--text-3); }

/* matrix table */
.cmx td, .cmx th { text-align: center; }
.cmx td:first-child, .cmx th:first-child { text-align: start; }
.yes { color: var(--success); font-weight: 800; } .no { color: var(--danger); font-weight: 800; } .cond { color: var(--warning); font-weight: 800; }

/* delivery states (COR-CH-004) */
.dstates { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dstates span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); }
.dstates span.on { background: var(--success-bg); color: var(--success); }
.dstates span.bad { background: var(--danger-bg); color: var(--danger); }
.dstates .sep { background: none; padding: 0; color: var(--border-strong); }

/* envelope (COR-V6-01) */
.env { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.env div { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.env div span { display: block; font-size: 11.5px; color: var(--text-3); }
.env div b { font-size: 13px; }
.env div.miss { border-color: var(--danger-bd); background: var(--danger-bg); }
@media (max-width: 720px) { .env { grid-template-columns: 1fr; } }

/* outlook mock */
.olk { display: grid; grid-template-columns: 220px minmax(0,1fr) 340px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); min-height: 620px; }
.olk .olk-l { background: var(--surface-2); border-inline-end: 1px solid var(--border); }
.olk .olk-m { padding: 20px; }
.olk .olk-r { border-inline-start: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; }
@media (max-width: 1100px) { .olk { grid-template-columns: minmax(0,1fr); } .olk .olk-l { display: none; } }

.row-tx td:nth-child(2) { min-width: 300px; }
.row-tx td:nth-child(3) { min-width: 120px; }

/* goal & activity (STRAT-V7-03 / COR-V5-06) */
.goal-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--violet-bg); color: var(--violet); border: 1px solid var(--violet-bd); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-chip.none { background: var(--surface-3); color: var(--text-3); border-color: var(--border); }
.goal-box { border: 1.5px solid var(--violet-bd); background: var(--violet-bg); border-radius: 16px; padding: 14px; }
.goal-box .select, .goal-box .input { background-color: var(--surface); }

/* email linking (COR-CH-003/005 · DLB-003..023) */
.mailhdr { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; background: var(--primary-50); border: 1px solid var(--primary-100); }
.txaddr { font-size: 14px; font-weight: 700; background: var(--surface); padding: 4px 10px; border-radius: 8px; color: var(--primary); }
.mstats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.mstats div { border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; text-align: center; background: var(--surface-2); }
.mstats b { display: block; font-size: 18px; } .mstats span { font-size: 11.5px; color: var(--text-3); }
.mailgrid { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0,1fr); gap: 14px; align-items: start; }
.mlist { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; max-height: 640px; overflow-y: auto; background: var(--surface); }
.mbranch { display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-size: 12px; font-weight: 800; color: var(--violet); background: var(--violet-bg); border-top: 1px solid var(--border); }
.mbranch:first-child { border-top: 0; }
.mrow { position: relative; width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: start; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: inherit; padding: 10px 12px; cursor: pointer; }
.mrow:hover { background: var(--surface-2); }
.mrow.on { background: var(--primary-50); box-shadow: inset -3px 0 0 var(--primary); }
[dir="ltr"] .mrow.on { box-shadow: inset 3px 0 0 var(--primary); }
.mrow.ext .av { outline: 2px dashed var(--accent); outline-offset: 1px; }
.mline { position: absolute; top: 0; bottom: 50%; width: 12px; border-inline-start: 1.5px solid var(--border-strong); border-bottom: 1.5px solid var(--border-strong); border-end-start-radius: 8px; }
.mdetail { border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; background: var(--surface); min-height: 300px; }
.mbody { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; line-height: 1.95; font-size: 14px; }
.authpkg summary { cursor: pointer; list-style: none; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.authpkg[open] summary { border-radius: 12px 12px 0 0; }
@media (max-width: 1100px) { .mailgrid { grid-template-columns: minmax(0,1fr); } .mstats { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 6px 0; }
.flow .fs { flex: 1; min-width: 150px; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface); }
.flow .fs b { display: block; font-size: 13px; margin-top: 6px; } .flow .fs span { font-size: 11.5px; color: var(--text-3); }
.flow .ar { flex: none; width: 28px; display: grid; place-items: center; color: var(--text-3); }
.prov-card2 { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.plogo2 { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }

.g-main.wide { grid-template-columns: minmax(0,1fr); }
.g-main.wide > .stack { display: none; }
.mdetail code { word-break: break-all; }

/* 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; } }

/* ================= هوية الوثائق: الخطوط والترويسات والقوالب ================= */
.a4-box { position: relative; overflow: hidden; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 14px 34px -18px rgba(15,40,70,.45); background: #fff; }
.a4 { position: absolute; top: 0; inset-inline-start: 0; background: #fff; color: #1B1B1B; box-sizing: border-box; overflow: hidden; }
.a4-inner { position: relative; z-index: 1; }
.a4-h { position: relative; z-index: 1; color: var(--c); }
.a4-h b { font-weight: 800; }
.a4-l-single { border-bottom: 2px solid var(--c); padding-bottom: 12px; margin-bottom: 22px; }
.a4-l-double { border-bottom: 4px double var(--c); padding-bottom: 12px; margin-bottom: 22px; }
.a4-l-bar { border-bottom: 7px solid var(--c); padding-bottom: 12px; margin-bottom: 22px; }
.a4-split { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.a4-split .ar, .a4-split .en { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.6; }
.a4-split .ar { text-align: center; } .a4-split .en { text-align: center; font-size: 12px; }
.a4-split .ar b { font-size: 17px; } .a4-split .en b { font-size: 14px; }
.a4-split span { color: #4A5560; }
.a4-center { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.a4-center b { font-size: 19px; } .a4-center span { font-size: 12.5px; color: #4A5560; } .a4-center em { font-style: normal; font-size: 12.5px; color: var(--c); font-weight: 700; }
.a4-bandwrap .a4-band { background: var(--c); color: #fff; display: flex; align-items: center; gap: 18px; padding: 22px 76px; min-height: 110px; }
.a4-band b { display: block; font-size: 20px; } .a4-band span { display: block; font-size: 12.5px; opacity: .85; }
.a4-band em { margin-inline-start: auto; font-style: normal; font-weight: 800; font-size: 22px; letter-spacing: .5px; border: 2px solid rgba(255,255,255,.7); border-radius: 8px; padding: 2px 16px; }
.a4-logo { display: block; object-fit: contain; }
.a4-mini { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid; padding-bottom: 8px; margin-bottom: 18px; font-size: 12px; color: #4A5560; }
.a4-mini span { margin-inline-start: auto; font-family: var(--mono); direction: ltr; }
.a4-meta { display: flex; flex-direction: column; gap: 0; font-size: 13px; line-height: 1.9; margin: 0 0 18px; width: max-content; }
.a4-meta.end { margin-inline-start: auto; }
.a4-meta span { color: #5B6670; font-weight: 700; }
.a4-subj { font-weight: 800; margin-bottom: 10px; }
.a4-subj span { color: #5B6670; }
.a4-to { font-weight: 700; margin-bottom: 6px; white-space: pre-wrap; }
.a4-p { margin: 0 0 8px; }
.a4-p.close { margin-top: 14px; }
.a4-f { background: #FFF4D6; color: #8A5A00; border-radius: 4px; padding: 0 4px; font-size: .86em; font-family: Tajawal, sans-serif; }
.a4-sig { margin-top: 22px; margin-inline-start: auto; width: 46%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.a4-sig span { font-size: .92em; }
.a4-stamp { margin-top: 8px; border: 1.5px dashed var(--c); color: var(--c); border-radius: 8px; padding: 6px 12px; font-size: 11.5px; line-height: 1.6; font-family: Tajawal, sans-serif; }
.a4-stamp.st { border-style: solid; border-radius: 50%; width: 96px; height: 96px; display: grid; place-items: center; padding: 10px; transform: rotate(-8deg); }
.a4-qr { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 11px; line-height: 1.5; color: #5B6670; font-family: Tajawal, sans-serif; }
.a4-qr .q { width: 58px; height: 58px; flex: none; image-rendering: pixelated; }
.a4-footwrap { position: absolute; z-index: 1; }
.a4-foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1.5px solid var(--c); padding-top: 8px; font-size: 11px; color: #5B6670; line-height: 1.6; font-family: Tajawal, sans-serif; }
.a4-foot i { font-style: normal; margin: 0 6px; color: var(--c); }
.a4-foot span { white-space: nowrap; }
.a4-wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: .06; z-index: 0; }
.a4-wm img { width: 58%; }
.a4-wm.t { font-size: 70px; font-weight: 800; transform: rotate(-28deg); opacity: .05; }
.a4-sec { position: absolute; top: 14px; inset-inline-start: 18px; z-index: 2; border: 1.5px solid #B42318; color: #B42318; font-weight: 800; font-size: 13px; padding: 0 10px; border-radius: 5px; background: #fff; font-family: Tajawal, sans-serif; }

.br-drop { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center; background: var(--surface-2, var(--surface-3)); cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.br-drop:hover, .br-drop.on { border-color: var(--primary); background: var(--primary-50); }
.br-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.br-drop b { display: block; margin-top: 6px; }
.br-font { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: center; }
.br-font:last-child { border-bottom: 0; }
.br-font .spec { font-size: 26px; line-height: 1.5; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.br-font .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.br-font .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.br-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.br-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); text-align: start; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.br-card:hover { border-color: var(--border-strong); }
.br-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.br-card .thumb { height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--border); overflow: hidden; position: relative; }
.br-card .thumb .a4 { transform: scale(.2); transform-origin: top right; }
[dir="ltr"] .br-card .thumb .a4 { transform-origin: top left; }
.br-sec { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.br-sec:last-child { border-bottom: 0; }
.br-sec .textarea { min-height: 44px; font-size: 13px; }
.br-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.br-chips button { border: 1px dashed #D9A400; background: #FFF8E1; color: #8A5A00; border-radius: 99px; font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; }
.br-color { display: flex; gap: 8px; align-items: center; }
.br-color input[type=color] { width: 40px; height: 34px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }
.br-prev { position: sticky; top: 84px; }
.br-checks .chk { padding: 6px 0; }
.br-lock { font-size: 11px; color: var(--text-3); display: inline-flex; gap: 4px; align-items: center; }
#brPrint { display: none; }
@media print {
  body > *:not(#brPrint) { display: none !important; }
  #brPrint { display: block !important; }
  #brPrint .a4 { position: static; transform: none !important; }
  @page { size: A4; margin: 0; }
}
.br-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: start; }
@media (max-width: 1100px) { .br-grid { grid-template-columns: 1fr; } .br-prev { position: static; } }
.br-card .row-between { flex-wrap: wrap; gap: 4px; }
.a4-sigwrap { position: relative; height: 74px; display: flex; align-items: center; justify-content: center; margin: 4px 0; }
.a4-sigimg { max-height: 70px; max-width: 220px; object-fit: contain; position: relative; z-index: 2; }
.a4-stampimg { position: absolute; height: 92px; opacity: .85; inset-inline-start: -30px; top: -12px; z-index: 1; }
.a4-signed { font-size: 10.5px; color: var(--c); border: 1px solid var(--c); border-radius: 6px; padding: 0 8px; font-family: Tajawal, sans-serif; line-height: 1.8; }
.a4-inits { display: flex; gap: 14px; justify-content: flex-start; margin-bottom: 6px; }
.a4-inits span { display: flex; flex-direction: column; align-items: center; }
.a4-inits img { height: 30px; max-width: 80px; object-fit: contain; }
.a4-inits small { font-size: 9px; color: #7A8590; font-family: Tajawal, sans-serif; line-height: 1.3; }
.a4-wm.t.draft { color: #B42318; opacity: .08; font-size: 118px; }

/* ================= التوقيع والتركين ================= */
.sg-padwrap { position: relative; border: 1.5px dashed var(--border-strong); border-radius: 14px; background: #fff; }
.sg-pad { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.sg-base { position: absolute; inset-inline: 28px; bottom: 54px; border-top: 1.5px solid #CBD5E1; font-size: 11px; color: #94A3B8; padding-top: 4px; pointer-events: none; }
.sg-result { min-height: 130px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; padding: 14px;
  background: repeating-conic-gradient(#EEF2F6 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.sg-result img { max-width: 100%; max-height: 150px; }
.sg-result.sm { min-height: 64px; width: 120px; flex: none; padding: 6px; }
.sg-result.sm img { max-height: 52px; }
.modal .sg-result.sm { width: 100%; min-height: 90px; }
.sg-inks { display: flex; gap: 6px; }
.sg-ink { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border-strong); cursor: pointer; }
.sg-ink.on { box-shadow: 0 0 0 2.5px var(--primary); }
.sg-fonts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sg-font { align-items: center; }
.sg-font span { font-size: 34px; line-height: 1.6; white-space: nowrap; overflow: hidden; max-width: 100%; }
.sg-mine { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sg-mine:last-child { border-bottom: 0; }
.c-sigrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.c-sigrow:last-child { border-bottom: 0; }
.c-sig img { max-height: 64px; max-width: 220px; }
.c-sig { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 6px; }
.c-inits { display: flex; gap: 14px; align-items: flex-end; margin-top: 18px; }
.c-inits span { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: #6C7681; font-family: Tajawal, sans-serif; line-height: 1.3; }
.c-inits img { height: 30px; }
.c-inits b { font-size: 13px; color: #4A5560; border-bottom: 1px solid #9AA7B3; padding: 0 4px; font-family: 'Aref Ruqaa', Tajawal, serif; }
.ex-fmt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ex-fmt button { text-align: start; }
.ex-fmt .fx { font-weight: 800; font-size: 18px; }
@media (max-width: 640px) { .sg-fonts { grid-template-columns: 1fr; } .ex-fmt { grid-template-columns: 1fr; } }
#ed .card-head { flex-wrap: wrap; gap: 10px; } #ed .card-head > div:first-child { min-width: 180px; flex: 1; }

/* 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; }

/* الشريط العلوي لا يفيض في الشاشات المتوسطة: يُخفى التاريخ ويتقلص البحث (مطابق لبقية الأغلفة) */
@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; } }

/* أهداف اللمس للجوال (تتمة الدفعة الثانية): خانة الاختيار وحدها في رأس الجدول، وتسميات الخانات الصغيرة */
@media (max-width: 768px) {
  .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; }
}

/* مراجعة الجودة (الدفعة 3): أهداف لمس لا تقل عن 32 بكسل على الجوال، والشرائط تلتف داخل بطاقتها (مطابق للدفعتين 1 و2) */
@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); border-color: var(--primary); }
  .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); }
  .switch input::after { top: 8px; }
  .switch { min-height: 32px; }
  /* ألوان الحبر: الدائرة بحجمها المرئي 24 بكسل ومساحة النقر 32 */
  .sg-inks { gap: 10px; }
  .sg-ink { width: 32px; height: 32px; border-width: 5px; background-clip: content-box; box-shadow: none; position: relative; }
  .sg-ink::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--border-strong); pointer-events: none; }
  .sg-ink.on::after { box-shadow: 0 0 0 2.5px var(--primary); }
  /* شريط الحالات ومراحل التسجيل يلتفان أسطراً داخل بطاقتهما */
  .statebar, .pipe { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
  .statebar .st { flex: 1 0 88px; }
  .pipe .p { flex: 1 0 104px; }
  /* مسار وصول البريد: الخطوات عمودياً والأسهم تشير إلى الأسفل */
  .flow:has(> .fs) { flex-direction: column; overflow-x: visible; gap: 4px; }
  .flow:has(> .fs) > .fs { min-width: 0; }
  .flow:has(> .fs) > .ar { align-self: center; transform: rotate(-90deg); }
}

/* مراجعة الجودة (الدفعة 3): اللوحة الجانبية المثبّتة لا تغطي المحتوى حين يصير التخطيط عموداً واحداً */
@media (max-width: 1100px) { aside[style*="position:sticky"], .card[style*="position:sticky"] { position: static !important; } }

@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); border-color: var(--primary); }
  .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: 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; }
/* UXR-001: زر التراجع داخل رسالة التأكيد */
.toast .toast-undo { margin-inline-start: auto; background: transparent; color: #9FD8FF; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.toast .toast-undo:hover { background: rgba(255,255,255,.08); }
/* UXR-003: سبب الزر المعطّل مقروء على خلفية رأس الصفحة الملوّنة */
.page-head .pxc-why { color: rgba(255,255,255,.92); }
/* UXR-005 (5.12): رقم المؤشر وأجزاؤه أزرار تفتح مجلدها في صندوق العمل */
.kpi button.kpi-go { background: none; border: 0; padding: 0; margin: 0; font-family: inherit; color: inherit; cursor: pointer; text-align: start; align-self: flex-start; }
.kpi button.kpi-go:hover, .kpi button.kpi-go:focus-visible { text-decoration: underline; }
.kpi .meta .kpi-part { height: auto; padding: 2px 8px; font-size: 11.5px; border-style: solid; border-radius: 999px; }

/* ================= الدفعة 4: سلوك الغلاف المشترك (UXR-016 · 020 · 025 · 055 · 057) ================= */
/* UXR-016: الرسالة بنوعها: الخطأ بلون الخطر ويبقى حتى يُغلق، والتحذير بلون التحذير، والنجاح والمعلومة بلونهما */
.toasts { max-width: calc(100vw - 24px); }
.toast { max-width: min(560px, calc(100vw - 24px)); }
.toast .toast-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toast.t-err { background: #8C1D1D; border-inline-start: 4px solid #FCA5A5; }
.toast.t-err > .i { color: #FECACA; }
.toast.t-warn { background: #6B4300; border-inline-start: 4px solid #FBBF24; }
.toast.t-warn > .i { color: #FDE68A; }
.toast.t-info > .i { color: #9FD8FF; }
.toast .toast-x { margin-inline-start: auto; flex: none; width: 32px; height: 32px; display: grid; place-items: center; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; cursor: pointer; }
.toast .toast-x .i { color: #fff; }
.toast .toast-x:hover, .toast .toast-x:focus-visible { background: rgba(255,255,255,.12); }

/* UXR-025: خطأ الحقل تحته بلون الخطر ويقول ما العمل */
.field-err { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; color: var(--danger, #B42318); font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.field-err .i { flex: none; margin-top: 2px; }
[aria-invalid="true"]:not(.toast-x) { border-color: var(--danger, #B42318) !important; box-shadow: 0 0 0 3px rgba(180,35,24,.14); }

/* UXR-055: فقرة رأس الصفحة تُطوى إلى ثلاثة أسطر، و«المزيد» يفتحها؛ رموز المتطلبات في سطرها */
.page-head .t > p.hero-clamp[data-clamp="on"] { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-head .hero-reqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.page-head .hero-more { background: transparent; border: 0; padding: 2px 0; margin-top: 4px; font: inherit; font-size: 13px; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; min-height: 32px; }
.page-head .hero-more[hidden] { display: none; }

/* UXR-020: قائمة «المزيد» والدور المختصر لا يظهران إلا في العرض الضيق */
.top-more { display: none; }
.search-trigger .st-short { display: none; }
.user-chip .uc-rs { display: none; }
@media (max-width: 720px) {
  .topbar { gap: 4px; flex-wrap: nowrap; }
  .topbar .top-more { display: block; }
  .topbar > .lang-btn, .topbar > a.icon-btn.lang-btn, .topbar > [data-pxhelp], .topbar > .ai-btn, .topbar > #reloadBtn, .topbar > [data-reload], .topbar > #themeBtn { display: none !important; }
  .topbar .icon-btn { width: 38px; height: 38px; flex: none; }
  .topbar .search-trigger { flex: 1 1 auto !important; min-width: 40px !important; width: auto !important; padding: 0 10px !important; justify-content: flex-start; gap: 6px; }
  .topbar .search-trigger > span:not(.st-short) { display: none !important; }
  .topbar .search-trigger .st-short { display: inline; color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; }
  .topbar .user-chip { padding-inline: 4px; gap: 6px; flex: none; }
  .topbar .user-chip .t { display: flex !important; flex-direction: column; min-width: 0; }
  .topbar .user-chip .t > b, .topbar .user-chip .t > [data-uc="role"] { display: none !important; }
  .topbar .user-chip .uc-rs { display: block; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--text-2, #334155); }
  .topbar .user-chip > .i { display: none; }
  .top-more .dd-menu { inset-inline-end: 0; inset-inline-start: auto; }
}
@media (max-width: 420px) { .topbar .search-trigger .st-short { display: none; } }

/* UXR-057: حقول الأرقام والتواريخ بأرقام غربية؛ والعزل داخل النص العربي لا يكسر الرمز */
.px-num { unicode-bidi: isolate; white-space: nowrap; }
/* UXR-025: زر الانتقال إلى موضع التصحيح في بند المدقّق */
.chk .chk-go { margin-top: 6px; min-height: 32px; }
.chk small .req-tag { margin-inline-start: 4px; }
.letter .field-err { font-family: var(--font, inherit); }

/* UXR-026: صندوق العمل: عمود المعاملة لا ينضغط، والجهة والتاريخ والأولوية تُطوى تحت العنوان حين يضيق المكان، والصفوف بطاقات تحت 768 */
.inbox-t .tx-meta, .inbox-t .tx-pri-in { display: none; }
.inbox-t tr.row-tx td.c-title { min-width: 260px; word-break: normal; overflow-wrap: normal; }
.inbox-t .txno { white-space: nowrap; }
@media (max-width: 1400px) {
  .inbox-t .c-party, .inbox-t .c-date, .inbox-t .c-pri { display: none; }
  .inbox-t .tx-meta { display: block; margin-top: 2px; }
  .inbox-t .tx-pri-in { display: flex; margin-top: 4px; }
  .inbox-t th, .inbox-t td { padding-inline: 8px; }
  .inbox-t .goal-chip, .inbox-t .c-need > * { white-space: normal; }
  .inbox-t tr.row-tx td.c-title { min-width: 240px; }
}
@media (max-width: 768px) {
  .inbox-t thead { display: none; }
  .inbox-t, .inbox-t tbody { display: block; width: 100%; }
  .inbox-t tr.row-tx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .inbox-t tr.row-tx > td { display: block; padding: 0; border: 0; min-width: 0 !important; }
  .inbox-t tr.row-tx td.c-dir { flex: none; }
  .inbox-t tr.row-tx td.c-title { flex: 1 1 calc(100% - 44px); min-width: 0 !important; }
  .inbox-t tr.row-tx td.c-sec { margin-inline-start: 38px; display: flex; gap: 6px; align-items: center; }
  .inbox-t tr.row-tx td.c-sec .tx-pri-in { margin-top: 0; }
  .inbox-t tr.row-tx td.c-need, .inbox-t tr.row-tx td.c-sla { flex: none; }
  .inbox-t tr > td[colspan] { display: block; }
  .inbox-t tr.row-tx > td.c-party, .inbox-t tr.row-tx > td.c-date, .inbox-t tr.row-tx > td.c-pri { display: none; }
}
/* UXR-027: شريط حالات المعاملة يلتف داخل بطاقته فلا يحتاج تمريراً عند 1280 */
.statebar { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
.statebar .st { flex: 1 0 80px; min-width: 80px; }

/* ADR-DEC-128/130: رموز المتطلبات تظهر لمدير النظام في منصة بصير وحده، وتبقى في الصفحة للتتبع والاختبارات */
html:not(.px-show-reqs) .req-tag, html:not(.px-show-reqs) .hero-reqs { display: none !important; }
/* ADR-DEC-129: الإبراز النشط في مخطط الأعمدة وشارة الخطوة الحالية بتعبئة يقرأ عليها النص الأبيض */
:root .hy-step.cur b { background: var(--primary-fill); }
/* UXR-061: الثقة كلمة، والنسبة تظهر عند المرور أو التركيز، والحقل تحت حد المراجعة معلَّم بكلمة وإطار */
.conf { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; cursor: help; }
.conf .conf-p { display: none; font-weight: 600; }
.conf:hover .conf-p, .conf:focus .conf-p, .conf:focus-visible .conf-p { display: inline; }
.field.conf-low > .input, .field.conf-low > .select, .field.conf-low > .box { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
/* UXR-044: أقسام ثانوية مطوية تحت عنوان واحد، وشريط إجراءات ثابت حين يخرج رأس الصفحة من الشاشة */
.fold-grp { border: 1px dashed var(--border-strong, var(--border)); border-radius: 14px; background: var(--surface-2); }
.fold-grp > .fold-hd { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: transparent; border: 0; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: start; border-radius: 14px; }
.fold-grp > .fold-hd:hover { background: var(--surface-3); }
.fold-grp > .fold-hd .fold-n { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
.fold-grp > .fold-hd .fold-st { margin-inline-start: auto; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.fold-grp > .fold-hd::before { content: "\25BE"; font-size: 14px; line-height: 1; transition: transform .15s; flex: none; }
html[dir="rtl"] .fold-grp[data-fold="closed"] > .fold-hd::before { transform: rotate(90deg); }
html:not([dir="rtl"]) .fold-grp[data-fold="closed"] > .fold-hd::before { transform: rotate(-90deg); }
.fold-grp > .fold-body { padding: 0 10px 10px; }
.fold-grp > .fold-body[hidden] { display: none !important; }
.sticky-acts { position: sticky; top: calc(var(--top-h, 64px) + 6px); z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.12)); }
.sticky-acts[hidden] { display: none !important; }
.sticky-acts .sticky-t { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .sticky-acts { flex-wrap: nowrap; overflow-x: auto; padding: 6px 8px; gap: 6px; } .sticky-acts .sticky-t { display: none; } .sticky-acts .btn { flex: 0 0 auto; } }
/* ADR-DEC-129: رموز صيغ التصدير الملونة في الوضع الداكن بلون حبر يقرأ على السطح الداكن */
:root[data-theme="dark"] .ex-fmt .fx[style*="#B42318"] { color: #F47C70 !important; }
:root[data-theme="dark"] .ex-fmt .fx[style*="#1F5FBF"] { color: #74A6F2 !important; }
