@font-face {
  font-family: "Sora";
  src: url("/assets/fonts/sora-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f1f0ec;
  --surface: #faf9f6;
  --surface-raised: #ffffff;
  --surface-muted: #e9e8e3;
  --ink: #151515;
  --ink-soft: #64645f;
  --ink-faint: #8a8983;
  --line: #d8d7d1;
  --line-strong: #bcbab2;
  --inverse: #121212;
  --on-inverse: #ffffff;
  --positive: #167a4b;
  --positive-bg: #e4f2e9;
  --danger: #b42318;
  --danger-bg: #fae8e6;
  --warning: #9a6700;
  --sidebar: #e8e7e2;
  --shadow: 0 18px 50px rgb(25 25 20 / 7%);
  --radius: 18px;
  --radius-small: 10px;
  --sidebar-width: 256px;
  --font-display: "Sora", "Trebuchet MS", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080808;
  --surface: #101010;
  --surface-raised: #151515;
  --surface-muted: #1c1c1c;
  --ink: #f7f7f4;
  --ink-soft: #aaa9a4;
  --ink-faint: #777772;
  --line: #292929;
  --line-strong: #414141;
  --inverse: #f3f3f0;
  --on-inverse: #0a0a0a;
  --positive: #8ed7ac;
  --positive-bg: #12281d;
  --danger: #f5a29a;
  --danger-bg: #301614;
  --warning: #e6c56a;
  --sidebar: #0c0c0c;
  --shadow: 0 24px 70px rgb(0 0 0 / 42%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
.metric-card strong {
  font-family: var(--font-display);
  letter-spacing: -.035em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
}

p {
  color: var(--ink-soft);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--inverse);
  color: var(--on-inverse);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.app-frame {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 28px 20px 20px;
}

.brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 16px;
}

.brand small {
  margin-top: -2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 46px;
}

.main-nav a {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  padding: 0 13px;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.main-nav a:hover {
  background: var(--surface-muted);
  color: var(--ink);
  transform: translateX(2px);
}

.main-nav a.active {
  background: var(--inverse);
  color: var(--on-inverse);
}

.main-nav svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.theme-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.moon-icon,
[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.user-chip {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding: 12px 3px 4px;
}

.user-chip strong,
.user-chip small {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip small {
  color: var(--ink-soft);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-raised);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}

.avatar.small {
  width: 34px;
  height: 34px;
}

.avatar.profile {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 20px;
}

.text-button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 12px;
  padding: 0 3px;
}

.text-button:hover {
  color: var(--ink);
}

.app-main {
  grid-column: 2;
  min-width: 0;
}

.mobile-header {
  display: none;
}

.page-shell {
  width: min(100%, 1500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 52px clamp(28px, 5vw, 76px) 72px;
}

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

.page-header > div:first-child {
  max-width: 760px;
}

.page-header p {
  margin-bottom: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0 17px;
  transition: transform 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

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

.button:active {
  transform: scale(.98);
}

.button.primary {
  background: var(--inverse);
  color: var(--on-inverse);
}

.button.primary:hover {
  opacity: .88;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--line-strong);
}

.button.small {
  min-height: 36px;
  font-size: 11px;
  padding: 0 12px;
}

.button.wide {
  width: 100%;
}

.button svg {
  width: 17px;
  height: 17px;
}

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

.metric-card {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
}

.metric-card.emphasis {
  border-color: var(--inverse);
  background: var(--inverse);
  color: var(--on-inverse);
}

.metric-card.emphasis::after {
  position: absolute;
  right: -20px;
  bottom: -50px;
  width: 120px;
  height: 120px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: .13;
}

.metric-label {
  display: block;
  margin-bottom: 22px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.emphasis .metric-label,
.emphasis small {
  color: currentColor;
  opacity: .65;
}

.metric-card strong {
  display: block;
  overflow: hidden;
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card small {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 11px;
}

.metric-card .date-value {
  font-size: clamp(23px, 2vw, 30px);
}

.positive {
  color: var(--positive) !important;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
  gap: 18px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 26px;
}

.section-heading {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

.count-badge {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.clan-list {
  display: grid;
}

.clan-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 24px;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  transition: background 160ms var(--ease), padding 160ms var(--ease);
}

.clan-row:hover {
  background: var(--surface-muted);
  margin-inline: -10px;
  padding-inline: 10px;
}

.clan-monogram {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
}

.clan-monogram.large {
  width: 70px;
  height: 70px;
  border-radius: 19px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 18px;
}

.clan-identity strong,
.clan-identity small,
.clan-number strong,
.clan-number small {
  display: block;
}

.clan-identity strong {
  font-size: 14px;
}

.clan-identity small,
.clan-number small {
  color: var(--ink-faint);
  font-size: 10px;
}

.clan-number {
  text-align: right;
}

.clan-number strong {
  color: var(--positive);
  font-family: var(--font-display);
  font-size: 14px;
}

.chevron {
  color: var(--ink-faint);
}

.ranking-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  min-height: 53px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.rank-number {
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 10px;
}

.rank-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  color: var(--positive);
  font-family: var(--font-display);
  font-size: 12px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
}

.breadcrumbs a:hover {
  color: var(--ink);
}

.title-with-mark {
  display: flex;
  align-items: center;
  gap: 20px;
}

.clan-page-header {
  align-items: center;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.metric-grid.compact .metric-card {
  min-height: 132px;
  padding: 19px;
}

.metric-grid.compact .metric-label {
  margin-bottom: 16px;
}

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

.table-heading {
  margin: 0;
  padding: 25px 26px 18px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 190px auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px 26px;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--surface-raised);
  padding: 0 13px;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}

.search-field input {
  padding-left: 40px;
}

.data-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  height: 43px;
  background: var(--surface-muted);
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 130ms var(--ease);
}

.data-table tbody tr:hover {
  background: var(--surface-muted);
}

.row-index {
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 10px;
}

.member-cell {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 10px;
}

.member-cell strong,
.member-cell small {
  display: block;
}

.member-cell strong {
  font-size: 13px;
}

.member-cell small {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  content: "";
}

.status-dot.active::before {
  background: var(--positive);
  box-shadow: 0 0 0 3px var(--positive-bg);
}

.status-dot.inactive::before {
  background: var(--danger);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.row-link {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  color: var(--ink-faint);
}

.row-link:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.segmented-filter {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-muted);
  margin-bottom: 20px;
  padding: 4px;
}

.segmented-filter button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 0 13px;
}

.segmented-filter button.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 2px 8px rgb(0 0 0 / 7%);
}

.timeline {
  display: grid;
}

.timeline-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.timeline-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--positive-bg);
  color: var(--positive);
  font-family: var(--font-display);
  font-weight: 800;
}

.timeline-icon.removed {
  background: var(--danger-bg);
  color: var(--danger);
}

.timeline-icon.rename {
  background: var(--surface-muted);
  color: var(--ink);
}

.timeline-title {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 13px;
}

.timeline-title span {
  color: var(--ink-soft);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 20px;
  color: var(--ink-soft);
  font-size: 11px;
}

.pagination a {
  color: var(--ink);
  font-weight: 800;
}

.detail-columns,
.admin-columns {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr);
  gap: 18px;
}

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

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

.stack-form label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.stack-form label small {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.stack-form .full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--inverse);
}

.check-row span {
  margin: 0 !important;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.snapshot-list {
  max-height: 500px;
  overflow: auto;
}

.snapshot-row {
  display: grid;
  grid-template-columns: 60px 80px minmax(100px, 1fr) 70px;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.snapshot-row time,
.snapshot-row span {
  color: var(--ink-soft);
}

.snapshot-row strong,
.snapshot-row .delta {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.member-header {
  align-items: center;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.profile-summary strong,
.profile-summary span {
  display: block;
}

.profile-summary span {
  color: var(--ink-soft);
  font-size: 12px;
}

.form-surface {
  max-width: 720px;
}

.section-copy {
  margin-bottom: 24px;
  font-size: 12px;
}

.admin-columns {
  grid-template-columns: minmax(300px, .7fr) minmax(480px, 1.3fr);
}

.integration-list {
  display: grid;
}

.integration-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.integration-row strong,
.integration-row small {
  display: block;
}

.integration-row strong {
  font-size: 13px;
}

.integration-row small {
  color: var(--ink-faint);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state.compact {
  min-height: 190px;
}

.empty-state p {
  max-width: 360px;
  margin-bottom: 0;
}

.empty-mark {
  display: grid;
  min-width: 56px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 12px;
  margin-bottom: 14px;
}

.empty-inline {
  color: var(--ink-soft);
  padding: 25px;
  text-align: center;
}

.denied-state {
  min-height: 520px;
}

.denied-state .button {
  margin-top: 10px;
}

.inline-alert,
.toast {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  font-size: 12px;
  padding: 12px 14px;
}

.inline-alert {
  margin-bottom: 18px;
}

.inline-alert.error,
.toast.error {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
}

.inline-alert.success,
.toast.success {
  border-color: color-mix(in srgb, var(--positive) 30%, var(--line));
  background: var(--positive-bg);
  color: var(--positive);
}

.toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow);
  animation: toast-in 260ms var(--ease) both;
}

.toast button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font-size: 20px;
}

.toast.leaving {
  animation: toast-out 180ms ease-in both;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.login-page {
  overflow-x: hidden;
}

.login-simple {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background: var(--bg);
  padding: 72px 20px;
}

.login-simple-theme {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 44px;
  justify-content: center;
  padding: 0;
}

.login-simple-card {
  width: min(100%, 400px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 36px;
}

.login-simple-brand {
  justify-content: center;
  width: 100%;
}

.login-simple-card h1 {
  margin: 28px 0;
  font-size: 27px;
  text-align: center;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.15fr) minmax(420px, .85fr);
  min-height: 100vh;
}

.login-intro {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background: #111;
  color: #fff;
  padding: clamp(30px, 5vw, 72px);
}

.login-intro::before,
.login-intro::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.login-intro::before {
  right: -16vw;
  bottom: -35vw;
  width: 70vw;
  height: 70vw;
}

.login-intro::after {
  right: -5vw;
  bottom: -24vw;
  width: 48vw;
  height: 48vw;
}

.login-brand {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  color: #fff;
}

.login-brand .brand-mark {
  border: 1px solid rgb(255 255 255 / 30%);
  background: #fff;
  color: #111;
}

.login-brand small {
  color: #999;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-block: 100px;
}

.login-copy .eyebrow {
  color: #929292;
}

.login-copy h1 {
  margin-bottom: 24px;
  color: #fff;
  font-size: clamp(42px, 6vw, 80px);
  line-height: .98;
}

.login-copy p {
  max-width: 520px;
  color: #aaa;
  font-size: clamp(15px, 1.4vw, 19px);
}

.login-metric {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-metric p {
  margin: 0;
  color: #999;
  font-size: 11px;
}

.metric-line {
  width: 38px;
  height: 1px;
  background: #777;
}

.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--surface);
  padding: 40px clamp(30px, 6vw, 90px);
}

.login-theme {
  position: absolute;
  top: 30px;
  right: 30px;
}

.login-form-wrap {
  width: min(100%, 410px);
}

.form-heading {
  margin-bottom: 30px;
}

.form-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 3vw, 42px);
}

.form-heading p {
  margin: 0;
  font-size: 13px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 50px;
}

.password-field button {
  position: absolute;
  top: 2px;
  right: 3px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.login-help {
  margin: 22px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

.muted {
  color: var(--ink-soft);
}

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

@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-columns,
  .detail-columns,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: minmax(220px, 1fr) repeat(2, 150px);
  }

  .filter-bar .button {
    grid-column: 1 / -1;
  }

  .login-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .app-frame {
    display: block;
  }

  .sidebar {
    width: min(310px, 86vw);
    box-shadow: 20px 0 60px rgb(0 0 0 / 25%);
    transform: translateX(-105%);
    transition: transform 220ms var(--ease);
  }

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

  .app-main {
    min-width: 0;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    padding: 0 16px;
  }

  .icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
  }

  .brand.compact {
    min-height: 44px;
  }

  .brand.compact .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 10px;
  }

  .page-shell {
    padding: 30px 18px 56px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .login-layout {
    display: block;
  }

  .login-intro {
    min-height: 380px;
    padding: 28px;
  }

  .login-copy {
    margin-block: 70px 40px;
  }

  .login-copy h1 {
    font-size: clamp(38px, 12vw, 60px);
  }

  .login-intro::before {
    width: 120vw;
    height: 120vw;
  }

  .login-intro::after {
    width: 80vw;
    height: 80vw;
  }

  .login-panel {
    min-height: 600px;
    padding: 90px 24px 50px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .metric-grid,
  .metric-grid.compact {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card,
  .metric-grid.compact .metric-card {
    min-height: 126px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .metric-label {
    margin-bottom: 15px;
    font-size: 9px;
  }

  .surface {
    border-radius: 14px;
    padding: 19px;
  }

  .table-surface {
    padding: 0;
  }

  .table-heading {
    padding: 20px 18px 15px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
    padding: 14px 18px;
  }

  .filter-bar .search-field {
    grid-column: 1 / -1;
  }

  .filter-bar .button {
    grid-column: 1 / -1;
  }

  .clan-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .clan-number {
    display: none;
  }

  .clan-monogram {
    width: 38px;
    height: 38px;
  }

  .title-with-mark {
    align-items: flex-start;
    gap: 14px;
  }

  .clan-monogram.large,
  .avatar.profile {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    font-size: 15px;
  }

  .header-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .header-actions .button,
  .header-actions form,
  .header-actions form .button {
    width: 100%;
  }

  .stack-form.two-columns {
    grid-template-columns: 1fr;
  }

  .stack-form .full {
    grid-column: auto;
  }

  .segmented-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .integration-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding-block: 12px;
  }

  .integration-row form {
    grid-column: 2 / -1;
  }

  .integration-row form .button {
    width: 100%;
  }

  .snapshot-row {
    grid-template-columns: 45px 60px minmax(80px, 1fr) 55px;
    font-size: 10px;
  }

  .toast-stack {
    top: 74px;
    right: 16px;
  }

  .login-simple {
    align-items: center;
    padding: 70px 16px 32px;
  }

  .login-simple-theme {
    top: 16px;
    right: 16px;
  }

  .login-simple-card {
    border-radius: 14px;
    padding: 28px 22px;
  }
}

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