/* ═══════════════════════════════════════════════════════════
   settings.css — Account & admin area (RTL)
   One shell for: الملف الشخصي والأمان · المستخدمون · النظام والاتصال · مركز التقييم والتصحيح
   Topbar · side navigation · page header · cards with setting rows · lists · modals · save bar
   ═══════════════════════════════════════════════════════════ */

:root {
  --st-bg: #0B0B0C;
  --st-card: #141415;
  --st-card-2: #1B1B1D;
  --st-input: #0F0F10;
  --st-code: #0D0D0F;
  --st-hover: rgba(255, 255, 255, 0.04);
  --st-border: rgba(255, 255, 255, 0.07);
  --st-border-strong: rgba(255, 255, 255, 0.12);
  --st-text: #ECECEC;
  --st-text-2: #A1A1A6;
  --st-text-3: #6E6E73;
  --st-accent: #DC2626;
  --st-accent-hover: #B91C1C;
  --st-accent-soft: rgba(220, 38, 38, 0.12);
  --st-ok: #22C55E;
  --st-ok-soft: rgba(34, 197, 94, 0.12);
  --st-warn: #F59E0B;
  --st-warn-soft: rgba(245, 158, 11, 0.12);
  --st-bad: #F05252;
  --st-bad-soft: rgba(240, 82, 82, 0.11);
  --st-violet: #A78BFA;
  --st-violet-soft: rgba(167, 139, 250, 0.12);
  --st-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --st-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --st-focus: rgba(255, 255, 255, 0.42);
  --st-focus-ring: rgba(255, 255, 255, 0.07);
}
body.light-theme {
  --st-bg: #F6F6F7;
  --st-card: #FFFFFF;
  --st-card-2: #F3F3F4;
  --st-input: #FFFFFF;
  --st-code: #F7F7F8;
  --st-hover: rgba(0, 0, 0, 0.035);
  --st-border: rgba(0, 0, 0, 0.08);
  --st-border-strong: rgba(0, 0, 0, 0.14);
  --st-text: #1C1C1E;
  --st-text-2: #55555B;
  --st-text-3: #8E8E93;
  --st-accent-soft: rgba(220, 38, 38, 0.08);
  --st-ok: #16A34A;
  --st-ok-soft: rgba(22, 163, 74, 0.1);
  --st-warn: #D97706;
  --st-warn-soft: rgba(217, 119, 6, 0.1);
  --st-bad: #DC2626;
  --st-bad-soft: rgba(220, 38, 38, 0.08);
  --st-violet: #7C3AED;
  --st-violet-soft: rgba(124, 58, 237, 0.09);
  --st-shadow: 0 18px 48px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  --st-focus: rgba(0, 0, 0, 0.45);
  --st-focus-ring: rgba(0, 0, 0, 0.06);
}

/* ── Shell ── */
.st-page {
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  background: var(--st-bg);
  color: var(--st-text);
  font-family: var(--font-family);
}
.st-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--st-bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--st-border);
}
.st-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--st-text-2);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.st-back:hover { background: var(--st-hover); color: var(--st-text); }
.st-back i { transition: transform 200ms var(--st-ease); }
.st-back:hover i { transform: translateX(3px); }
.st-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
.st-brand img { width: 26px; height: 26px; object-fit: contain; }

.st-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 44px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 120px;
}

/* ── Side navigation ── */
.st-nav {
  position: sticky;
  top: 92px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-nav-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--st-text-3);
  padding: 16px 12px 6px;
}
.st-nav-label:first-child { padding-top: 0; }
.st-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--st-text-2);
  font: inherit;
  font-size: 0.9rem;
  text-align: right;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.st-nav-item i { width: 18px; text-align: center; font-size: 0.9rem; color: var(--st-text-3); transition: color 150ms ease; }
.st-nav-item:hover { background: var(--st-hover); color: var(--st-text); }
.st-nav-item.active { background: var(--st-card-2); color: var(--st-text); font-weight: 500; }
.st-nav-item.active i { color: var(--st-accent); }
.st-nav-item.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--st-accent);
}
.st-nav-badge {
  margin-inline-start: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--st-bad-soft);
  color: var(--st-bad);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.st-nav-item:focus-visible,
.st-back:focus-visible,
.st-btn:focus-visible,
.st-icon-btn:focus-visible,
.st-seg button:focus-visible,
.st-fb-head:focus-visible,
.st-swatch:focus-visible,
.st-avatar-edit:focus-visible {
  outline: 2px solid var(--st-accent);
  outline-offset: 2px;
}

/* ── Page header ── */
.st-main { min-width: 0; }
.st-main.st-enter { animation: stEnter 320ms var(--st-ease) both; }
@keyframes stEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.st-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.st-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--st-text);
}
.st-sub {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--st-text-2);
  line-height: 1.6;
}
.st-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Cards & setting rows ── */
.st-card {
  background: var(--st-card);
  border: 1px solid var(--st-border);
  border-radius: 16px;
  margin-bottom: 20px;
}
.st-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--st-border);
}
.st-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--st-card-2);
  color: var(--st-text-2);
  font-size: 0.9rem;
}
.st-card-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--st-text); }
.st-card-desc { margin: 2px 0 0; font-size: 0.8rem; color: var(--st-text-3); line-height: 1.5; }
.st-card-body { padding: 4px 22px; }
.st-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--st-border);
}
.st-card-foot .st-foot-note { margin-inline-end: auto; font-size: 0.8rem; color: var(--st-text-3); }

.st-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 28px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--st-border);
}
.st-row:last-child { border-bottom: none; }
.st-row-label { font-size: 0.9rem; font-weight: 500; color: var(--st-text); }
.st-row-hint { margin-top: 3px; font-size: 0.78rem; color: var(--st-text-3); line-height: 1.55; }
.st-row-control { min-width: 0; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.st-row-control > .st-field,
.st-row-control > .st-input,
.st-row-control > .st-static { flex: 1; }

/* ── Inputs ── */
.st-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--st-border-strong);
  background: var(--st-input);
  color: var(--st-text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.st-input::placeholder { color: var(--st-text-3); }
.st-input:hover { border-color: color-mix(in srgb, var(--st-text-3) 55%, transparent); }
.st-input:focus { outline: none; border-color: var(--st-focus); box-shadow: 0 0 0 3px var(--st-focus-ring); }
.st-input.mono,
.st-input[dir="ltr"] { direction: ltr; text-align: left; font-size: 0.86rem; }
.st-input.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.st-input.invalid,
.st-input.invalid:focus { border-color: var(--st-bad); box-shadow: 0 0 0 3px var(--st-bad-soft); }
textarea.st-input { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.st-input {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--st-text-3) 50%), linear-gradient(135deg, var(--st-text-3) 50%, transparent 50%);
  background-position: 16px 50%, 21px 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.st-field { position: relative; min-width: 0; }
.st-field .st-input { padding-left: 42px; }
.st-field-btn {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--st-text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}
.st-field-btn:hover { background: var(--st-hover); color: var(--st-text); }
.st-search { position: relative; min-width: 0; }
.st-search > i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--st-text-3);
  font-size: 0.85rem;
  pointer-events: none;
}
.st-search .st-input { padding-right: 36px; width: 260px; }

/* value fixed by the server environment */
.st-static {
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px dashed var(--st-border-strong);
  background: var(--st-hover);
  color: var(--st-text-2);
  font-size: 0.86rem;
}
.st-static-value { direction: ltr; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-static-tag { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 0.72rem; color: var(--st-text-3); }

/* ── Buttons ── */
.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease, transform 100ms ease;
}
.st-btn:active:not(:disabled) { transform: scale(0.98); }
.st-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.st-btn-primary { background: var(--st-accent); color: #fff; }
.st-btn-primary:hover:not(:disabled) { background: var(--st-accent-hover); }
.st-btn-ghost { background: transparent; border-color: var(--st-border-strong); color: var(--st-text); }
.st-btn-ghost:hover:not(:disabled) { background: var(--st-hover); }
.st-btn-danger { background: transparent; border-color: color-mix(in srgb, var(--st-bad) 40%, transparent); color: var(--st-bad); }
.st-btn-danger:hover:not(:disabled) { background: var(--st-bad-soft); }
.st-btn-violet { background: var(--st-violet); color: #fff; }
.st-btn-violet:hover:not(:disabled) { filter: brightness(1.08); }
.st-btn-sm { height: 32px; padding: 0 12px; font-size: 0.82rem; border-radius: 9px; }
.st-btn .fa-spinner { font-size: 0.85em; }

.st-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--st-text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  transition: background 150ms ease, color 150ms ease;
}
.st-icon-btn:hover { background: var(--st-hover); color: var(--st-text); }
.st-icon-btn.danger:hover { background: var(--st-bad-soft); color: var(--st-bad); }
.st-icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--st-text);
  color: var(--st-bg);
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 180ms var(--st-ease);
  z-index: 5;
}
.st-icon-btn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 250ms; }

/* ── Pills ── */
.st-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-hover);
  color: var(--st-text-2);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
}
.st-pill i { font-size: 0.7rem; }
.st-pill .st-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-pill.ok { color: var(--st-ok); background: var(--st-ok-soft); border-color: transparent; }
.st-pill.bad { color: var(--st-bad); background: var(--st-bad-soft); border-color: transparent; }
.st-pill.warn { color: var(--st-warn); background: var(--st-warn-soft); border-color: transparent; }
.st-pill.accent { color: var(--st-accent); background: var(--st-accent-soft); border-color: transparent; }
.st-pill.violet { color: var(--st-violet); background: var(--st-violet-soft); border-color: transparent; }

/* ── Switch ── */
.st-switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex-shrink: 0; cursor: pointer; }
.st-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.st-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--st-border-strong);
  transition: background 200ms ease;
}
.st-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 260ms var(--st-ease);
}
.st-switch input:checked + .st-switch-track { background: var(--st-accent); }
.st-switch input:checked + .st-switch-track::after { transform: translateX(-18px); }
.st-switch input:focus-visible + .st-switch-track { outline: 2px solid var(--st-accent); outline-offset: 2px; }

/* ── Segmented control ── */
.st-seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--st-card);
  border: 1px solid var(--st-border);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.st-seg::-webkit-scrollbar { display: none; }
.st-seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--st-text-2);
  font: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.st-seg button:hover { color: var(--st-text); }
.st-seg button.active { background: var(--st-card-2); color: var(--st-text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.st-seg-count {
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--st-hover);
  color: var(--st-text-3);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.st-seg button.active .st-seg-count { color: var(--st-text-2); }
.st-seg button .st-seg-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ── Floating save bar ── */
.st-savebar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 10px;
  padding-inline-start: 18px;
  border-radius: 14px;
  background: var(--st-card-2);
  border: 1px solid var(--st-border-strong);
  box-shadow: var(--st-shadow);
  transform: translate(-50%, 150%);
  opacity: 0;
  pointer-events: none;
  transition: transform 380ms var(--st-ease), opacity 200ms ease;
}
.st-savebar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.st-savebar-text { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--st-text); white-space: nowrap; }
.st-savebar-text .st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-warn); box-shadow: 0 0 0 4px var(--st-warn-soft); }

/* ── Empty / loading states ── */
.st-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--st-text-2);
}
.st-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--st-card-2);
  color: var(--st-text-3);
  font-size: 1.3rem;
}
.st-empty h3 { margin: 0 0 6px; font-size: 1rem; color: var(--st-text); }
.st-empty p { margin: 0 auto; max-width: 420px; font-size: 0.86rem; line-height: 1.7; }
.st-skeleton {
  height: 64px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--st-card) 0%, var(--st-card-2) 50%, var(--st-card) 100%);
  background-size: 200% 100%;
  animation: stShimmer 1.2s linear infinite;
  border: 1px solid var(--st-border);
}
@keyframes stShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Modal ── */
.st-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: stFadeIn 180ms ease both;
}
.st-modal-backdrop.closing { animation: stFadeOut 160ms ease both; }
.st-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--st-card);
  border: 1px solid var(--st-border-strong);
  border-radius: 18px;
  box-shadow: var(--st-shadow);
  color: var(--st-text);
  animation: stPop 300ms var(--st-ease) both;
}
.st-modal-backdrop.closing .st-modal { animation: stPopOut 160ms ease both; }
.st-modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.st-modal-head .st-card-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.st-modal-title { margin: 0; font-size: 1.08rem; font-weight: 700; }
.st-modal-desc { margin: 4px 0 0; font-size: 0.84rem; color: var(--st-text-2); line-height: 1.6; }
.st-modal-close { margin-inline-start: auto; }
.st-modal-body { padding: 14px 22px 6px; }
.st-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.st-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.st-form-grid .full { grid-column: 1 / -1; }
.st-label { display: block; margin-bottom: 6px; font-size: 0.82rem; font-weight: 500; color: var(--st-text-2); }
.st-help { margin-top: 6px; font-size: 0.76rem; color: var(--st-text-3); }
@keyframes stFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes stFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes stPop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes stPopOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* role picker inside the create-user modal */
.st-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--st-border-strong);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.st-choice input { margin-top: 3px; accent-color: var(--st-accent); }
.st-choice label:hover { background: var(--st-hover); }
.st-choice label:has(input:checked) { border-color: var(--st-focus); background: var(--st-card-2); }
.st-choice strong { display: block; font-size: 0.86rem; font-weight: 500; }
.st-choice span { display: block; margin-top: 2px; font-size: 0.74rem; color: var(--st-text-3); line-height: 1.5; }

/* ═════════════ Profile & security ═════════════ */
.st-profile-hero { display: flex; align-items: center; gap: 22px; padding: 22px; }
.st-avatar-edit {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.st-avatar-edit .st-av {
  width: 100%;
  height: 100%;
  font-size: 2rem;
}
.st-avatar-edit::after {
  content: "\f030";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 180ms ease;
}
.st-avatar-edit:hover::after { opacity: 1; }
.st-profile-id { min-width: 0; flex: 1; }
.st-profile-name { margin: 0; font-size: 1.2rem; font-weight: 700; }
.st-profile-handle { margin-top: 3px; display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--st-text-2); direction: rtl; }
.st-profile-handle bdi { direction: ltr; }
.st-swatches { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.st-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 150ms var(--st-ease), box-shadow 150ms ease;
}
.st-swatch:hover { transform: scale(1.1); }
.st-swatch.active { box-shadow: 0 0 0 2px var(--st-card), 0 0 0 4px var(--st-text); }
.st-swatch-upload {
  background: var(--st-card-2);
  color: var(--st-text-2);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--st-border-strong);
}

/* generic avatar (initials or image) */
.st-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  background: var(--st-card-2);
}
.st-av img { width: 100%; height: 100%; object-fit: cover; }

/* password strength */
.st-meter { display: flex; gap: 4px; margin-top: 8px; transition: opacity 200ms ease; }
.st-meter[data-level="0"] { opacity: 0; }
.st-meter span { flex: 1; height: 4px; border-radius: 4px; background: var(--st-border-strong); transition: background 200ms ease; }
.st-meter[data-level="1"] span:nth-child(-n+1) { background: var(--st-bad); }
.st-meter[data-level="2"] span:nth-child(-n+2) { background: var(--st-warn); }
.st-meter[data-level="3"] span:nth-child(-n+3) { background: var(--st-ok); }
.st-meter[data-level="4"] span { background: var(--st-ok); }
.st-meter-label { margin-top: 6px; font-size: 0.75rem; color: var(--st-text-3); min-height: 1.1em; }

/* 2FA */
.st-2fa-state { display: flex; align-items: center; gap: 14px; padding: 18px 0; }
.st-2fa-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.st-2fa-icon.on { background: var(--st-ok-soft); color: var(--st-ok); }
.st-2fa-icon.off { background: var(--st-warn-soft); color: var(--st-warn); }
.st-2fa-text { flex: 1; min-width: 0; }
.st-2fa-text strong { display: block; font-size: 0.92rem; }
.st-2fa-text span { display: block; margin-top: 3px; font-size: 0.8rem; color: var(--st-text-2); line-height: 1.6; }
.st-2fa-setup {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 380ms var(--st-ease);
}
.st-2fa-setup.open { grid-template-rows: 1fr; }
.st-2fa-setup > div { overflow: hidden; }
.st-2fa-steps { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; padding: 6px 0 22px; border-top: 1px solid var(--st-border); padding-top: 20px; }
.st-qr {
  width: 172px;
  height: 172px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-qr img { width: 100%; height: 100%; }
.st-step { display: flex; gap: 12px; margin-bottom: 16px; }
.st-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--st-card-2);
  border: 1px solid var(--st-border-strong);
  font-size: 0.75rem;
  font-weight: 700;
}
.st-step-body { min-width: 0; flex: 1; }
.st-step-body strong { display: block; font-size: 0.88rem; font-weight: 500; }
.st-step-body p { margin: 3px 0 0; font-size: 0.78rem; color: var(--st-text-3); line-height: 1.6; }
.st-secret {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  padding-inline-start: 12px;
  border-radius: 10px;
  background: var(--st-code);
  border: 1px solid var(--st-border);
}
.st-secret code {
  flex: 1;
  direction: ltr;
  text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  color: var(--st-text);
}
.st-otp {
  width: 220px;
  height: 50px;
  margin-top: 8px;
  text-align: center !important;
  font-size: 1.4rem !important;
  font-weight: 700;
  letter-spacing: 0.45em;
  padding: 0 0 0 0.45em !important;
  font-variant-numeric: tabular-nums;
}
.st-otp-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.st-2fa-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.st-2fa-off { border-top: 1px solid var(--st-border); padding: 18px 0 20px; }
.st-2fa-off-text strong { display: block; font-size: 0.9rem; }
.st-2fa-off-text span { display: block; margin: 3px 0 12px; font-size: 0.8rem; color: var(--st-text-2); line-height: 1.6; }
.st-2fa-off .st-input { width: 260px; max-width: 100%; height: 42px; }

/* ═════════════ Admin: users ═════════════ */
.st-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.st-list { background: var(--st-card); border: 1px solid var(--st-border); border-radius: 16px; overflow: hidden; }
.st-user-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.75fr) minmax(0, 1.55fr) minmax(0, 0.95fr) minmax(0, 0.85fr) 118px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--st-border);
  transition: background 150ms ease;
}
.st-user-row:last-child { border-bottom: none; }
.st-user-row:not(.head):hover { background: var(--st-hover); }
.st-user-row.head {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--st-text-3);
  background: var(--st-card-2);
}
.st-user-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-user-names { min-width: 0; }
.st-user-names strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-user-names span { display: block; font-size: 0.78rem; color: var(--st-text-3); direction: ltr; text-align: right; }
.st-you { font-size: 0.68rem; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--st-card-2); color: var(--st-text-2); border: 1px solid var(--st-border); }
.st-user-date { font-size: 0.82rem; color: var(--st-text-2); }
.st-user-actions { display: flex; justify-content: flex-end; gap: 2px; }
.st-cell-label { display: none; }

/* Feature access: per-account chips + "for everyone" switches */
.st-feats { display: flex; flex-wrap: wrap; gap: 6px; }
.st-feat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px dashed var(--st-border-strong);
  background: transparent;
  color: var(--st-text-3);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 120ms ease;
}
.st-feat i { font-size: 0.7rem; }
.st-feat:hover:not(:disabled) { color: var(--st-text); border-color: var(--st-text-3); background: var(--st-hover); }
.st-feat:active:not(:disabled) { transform: scale(0.96); }
.st-feat.on { border-style: solid; border-color: transparent; background: var(--st-accent-soft); color: var(--st-accent); }
.st-feat.on:hover:not(:disabled) { background: var(--st-accent-soft); color: var(--st-accent); border-color: var(--st-accent); }
.st-feat.inherited { cursor: default; opacity: 0.75; }
.st-feat:disabled:not(.inherited) { opacity: 0.6; cursor: progress; }
.st-feat-check { font-size: 0.62rem !important; }
.st-feat:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.st-feat[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--st-text);
  color: var(--st-bg);
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 180ms var(--st-ease);
  z-index: 5;
}
.st-feat[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 300ms; }
.st-feature-control { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.st-switch-labeled { display: inline-flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--st-text-2); cursor: pointer; }
.st-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--st-border-strong);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, opacity 150ms ease;
}
.st-check input { margin-top: 3px; accent-color: var(--st-accent); }
.st-check:hover { background: var(--st-hover); }
.st-check:has(input:checked) { border-color: var(--st-focus); background: var(--st-card-2); }
.st-check strong { display: block; font-size: 0.84rem; font-weight: 500; }
.st-check strong i { color: var(--st-accent); font-size: 0.75rem; margin-inline-end: 4px; }
.st-check small { display: block; margin-top: 2px; font-size: 0.74rem; color: var(--st-text-3); line-height: 1.5; }
#ad-new-features.is-disabled .st-check { opacity: 0.55; cursor: default; }

/* ═════════════ Admin: system ═════════════ */
.st-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.st-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--st-card);
  border: 1px solid var(--st-border);
}
.st-status .st-card-icon { width: 38px; height: 38px; }
.st-status-name { font-size: 0.86rem; font-weight: 500; }
.st-status-state { display: flex; align-items: center; gap: 7px; margin-top: 3px; font-size: 0.78rem; color: var(--st-text-3); }
.st-status-state .st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-text-3); }
.st-status.ok .st-status-state { color: var(--st-ok); }
.st-status.ok .st-dot { background: var(--st-ok); box-shadow: 0 0 0 3px var(--st-ok-soft); }
.st-status.bad .st-status-state { color: var(--st-bad); }
.st-status.bad .st-dot { background: var(--st-bad); box-shadow: 0 0 0 3px var(--st-bad-soft); }
.st-status.checking .st-dot { animation: stPulse 1s ease-in-out infinite; }
@keyframes stPulse { 50% { opacity: 0.3; } }
.st-conn-result { padding-top: 14px; }
.st-conn-result:empty { display: none; }
.st-inline-result { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; line-height: 1.5; }
.st-inline-result.ok { color: var(--st-ok); }
.st-inline-result.bad { color: var(--st-bad); }
.st-inline-result.muted { color: var(--st-text-3); }

/* ═════════════ Evaluation center ═════════════ */
.st-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 12px; margin-bottom: 22px; }
.st-kpi {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--st-card);
  border: 1px solid var(--st-border);
  min-width: 0;
}
.st-kpi-label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--st-text-2); white-space: nowrap; }
.st-kpi-label .st-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.st-kpi-value { margin-top: 8px; font-size: 1.7rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--st-text); }
.st-kpi-value small { font-size: 0.9rem; font-weight: 500; color: var(--st-text-3); }
.st-bar { margin-top: 12px; height: 6px; border-radius: 6px; overflow: hidden; display: flex; background: var(--st-border-strong); }
.st-bar span { height: 100%; transition: width 600ms var(--st-ease); }
.st-kpi-hint { margin-top: 8px; font-size: 0.74rem; color: var(--st-text-3); }

.st-fb-list { display: flex; flex-direction: column; gap: 10px; }
.st-fb {
  background: var(--st-card);
  border: 1px solid var(--st-border);
  border-radius: 14px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.st-fb:hover { border-color: var(--st-border-strong); }
.st-fb.open { border-color: var(--st-border-strong); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
.st-fb-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 14px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}
.st-fb-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.st-fb-icon.like { background: var(--st-ok-soft); color: var(--st-ok); }
.st-fb-icon.dislike { background: var(--st-bad-soft); color: var(--st-bad); }
.st-fb-icon.corrected { background: var(--st-violet-soft); color: var(--st-violet); }
.st-fb-main { flex: 1; min-width: 0; }
.st-fb-q {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--st-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.st-fb.open .st-fb-q { -webkit-line-clamp: unset; }
.st-fb-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 0.77rem; color: var(--st-text-3); }
.st-fb-meta span { display: inline-flex; align-items: center; gap: 6px; }
.st-fb-meta i { font-size: 0.72rem; }
.st-fb-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.st-fb-chevron { color: var(--st-text-3); font-size: 0.8rem; transition: transform 300ms var(--st-ease); }
.st-fb.open .st-fb-chevron { transform: rotate(180deg); }
.st-fb-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 360ms var(--st-ease); }
.st-fb.open .st-fb-body { grid-template-rows: 1fr; }
.st-fb-body > div { overflow: hidden; min-height: 0; }
.st-fb-inner { padding: 0 18px 18px 18px; padding-inline-start: 66px; }
.st-callout {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 4px;
}
.st-callout i { margin-top: 4px; font-size: 0.85rem; }
.st-callout strong { display: block; font-size: 0.78rem; font-weight: 500; opacity: 0.85; }
.st-callout.bad { background: var(--st-bad-soft); color: var(--st-text); }
.st-callout.bad i { color: var(--st-bad); }
.st-callout.violet { background: var(--st-violet-soft); color: var(--st-text); }
.st-callout.violet i { color: var(--st-violet); }
.st-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--st-text-3);
}
.st-block-head .st-icon-btn { width: 28px; height: 28px; font-size: 0.78rem; }
.st-code {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--st-code);
  border: 1px solid var(--st-border);
  direction: ltr;
  text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--st-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.st-code.corrected { border-color: color-mix(in srgb, var(--st-violet) 35%, transparent); }
.st-answer {
  position: relative;
  max-height: 240px;
  overflow: hidden;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--st-border);
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--st-text);
}
.st-answer.expanded { max-height: none; }
.st-answer:not(.expanded).clipped::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--st-card));
  pointer-events: none;
}
.st-answer > :first-child { margin-top: 0; }
.st-answer > :last-child { margin-bottom: 0; }
.st-answer table { font-size: 0.8rem; }
.st-more { margin-top: 6px; border: none; background: none; color: var(--st-text-2); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 2px 0; }
.st-more:hover { color: var(--st-text); text-decoration: underline; }
.st-fb-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-kpis .st-kpi.wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .st-topbar { padding: 0 12px; }
  .st-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0 16px 120px; }
  .st-nav {
    position: sticky;
    top: 60px;
    z-index: 20;
    flex-direction: row;
    gap: 4px;
    margin: 0 -16px;
    padding: 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--st-bg) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--st-border);
  }
  .st-nav::-webkit-scrollbar { display: none; }
  .st-nav-label { display: none; }
  .st-nav-item { width: auto; height: 36px; flex-shrink: 0; border: 1px solid var(--st-border); }
  .st-nav-item.active { border-color: var(--st-border-strong); }
  .st-nav-item.active::before { display: none; }
  .st-title { font-size: 1.35rem; }
  .st-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .st-status-grid { grid-template-columns: minmax(0, 1fr); }
  .st-search .st-input { width: 100%; }
  .st-toolbar .st-search { flex: 1; }
  .st-user-row.head { display: none; }
  .st-user-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main actions" "meta meta";
    gap: 10px 12px;
    padding: 14px 16px;
  }
  .st-user-row > .st-user-main { grid-area: main; }
  .st-user-row > .st-user-actions { grid-area: actions; }
  .st-user-meta-wrap { grid-area: meta; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-inline-start: 48px; }
  .st-fb-inner { padding-inline-start: 18px; }
  .st-fb-side .st-pill { display: none; }
  .st-2fa-steps { grid-template-columns: minmax(0, 1fr); }
  .st-qr { margin: 0 auto; }
  .st-form-grid,
  .st-choice,
  .st-checks { grid-template-columns: minmax(0, 1fr); }
  .st-feature-control { justify-content: flex-start; }
  .st-savebar { left: 12px; right: 12px; transform: translateY(150%); justify-content: space-between; }
  .st-savebar.show { transform: none; }
  .st-savebar-text span:last-child { white-space: normal; }
  .st-back span { display: none; }
}
@media (min-width: 901px) {
  .st-user-meta-wrap { display: contents; }
}
@media (max-width: 520px) {
  .st-2fa-state { flex-wrap: wrap; }
  .st-2fa-state > .st-2fa-actions, .st-2fa-state > .st-btn { width: 100%; justify-content: center; }
  .st-2fa-actions .st-btn { flex: 1; justify-content: center; }
  .st-2fa-off .st-input { width: 100%; }
  .st-profile-hero { flex-direction: column; text-align: center; }
  .st-profile-handle, .st-swatches { justify-content: center; }
  .st-kpi-value { font-size: 1.45rem; }
  .st-card-head { padding: 16px; }
  .st-card-body { padding: 4px 16px; }
  .st-card-foot { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-main.st-enter, .st-modal, .st-modal-backdrop, .st-skeleton { animation: none !important; }
  .st-fb-body, .st-2fa-setup, .st-savebar, .st-switch-track::after { transition: none !important; }
}
