:root {
  color-scheme: dark;
  --ink: #e8f1ef;
  --muted: #82918f;
  --muted-2: #596866;
  --paper: #07100f;
  --panel: rgba(13, 24, 23, 0.86);
  --panel-solid: #0d1817;
  --line: rgba(181, 221, 213, 0.11);
  --line-strong: rgba(181, 221, 213, 0.22);
  --teal: #4de0c0;
  --teal-soft: #9cf6e3;
  --teal-deep: #183f39;
  --danger: #ff7c79;
  --warning: #f1bd6b;
  --success: #62d8a5;
  --radius: 18px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(35, 93, 82, 0.12), transparent 38%),
    #07100f;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(110px);
  pointer-events: none;
}

.ambient--one {
  top: -260px;
  left: 12%;
  background: #2fc2a4;
}

.ambient--two {
  right: -310px;
  bottom: -310px;
  background: #14665b;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.spinner {
  display: block;
  width: 28px;
  height: 28px;
  margin: auto;
  border: 2px solid rgba(77, 224, 192, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  transform: rotate(45deg);
  border: 1px solid rgba(77, 224, 192, 0.5);
  border-radius: 8px;
  background: rgba(77, 224, 192, 0.08);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  position: absolute;
  content: "";
  background: var(--teal);
}

.brand-mark::before {
  inset: 7px 13px;
}

.brand-mark::after {
  inset: 13px 7px;
}

.brand-mark i {
  inset: 10px;
  border-radius: 2px;
  background: var(--paper);
}

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(77, 224, 192, 0.08), transparent 46%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(152, 207, 196, 0.028) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(152, 207, 196, 0.028) 80px),
    #091311;
}

.auth-panel::after {
  position: absolute;
  right: -210px;
  bottom: -210px;
  width: 540px;
  height: 540px;
  border: 1px solid rgba(77, 224, 192, 0.17);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(77, 224, 192, 0.025),
    0 0 0 140px rgba(77, 224, 192, 0.018);
  content: "";
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.eyebrow,
.kicker,
.breadcrumb {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 6.2vw, 88px);
  font-weight: 520;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.auth-copy > p:last-child {
  max-width: 510px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.auth-foot,
.secure-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot,
.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 18px var(--teal);
}

.auth-form-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.auth-card {
  width: min(100%, 430px);
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(10, 20, 18, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}

.auth-heading h2,
.dialog-heading h2,
.panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.auth-heading p,
.panel-copy,
.enabled-state p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(77, 224, 192, 0.35);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--teal) 0 3px, transparent 4px);
}

.mini-mark--secure {
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(77, 224, 192, 0.28), transparent);
}

.mini-mark--invite {
  background: linear-gradient(90deg, transparent 46%, var(--teal) 47% 53%, transparent 54%), linear-gradient(0deg, transparent 46%, var(--teal) 47% 53%, transparent 54%);
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  color: #b6c3c1;
  font-size: 12px;
  font-weight: 600;
}

.field small {
  color: var(--muted-2);
  font-weight: 400;
}

.field input,
.field select,
.invite-link input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: rgba(2, 8, 7, 0.54);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus,
.field select:focus,
.invite-link input:focus {
  border-color: rgba(77, 224, 192, 0.7);
  background: rgba(2, 8, 7, 0.8);
  box-shadow: 0 0 0 3px rgba(77, 224, 192, 0.1);
}

.code-input {
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button--primary {
  color: #05241e;
  background: var(--teal);
  box-shadow: 0 10px 28px rgba(77, 224, 192, 0.13);
}

.button--primary:hover:not(:disabled) {
  background: var(--teal-soft);
}

.button--secondary,
.button--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.button--secondary:hover:not(:disabled),
.button--ghost:hover:not(:disabled) {
  border-color: rgba(77, 224, 192, 0.4);
  background: rgba(77, 224, 192, 0.07);
}

.button--light {
  color: #112522;
  background: #d8f8ef;
}

.button--full {
  width: 100%;
  min-height: 50px;
}

.text-button,
.dialog-close {
  padding: 0;
  border: 0;
  cursor: pointer;
  color: var(--teal);
  background: transparent;
  font-size: 12px;
}

.back-to-login {
  margin-bottom: 24px;
  color: var(--muted);
}

.auth-note {
  margin: 20px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.form-alert {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 124, 121, 0.28);
  border-radius: 9px;
  color: #ffc1be;
  background: rgba(144, 36, 35, 0.14);
  font-size: 12px;
}

.app-view {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 250px;
  padding: 30px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 15, 14, 0.94);
  backdrop-filter: blur(22px);
}

.brand--app {
  margin-left: 9px;
}

.workspace-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 9px 15px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.workspace-label span {
  padding: 3px 6px;
  border: 1px solid rgba(77, 224, 192, 0.15);
  border-radius: 4px;
  color: #6fa79d;
  font-size: 7px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 12px;
  transition: 150ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.is-active {
  border-color: rgba(77, 224, 192, 0.13);
  box-shadow: inset 2px 0 var(--teal);
}

.nav-icon {
  display: grid;
  width: 22px;
  place-items: center;
  color: var(--teal);
  font-size: 16px;
}

.sidebar-foot {
  display: grid;
  gap: 16px;
}

.secure-note {
  padding: 0 11px;
  color: var(--muted-2);
  font-size: 10px;
}

.secure-note span {
  color: var(--success);
  font-size: 7px;
}

.nav-item--muted {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.workspace {
  min-height: 100vh;
  margin-left: 250px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 clamp(24px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 15, 0.84);
  backdrop-filter: blur(18px);
}

.breadcrumb {
  margin: 0;
  color: var(--muted-2);
  font-size: 9px;
}

.breadcrumb span {
  color: #9badaa;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-chip strong {
  display: block;
  max-width: 210px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(77, 224, 192, 0.28);
  border-radius: 10px;
  color: var(--teal-soft);
  background: rgba(77, 224, 192, 0.08);
  font-size: 11px;
  font-weight: 750;
}

.role-list {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(77, 224, 192, 0.15);
  border-radius: 4px;
  color: #7db4aa;
  background: rgba(77, 224, 192, 0.04);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.content {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 70px) clamp(24px, 4vw, 58px) 70px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 520;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.page-heading > div > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
}

.security-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid rgba(241, 189, 107, 0.25);
  border-radius: 13px;
  background: linear-gradient(100deg, rgba(241, 189, 107, 0.12), rgba(241, 189, 107, 0.025));
}

.security-banner strong {
  display: block;
  font-size: 13px;
}

.security-banner p {
  margin: 4px 0 0;
  color: #b49d78;
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.13);
}

.metric-card {
  position: relative;
  min-height: 170px;
  padding: 24px;
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  right: -45px;
  bottom: -70px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(77, 224, 192, 0.07);
  border-radius: 50%;
  content: "";
}

.metric-card > span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.metric-card > span {
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 14px 0 9px;
  color: var(--teal-soft);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.panel {
  padding: 25px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.kicker {
  display: block;
  margin-bottom: 7px;
  font-size: 8px;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  border-top: 1px solid var(--line);
}

.activity-item:first-child {
  border-top: 0;
}

.activity-item i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4d6d67;
}

.activity-item strong {
  display: block;
  font-size: 11px;
  font-weight: 580;
}

.activity-item span {
  color: var(--muted-2);
  font-size: 10px;
}

.empty-state {
  padding: 35px 0;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.signal-panel {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(19, 55, 49, 0.75), rgba(9, 19, 18, 0.92));
}

.signal-panel h2 {
  max-width: 240px;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1.08;
}

.signal-panel p {
  position: relative;
  z-index: 1;
  max-width: 300px;
  color: #8fa29f;
  font-size: 12px;
}

.signal-lines {
  position: absolute;
  right: -35px;
  bottom: -50px;
  width: 210px;
  height: 210px;
  transform: rotate(-16deg);
}

.signal-lines i {
  position: absolute;
  inset: calc(var(--i, 0) * 23px);
  border: 1px solid rgba(77, 224, 192, 0.11);
  border-radius: 50%;
}

.signal-lines i:nth-child(1) { --i: 0; }
.signal-lines i:nth-child(2) { --i: 1; }
.signal-lines i:nth-child(3) { --i: 2; }
.signal-lines i:nth-child(4) { --i: 3; }

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-tools {
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 11px;
}

th {
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.012);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.014);
}

.muted-cell {
  color: var(--muted-2);
}

.person-cell {
  display: grid;
  gap: 2px;
}

.person-cell strong {
  font-weight: 600;
}

.person-cell span {
  color: var(--muted-2);
  font-size: 9px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 2px 3px 2px 0;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #a2b3b0;
  background: rgba(255, 255, 255, 0.025);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.badge--root { color: #ffcf91; border-color: rgba(255, 193, 112, 0.23); background: rgba(255, 193, 112, 0.06); }
.badge--admin { color: #b4a9ff; border-color: rgba(165, 149, 255, 0.23); background: rgba(165, 149, 255, 0.06); }
.badge--developer { color: #81dcc8; border-color: rgba(77, 224, 192, 0.2); background: rgba(77, 224, 192, 0.05); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  content: "";
}

.status-badge--active::before { background: var(--success); }
.status-badge--invited::before { background: var(--warning); }
.status-badge--disabled::before { background: var(--danger); }

.row-action {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

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

.stack-form {
  display: grid;
  margin-top: 24px;
}

.enabled-state {
  display: flex;
  gap: 13px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(98, 216, 165, 0.2);
  border-radius: 10px;
  background: rgba(98, 216, 165, 0.05);
}

.enabled-state > span {
  color: var(--success);
}

.mfa-setup > p {
  color: var(--muted);
  font-size: 11px;
}

.mfa-enrollment {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.mfa-qr-card {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
}

.mfa-qr-card canvas {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
  image-rendering: pixelated;
}

.mfa-qr-card canvas[hidden] {
  display: none;
}

.mfa-qr-error {
  max-width: 170px;
  margin: 0;
  color: #6c2525;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.mfa-qr-instructions h3 {
  margin: 7px 0 11px;
  font-size: 17px;
}

.mfa-qr-instructions ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.mfa-qr-instructions strong {
  color: var(--ink);
}

.mfa-manual {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.14);
}

.mfa-manual summary {
  padding: 13px 14px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.mfa-manual[open] summary {
  color: var(--ink);
}

.mfa-manual > p {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.mfa-manual .secret-row {
  margin: 0;
  padding: 0 14px 14px;
}

.secret-row,
.invite-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.secret-row code {
  flex: 1;
  padding: 13px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-soft);
  background: rgba(0, 0, 0, 0.25);
  letter-spacing: 0.12em;
}

.dialog {
  width: min(calc(100% - 32px), 520px);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--ink);
  background: #0b1615;
  box-shadow: var(--shadow);
}

.dialog--wide {
  width: min(calc(100% - 32px), 620px);
}

.dialog::backdrop {
  background: rgba(0, 6, 5, 0.76);
  backdrop-filter: blur(6px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}

.dialog-close {
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.role-picker {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.role-picker legend {
  margin-bottom: 8px;
  color: #b6c3c1;
  font-size: 12px;
  font-weight: 600;
}

.role-picker label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.role-picker label:has(input:checked) {
  border-color: rgba(77, 224, 192, 0.35);
  background: rgba(77, 224, 192, 0.045);
}

.role-picker input {
  accent-color: var(--teal);
}

.role-picker strong,
.role-picker small {
  display: block;
}

.role-picker strong {
  font-size: 11px;
}

.role-picker small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.invite-link {
  margin-top: 18px;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.recovery-code {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--teal-soft);
  background: rgba(0, 0, 0, 0.22);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 9px;
  width: min(360px, calc(100% - 40px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid rgba(77, 224, 192, 0.2);
  border-radius: 9px;
  color: #c7ddd8;
  background: #10201e;
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 180ms ease-out;
}

.toast--error {
  border-color: rgba(255, 124, 121, 0.25);
  color: #ffc1be;
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.setup-view {
  width: min(940px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 80px;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.setup-badge {
  padding: 6px 9px;
  border: 1px solid rgba(77, 224, 192, 0.2);
  border-radius: 5px;
  color: #78b5aa;
  background: rgba(77, 224, 192, 0.04);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.setup-intro {
  max-width: 650px;
  padding: 68px 0 40px;
}

.setup-intro h1,
.setup-result h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.setup-intro > p:last-child,
.setup-result > p:not(.eyebrow) {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
}

.setup-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 124, 121, 0.28);
  border-radius: 10px;
  color: #ffc1be;
  background: rgba(144, 36, 35, 0.14);
  font-size: 12px;
}

.setup-form {
  display: grid;
  gap: 14px;
}

.setup-section {
  margin: 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.setup-section legend {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  margin: 0 0 26px;
  padding: 0;
}

.setup-section legend > span {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(77, 224, 192, 0.24);
  border-radius: 8px;
  color: var(--teal);
  background: rgba(77, 224, 192, 0.05);
  font-size: 9px;
  font-weight: 750;
}

.setup-section legend strong,
.setup-section legend small {
  display: block;
}

.setup-section legend strong {
  font-size: 14px;
}

.setup-section legend small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.setup-section code,
.setup-result code {
  color: var(--teal-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

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

.setup-columns--host {
  grid-template-columns: minmax(0, 1fr) 130px;
}

.setup-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
}

.setup-submit p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
}

.setup-result {
  display: grid;
  justify-items: start;
  max-width: 720px;
  margin: 110px auto 0;
  text-align: left;
}

.setup-result .button {
  margin-top: 30px;
  text-decoration: none;
}

.setup-result-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(98, 216, 165, 0.32);
  border-radius: 14px;
  color: var(--success);
  background: rgba(98, 216, 165, 0.08);
  font-size: 20px;
}

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

  .auth-panel {
    display: none;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .panel-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .auth-form-wrap {
    align-items: center;
    padding: 18px;
  }

  .auth-card {
    padding: 27px 22px;
  }

  .topbar {
    min-height: 68px;
    padding: 0 18px;
  }

  .breadcrumb {
    display: none;
  }

  .content {
    padding: 30px 18px 55px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .metric-card {
    min-height: 145px;
  }

  .security-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-chip > div:not(.avatar) {
    display: none;
  }

  .recovery-codes {
    grid-template-columns: 1fr;
  }

  .mfa-enrollment {
    grid-template-columns: 1fr;
  }

  .mfa-qr-card {
    width: min(100%, 250px);
  }

  .dialog-actions,
  .invite-link {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-view {
    width: min(100% - 28px, 940px);
    padding-top: 24px;
  }

  .setup-intro {
    padding-top: 48px;
  }

  .setup-columns,
  .setup-columns--host {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .setup-submit {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
