/* ════════════════════════════════════════════════════════════════════
   Ignix67 Identity — Admin Console
   Token-only stylesheet. Built ENTIRELY on the shared design-system token
   layer (colors_and_type.css) — the SAME file the auth pages load, so the
   whole Identity surface rebrands together. Every colour here is a var(--*)
   or a colour mix of one; every radius a --radius* token. No colour literal
   appears in this file, and DesignTokenLayerTests fails the build if one does.
   A rebrand = editing the token layer only; markup never changes.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Derived tokens (still token-only; one place to extend) ─── */
:root {
  /* tinted fills derived from tokens so they rebrand automatically */
  --tint-primary:  color-mix(in srgb, var(--primary) 10%, transparent);
  --tint-primary-2:color-mix(in srgb, var(--primary) 16%, transparent);
  --row-hover:     color-mix(in srgb, var(--primary) 4%, var(--card));
  --row-stripe:    color-mix(in srgb, var(--muted) 40%, var(--card));
  --thead-bg:      color-mix(in srgb, var(--muted) 55%, var(--card));
  --shell-bg:      var(--background);
  --overlay:       color-mix(in srgb, var(--brand-ink) 55%, transparent);

  /* environment accent — maps onto existing status tokens, no new colors */
  --env-dev:     var(--status-queued);
  --env-staging: var(--status-timeout);
  --env-prod:    var(--destructive);

  /* domain status → status tokens */
  --st-active:   var(--status-succeeded);
  --st-locked:   var(--status-failed);
  --st-unverified: var(--status-pending);
  --st-mfa-pending: var(--status-timeout);

  --sidebar-w: 244px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
  --row-h: 40px;          /* compact */
}
.density-comfortable { --row-h: 52px; }

/* Brand and per-tenant palettes live in colors_and_type.css, not here, because
   both surfaces have to rebrand from one edit. The bundle shipped them twice
   and in two different selector forms — a class in this file, an attribute in
   auth.css — which would let a deployment re-skin the login pages and leave the
   console violet. Reconciled onto the attribute form in the token layer; see the
   BRAND SETS block there, and DesignTokenLayerTests for the rule. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--shell-bg);
  color: var(--foreground);
  font-size: var(--fs-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
/* Server-rendered console uses real anchors for navigation (rows → detail, tabs, pager).
   The design SPA used onClick handlers, so it never needed an <a> reset — add one here so
   link-ified controls inherit text colour instead of the UA blue/underline. Styled controls
   (.btn, .icon-btn, .sb__item, …) set their own colour and are unaffected. */
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--tint-primary-2); }

/* ════ App shell ════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--shell-bg);
}
.app--collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
.main { display: flex; flex-direction: column; min-width: 0; }

/* ════ Sidebar (always dark-tinted) ════ */
.sb {
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--sidebar-border);
}
.sb__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 12px;
}
.sb__mark { width: 30px; height: 30px; border-radius: var(--radius-md); flex-shrink: 0; display: block; }
/* The sidebar's brightest text is var(--sidebar-accent-foreground), not a literal
   white: it is the colour already paired with --sidebar-accent, it is declared
   once in the token layer, and a brand set that darkens the sidebar can move it
   without touching this file. (Four hard-coded whites lived here before the
   design port — one of them on the active nav item, which is why a teal brand
   set could not have produced a legible sidebar.) */
/* The spec's sidebar markup wraps the two brand lines in .sb__brand-text and the
   bundle's stylesheet had no rule for it, so a long installation name pushed the
   row wider than the sidebar instead of ellipsising. min-width:0 is what lets the
   name below actually truncate inside a flex row. */
.sb__brand-text { min-width: 0; }
.sb__brand-name { font-weight: var(--fw-semibold); font-size: 13px; color: var(--sidebar-accent-foreground); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb__brand-sub  { font-size: 11px; color: var(--sidebar-foreground); margin-top: 1px; }

.sb__nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sb__group { display: flex; flex-direction: column; gap: 1px; }
.sb__group-label {
  text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent);
  padding: 6px 10px 4px; font-weight: var(--fw-semibold);
}
.sb__item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-md);
  color: var(--sidebar-foreground); font-size: 13px; font-weight: var(--fw-medium);
  transition: background 120ms, color 120ms; text-align: left; width: 100%;
}
.sb__item:hover { background: var(--sidebar-muted); color: var(--sidebar-accent-foreground); }
.sb__item--active { background: color-mix(in srgb, var(--sidebar-accent) 16%, transparent); color: var(--sidebar-accent-foreground); }
.sb__indicator {
  position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px;
  background: var(--sidebar-accent); border-radius: 0 2px 2px 0;
}
.sb__icon { flex-shrink: 0; }
.sb--collapsed .sb__item { justify-content: center; }
.sb__footer { border-top: 1px solid var(--sidebar-border); padding-top: 8px; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sb__toggle {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-md);
  color: color-mix(in srgb, var(--sidebar-foreground) 85%, transparent); font-size: 12px; width: 100%;
}
.sb__toggle:hover { background: var(--sidebar-muted); color: var(--sidebar-accent-foreground); }

/* ════ TopBar ════ */
.topbar {
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.topbar__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted-foreground); }
.topbar__sep { color: var(--border); }
.topbar__crumb { white-space: nowrap; }
.topbar__crumb--last { color: var(--foreground); font-weight: var(--fw-medium); }
/* The spec has two top-bar shapes: a crumb trail, and a single section title —
   which it rendered with an inline font-size/weight. This is that second shape as
   a class, so no page carries a style attribute for it. Step 06's tenant pages use
   the trail; everything shipped today is a single title. */
.topbar__crumbs--section .topbar__crumb--last { font-size: 14px; font-weight: var(--fw-semibold); }
.topbar__right { display: flex; align-items: center; gap: 10px; }

/* Environment indicator */
.env {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 9px; border-radius: var(--radius-md);
  font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: 0.04em;
  text-transform: uppercase; border: 1px solid transparent; white-space: nowrap;
}
.env__dot { width: 7px; height: 7px; border-radius: var(--radius-xl); }
.env--dev     { color: var(--env-dev);     background: color-mix(in srgb, var(--env-dev) 12%, transparent);     border-color: color-mix(in srgb, var(--env-dev) 30%, transparent); }
.env--dev     .env__dot { background: var(--env-dev); }
.env--staging { color: var(--env-staging); background: color-mix(in srgb, var(--env-staging) 14%, transparent); border-color: color-mix(in srgb, var(--env-staging) 32%, transparent); }
.env--staging .env__dot { background: var(--env-staging); }
.env--prod    { color: var(--env-prod);    background: color-mix(in srgb, var(--env-prod) 12%, transparent);    border-color: color-mix(in srgb, var(--env-prod) 34%, transparent); }
.env--prod    .env__dot { background: var(--env-prod); box-shadow: 0 0 0 3px color-mix(in srgb, var(--env-prod) 18%, transparent); }

/* Language switcher + generic top chip */
.topchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--card);
  color: var(--foreground); font-size: 12px; font-weight: var(--fw-medium);
  transition: background 120ms, border-color 120ms;
}
.topchip:hover { background: var(--muted); }
/* Language switcher (top-bar) — native <details> disclosure, no JS (#29 web-foundation step 03).
   The .topchip summary keeps the chip look; the menu is a popover anchored to the right. */
details.langsel { position: relative; }
details.langsel > summary { list-style: none; cursor: pointer; }
details.langsel > summary::-webkit-details-marker { display: none; }
.langsel__menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 170px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: var(--sp-1); z-index: 30; display: none;
}
details.langsel[open] .langsel__menu { display: block; }
.langsel__item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm); text-decoration: none;
  font-size: var(--fs-sm); color: var(--foreground); white-space: nowrap;
}
.langsel__item:hover { background: var(--accent); color: var(--accent-foreground); }
.langsel__item[aria-selected="true"] { color: var(--primary); font-weight: var(--fw-medium); }
.topbar__divider { width: 1px; height: 22px; background: var(--border); }
.topbar__user {
  display: flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 8px 0 4px; border-radius: var(--radius-xl); transition: background 120ms;
}
.topbar__user:hover { background: var(--muted); }
.topbar__avatar {
  width: 28px; height: 28px; border-radius: var(--radius-xl);
  background: var(--primary); color: var(--primary-foreground);
  display: grid; place-items: center; font-weight: var(--fw-semibold); font-size: 12px;
}
.topbar__name { font-size: 13px; font-weight: var(--fw-medium); }
.topbar__role { font-size: 11px; color: var(--muted-foreground); }

/* dropdown menu (shared: lang, user, row actions, select) */
.menu {
  position: absolute; z-index: 40; min-width: 180px;
  background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 5px; margin-top: 6px;
}
.menu__item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border-radius: var(--radius-sm); font-size: 13px;
  color: var(--foreground); text-align: left; white-space: nowrap;
}
.menu__item:hover { background: var(--accent); color: var(--accent-foreground); }
.menu__item--danger { color: var(--destructive); }
.menu__item--danger:hover { background: color-mix(in srgb, var(--destructive) 10%, transparent); color: var(--destructive); }
.menu__item--active { color: var(--primary); font-weight: var(--fw-medium); }
.menu__sep { height: 1px; background: var(--border); margin: 4px -1px; }
.menu__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); padding: 6px 9px 3px; font-weight: var(--fw-semibold); }

/* ════ Page shell ════ */
.page { padding: 22px 28px 64px; max-width: 1320px; margin: 0 auto; width: 100%; }
.page--wide { max-width: 1480px; }
.page--narrow { max-width: 880px; }
.page__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page__title { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -0.015em; }
.page__sub { color: var(--muted-foreground); font-size: 13px; margin-top: 3px; }
.page__actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ════ Buttons ════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: var(--fw-medium); white-space: nowrap;
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms;
  border: 1px solid transparent;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tint-primary-2); }
.btn--default { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn--default:hover { background: var(--brand-violet-hover); }
.btn--outline { background: var(--card); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn--outline:hover { background: var(--muted); }
.btn--ghost { color: var(--foreground); }
.btn--ghost:hover { background: var(--muted); }
.btn--destructive { background: var(--destructive); color: var(--destructive-foreground); box-shadow: var(--shadow-sm); }
.btn--destructive:hover { background: color-mix(in srgb, var(--destructive) 88%, black); }
.btn--danger-outline { background: var(--card); color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); }
.btn--danger-outline:hover { background: color-mix(in srgb, var(--destructive) 8%, transparent); }
.btn--sm { padding: 6px 10px; font-size: 12px; }
.btn--lg { padding: 10px 18px; font-size: 14px; }
.btn--icon { padding: 7px; width: 32px; height: 32px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════ Badges ════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-xl);
  font-size: 11px; font-weight: var(--fw-medium); white-space: nowrap;
  border: 1px solid transparent;
}
.badge .badge__dot { width: 6px; height: 6px; border-radius: var(--radius-xl); flex-shrink: 0; }
.badge--neutral { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
/* domain status badges (token-derived tints) */
.badge--active     { color: var(--st-active);     background: color-mix(in srgb, var(--st-active) 12%, transparent);     border-color: color-mix(in srgb, var(--st-active) 28%, transparent); }
.badge--active .badge__dot { background: var(--st-active); }
.badge--locked     { color: var(--st-locked);     background: color-mix(in srgb, var(--st-locked) 12%, transparent);     border-color: color-mix(in srgb, var(--st-locked) 30%, transparent); }
.badge--locked .badge__dot { background: var(--st-locked); }
.badge--unverified { color: color-mix(in srgb, var(--st-unverified) 70%, var(--foreground)); background: color-mix(in srgb, var(--st-unverified) 16%, transparent); border-color: color-mix(in srgb, var(--st-unverified) 32%, transparent); }
.badge--unverified .badge__dot { background: var(--st-unverified); }
.badge--mfapending { color: var(--st-mfa-pending); background: color-mix(in srgb, var(--st-mfa-pending) 14%, transparent); border-color: color-mix(in srgb, var(--st-mfa-pending) 30%, transparent); }
.badge--mfapending .badge__dot { background: var(--st-mfa-pending); }

/* principal type badge — uppercase mono micro-label */
.ptype {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: 0.05em;
  text-transform: uppercase; font-family: var(--font-mono); border: 1px solid var(--border);
}
.ptype--staff   { color: var(--primary);          background: var(--tint-primary);  border-color: color-mix(in srgb, var(--primary) 26%, transparent); }
.ptype--partner { color: var(--status-queued);    background: color-mix(in srgb, var(--status-queued) 12%, transparent);   border-color: color-mix(in srgb, var(--status-queued) 28%, transparent); }
.ptype--client  { color: var(--muted-foreground); background: var(--muted); border-color: var(--border); }

/* MFA status indicator */
.mfa { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.mfa__icon { display: inline-grid; place-items: center; }
.mfa--on  { color: var(--st-active); }
.mfa--off { color: var(--muted-foreground); }
.mfa--pending { color: var(--st-mfa-pending); }
.mfa__method { color: var(--muted-foreground); font-size: 11px; }

/* ════ Card / Panel / Section ════ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.panel__title { font-weight: var(--fw-semibold); font-size: 14px; }
.panel__desc { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.panel__body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.panel__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 30%, var(--card)); }

/* ════ Filters / search / select ════ */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar__spacer { flex: 1; }
.search { position: relative; flex: 1; max-width: 360px; min-width: 220px; }
.search__icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search__input {
  width: 100%; height: 34px; padding: 0 12px 0 32px;
  border: 1px solid var(--input); border-radius: var(--radius-md);
  background: var(--card); color: var(--foreground); font-size: 13px;
  transition: border-color 120ms, box-shadow 120ms;
}
.search__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint-primary); }
.search__input::placeholder { color: var(--muted-foreground); }

.select {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 9px 0 11px; border-radius: var(--radius-md);
  border: 1px solid var(--input); background: var(--card); color: var(--foreground);
  font-size: 13px; font-weight: var(--fw-medium); white-space: nowrap;
  transition: border-color 120ms, background 120ms;
}
.select:hover { background: var(--muted); }
.select[data-open="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint-primary); }
.select__label { color: var(--muted-foreground); font-weight: var(--fw-regular); }
.select__chev { color: var(--muted-foreground); }

/* segmented control */
.segmented { display: inline-flex; gap: 2px; background: var(--muted); padding: 3px; border-radius: var(--radius-md); }
.segmented__btn { padding: 5px 11px; border-radius: var(--radius-sm); font-size: 12px; font-weight: var(--fw-medium); color: var(--muted-foreground); transition: all 120ms; }
.segmented__btn:hover { color: var(--foreground); }
.segmented__btn--active { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }

/* active filter chips */
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: var(--radius-xl); background: var(--accent); color: var(--accent-foreground); font-size: 12px; font-weight: var(--fw-medium); }
.fchip__x { display: grid; place-items: center; width: 16px; height: 16px; border-radius: var(--radius-xl); }
.fchip__x:hover { background: color-mix(in srgb, var(--accent-foreground) 18%, transparent); }

/* ════ Table ════ */
.tablewrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  background: var(--thead-bg); color: var(--muted-foreground);
  font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: 0.04em; text-transform: uppercase;
  text-align: left; padding: 0 14px; height: 38px; white-space: nowrap;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1;
}
.table thead th.th--sortable { cursor: pointer; user-select: none; }
.table thead th.th--sortable:hover { color: var(--foreground); }
.th__sort { display: inline-flex; align-items: center; gap: 5px; }
.th__sort .lucide { opacity: 0.5; }
.th--active .th__sort .lucide { opacity: 1; color: var(--primary); }
.table tbody td { padding: 0 14px; height: var(--row-h); border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--foreground); }
.table tbody tr { transition: background 100ms; cursor: pointer; }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table--zebra tbody tr:nth-child(even) { background: var(--row-stripe); }
.table--zebra tbody tr:nth-child(even):hover { background: var(--row-hover); }
.table .td--mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }
.table .td--muted { color: var(--muted-foreground); }
.table .td--right { text-align: right; }
.table .td--actions { width: 1%; white-space: nowrap; }
.table .td--check, .table th.th--check { width: 36px; padding-left: 14px; padding-right: 0; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user__av { width: 28px; height: 28px; border-radius: var(--radius-xl); background: var(--tint-primary); color: var(--primary); display: grid; place-items: center; font-size: 11px; font-weight: var(--fw-semibold); flex-shrink: 0; }
.cell-user__main { min-width: 0; }
.cell-user__name { font-weight: var(--fw-medium); color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-user__sub { font-size: 11px; color: var(--muted-foreground); }
.row-actions { display: inline-flex; align-items: center; gap: 2px; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-md); color: var(--muted-foreground); transition: background 120ms, color 120ms; }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.icon-btn--danger:hover { background: color-mix(in srgb, var(--destructive) 10%, transparent); color: var(--destructive); }

/* checkbox */
.checkbox { appearance: none; width: 16px; height: 16px; border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); display: inline-grid; place-items: center; cursor: pointer; transition: background 120ms, border-color 120ms; vertical-align: middle; }
.checkbox:checked { background: var(--primary); border-color: var(--primary); }
.checkbox:checked::after { content: ''; width: 9px; height: 9px; background: var(--primary-foreground); -webkit-mask: var(--check-mask) center/contain no-repeat; mask: var(--check-mask) center/contain no-repeat; }
:root { --check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E"); }
.checkbox:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tint-primary); }

/* ════ Pagination ════ */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; }
.pagination__info { font-size: 12px; color: var(--muted-foreground); }
.pagination__info b { color: var(--foreground); font-weight: var(--fw-semibold); }
.pagination__controls { display: flex; align-items: center; gap: 4px; }
.pg-btn { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 12px; font-weight: var(--fw-medium); transition: background 120ms; }
.pg-btn:hover:not(:disabled) { background: var(--muted); }
.pg-btn--active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ════ Bulk action bar ════ */
.bulkbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; margin-bottom: 12px; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); border: 1px solid color-mix(in srgb, var(--accent-foreground) 18%, transparent); font-size: 13px; }
.bulkbar__count { font-weight: var(--fw-semibold); }

/* ════ Detail page ════ */
.breadcrumb-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 13px; margin-bottom: 14px; padding: 4px 0; }
.breadcrumb-back:hover { color: var(--foreground); }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.detail-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-id__av { width: 48px; height: 48px; border-radius: var(--radius-xl); background: var(--tint-primary); color: var(--primary); display: grid; place-items: center; font-size: 17px; font-weight: var(--fw-semibold); flex-shrink: 0; }
.detail-id__name { font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: 1.2; }
.detail-id__meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.detail-id__email { font-size: 12px; color: var(--muted-foreground); font-family: var(--font-mono); }
.detail-header__actions { display: flex; gap: 7px; flex-shrink: 0; }

.detail-grid { display: grid; grid-template-columns: 1fr 332px; gap: 20px; align-items: flex-start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 18px; }

/* tabs (underline style for detail) */
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabbar__tab { position: relative; padding: 10px 14px; font-size: 13px; font-weight: var(--fw-medium); color: var(--muted-foreground); transition: color 120ms; }
.tabbar__tab:hover { color: var(--foreground); }
.tabbar__tab--active { color: var(--primary); }
.tabbar__tab--active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--primary); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.tabbar__count { margin-left: 6px; font-size: 11px; color: var(--muted-foreground); background: var(--muted); border-radius: var(--radius-xl); padding: 0 6px; }

/* meta key/value list */
.meta { display: flex; flex-direction: column; }
.meta__row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.meta__row:last-child { border-bottom: none; }
.meta__k { color: var(--muted-foreground); }
.meta__v { color: var(--foreground); font-weight: var(--fw-medium); text-align: right; }

/* ════ Audit entries ════ */
.audit { display: flex; flex-direction: column; }
.audit__row { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.audit__row:last-child { border-bottom: none; }
.audit__icon { width: 28px; height: 28px; border-radius: var(--radius-md); display: grid; place-items: center; flex-shrink: 0; background: var(--muted); color: var(--muted-foreground); }
.audit__icon--danger { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }
.audit__icon--ok { background: color-mix(in srgb, var(--st-active) 12%, transparent); color: var(--st-active); }
.audit__icon--warn { background: color-mix(in srgb, var(--st-mfa-pending) 14%, transparent); color: var(--st-mfa-pending); }
.audit__body { flex: 1; min-width: 0; }
.audit__action { font-size: 13px; color: var(--foreground); font-weight: var(--fw-medium); }
.audit__detail { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; line-height: 1.45; }
.audit__detail .mono { color: var(--foreground); }
.audit__foot { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 11px; color: var(--muted-foreground); }
.audit__actor { font-weight: var(--fw-medium); color: var(--foreground); }
.audit__dot { color: var(--border); }

/* ════ Forms ════ */
.form-section { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section__head { }
.form-section__title { font-size: 14px; font-weight: var(--fw-semibold); }
.form-section__desc { font-size: 12px; color: var(--muted-foreground); margin-top: 4px; line-height: 1.5; }
.form-section__fields { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: var(--fw-medium); color: var(--foreground); display: flex; align-items: center; gap: 6px; }
.field__req { color: var(--destructive); }
.field__hint { font-size: 12px; color: var(--muted-foreground); line-height: 1.45; }
.field__error { font-size: 12px; color: var(--destructive); display: flex; align-items: center; gap: 5px; }
.input {
  display: block; width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--input); border-radius: var(--radius-md);
  font-size: 13px; background: var(--card); color: var(--foreground);
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--tint-primary); }
.input::placeholder { color: var(--muted-foreground); }
.input--error { border-color: var(--destructive); }
.input--error:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 16%, transparent); }
.input--area { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.input--mono { font-family: var(--font-mono); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* radio / choice cards */
.choice-grid { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 11px; padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: border-color 120ms, background 120ms; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.choice--active { border-color: var(--primary); background: var(--tint-primary); }
.choice__radio { width: 16px; height: 16px; border-radius: var(--radius-xl); border: 1.5px solid var(--input); flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; }
.choice--active .choice__radio { border-color: var(--primary); }
.choice--active .choice__radio::after { content: ''; width: 8px; height: 8px; border-radius: var(--radius-xl); background: var(--primary); }
/* Server-first radio choices: the design SPA tracked the active choice in JS state; the
   server-rendered create form uses real (visually-hidden) radios and drives the active look
   purely from :checked via :has() — no JS needed for selection feedback. */
.choice input[type="radio"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--tint-primary); }
.choice:has(input:checked) .choice__radio { border-color: var(--primary); }
.choice:has(input:checked) .choice__radio::after { content: ''; width: 8px; height: 8px; border-radius: var(--radius-xl); background: var(--primary); }
/* Initial-password field is only relevant when the "set a password" credential mode is chosen;
   hide it (no JS) when invite mode is selected. */
form:has(input[name="CredMode"][value="invite"]:checked) .credmode-password { display: none; }
.choice__title { font-size: 13px; font-weight: var(--fw-medium); }
.choice__desc { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }

/* toggle / switch */
.switch { position: relative; width: 36px; height: 20px; border-radius: var(--radius-xl); background: var(--input); transition: background 140ms; flex-shrink: 0; }
.switch[data-on="true"] { background: var(--primary); }
.switch__knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-sm); transition: transform 140ms; }
.switch[data-on="true"] .switch__knob { transform: translateX(16px); }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row__main { min-width: 0; }
.toggle-row__title { font-size: 13px; font-weight: var(--fw-medium); }
.toggle-row__desc { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.45; max-width: 520px; }

/* sticky save bar */
.savebar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; margin-top: 8px; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.savebar__msg { font-size: 13px; color: var(--muted-foreground); display: flex; align-items: center; gap: 8px; }
.savebar--dirty .savebar__msg { color: var(--st-mfa-pending); }

/* ════ Roles / scopes chips ════ */
.role-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-foreground); font-size: 12px; font-weight: var(--fw-medium); font-family: var(--font-mono); border: 1px solid color-mix(in srgb, var(--accent-foreground) 16%, transparent); }
.role-chip__x { display: grid; place-items: center; width: 16px; height: 16px; border-radius: var(--radius-sm); }
.role-chip__x:hover { background: color-mix(in srgb, var(--accent-foreground) 18%, transparent); }
.chip-field { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 7px; border: 1px solid var(--input); border-radius: var(--radius-md); background: var(--card); min-height: 40px; }

.scope { display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.scope:last-child { border-bottom: none; }
.scope__name { font-family: var(--font-mono); font-size: 12px; font-weight: var(--fw-medium); color: var(--foreground); background: var(--muted); padding: 1px 7px; border-radius: var(--radius-sm); white-space: nowrap; }
.scope__desc { font-size: 12px; color: var(--muted-foreground); line-height: 1.45; }

/* ════ Client secret field ════ */
.secret { display: flex; align-items: center; gap: 8px; }
.secret__value { flex: 1; font-family: var(--font-mono); font-size: 12px; padding: 8px 12px; border: 1px solid var(--input); border-radius: var(--radius-md); background: var(--muted); color: var(--foreground); letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret__value--revealed { background: var(--card); }

/* reveal-once box */
.reveal-once { border: 1px solid color-mix(in srgb, var(--st-mfa-pending) 36%, transparent); background: color-mix(in srgb, var(--st-mfa-pending) 8%, var(--card)); border-radius: var(--radius); padding: 14px 16px; }
.reveal-once__title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: var(--fw-semibold); color: color-mix(in srgb, var(--st-mfa-pending) 60%, var(--foreground)); }
.reveal-once__value { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--font-mono); font-size: 13px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.reveal-once__value code { flex: 1; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; margin-top: 10px; font-family: var(--font-mono); font-size: 13px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 16px; }
.recovery-codes div { color: var(--foreground); }
.recovery-codes div.used { color: var(--muted-foreground); text-decoration: line-through; }

/* ════ Signing key card ════ */
.keycard { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.keycard:last-child { border-bottom: none; }
.keycard__icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; flex-shrink: 0; background: var(--tint-primary); color: var(--primary); }
.keycard__main { flex: 1; min-width: 0; }
.keycard__kid { font-family: var(--font-mono); font-size: 13px; font-weight: var(--fw-medium); }
.keycard__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: var(--muted-foreground); }

/* ════ Dialog / modal ════ */
.overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 24px; animation: overlay-in 120ms ease-out; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.dialog { width: 100%; max-width: 480px; background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: dialog-in 140ms ease-out; overflow: hidden; }
.dialog--wide { max-width: 560px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog__head { display: flex; gap: 13px; padding: 20px 22px 0; }
.dialog__icon { width: 38px; height: 38px; border-radius: var(--radius-md); display: grid; place-items: center; flex-shrink: 0; }
.dialog__icon--danger { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }
.dialog__icon--warn { background: color-mix(in srgb, var(--st-mfa-pending) 14%, transparent); color: var(--st-mfa-pending); }
.dialog__icon--primary { background: var(--tint-primary); color: var(--primary); }
.dialog__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.dialog__sub { font-size: 13px; color: var(--muted-foreground); margin-top: 3px; line-height: 1.5; }
.dialog__body { padding: 16px 22px 4px; display: flex; flex-direction: column; gap: 14px; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 22px; }
.dialog__close { position: absolute; }

/* warning callout inside dialog */
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); font-size: 12px; line-height: 1.5; }
.callout--danger { background: color-mix(in srgb, var(--destructive) 8%, transparent); border: 1px solid color-mix(in srgb, var(--destructive) 26%, transparent); color: color-mix(in srgb, var(--destructive) 72%, var(--foreground)); }
.callout--warn { background: color-mix(in srgb, var(--st-mfa-pending) 10%, transparent); border: 1px solid color-mix(in srgb, var(--st-mfa-pending) 30%, transparent); color: color-mix(in srgb, var(--st-mfa-pending) 64%, var(--foreground)); }
.callout__icon { flex-shrink: 0; margin-top: 1px; }
.callout b { font-weight: var(--fw-semibold); }
.confirm-target { font-family: var(--font-mono); font-weight: var(--fw-semibold); color: var(--foreground); }

/* ════ States ════ */
.empty { display: flex; flex-direction: column; align-items: center; padding: 56px 20px; gap: 8px; text-align: center; }
.empty__icon { width: 60px; height: 60px; border-radius: var(--radius-xl); background: var(--tint-primary); color: var(--primary); display: grid; place-items: center; margin-bottom: 6px; }
.empty__title { font-size: 15px; font-weight: var(--fw-semibold); }
.empty__desc { color: var(--muted-foreground); font-size: 13px; max-width: 360px; line-height: 1.5; }
.empty__action { margin-top: 8px; }
.error-state .empty__icon { background: color-mix(in srgb, var(--destructive) 10%, transparent); color: var(--destructive); }

.skeleton { background: linear-gradient(90deg, var(--muted) 25%, color-mix(in srgb, var(--muted) 50%, var(--card)) 50%, var(--muted) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-row { height: var(--row-h); display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--border); }

.spin { animation: rotate 1s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.pulse-dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--radius-md); background: var(--foreground); color: var(--background); font-size: 13px; font-weight: var(--fw-medium); box-shadow: var(--shadow-lg); animation: toast-in 180ms ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; } }
.toast__icon { color: var(--st-active); }
/* A flash can report a failure as well as a success, and five pages expressed that
   with a conditional style attribute. One modifier, so the tone is declared here
   with every other tone. */
.toast__icon--danger { color: var(--destructive); }

/* ════ Standalone console pages (login, ping) ════
   These two render outside .app — no sidebar, no top bar — so they have no
   .page to sit in. They were built with style attributes and three class names
   that this stylesheet never defined (.btn--primary, .badge--danger-soft,
   .badge--ok), which left the console's own sign-in button transparent. The
   shapes below are the auth card's, expressed in the console's tokens. */
.standalone { display: grid; place-items: center; min-height: 100vh; padding: var(--sp-4); background: var(--background); color: var(--foreground); }
.standalone--flow { display: block; place-items: unset; min-height: 0; padding: var(--sp-8); }
.standalone__card { width: 100%; max-width: 380px; padding: var(--sp-8); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-lg); }
.standalone__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.standalone__name { font-weight: var(--fw-semibold); }
.standalone__sub { font-size: 12px; color: var(--muted-foreground); }
.standalone__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin: 0 0 16px; }
.standalone__form { display: flex; flex-direction: column; gap: 14px; }

/* helpers */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.col--tight { align-items: flex-start; line-height: 1.2; }
/* A form that exists only to carry a POST (the top bar's sign-out) must not add
   a margin to the row it sits in. */
.form-inline { margin: 0; display: inline-flex; }
.gap-s { gap: 6px; } .gap-m { gap: 12px; } .gap-l { gap: 18px; }
.muted { color: var(--muted-foreground); }
/* .meta__k is muted by default; a row whose key IS the value (a redirect URI, a
   scope name) needs the foreground instead. */
.meta__k--strong { color: var(--foreground); }
.text-xs { font-size: var(--fs-xs); }
.mt-s { margin-top: 6px; } .mt-m { margin-top: 14px; }
.mb-m { margin-bottom: 14px; }
/* A .meta list rendered as a card rather than as a panel section — the federation tab shows one per
   upstream, and without a border the rows of two providers read as one list. */
.meta--boxed { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; }
.meta--boxed:last-child { margin-bottom: 0; }
.lucide { width: 16px; height: 16px; display: inline-block; vertical-align: -2px; flex-shrink: 0; }
.flex1 { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 0; border: none; }
