:root {
  --ink: #f7f7f4;
  --ink-dim: #b7b7ad;
  --ink-muted: #7d7d76;
  --void: #030304;
  --void-2: #070708;
  --plane: #0d0d0f;
  --plane-2: #131316;
  --line: #242428;
  --line-soft: #17171a;
  --field: #050506;
  --signal: #7cffaa;
  --signal-soft: #0d2016;
  --warning: #ffb2a6;
  --accent: #f7f7f4;
  color: var(--ink);
  background: var(--void);
  font-family:
    "Avenir Next", "SF Pro Text", "SF Pro Display", "Helvetica Neue", ui-sans-serif,
    sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 64px
      64px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 64px
      64px,
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.05), transparent 420px),
    var(--void);
}

body::selection {
  background: #e9e9dd;
  color: #050506;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
  padding: 0;
}

.boot-screen,
.auth-screen {
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: 32px 20px;
}

.loading-panel {
  display: grid;
  width: min(420px, 100%);
  gap: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 150px),
    rgba(8, 8, 10, 0.78);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
  padding: 28px;
}

.loading-wordmark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.loading-wordmark .brand-mark {
  width: 42px;
  height: 42px;
}

.loading-wordmark .brand-logo {
  width: 42px;
  height: 42px;
}

.loading-wordmark strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 520;
}

.loading-copy {
  display: grid;
  gap: 8px;
}

.loading-copy p {
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 360;
}

.loading-track {
  position: relative;
  overflow: hidden;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loading-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--ink);
  animation: loading-sweep 1.25s ease-in-out infinite;
}

@keyframes loading-sweep {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(260%);
  }
}

.brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.brand.text-only {
  grid-template-columns: minmax(0, 1fr);
}

.brand.compact,
.auth-card {
  width: min(430px, 100%);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #39393f;
  border-radius: 7px;
  background: #f4f4ee;
  color: #030304;
  font-size: 11px;
  font-weight: 560;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  object-fit: contain;
  padding: 0;
}

.brand strong,
h1 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 520;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

small {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 360;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.studio-shell {
  position: relative;
}

.shell-rail,
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 38px;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 160px),
    rgba(4, 4, 5, 0.94);
  padding: 22px;
}

.shell-rail::after {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 1px;
  height: 28vh;
  background: linear-gradient(180deg, transparent, rgba(247, 247, 244, 0.32));
  content: "";
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  position: relative;
  border: 0;
  border-radius: 7px;
  color: var(--ink-dim);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 390;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.nav a.active,
.nav a:hover,
.nav a:focus-visible {
  background: rgba(255, 255, 255, 0.026);
  color: var(--ink);
  outline: none;
}

.nav a.active::before {
  position: absolute;
  top: 50%;
  left: -22px;
  width: 1px;
  height: 22px;
  background: var(--ink);
  content: "";
  transform: translateY(-50%);
}

.profile-menu {
  position: relative;
  margin-top: auto;
}

.profile-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  padding: 10px;
}

.profile-summary::-webkit-details-marker {
  display: none;
}

.profile-summary:hover,
.profile-summary:focus-visible {
  border-color: var(--line);
  outline: none;
}

.profile-summary > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--plane-2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 560;
}

.profile-summary strong,
.profile-detail strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
}

.profile-summary small,
.profile-detail span {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 360;
}

.profile-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 110px),
    var(--plane);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  padding: 14px;
}

.profile-detail {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-detail strong {
  overflow-wrap: anywhere;
}

.profile-signout {
  min-height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
}

.profile-signout:hover,
.profile-signout:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.content {
  display: grid;
  min-width: 0;
}

.panel-heading,
.section-heading,
.page-heading {
  display: grid;
  gap: 6px;
}

.eyebrow {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace,
.command-surface {
  position: relative;
  display: grid;
  align-content: start;
  gap: 30px;
  width: min(1180px, calc(100vw - 232px));
  padding: 68px 42px 80px;
}

.command-surface::before {
  position: absolute;
  top: 68px;
  left: 42px;
  width: 46px;
  height: 1px;
  background: var(--ink);
  opacity: 0.5;
  content: "";
}

.hairline {
  height: 1px;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.hero,
.dashboard-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 34px;
  align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 36px;
}

h2 {
  max-width: 780px;
  color: var(--ink);
  font-size: 38px;
  font-weight: 440;
  line-height: 1.08;
}

.compact-heading h2 {
  font-size: 34px;
}

h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 430;
  line-height: 1.12;
}

p {
  max-width: 650px;
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 360;
  line-height: 1.7;
}

.auth-card,
.panel,
.overview-card,
.metric,
.form-panel,
.settings-section,
.step-rail,
.onboarding-main,
.lesson-panel,
.welcome-panel,
.review-grid,
.brand-preview,
.settings-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 120px),
    rgba(13, 13, 15, 0.96);
}

.auth-card,
.panel,
.overview-card,
.form-panel,
.settings-section,
.step-rail,
.onboarding-main {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.auth-card {
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.4);
}

.auth-card h2 {
  font-size: 38px;
  font-weight: 390;
}

.readiness-card {
  align-content: space-between;
  min-height: 270px;
}

.control-overview {
  align-content: space-between;
  min-height: 220px;
}

.control-overview p {
  color: var(--ink-muted);
  font-size: 14px;
}

.dashboard-events {
  margin-top: 22px;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  padding: 14px 16px;
}

.event-row div {
  display: grid;
  gap: 5px;
}

.event-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 520;
}

.event-row small {
  color: var(--ink-muted);
}

.event-row > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 560;
}

.analytics-hero {
  align-items: end;
}

.analytics-status-card {
  min-height: 170px;
  align-content: space-between;
}

.analytics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-grid .metric {
  min-height: 118px;
}

.analytics-grid .metric strong {
  font-size: 30px;
}

.retention-panel,
.analytics-columns {
  margin-top: 18px;
}

.retention-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.retention-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 16px;
}

.retention-card span {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  text-transform: uppercase;
}

.retention-card strong {
  color: var(--ink);
  font-size: 28px;
  font-weight: 390;
}

.retention-track,
.method-bar {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.retention-track span,
.method-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--signal);
}

.analytics-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.method-list,
.analytics-event-list {
  display: grid;
  gap: 10px;
}

.method-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  padding: 14px 16px;
}

.method-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 520;
}

.method-row small {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 560;
}

.analytics-event-row > span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 8px;
  text-transform: capitalize;
}

.muted-copy {
  max-width: none;
  margin: 0;
  color: var(--ink-muted);
}

.setup-list {
  display: grid;
  gap: 11px;
  list-style: none;
}

.setup-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 380;
}

.setup-list li::before {
  width: 7px;
  height: 7px;
  border: 1px solid #53535a;
  border-radius: 999px;
  content: "";
}

.setup-list li.complete {
  color: var(--ink);
}

.setup-list li.complete::before {
  border-color: var(--signal);
  background: var(--signal);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 520;
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: #030304;
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #ffffff;
  outline: none;
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: #606068;
  outline: none;
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.metric-grid,
.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  display: grid;
  min-height: 128px;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
}

.metric span,
.summary span {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  text-transform: uppercase;
}

.metric strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 390;
  line-height: 0.95;
}

.route-stack {
  display: grid;
  max-width: 880px;
  gap: 28px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
}

.field input,
.field textarea,
.field select {
  min-height: 45px;
  width: 100%;
  border: 1px solid #29292f;
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
}

.field textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #66666d;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #8a8a92;
  outline: none;
}

.field select {
  appearance: none;
}

.color-field {
  display: grid;
  gap: 10px;
}

.color-preset-box {
  width: fit-content;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
  padding: 10px;
}

.color-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-preset-swatch {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--preset-color);
  box-shadow: inset 0 0 0 2px rgba(6, 6, 7, 0.72);
  cursor: pointer;
  padding: 0;
}

.color-preset-swatch:hover,
.color-preset-swatch:focus-visible,
.color-preset-swatch.active {
  border-color: rgba(245, 245, 247, 0.82);
  outline: none;
  transform: translateY(-1px);
}

.logo-upload-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 84px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--field);
  cursor: pointer;
  padding: 12px;
}

.logo-upload-card:hover,
.logo-upload-card:focus-within {
  border-color: var(--line);
}

.logo-upload-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.logo-upload-preview {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f4f4ee;
  color: #030304;
  font-size: 12px;
  font-weight: 560;
}

.logo-upload-preview img,
.brand-preview-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.logo-upload-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.logo-upload-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-error,
.form-message,
.dev-otp {
  max-width: none;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.form-error {
  color: var(--warning);
}

.form-message {
  color: var(--ink-dim);
}

.dev-otp {
  border: 1px solid #214631;
  border-radius: 7px;
  background: var(--signal-soft);
  color: #cff7da;
  padding: 10px 12px;
}

.summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  padding: 16px;
}

.summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 430;
}

.placeholder-view {
  display: grid;
  gap: 20px;
  max-width: 720px;
}

.settings-route,
.settings-matrix,
.templates-route,
.users-route,
.admins-route {
  display: grid;
  max-width: 1120px;
  gap: 22px;
}

.users-workspace {
  display: grid;
}

.users-table-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent 130px),
    rgba(10, 10, 12, 0.86);
  padding: 18px;
}

.admins-table-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent 130px),
    rgba(10, 10, 12, 0.86);
  padding: 18px;
}

.admin-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
  align-items: end;
}

.users-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.users-table,
.admins-table {
  display: grid;
  overflow-x: auto;
}

.users-table-head,
.user-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) 90px 104px 132px 132px 126px 54px;
  align-items: center;
  min-width: 940px;
}

.admins-table-head,
.admin-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px 130px;
  align-items: center;
  min-width: 540px;
}

.users-table-head {
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  padding: 0 10px 10px;
  text-transform: uppercase;
}

.admins-table-head {
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  padding: 0 10px 10px;
  text-transform: uppercase;
}

.user-list {
  display: contents;
}

.user-row,
.admin-row {
  gap: 8px;
  min-height: 76px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
}

.user-row:hover,
.user-row:focus-within,
.admin-row:hover,
.admin-row:focus-within {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
}

.user-identity-cell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-row-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip,
.status-chip {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 560;
  padding: 4px 8px;
}

.role-chip {
  color: var(--ink);
}

.status-chip.active {
  border-color: rgba(124, 255, 170, 0.28);
  color: var(--signal);
}

.status-chip.inactive {
  border-color: rgba(255, 178, 166, 0.28);
  color: var(--warning);
}

.status-chip.blocked {
  border-color: rgba(255, 111, 111, 0.3);
  color: #ff9b9b;
}

.user-data-cell {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-action-cell {
  display: flex;
  justify-content: flex-end;
}

.icon-action {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}

.icon-action:hover,
.icon-action:focus-visible {
  border-color: #606068;
  background: rgba(255, 255, 255, 0.046);
  outline: none;
}

.icon-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  padding: 24px;
}

.user-edit-dialog {
  display: grid;
  width: min(940px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  gap: 18px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 180px),
    #101012;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.54);
  padding: 22px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dialog-title-group h3 {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 24px;
  font-weight: 430;
}

.dialog-title-group p {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.dialog-close {
  min-width: auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.role-select-field {
  height: 45px;
}

.user-editor {
  display: grid;
  gap: 18px;
}

.user-activity-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.user-activity-grid div {
  display: grid;
  min-height: 86px;
  align-content: space-between;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  padding: 14px;
}

.user-activity-grid span {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  text-transform: uppercase;
}

.user-activity-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 420;
  line-height: 1.35;
}

.user-flags {
  display: grid;
  gap: 8px;
  align-content: end;
}

.toggle-row.compact {
  min-height: 45px;
}

.full-span {
  grid-column: 1 / -1;
}

.user-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.dialog-action-spacer {
  flex: 1 1 auto;
}

.danger-action {
  color: #ffb4b4;
}

.admin-invite-shell .auth-card {
  width: min(520px, 100%);
}

.settings-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
  align-items: end;
}

.settings-state {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.settings-state strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 430;
}

.settings-state small {
  overflow-wrap: anywhere;
}

.settings-section {
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  border-color: var(--line-soft);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028), transparent 42%),
    rgba(10, 10, 12, 0.84);
}

.settings-section .section-heading {
  position: sticky;
  top: 90px;
}

.settings-section > :not(.section-heading) {
  grid-column: 2;
}

.settings-section h3 {
  font-size: 25px;
  font-weight: 390;
}

.section-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding-top: 2px;
}

.settings-section > .section-actions {
  grid-column: 2;
}

.section-save {
  min-width: 118px;
}

.template-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-tabs span {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(10, 10, 12, 0.82);
  padding: 14px;
}

.template-tabs strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 430;
}

.template-gallery {
  display: grid;
  gap: 16px;
}

.template-card {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(320px, 1.02fr);
  gap: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028), transparent 46%),
    rgba(10, 10, 12, 0.84);
  padding: 22px;
}

.template-editor {
  display: grid;
  align-content: start;
  gap: 18px;
}

.template-card-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.template-preview {
  --email-surface: #f3f3ef;
  --email-card: #ffffff;
  --email-card-alt: #fbfbf8;
  --email-line: #deded6;
  --email-ink: #101013;
  --email-muted: #626269;
  display: grid;
  min-height: 100%;
  align-content: center;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.72), transparent 210px),
    var(--email-surface);
  color: var(--email-ink);
  padding: 24px;
  text-align: center;
}

.template-subject {
  width: min(100%, 390px);
  color: var(--email-muted);
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
}

.template-mail {
  display: grid;
  width: min(100%, 390px);
  justify-items: center;
  gap: 15px;
  border: 1px solid var(--email-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, var(--email-card), var(--email-card-alt)),
    var(--email-card);
  padding: 30px 26px 24px;
  box-shadow: 0 22px 55px rgba(16, 16, 19, 0.1);
}

.template-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--template-color, #101013) 45%, #101013);
  color: #ffffff;
  font-size: 11px;
  font-weight: 560;
}

.template-logo-frame {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  background: #17171a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(16, 16, 19, 0.12);
}

.template-logo-image {
  width: 30px;
  max-height: 30px;
  object-fit: contain;
}

.template-mail h4 {
  margin: 0;
  color: var(--email-ink);
  font-size: 24px;
  font-weight: 460;
  line-height: 1.08;
}

.template-mail .email-body-copy {
  max-width: none;
  margin: 0;
  color: var(--email-muted);
  font-size: 13px;
  line-height: 1.6;
}

.template-mail strong {
  display: inline-flex;
  width: fit-content;
  min-height: 38px;
  align-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--template-color, #101013) 78%, #101013);
  color: #ffffff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 560;
}

.email-preview-footer {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 10px;
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--email-line) 68%, #ffffff);
  padding-top: 16px;
}

.email-safe-note {
  max-width: 310px;
  margin: 0;
  color: var(--email-muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.email-contact-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  color: #8b8b91;
  font-size: 11px;
}

.email-contact-row a {
  color: color-mix(in srgb, var(--template-color, #101013) 70%, #101013);
  font-weight: 620;
}

.guidance {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  padding: 14px;
}

.guidance div {
  display: grid;
  gap: 6px;
}

.guidance span {
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 620;
  text-transform: uppercase;
}

.guidance code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "SF Mono", "Aptos Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 420;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toggle-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 390;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-control {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid #3b3b41;
  border-radius: 999px;
  background: #1b1b1f;
}

.toggle-control::after {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #8b8b92;
  content: "";
  transform: translateY(-50%);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.toggle-row input:checked + .toggle-control {
  border-color: #326a46;
  background: #102b1a;
}

.toggle-row input:checked + .toggle-control::after {
  background: var(--signal);
  transform: translate(18px, -50%);
}

.toggle-row:has(input:focus-visible) {
  border-color: #8a8a92;
}

.sticky-actions {
  padding-bottom: 16px;
}

.onboarding-layout,
.onboarding-command {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  width: min(1080px, 100%);
}

.step-rail {
  align-content: start;
  gap: 24px;
}

.step-rail h2 {
  font-size: 31px;
  font-weight: 390;
  line-height: 1.06;
}

.step-rail ol {
  display: grid;
  gap: 8px;
  list-style: none;
}

.step-rail li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-muted);
  padding: 8px;
  font-size: 13px;
}

.step-rail li span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 12px;
}

.step-rail li strong {
  font-weight: 390;
}

.step-rail li.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.step-rail li.complete span {
  border-color: #326a46;
  background: var(--signal-soft);
  color: #cff7da;
}

.onboarding-main {
  min-height: 620px;
  align-content: start;
}

.lesson-panel {
  display: grid;
  padding: 16px;
  background: rgba(5, 5, 6, 0.78);
}

.lesson-panel ul {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 18px;
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 360;
  line-height: 1.55;
}

.welcome-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}

.welcome-panel > div,
.review-grid > div {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  padding: 16px;
}

.welcome-panel strong,
.review-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 430;
  line-height: 1.45;
}

.welcome-panel p {
  max-width: none;
  font-size: 13px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  background: transparent;
}

.review-grid > div:last-child {
  grid-column: 1 / -1;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  border-color: var(--line-soft);
  background: var(--field);
  padding: 16px;
}

.brand-preview-mark,
.account-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--preview-color, #f7f7f4) 12%, #050506);
  color: var(--preview-color, #f7f7f4);
  font-size: 12px;
  font-weight: 560;
}

.brand-preview strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 430;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  --preview-color: #f7f7f4;
}

.hosted-auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.hosted-auth-main {
  display: grid;
  width: min(480px, 100%);
  gap: 18px;
}

.hosted-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 520;
}

.hosted-auth-brand .brand-mark,
.hosted-auth-brand .brand-logo {
  width: 38px;
  height: 38px;
}

.hosted-auth-card {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), transparent 140px),
    rgba(13, 13, 15, 0.96);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.4);
  padding: 26px;
}

.hosted-auth-card h2 {
  font-size: 42px;
  font-weight: 390;
}

.hosted-auth-note {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--field);
  padding: 14px;
}

.hosted-auth-note strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 430;
}

.hosted-auth-note p {
  margin: 0;
  font-size: 13px;
}

.hosted-auth-note.danger {
  border-color: rgba(255, 126, 112, 0.34);
  background: rgba(91, 32, 28, 0.18);
}

.hosted-auth-note.danger strong {
  color: #ffb0a6;
}

.hosted-auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 390;
}

.hosted-auth-links a,
.hosted-auth-links button,
.text-action {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  font-size: 12.5px;
  font-weight: 390;
}

.hosted-auth-links a:hover,
.hosted-auth-links a:focus-visible,
.hosted-auth-links button:hover,
.hosted-auth-links button:focus-visible,
.text-action:hover,
.text-action:focus-visible {
  color: var(--ink);
  outline: none;
}

.completion-panel {
  max-width: 620px;
}

@media (max-width: 1120px) {
  .onboarding-layout,
  .onboarding-command {
    grid-template-columns: 1fr;
  }

  .step-rail ol {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step-rail li {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .shell-rail,
  .sidebar {
    position: static;
    height: auto;
    gap: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .shell-rail::after {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav a {
    text-align: center;
  }

  .nav a.active::before {
    display: none;
  }

  .workspace,
  .command-surface {
    width: 100%;
  }

  .hero,
  .dashboard-command,
  .settings-intro,
  .users-workspace,
  .user-activity-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace,
  .command-surface {
    gap: 22px;
    padding: 38px 20px 54px;
  }

  .command-surface::before {
    top: 38px;
    left: 20px;
  }

  h2,
  .compact-heading h2 {
    font-size: 36px;
  }

  .metric-grid,
  .signal-grid,
  .nav,
  .users-search,
  .form-grid.two-columns,
  .user-activity-grid,
  .toggle-grid,
  .welcome-panel,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .settings-section {
    grid-template-columns: 1fr;
  }

  .settings-section > :not(.section-heading),
  .settings-section > .section-actions {
    grid-column: 1;
  }

  .template-card {
    grid-template-columns: 1fr;
  }

  .template-tabs {
    grid-template-columns: 1fr;
  }

  .settings-section .section-heading {
    position: static;
  }

  .step-rail ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-grid > div,
  .review-grid > div:last-child {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .form-actions {
    display: grid;
  }

  .user-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .status-chip {
    grid-column: 2;
    width: fit-content;
  }

  .user-editor-actions {
    display: grid;
  }

  .step-rail ol {
    grid-template-columns: 1fr;
  }
}

/* Dark workspace refresh inspired by compact SaaS control surfaces. */
body {
  background:
    radial-gradient(circle at 54% -12%, rgba(255, 255, 255, 0.07), transparent 430px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 280px),
    #050506;
}

.studio-shell {
  grid-template-columns: 244px minmax(0, 1fr);
  background: #070708;
}

.workspace-topbar svg,
.toolbar-search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  z-index: 11;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 168px),
    rgba(9, 9, 10, 0.96);
  padding: 20px 18px;
}

.workspace-sidebar::after {
  display: none;
}

.workspace-sidebar .brand {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  min-height: 42px;
}

.workspace-sidebar .brand.text-only {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-sidebar .brand-logo,
.workspace-sidebar .brand-mark {
  width: 40px;
  height: 40px;
}

.workspace-sidebar .brand strong,
.workspace-sidebar h1 {
  font-size: 17px;
  font-weight: 560;
  letter-spacing: 0;
}

.workspace-sidebar .nav {
  gap: 6px;
}

.workspace-sidebar .nav a {
  display: flex;
  min-height: 38px;
  align-items: center;
  border-radius: 8px;
  color: var(--ink-muted);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 410;
}

.workspace-sidebar .nav a:hover,
.workspace-sidebar .nav a:focus-visible {
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-dim);
}

.workspace-sidebar .nav a.active {
  background: rgba(255, 255, 255, 0.065);
  color: var(--ink);
}

.workspace-sidebar .nav a.active::before {
  left: -18px;
  height: 18px;
  opacity: 0.82;
}

.workspace-sidebar .profile-summary {
  min-height: 54px;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.workspace-sidebar .profile-dropdown {
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 118px),
    #111113;
}

.content {
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px) 0 58px /
      72px 72px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 58px /
      72px 72px,
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.045), transparent 360px);
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 7, 8, 0.88);
  backdrop-filter: blur(14px);
  padding: 0 28px;
}

.workspace-topbar > div:first-child {
  display: grid;
  gap: 2px;
}

.workspace-topbar strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 530;
}

.workspace-topbar small {
  color: var(--ink-muted);
  font-size: 11px;
}

.toolbar-search {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-muted);
  padding: 8px 10px;
}

.toolbar-search span {
  display: grid;
  place-items: center;
}

.toolbar-search strong {
  overflow: hidden;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 430;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace,
.studio-main {
  width: min(1240px, calc(100vw - 244px));
  gap: 24px;
  padding: 34px 42px 72px;
}

.studio-main::before {
  display: none;
}

.hero,
.dashboard-command {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: end;
  padding-bottom: 24px;
}

.page-heading,
.panel-heading,
.section-heading {
  gap: 7px;
}

.eyebrow {
  color: #8d8d86;
  font-size: 10px;
  font-weight: 650;
}

h2,
.compact-heading h2 {
  max-width: 760px;
  font-size: 35px;
  font-weight: 470;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  font-weight: 470;
}

p {
  margin-top: 8px;
  color: #9b9b94;
  font-size: 14px;
  font-weight: 360;
  line-height: 1.55;
}

.auth-card,
.panel,
.overview-card,
.metric,
.form-panel,
.settings-section,
.step-rail,
.onboarding-main,
.lesson-panel,
.welcome-panel > div,
.review-grid > div,
.brand-preview,
.settings-state,
.users-table-panel,
.admins-table-panel,
.template-card,
.template-tabs span,
.retention-card,
.method-row,
.event-row,
.user-activity-grid div,
.summary,
.guidance {
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 130px),
    rgba(12, 12, 14, 0.82);
  box-shadow: none;
}

.auth-card,
.panel,
.overview-card,
.form-panel,
.settings-section,
.step-rail,
.onboarding-main,
.users-table-panel,
.admins-table-panel,
.template-card {
  gap: 18px;
  padding: 20px;
}

.control-overview,
.analytics-status-card,
.settings-state {
  min-height: 0;
  align-content: space-between;
}

.metric-grid,
.signal-grid {
  gap: 12px;
}

.metric {
  min-height: 104px;
  padding: 16px;
}

.metric strong {
  font-size: 28px;
  font-weight: 420;
}

.metric span,
.summary span,
.retention-card span,
.user-activity-grid span,
.guidance span,
.users-table-head,
.admins-table-head {
  color: #8b8b84;
  font-size: 10px;
  font-weight: 650;
}

.field {
  gap: 7px;
  font-size: 12.5px;
  font-weight: 470;
}

.field input,
.field textarea,
.field select {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(2, 2, 3, 0.86);
  padding: 0 12px;
}

.field textarea {
  padding: 11px 12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}

.primary-action,
.secondary-action,
.profile-signout {
  min-height: 38px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 560;
}

.secondary-action,
.icon-action,
.profile-signout {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.primary-action {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.42) inset;
}

.settings-intro {
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: end;
}

.settings-section {
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 36%),
    rgba(12, 12, 14, 0.82);
}

.settings-section h3 {
  font-size: 24px;
  font-weight: 420;
}

.users-table-head,
.admins-table-head {
  border-color: rgba(255, 255, 255, 0.08);
}

.user-row,
.admin-row {
  border-radius: 10px;
}

.user-row:hover,
.user-row:focus-within,
.admin-row:hover,
.admin-row:focus-within {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.role-chip,
.status-chip {
  border-color: rgba(255, 255, 255, 0.1);
  font-weight: 560;
}

.dialog-backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.user-edit-dialog {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 190px),
    #101011;
}

.template-preview {
  border-radius: 12px;
}

.template-mail {
  border-radius: 12px;
}

.toggle-row {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(2, 2, 3, 0.86);
  font-weight: 400;
}

.auth-studio-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(420px, 1.08fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -8%, rgba(255, 255, 255, 0.06), transparent 440px),
    #050506;
}

.auth-form-pane {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
  min-height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px;
}

.auth-form-pane > .brand,
.auth-form-pane .auth-card {
  width: min(430px, 100%);
}

.auth-form-pane .brand {
  grid-template-columns: 42px minmax(0, 1fr);
}

.auth-form-pane .brand-mark,
.auth-form-pane .brand-logo {
  width: 42px;
  height: 42px;
}

.auth-form-pane .auth-card {
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 160px),
    rgba(13, 13, 15, 0.92);
  padding: 26px;
}

.auth-form-pane .auth-card h2 {
  font-size: 31px;
  font-weight: 560;
}

.auth-visual-pane {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 40%, rgba(255, 255, 255, 0.065), transparent 300px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 45%),
    #070708;
  padding: 48px;
}

.auth-visual-pane::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px) 0 0 /
      38px 38px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 /
      38px 38px;
  content: "";
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, #000, transparent 72%);
}

.security-tips-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(440px, 88%);
  gap: 22px;
}

.security-tips-panel h3 {
  max-width: 340px;
  color: #f7f7f3;
  font-size: 26px;
  font-weight: 480;
  line-height: 1.12;
}

.security-tips-panel ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.security-tips-panel li {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 17px 0;
}

.security-tips-panel li:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.security-tips-panel strong {
  color: #f2f2ee;
  font-size: 13px;
  font-weight: 560;
}

.security-tips-panel span:not(.eyebrow) {
  color: #8f8f89;
  font-size: 12px;
  font-weight: 360;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .studio-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .workspace,
  .studio-main {
    width: calc(100vw - 224px);
  }

  .hero,
  .dashboard-command,
  .settings-intro,
  .analytics-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .auth-studio-shell {
    grid-template-columns: 1fr;
  }

  .auth-form-pane {
    border-right: 0;
    padding: 34px 20px;
  }

  .auth-visual-pane {
    display: none;
  }
}

@media (max-width: 760px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .workspace-sidebar .nav {
    display: flex;
    width: auto;
    flex-wrap: wrap;
  }

  .workspace-topbar {
    position: static;
    padding: 12px 18px;
  }

  .toolbar-search {
    display: none;
  }

  .workspace,
  .studio-main {
    width: 100%;
    padding: 28px 18px 54px;
  }

  h2,
  .compact-heading h2 {
    font-size: 31px;
  }
}

/* StackAI-style dark workspace pass: flatter, denser, and less card-heavy. */
.content {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.017) 1px, transparent 1px) 0 58px /
      72px 72px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px) 0 58px /
      72px 72px,
    radial-gradient(circle at 52% -12%, rgba(255, 255, 255, 0.038), transparent 360px),
    #050506;
}

.workspace,
.studio-main {
  width: min(1320px, calc(100vw - 244px));
  padding: 32px 48px 72px;
}

.workspace-topbar {
  min-height: 58px;
  padding-inline: 30px;
}

.workspace-topbar strong {
  font-size: 13px;
  font-weight: 540;
}

.toolbar-search {
  min-width: 216px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.workspace-sidebar {
  gap: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 190px),
    rgba(7, 7, 8, 0.98);
}

.workspace-sidebar .brand {
  margin-bottom: 4px;
}

.workspace-sidebar .brand strong {
  font-size: 17px;
  font-weight: 560;
}

.workspace-sidebar .nav a {
  min-height: 36px;
  border-radius: 7px;
  padding-inline: 11px;
  font-size: 13px;
  font-weight: 390;
}

.workspace-sidebar .nav a:hover,
.workspace-sidebar .nav a:focus-visible {
  background: rgba(255, 255, 255, 0.032);
}

.workspace-sidebar .nav a.active {
  background: rgba(255, 255, 255, 0.055);
  color: #f7f7f3;
}

.page-heading,
.compact-heading {
  max-width: 760px;
}

h2,
.compact-heading h2 {
  font-size: clamp(32px, 3.2vw, 46px);
  font-weight: 430;
  line-height: 1.04;
}

.compact-heading p,
.page-heading p {
  max-width: 680px;
  color: #969690;
  font-size: 14px;
  line-height: 1.55;
}

.settings-route,
.settings-matrix {
  max-width: none;
  gap: 0;
}

.settings-intro {
  display: block;
  margin-bottom: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.085);
}

.settings-intro .settings-state {
  display: none;
}

.settings-section {
  display: grid;
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr);
  align-items: start;
  gap: 30px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 24px 0;
}

.settings-section:first-of-type {
  padding-top: 8px;
}

.settings-section .section-heading {
  position: sticky;
  top: 82px;
  gap: 6px;
  padding-top: 2px;
}

.settings-section .section-heading .eyebrow {
  color: #777771;
  font-size: 10px;
  font-weight: 640;
}

.settings-section h3 {
  color: #f3f3ef;
  font-size: 20px;
  font-weight: 440;
  line-height: 1.18;
}

.settings-section > :not(.section-heading) {
  grid-column: 2;
}

.settings-section > .form-grid,
.settings-section .form-grid.two-columns {
  gap: 16px 18px;
}

.field {
  gap: 7px;
}

.field > span,
.field label > span {
  color: #d9d9d3;
  font-size: 12px;
  font-weight: 470;
}

.field input,
.field textarea,
.field select {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.42);
  color: #f4f4f1;
  font-size: 13px;
  font-weight: 410;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.field textarea {
  min-height: 92px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.58);
}

.guidance {
  margin-top: 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  padding: 14px 16px;
}

.guidance div {
  gap: 4px;
}

.guidance span {
  color: #8b8b85;
  font-size: 10px;
  font-weight: 640;
}

.guidance code {
  color: #f4f4f1;
  font-size: 12px;
  font-weight: 420;
}

.settings-section > .section-actions {
  grid-column: 2;
  justify-content: flex-end;
  padding-top: 0;
}

.secondary-action,
.primary-action,
.danger-action {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 560;
}

.section-save {
  min-width: 104px;
}

.color-preset-box {
  width: 100%;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.42);
  padding: 8px;
}

.color-preset-grid {
  gap: 7px;
}

.color-preset-swatch {
  width: 24px;
  height: 24px;
  box-shadow: inset 0 0 0 2px rgba(5, 5, 6, 0.82);
}

.logo-upload-card {
  min-height: 72px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
  padding: 10px;
}

.logo-upload-preview {
  width: 44px;
  height: 44px;
  border-radius: 7px;
}

.logo-upload-copy strong {
  font-size: 12px;
  font-weight: 560;
}

.logo-upload-copy small {
  color: #83837d;
  font-size: 11px;
  line-height: 1.35;
}

.toggle-grid {
  gap: 8px;
}

.toggle-row {
  min-height: 40px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
  color: #deded8;
  font-size: 12px;
  font-weight: 400;
}

.toggle-control {
  width: 36px;
  height: 20px;
}

.toggle-control::after {
  width: 14px;
  height: 14px;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
}

.toggle-row input:checked + .toggle-control::after {
  transform: translate(16px, -50%);
}

.overview-card,
.metric,
.panel,
.form-panel,
.users-table-panel,
.admins-table-panel,
.template-card,
.retention-card {
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 120px),
    rgba(12, 12, 13, 0.76);
}

@media (max-width: 1120px) {
  .workspace,
  .studio-main {
    width: calc(100vw - 224px);
  }
}

@media (max-width: 820px) {
  .settings-section,
  .settings-section > :not(.section-heading),
  .settings-section > .section-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .settings-section .section-heading {
    position: static;
  }
}
