/* ==========================================================================
   vizsu admin console — brand stylesheet
   Light theme only. Sharp 0–4px radii. One primary action per view.
   ========================================================================== */

:root {
  --ink: #0B1015;
  --bg: #F5F9FF;
  --surface: #FBFCFF;
  --blue: #0562EF;
  --blue-deep: #0546B3;
  --bright: #1F7BFF;
  --cyan: #31B4E6;
  --muted: #525D6D;
  --faint: #8B94A3;
  --hairline: rgba(11, 16, 21, 0.10);
  --hairline-strong: rgba(11, 16, 21, 0.18);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 4px;
  --radius-sm: 2px;
  --dur: 160ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 268px;
}

* { box-sizing: border-box; }

/* The class-level `display` rules below (.login, .shell, .auth-form, …) have
   higher specificity than the UA `[hidden] { display: none }`, which would
   otherwise make the `hidden` attribute a no-op — leaving the login and MFA
   views stacked on top of the dashboard after sign-in. Force hidden to win. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }

/* ---- brand lockup -------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; display: inline-flex; color: inherit; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.brand--lg .brand__mark { width: 44px; height: 44px; }
.brand--lg .brand__word { font-size: 1.9rem; }

/* ---- eyebrow ------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: var(--blue);
  margin: 0;
}

/* ---- buttons ------------------------------------------------------------- */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius);
  padding: 0.6rem 1.05rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--blue-deep); }

.btn--secondary { background: #fff; color: var(--ink); border-color: var(--hairline-strong); }
.btn--secondary:hover:not(:disabled) { border-color: var(--ink); }

.btn--ghost { background: transparent; color: var(--muted); border-color: var(--hairline); }
.btn--ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--hairline-strong); background: rgba(11,16,21,0.03); }

.btn--danger { color: #b3261e; }
.btn--danger:hover:not(:disabled) { border-color: #b3261e; color: #b3261e; }

.btn--block { width: 100%; }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(49,180,230,0.10), transparent 55%),
    radial-gradient(120% 120% at 0% 100%, rgba(5,98,239,0.08), transparent 50%),
    var(--bg);
}
/* subtle cyan dot-matrix accent */
.login__aura {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(49,180,230,0.22) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: radial-gradient(60% 55% at 78% 22%, #000, transparent 70%);
  pointer-events: none;
}
.login__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 2.4rem 2.2rem;
  box-shadow: 0 22px 60px -30px rgba(11,16,21,0.35);
}
.login__eyebrow { margin: 0.9rem 0 1.6rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form__title { font-size: 1.5rem; }
.auth-form__alt { font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 0; text-align: center; }
.auth-form__alt a { color: var(--accent, #0562EF); font-weight: 500; text-decoration: none; }
.auth-form__alt a:hover { text-decoration: underline; }

/* Divider ("or") between primary auth and alternative methods. */
.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.4rem 0 0.1rem;
  color: var(--faint); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.16em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--hairline);
}
/* Stack of alternative sign-in buttons (email code / Google / passkey). */
.auth-alt { display: flex; flex-direction: column; gap: 0.5rem; }

/* ==========================================================================
   FIELDS
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field__label { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.field__hint { font-size: 0.76rem; color: var(--faint); }

.input {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 0.62rem 0.75rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(5,98,239,0.14);
}
.input--code {
  font-family: var(--font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 1.15rem;
}
select.input { appearance: none; cursor: pointer; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.form-error {
  font-size: 0.83rem;
  color: #b3261e;
  background: rgba(179,38,30,0.07);
  border: 1px solid rgba(179,38,30,0.22);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin: 0;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100%;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.15rem;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
/* cyan gradient hairline accent under the header */
.sidebar__head::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent 60%);
}
.sidebar__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
}

.nav { flex: 1; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  position: relative;
}
.nav-item:hover { background: rgba(11,16,21,0.04); color: var(--ink); }
.nav-item.is-active { background: rgba(5,98,239,0.09); color: var(--blue-deep); font-weight: 600; }
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: var(--radius-sm);
  background: var(--blue);
}
.nav-item:focus-visible { outline: 2px solid var(--bright); outline-offset: 1px; }

.sidebar__foot {
  border-top: 1px solid var(--hairline);
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.user-chip { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.user-chip__name { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__meta { font-size: 0.76rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   CONTENT
   ========================================================================== */
.content {
  padding: 2.4rem clamp(1.5rem, 3vw, 3rem);
  overflow-y: auto;
  height: 100vh;
}
.section { max-width: 940px; margin: 0 auto; }
.route-loading { color: var(--faint); font-family: var(--font-mono); font-size: 0.85rem; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.section-head__text .eyebrow { margin-bottom: 0.55rem; }
.section-title { font-size: clamp(1.7rem, 1rem + 2vw, 2.4rem); letter-spacing: -0.02em; }
.section-desc { color: var(--muted); font-size: 0.92rem; margin: 0.4rem 0 0; max-width: 52ch; }

/* ---- summary strip / stats ---------------------------------------------- */
.summary-strip {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat__value { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1; }
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}

/* ---- table --------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--hairline);
  background: rgba(11,16,21,0.015);
}
.data-table tbody td { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(5,98,239,0.03); }
.cell-strong { font-weight: 600; }
.cell-muted { color: var(--faint); }

/* ---- badges & chips ------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.17rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-transform: lowercase;
  white-space: nowrap;
}
.badge--accent { background: rgba(5,70,179,0.10); color: var(--blue-deep); border-color: rgba(5,70,179,0.20); }
.badge--blue { background: rgba(5,98,239,0.10); color: var(--blue); border-color: rgba(5,98,239,0.20); }
.badge--neutral { background: rgba(11,16,21,0.05); color: var(--muted); border-color: var(--hairline); }
.badge--faint { background: rgba(139,148,163,0.12); color: var(--faint); border-color: var(--hairline); }
.badge--ok { background: rgba(31,123,255,0.10); color: var(--bright); border-color: rgba(31,123,255,0.22); }
.badge--warn { background: rgba(179,38,30,0.08); color: #b3261e; border-color: rgba(179,38,30,0.20); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.65rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(5,98,239,0.07);
  color: var(--blue-deep);
  border: 1px solid rgba(5,98,239,0.16);
}
.chip--empty { background: rgba(11,16,21,0.04); color: var(--faint); border-color: var(--hairline); }

/* ---- card list ----------------------------------------------------------- */
.card-list { display: flex; flex-direction: column; gap: 0.9rem; }
.card-list__loading { color: var(--faint); font-family: var(--font-mono); font-size: 0.8rem; padding: 0.5rem 0; }
.card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--hairline-strong); box-shadow: 0 10px 30px -22px rgba(11,16,21,0.4); }
.card[data-revoked="true"] { opacity: 0.62; }
.card__main { min-width: 0; }
.card__title-row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.card__title { font-size: 1.05rem; }
.proto-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
}
.card__meta { display: flex; flex-wrap: wrap; gap: 1.4rem; margin: 0.85rem 0 0; }
.meta-pair dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin: 0 0 0.15rem;
}
.meta-pair dd { margin: 0; font-size: 0.86rem; font-weight: 500; }
.card__actions { flex-shrink: 0; }
.card__list { margin: 0.7rem 0 0; padding-left: 1.1rem; font-size: 0.82rem; color: var(--muted, inherit); }

/* ---- panel forms --------------------------------------------------------- */
.form-slot, .reveal-slot { margin-bottom: 1.5rem; }
.panel-form {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.panel-form__title { font-size: 1.2rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.field-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; padding-top: 0.2rem; border-top: 1px dashed var(--hairline); }
.form-note {
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(49,180,230,0.08);
  border-left: 2px solid var(--cyan);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.6rem 0.85rem;
  margin: 0;
}
.form-actions { display: flex; gap: 0.7rem; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; }
.check {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.86rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-mono);
}
.check:hover { border-color: var(--hairline-strong); }
.check input { accent-color: var(--blue); width: 15px; height: 15px; }

/* ---- one-time key reveal ------------------------------------------------- */
.reveal {
  position: relative;
  background: linear-gradient(135deg, var(--ink), #10202f);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: 0 18px 44px -24px rgba(5,98,239,0.6);
}
.reveal .eyebrow { color: var(--cyan); }
.reveal__title { color: #fff; font-size: 1.15rem; margin: 0.5rem 0 0.3rem; }
.reveal__warn { color: #ffd7d2; font-size: 0.85rem; margin: 0 0 1rem; }
.reveal__row { display: flex; gap: 0.6rem; align-items: stretch; flex-wrap: wrap; }
.reveal__key {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  word-break: break-all;
  color: #eaf2ff;
}
.reveal__copy { flex-shrink: 0; }
.reveal__dismiss {
  position: absolute;
  top: 0.8rem; right: 0.9rem;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.reveal__dismiss:hover { color: #fff; }

/* ---- settings ------------------------------------------------------------ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.panel {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel--danger { border-color: rgba(179,38,30,0.25); }
.panel__title { font-size: 1.05rem; margin-bottom: 1rem; }
.detail-list { display: flex; flex-direction: column; gap: 0.9rem; margin: 0; }
.membership-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.membership { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.membership__org { font-weight: 500; }

.status-widget { display: flex; flex-direction: column; gap: 0.65rem; }
.status-line { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.status-line__name { flex: 1; text-transform: capitalize; }
.status-line__val { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot--ok { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31,157,85,0.16); }
.dot--down { background: #b3261e; box-shadow: 0 0 0 3px rgba(179,38,30,0.16); }

/* ---- misc states --------------------------------------------------------- */
.empty {
  color: var(--faint);
  font-size: 0.9rem;
  text-align: center;
  padding: 2.2rem 1rem;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
}
.banner { border-radius: var(--radius); padding: 0.85rem 1rem; font-size: 0.88rem; }
.banner--error { background: rgba(179,38,30,0.07); border: 1px solid rgba(179,38,30,0.22); color: #b3261e; }
.banner--muted { background: rgba(11,16,21,0.03); border: 1px solid var(--hairline); color: var(--muted); }

/* ==========================================================================
   PLATFORM (super-admin, cross-tenant)
   ========================================================================== */

/* sidebar section divider */
.nav__section { margin: 0.9rem 0 0.15rem; padding: 0 0.7rem; }
.nav__section-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
}
.nav__section-label::before { content: '〉 '; color: var(--cyan); }

/* ---- metric grid (overview) --------------------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.25rem;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.metric::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
}
.metric:hover { border-color: var(--hairline-strong); box-shadow: 0 12px 34px -26px rgba(11,16,21,0.5); }
.metric__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}
.metric__value { font-family: var(--font-display); font-weight: 600; font-size: 2.1rem; line-height: 1; letter-spacing: -0.02em; }
.metric__hint { font-size: 0.76rem; color: var(--muted); }

/* ---- overview lower zone ------------------------------------------------- */
.overview-lower { display: flex; flex-direction: column; gap: 1.6rem; }
.overview-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.panel--flush { padding-bottom: 0.4rem; }
.panel--flush .table-wrap { margin-top: 0.3rem; }

.overview-pair { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.overview-pair dt { color: var(--muted); font-size: 0.88rem; }
.overview-pair dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }

/* ---- horizontal bar list (event-type breakdown) ------------------------- */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 9rem) 1fr auto; align-items: center; gap: 0.7rem; }
.bar-row__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row__track { height: 7px; background: rgba(11,16,21,0.06); border-radius: 999px; overflow: hidden; }
.bar-row__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bar-row__count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink); min-width: 1.6rem; text-align: right; }

/* ---- toolbar (search inputs in section header) -------------------------- */
.toolbar { display: flex; gap: 0.6rem; align-items: center; }
.toolbar__search { min-width: 260px; }

/* ---- table extras -------------------------------------------------------- */
.table-footer { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); margin: 0.7rem 0.2rem 0; }
.stack { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cell-sub { font-size: 0.72rem; color: var(--faint); }
.cell-sub.ok { color: #1f9d55; }
.cell-sub.warn { color: #b3261e; }
.mono-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 8.5rem;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.data-table tbody tr[data-inactive="true"] { opacity: 0.55; }

/* ---- org tags (user row) ------------------------------------------------- */
.org-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.org-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(5,98,239,0.07);
  color: var(--blue-deep);
  border: 1px solid rgba(5,98,239,0.16);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- clickable table rows (user detail overlay) -------------------------- */
.row-clickable { cursor: pointer; }
.row-clickable:focus-visible { outline: 2px solid var(--bright); outline-offset: -2px; }

/* ---- overlay panel (user detail drawer) ----------------------------------- */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 21, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 100;
}
.overlay-panel {
  width: min(560px, 100%);
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  padding: 2rem clamp(1.25rem, 3vw, 2.4rem);
  box-shadow: -22px 0 60px -30px rgba(11, 16, 21, 0.5);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .sidebar__head { border-bottom: none; padding-bottom: 0; }
  .sidebar__head::after { display: none; }
  .nav { flex-basis: 100%; order: 3; }
  .nav__list { flex-direction: row; flex-wrap: wrap; }
  .sidebar__foot { border-top: none; padding-top: 0; flex-direction: row; align-items: center; margin-left: auto; }
  .content { height: auto; }
  .card { flex-direction: column; }
  .card__actions { align-self: flex-start; }
  .toolbar, .toolbar__search { width: 100%; min-width: 0; }
  .nav__section { flex-basis: 100%; }
}

/* ==========================================================================
   LOADERS — page preloader, button busy states, full-page overlay.
   Driven by /admin/loaders.js (shared by every hosted page).
   ========================================================================== */
.sso-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sso-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sso-spin 0.7s linear infinite;
  flex: none;
}
.sso-spinner--lg { width: 32px; height: 32px; border-width: 3px; color: var(--blue); }
@keyframes sso-spin { to { transform: rotate(360deg); } }

/* Initial page preloader: static markup, covers the page until its scripts
   ran. The delayed failsafe animation hides it even if JS never dismisses it. */
.sso-preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
  animation: sso-failsafe 0s linear 8s forwards;
}
.sso-preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes sso-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* Button busy state: spinner before the label; acts disabled. */
.btn.is-busy { cursor: progress; opacity: 0.8; }
.btn.is-busy::before {
  content: '';
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sso-spin 0.7s linear infinite;
  flex: none;
}

/* Full-page "Signing in…" overlay before handing off to the server. */
.sso-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(245, 249, 255, 0.92);
  backdrop-filter: blur(2px);
}
.sso-overlay__text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}

.route-loading { display: flex; align-items: center; gap: 0.6rem; }
.route-loading::before {
  content: '';
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sso-spin 0.7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sso-spinner,
  .btn.is-busy::before,
  .route-loading::before {
    animation: sso-pulse 1.6s ease-in-out infinite;
    border-right-color: currentColor;
    opacity: 0.6;
  }
  .sso-preloader { transition: none; }
}
@keyframes sso-pulse { 50% { opacity: 0.25; } }
