/* ===== «حسابات الموردين الأونلاين» (sa-*.js) — all classes are .sa-* scoped ===== */
.sa [hidden], .sa-form [hidden] { display: none !important; }
.sa { display: grid; gap: 16px; }
/* Four top sections, no horizontal scroll: they share the row and wrap to a 2×2 grid on phones. */
.sa-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 4px; padding: 4px; border-radius: var(--bo-r, 12px); background: #eef1f5; }
.sa-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 0; background: none; border-radius: var(--bo-r-sm, 8px);
  font: inherit; font-weight: 700; color: var(--bo-muted, #6b7280); cursor: pointer; text-align: center; line-height: 1.3; transition: color .18s, background .18s, box-shadow .18s; }
.sa-tab:hover { color: var(--bo-ink, #111827); background: rgba(255, 255, 255, .6); }
.sa-tab.on { color: var(--bo-accent, #0f766e); background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.sa-tab:focus-visible, .sa-sub:focus-visible, .sa-cchip:focus-visible { outline: 2px solid var(--bo-accent, #0f766e); outline-offset: 2px; }
.sa-tab svg, .sa-kpi svg, .sa-note > svg { width: 16px; height: 16px; flex: none; }
.sa-subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.sa-sub { min-height: 32px; padding: 4px 16px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: 999px; background: #fff; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--bo-muted, #6b7280); cursor: pointer; transition: color .18s, border-color .18s, background .18s; }
.sa-sub:hover { color: var(--bo-ink, #111827); border-color: #cbd2dc; }
.sa-sub.on { color: #fff; background: var(--bo-accent, #0f766e); border-color: var(--bo-accent, #0f766e); }

/* Body: a thin progress line while fresh data loads; a stale snapshot is visible but not clickable. */
.sa-body { position: relative; display: grid; gap: 16px; min-width: 0; }
.sa-body.is-busy::before { content: ""; position: absolute; inset-inline: 0; top: -10px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--bo-accent, #0f766e), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: sa-load 1s linear infinite; }
.sa-body.is-stale { pointer-events: none; opacity: .75; }
@keyframes sa-load { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.sa-skel { display: grid; gap: 12px; }
.sa-skel i { display: block; height: 64px; border-radius: var(--bo-r, 12px); background: linear-gradient(90deg, #f1f3f6 25%, #e7eaef 50%, #f1f3f6 75%); background-size: 200% 100%; animation: sa-shine 1.2s ease-in-out infinite; }
.sa-skel i.is-bar { height: 40px; max-width: 60%; }
@keyframes sa-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sa-skel i, .sa-body.is-busy::before { animation: none; } }

/* Section header: title + one line on the start side, actions grouped on the end side. */
.sa-hd { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.sa-hd h2 { margin: 0; font-size: var(--bo-fs-lg, 1.25rem); font-weight: 800; line-height: 1.3; }
.sa-hd p { margin: 4px 0 0; color: var(--bo-muted, #6b7280); font-size: .88rem; line-height: 1.6; }
.sa-hd__a { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-hd__a .btn svg, .sa-fbar .btn svg, .sa-empty .btn svg { width: 16px; height: 16px; }

/* One filter bar: wide search, two main filters, «فلاتر» with a counter for the rest. */
.sa-fbar { display: grid; gap: 8px; }
.sa-fbar__r, .sa-fbar__more { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sa-fbar__more { padding: 8px; border-radius: var(--bo-r-sm, 8px); background: #f6f7f9; }
.sa-fbar select { min-height: 40px; padding: 4px 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px); font: inherit; background: #fff; max-width: 100%; min-width: 0; }
.sa-fbar__i { color: var(--bo-muted, #6b7280); margin-inline-start: auto; white-space: nowrap; }
.sa-search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 0; min-height: 40px; padding-inline: 12px; border: 1px solid var(--bo-line, #e5e7eb);
  border-radius: var(--bo-r-sm, 8px); background: #fff; color: var(--bo-muted, #6b7280); transition: border-color .18s, box-shadow .18s; }
.sa-search:focus-within { border-color: var(--bo-accent, #0f766e); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.sa-search svg { width: 16px; height: 16px; flex: none; }
.sa-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--bo-ink, #111827); min-height: 38px; padding: 0; }
.sa-fbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.sa-fbtn b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bo-accent, #0f766e); color: #fff; font-size: .75rem; }
.sa-fbtn.is-on { border-color: var(--bo-accent, #0f766e); color: var(--bo-accent, #0f766e); }

/* Empty state: icon + one sentence + the action that fixes it. */
.sa-empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; text-align: center; color: var(--bo-muted, #6b7280); border: 1px dashed var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 12px); background: #fff; }
.sa-empty__ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #f0fdfa; color: var(--bo-accent, #0f766e); }
.sa-empty__ic svg { width: 24px; height: 24px; }
.sa-empty p { margin: 0; max-width: 46ch; line-height: 1.7; color: var(--bo-ink, #374151); }
.sa-card .sa-empty { border: 0; padding: 16px 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the table scrolls inside its frame: keep its screen-reader labels (absolute) inside it too, or the page scrolls sideways */
.sa-tw { position: relative; }

.sa-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sa-bar select, .sa-bar input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 8px); font: inherit; background: #fff; }
.sa-q { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.sa-sp { flex: 1; }

.sa-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sa-kpi { display: grid; gap: 8px; text-align: start; padding: 16px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 12px); background: #fff;
  font: inherit; cursor: pointer; transition: box-shadow .18s, border-color .18s; }
.sa-kpi:hover, .sa-kpi:focus-visible { box-shadow: 0 4px 14px rgba(16, 24, 40, .08); border-color: var(--bo-accent, #0f766e); outline: 0; }
.sa-kpi b { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--bo-ink, #111827); }
.sa-kpi small { color: var(--bo-muted, #6b7280); font-size: .9rem; font-weight: 600; }
.sa-kpi__ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #f1f5f9; color: var(--bo-muted, #6b7280); }
.sa-kpi__ic svg { width: 18px; height: 18px; }
.sa-kpi.is-ok .sa-kpi__ic { background: #dcfce7; color: #166534; }
.sa-kpi.is-info .sa-kpi__ic { background: #e0f2fe; color: #075985; }
.sa-kpi.is-warn .sa-kpi__ic { background: #fef3c7; color: #92400e; }
.sa-kpi.is-warn b { color: #b45309; }
.sa-kpi.is-bad .sa-kpi__ic { background: #fee2e2; color: #991b1b; }
.sa-kpi.is-bad b { color: var(--bo-red, #b91c1c); }

/* Overview: «يحتاج انتباه» next to the request flow. */
.sa-ov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.sa-ov .sa-card { display: grid; gap: 16px; }
.sa-ov h3 { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 1rem; }
.sa-ov h3 svg { width: 18px; height: 18px; color: var(--bo-muted, #6b7280); }
.sa-needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sa-need { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px);
  background: #fff; font: inherit; text-align: start; cursor: pointer; transition: border-color .18s, background .18s; }
.sa-need:hover, .sa-need:focus-visible { border-color: currentColor; background: #fafafa; outline: 0; }
.sa-need__ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none; }
.sa-need svg { width: 16px; height: 16px; flex: none; }
.sa-need__t { flex: 1; color: var(--bo-ink, #111827); font-weight: 600; }
.sa-need b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.sa-need > svg:last-child { color: var(--bo-muted, #9ca3af); }
.sa-need.is-bad { color: #991b1b; } .sa-need.is-bad .sa-need__ic { background: #fee2e2; }
.sa-need.is-warn { color: #92400e; } .sa-need.is-warn .sa-need__ic { background: #fef3c7; }
.sa-need.is-info { color: #075985; } .sa-need.is-info .sa-need__ic { background: #e0f2fe; }

.sa-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 12px 16px; font-size: .88rem; border-radius: var(--bo-r, 8px); background: #f0fdfa; border: 1px solid #ccfbf1; color: #134e4a; }
.sa-note p, .sa-note span { margin: 0; line-height: 1.7; }
.sa-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sa-card { padding: 16px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 10px); background: #fff; }
.sa-card h3 { margin: 0 0 12px; font-size: 1rem; }
.sa-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.sa-set { max-width: 820px; }

.sa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #f3f4f6; color: #374151; }
.sa-chip.is-ok { background: #dcfce7; color: #166534; }
.sa-chip.is-warn { background: #fef3c7; color: #92400e; }
.sa-chip.is-bad { background: #fee2e2; color: #991b1b; }
.sa-chip.is-info { background: #e0f2fe; color: #075985; }
.sa-chip.is-mute { background: #f3f4f6; color: #6b7280; }

.sa-tbl td { vertical-align: top; }
.sa-tbl td small { display: block; }
.sa-tbl tr.is-flag td { background: #fffbeb; }
.sa-acts { display: inline-flex; gap: 4px; flex-wrap: wrap; white-space: nowrap; }
.sa-acts svg { width: 15px; height: 15px; }

.sa-list { display: grid; gap: 8px; }
.sa-row, .sa-task { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--bo-line, #e5e7eb);
  border-radius: var(--bo-r, 10px); background: #fff; text-align: start; transition: border-color .18s, box-shadow .18s; }
.sa-row { cursor: pointer; width: 100%; font: inherit; }
.sa-row:hover, .sa-row:focus-visible { border-color: var(--bo-accent, #0f766e); box-shadow: var(--bo-shadow, 0 4px 14px rgba(0, 0, 0, .06)); }
.sa-task.is-late { border-inline-start: 4px solid var(--bo-red, #b91c1c); }
.sa-row__m { display: grid; gap: 3px; min-width: 0; }
.sa-row__m small { color: var(--bo-muted, #6b7280); line-height: 1.6; }
.sa-row__s { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 50%; }
.sa-late { color: var(--bo-red, #b91c1c); font-weight: 600; }
.sa-prog { display: block; width: 90px; height: 6px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.sa-prog i { display: block; height: 100%; background: var(--bo-green, #15803d); }

.sa-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.sa-items { display: grid; gap: 10px; }
.sa-item { padding: 12px 14px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 10px); background: #fff; display: grid; gap: 6px; }
.sa-ok { color: var(--bo-green, #15803d); font-weight: 600; }
.sa-why { color: var(--bo-red, #b91c1c); }
.sa-hist { margin: 0; padding-inline-start: 18px; color: var(--bo-muted, #6b7280); font-size: .85rem; line-height: 1.7; }

.sa-sups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sa-sup { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 10px); background: #fff; }
.sa-sup.is-off { opacity: .6; }
.sa-sup header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sa-sup dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: .85rem; }
.sa-sup dt { color: var(--bo-muted, #6b7280); }
.sa-sup dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sa-sup footer { display: flex; gap: 6px; justify-content: flex-end; }
.sa-instr { font-size: .85rem; color: #374151; white-space: pre-line; background: #f9fafb; border-radius: 6px; padding: 8px; margin: 0; }

/* The form IS the modal card's content: header and footer stay put, only the body scrolls, and the card
   grows for wide forms instead of the form overflowing a 620px card (which clipped × and «حفظ»). */
.modal__card:has(> .sa-form.is-wide) { width: min(820px, 100%); }
.sa-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }
.sa-form > .modal__h, .sa-form > .modal__f { flex: 0 0 auto; }
.sa-form__b { display: grid; gap: 14px; align-content: start; }
.sa-form .fld textarea { min-height: 84px; resize: vertical; }
.sa-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sa-err { margin: 0; color: var(--bo-red, #b91c1c); font-weight: 600; }
.sa-err:empty { display: none; }
.sa-warn { display: flex; gap: 6px; align-items: center; margin: 0; padding: 8px 10px; border-radius: 6px; background: #fffbeb; color: #92400e; font-size: .85rem; }
.sa-warn svg { width: 15px; height: 15px; flex: none; }
.sa-check { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px dashed var(--bo-line, #d1d5db); border-radius: 8px; cursor: pointer; line-height: 1.6; }
.sa-check input { margin-top: 4px; }
.sa-prev { display: grid; gap: 10px; }

.sa-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-seg label { cursor: pointer; }
.sa-seg input { position: absolute; opacity: 0; pointer-events: none; }
.sa-seg span { display: inline-block; padding: 7px 12px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 999px; font-weight: 600; transition: background .18s, color .18s, border-color .18s; }
.sa-seg input:checked + span { background: var(--bo-accent, #0f766e); border-color: var(--bo-accent, #0f766e); color: #fff; }
.sa-seg input:focus-visible + span { outline: 2px solid var(--bo-accent, #0f766e); outline-offset: 2px; }

.sa-pick { display: grid; gap: 8px; }
.sa-pick__r { display: grid; gap: 10px; padding: 10px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: 8px; }
.sa-pick__r:has(input[type="checkbox"]:checked) { border-color: var(--bo-accent, #0f766e); background: #f0fdfa; }
.sa-pick__c { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.sa-pick__c small { color: var(--bo-muted, #6b7280); }
.sa-pick__x { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }

/* Permission checkboxes (sa-perms.js), supplier categories, templates */
.sa-fs { border: 1px solid var(--bo-line, #e5e7eb); border-radius: 8px; padding: 10px 12px; margin: 0; min-width: 0; display: grid; gap: 8px; }
.sa-fs legend { padding: 0 6px; font-weight: 600; }
.sa-fs--wide { grid-column: 1 / -1; }
.sa-boxes, .sa-perms__g { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-pc { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 8px; cursor: pointer;
  background: #fff; line-height: 1.4; transition: border-color .18s, background .18s; }
.sa-pc:hover { border-color: var(--bo-accent, #0f766e); }
.sa-pc:has(input:checked) { border-color: var(--bo-accent, #0f766e); background: #f0fdfa; }
.sa-pc.is-auto { cursor: default; border-style: dashed; }
.sa-pc small { color: var(--bo-muted, #6b7280); font-size: .75rem; }
.sa-perms { display: grid; gap: 8px; }
.sa-perms__t { display: flex; align-items: center; gap: 8px; }
.sa-perms__t select { min-height: 34px; padding: 4px 8px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 8px; font: inherit; background: #fff; }
.sa-perms__m { color: var(--bo-amber, #b45309); }
.sa-pick__b { display: grid; gap: 10px; }
.sa-tpls { display: grid; gap: 8px; margin-bottom: 12px; }
.sa-tpl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: 8px; }
.sa-tpl [data-name] { flex: 1 1 200px; min-height: 34px; padding: 4px 10px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 8px; font: inherit; }

/* Employees tab (sa-people.js) */
.sa-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sa-person { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r, 10px); background: #fff; }
.sa-person header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sa-person header > div { display: grid; gap: 2px; min-width: 0; }
.sa-person__none { margin: 0; font-size: .85rem; }
.sa-person footer { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: auto; }
.sa-pas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sa-pa { position: relative; display: grid; gap: 6px; padding: 8px 10px; padding-inline-end: 40px; border-radius: 8px; background: #f9fafb; }
.sa-pa__h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sa-pa__e { position: absolute; inset-inline-end: 6px; top: 6px; }

@media (max-width: 720px) {
  .sa-row, .sa-task, .sa-head { flex-direction: column; }
  .sa-row__s { max-width: none; justify-content: flex-start; }
  .sa-q { max-width: none; }
  .sa-kpis { grid-template-columns: repeat(2, 1fr); }
  .sa-people { grid-template-columns: 1fr; }
}

/* ---- HR approval, the permissions guide and the self-service screen (osa4) ---- */
.sax { display: grid; gap: 16px; }
.sax .sa-card h4 { margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; }
.sa-hr { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 14px; border-radius: var(--bo-r, 10px); border: 1px solid; line-height: 1.6; }
.sa-hr span:last-child { flex-basis: 100%; }
.sa-hr.is-wait { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.sa-hr.is-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.sa-hr.is-bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
/* The request flow as a horizontal stepper: numbered dots joined by a line; vertical on narrow screens. */
.sa-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.sa-flow li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: .85rem; line-height: 1.5; color: var(--bo-ink, #374151); }
.sa-flow li::after { content: ""; position: absolute; top: 20px; inset-inline-start: calc(50% + 24px); inline-size: calc(100% - 40px); block-size: 2px; background: var(--bo-line, #e5e7eb); }
.sa-flow li:last-child::after { display: none; }
.sa-flow__ic { display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: #f0fdfa; color: var(--bo-accent, #0f766e); border: 2px solid #ccfbf1; position: relative; z-index: 1; }
.sa-flow__ic svg { width: 18px; height: 18px; }
.sa-flow__t b { display: block; color: var(--bo-muted, #6b7280); font-size: .75rem; }
.sa-gds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.sa-gd { display: grid; gap: 8px; }
.sa-gd[hidden] { display: none; }
.sa-gd header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sa-gd header small { color: var(--bo-muted, #6b7280); }
.sa-gd__l { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; color: #1d4ed8; text-decoration: none; word-break: break-all; }
.sa-gd__l:hover { text-decoration: underline; }
.sa-gd__p { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sa-gd__p li { display: grid; gap: 2px; padding: 6px 10px; border-radius: 8px; background: #f9fafb; font-size: .88rem; }
.sa-gd__p li span { color: var(--bo-muted, #6b7280); font-size: .8rem; line-height: 1.6; }
.sa-gd__p li.is-priv { background: #fffbeb; }
.sa-gd__n { margin: 0; font-size: .82rem; color: var(--bo-muted, #6b7280); line-height: 1.6; border-inline-start: 3px solid #c7d2fe; padding-inline-start: 8px; }
.sa-pick__r[hidden] { display: none; }

/* ---- osa6: one visual language for the module ---- */
/* Orange stays for the page's main action only: actions inside list rows and cards use the quiet style. */
.sa .sa-row__s .btn--p, .sa .sa-item .btn--p, .sa .sa-task .btn--p { background: #fff; color: var(--bo-accent, #0f766e); border: 1.5px solid currentColor; box-shadow: none; }
.sa .sa-row__s .btn--p:hover, .sa .sa-item .btn--p:hover, .sa .sa-task .btn--p:hover { background: #f0fdfa; filter: none; }
.sa-row__go { align-self: center; color: var(--bo-muted, #9ca3af); display: inline-flex; }
.sa-row__go svg { width: 18px; height: 18px; }
.sa-row:hover .sa-row__go { color: var(--bo-accent, #0f766e); }
.sa-card h3, .sa-card h4 { line-height: 1.4; }
.sa-chip svg { width: 12px; height: 12px; margin-inline-end: 4px; }
.sa-acts .btn { min-width: 34px; justify-content: center; }

/* Permissions guide: chips + search, a legend, a compact table, details in a drawer. */
.sa-gdx { display: grid; gap: 16px; }
.sa-cchips { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-cchip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: 999px; background: #fff;
  font: inherit; font-size: .88rem; font-weight: 600; color: var(--bo-ink, #374151); cursor: pointer; transition: background .18s, color .18s, border-color .18s; }
.sa-cchip small { color: var(--bo-muted, #6b7280); font-weight: 600; }
.sa-cchip:hover { border-color: #cbd2dc; }
.sa-cchip.on { background: var(--bo-accent, #0f766e); border-color: var(--bo-accent, #0f766e); color: #fff; }
.sa-cchip.on small { color: rgba(255, 255, 255, .8); }
.sa-legend { padding: 0; }
.sa-legend summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.sa-legend summary::-webkit-details-marker { display: none; }
.sa-legend summary svg { width: 16px; height: 16px; color: var(--bo-accent, #0f766e); }
.sa-legend summary small { color: var(--bo-muted, #6b7280); font-weight: 600; }
.sa-legend summary::after { content: "+"; margin-inline-start: auto; color: var(--bo-muted, #6b7280); font-weight: 700; }
.sa-legend[open] summary::after { content: "−"; }
.sa-legend dl { margin: 0; padding: 0 16px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.sa-legend dl > div { padding: 8px 12px; border-radius: var(--bo-r-sm, 8px); background: #f6f7f9; }
.sa-legend dt { font-weight: 700; font-size: .9rem; }
.sa-legend dd { margin: 4px 0 0; color: var(--bo-muted, #6b7280); font-size: .82rem; line-height: 1.6; }
.sa-gdt tbody tr { cursor: pointer; transition: background .15s; }
.sa-gdt tbody tr:hover, .sa-gdt tbody tr:focus-visible { background: #f6faf9; outline: 0; }
.sa-gdt td { vertical-align: middle; }
.sa-gdt .sa-gd__l { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: #1d4ed8; text-decoration: none; word-break: break-all; }
.sa-gdt .sa-gd__l svg { width: 12px; height: 12px; flex: none; }
.sa-gd__n { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: #f1f5f9; font-weight: 700; font-variant-numeric: tabular-nums; }
.sa-gd__go { width: 32px; color: var(--bo-muted, #9ca3af); }
.sa-gd__go svg { width: 16px; height: 16px; }
.sa-gdt[hidden] { display: none; }

.sa-drw { position: fixed; inset: 0; z-index: 900; }
.sa-drw__bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); animation: sa-fade .18s ease-out; }
.sa-drw__p { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: min(440px, 100vw); display: flex; flex-direction: column; background: #fff;
  box-shadow: 0 0 32px rgba(16, 24, 40, .18); animation: sa-in .2s ease-out; }
.sa-drw__p > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 16px; border-bottom: 1px solid var(--bo-line, #e5e7eb); }
.sa-drw__p h3 { margin: 0; font-size: 1.1rem; }
.sa-drw__p header small { color: var(--bo-muted, #6b7280); }
.sa-drw__b { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 24px; align-content: start; }
.sa-drw__b h4 { margin: 0 0 8px; font-size: .82rem; color: var(--bo-muted, #6b7280); font-weight: 700; }
.sa-drw__b p { margin: 0; }
.sa-drw__l { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; overflow-wrap: anywhere; }
.sa-drw__l svg { width: 16px; height: 16px; flex: none; }
@keyframes sa-fade { from { opacity: 0; } }
@keyframes sa-in { from { transform: translateX(-24px); opacity: 0; } }

/* New request wizard. */
.sa-wz .modal__b { gap: 16px; }
.sa-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sa-steps li { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 3px solid var(--bo-line, #e5e7eb); color: var(--bo-muted, #6b7280); font-weight: 700; cursor: pointer; }
.sa-steps li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef1f5; font-size: .82rem; flex: none; }
.sa-steps li.on { color: var(--bo-accent, #0f766e); border-color: var(--bo-accent, #0f766e); }
.sa-steps li.on span, .sa-steps li.done span { background: var(--bo-accent, #0f766e); color: #fff; }
.sa-steps li.done { color: var(--bo-ink, #374151); border-color: #99d5cf; }
.sa-wz__p { display: grid; gap: 16px; align-content: start; }
.sa-wz__emps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.sa-opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px); cursor: pointer; transition: border-color .18s, background .18s; }
.sa-opt:hover { border-color: #cbd2dc; }
.sa-opt:has(input:checked) { border-color: var(--bo-accent, #0f766e); background: #f0fdfa; }
.sa-opt input { margin-top: 4px; accent-color: var(--bo-accent, #0f766e); }
.sa-opt span { display: grid; gap: 2px; min-width: 0; }
.sa-opt small { color: var(--bo-muted, #6b7280); font-size: .78rem; overflow-wrap: anywhere; }
.sa-wz__g { margin: 0; padding: 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px); display: grid; gap: 8px; min-width: 0; }
.sa-wz__g legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; }
.sa-wz__g legend svg { width: 16px; height: 16px; color: var(--bo-accent, #0f766e); }
.sa-wz__g legend small { color: var(--bo-muted, #6b7280); }
.sa-wz__all { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--bo-accent, #0f766e); cursor: pointer; justify-self: start; }
.sa-wz__all input, .sa-wz__sups input { accent-color: var(--bo-accent, #0f766e); }
.sa-wz__sups { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-wz__tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--bo-r-sm, 8px); background: #f6f7f9; font-weight: 600; }
.sa-wz__tpl span { display: inline-flex; gap: 6px; align-items: center; }
.sa-wz__tpl svg { width: 16px; height: 16px; color: var(--bo-accent, #0f766e); }
.sa-wz__tpl select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 8px; font: inherit; background: #fff; }
.sa-wz__rev { display: grid; gap: 8px; }
.sa-wz__c { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px); }
.sa-wz__c header { display: flex; align-items: center; gap: 8px; }
.sa-wz__c header small { color: var(--bo-muted, #6b7280); flex: 1; }
.sa-wz__c header .btn svg { width: 14px; height: 14px; }
.sa-wz__c .sa-pick__x label { display: grid; gap: 4px; }
.sa-wz__c .sa-pick__x small { color: var(--bo-muted, #6b7280); }
.sa-wz__c .sa-pick__x input, .sa-wz__c .sa-pick__x select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--bo-line, #d1d5db); border-radius: 8px; font: inherit; background: #fff; min-width: 0; }
.sa-wz__miss { display: none; margin: 0; color: #b45309; font-size: .82rem; align-items: center; gap: 6px; }
.sa-wz__miss svg { width: 14px; height: 14px; }
.sa-wz__c.is-missing { border-color: #fcd34d; background: #fffbeb; }
.sa-wz__c.is-missing .sa-wz__miss { display: flex; }
.sa-wz .modal__f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sa-wz__sum { margin: 0; margin-inline-end: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--bo-muted, #6b7280); font-size: .88rem; }
.sa-wz__sum svg { width: 14px; height: 14px; }
.sa-wz__sum b { color: var(--bo-ink, #111827); }
.sa-wz .modal__f .btn svg { width: 16px; height: 16px; }
.sa-wz [type="submit"]:disabled, .sa-wz [data-wznext]:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

@media (max-width: 980px) {
  .sa-ov { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sa-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-tab { font-size: .85rem; padding: 8px; }
  .sa-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sa-kpi { padding: 12px; }
  .sa-kpi b { font-size: 1.6rem; }
  .sa-hd__a { width: 100%; }
  .sa-hd__a > * { flex: 1 1 auto; justify-content: center; }
  .sa-fbar__r > select, .sa-fbar__more > select { flex: 1 1 140px; }
  .sa-search { flex-basis: 100%; }
  .sa-fbar__i { margin-inline-start: 0; }
  .sa-flow { grid-template-columns: 1fr; gap: 0; }
  .sa-flow li { grid-template-columns: 40px 1fr; justify-items: start; align-items: center; text-align: start; padding-bottom: 16px; }
  .sa-flow li::after { top: 42px; inset-inline-start: 19px; inline-size: 2px; block-size: calc(100% - 44px); }
  .sa-flow__t b { display: inline; margin-inline-end: 4px; }
  /* Tables become stacked cards, each cell labelled. */
  .sa-tbl--cards thead { display: none; }
  .sa-tbl--cards, .sa-tbl--cards tbody, .sa-tbl--cards tr, .sa-tbl--cards td { display: block; width: 100%; }
  .sa-tbl--cards tr { padding: 12px; border: 1px solid var(--bo-line, #e5e7eb); border-radius: var(--bo-r-sm, 8px); margin-bottom: 8px; background: #fff; }
  .sa-tbl--cards td { border: 0; padding: 4px 0; }
  .sa-tbl--cards td[data-l] { display: flex; gap: 8px; align-items: baseline; }
  .sa-tbl--cards td[data-l]::before { content: attr(data-l); flex: 0 0 96px; color: var(--bo-muted, #6b7280); font-size: .78rem; }
  .sa-tbl--cards tr[hidden] { display: none; }
  .sa-tw { overflow: visible; border: 0; box-shadow: none; background: none; }
  .sa-gd__go { display: none !important; }
  .sa-steps li { font-size: .82rem; }
  .sa-wz__emps { grid-template-columns: 1fr; max-height: none; }
  .sa-wz__sum { flex-basis: 100%; }
  .sa-wz .modal__f .btn { flex: 1 1 auto; justify-content: center; }
}

/* the accounts table grew wider than the page and hid the row buttons behind a sideways scroll: let long cells wrap, keep the buttons column tight */
@media (min-width: 721px) {
  .sa-tbl th, .sa-tbl td { white-space: normal; }
  .sa-tbl td.ltr, .sa-tbl td b { overflow-wrap: anywhere; }
  .sa-tbl td[data-l="اسم المستخدم"] { min-width: 170px; }
  .sa-tbl td .sa-chip { white-space: normal; }
  .sa-tbl td.sa-acts { display: table-cell; width: 1%; white-space: nowrap; padding-inline: 8px; }
  .sa-tbl td.sa-acts .btn { min-width: 30px; padding-inline: 6px; }
  .sa-tbl td.sa-acts .btn + .btn { margin-inline-start: 4px; }
}
