:root {
  --ink: #111316;
  --muted: #5d6470;
  --subtle: #8b929e;
  --line: #dfe3e8;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --charcoal: #181b20;
  --blue: #1769ff;
  --blue-dark: #0e4fd1;
  --green: #108a62;
  --green-soft: #e5f6ef;
  --red: #c73333;
  --red-soft: #fde9e9;
  --amber: #b66a00;
  --radius: 8px;
  --shadow: 0 18px 60px rgba(17, 19, 22, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  background: rgba(24, 27, 32, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 7px;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #ffffff;
}

.hero {
  position: relative;
  min-height: 74svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 88px clamp(20px, 5vw, 64px);
  color: #ffffff;
  background: #181b20;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.hero-scene {
  position: absolute;
  inset: 0;
  opacity: 0.82;
}

.scene-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
}

.scene-panel {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.scene-panel-primary {
  right: 8vw;
  top: 15vh;
  width: min(520px, 42vw);
  min-height: 290px;
  padding: 28px;
}

.scene-panel-secondary {
  right: 25vw;
  bottom: 12vh;
  width: min(360px, 34vw);
  min-height: 150px;
  padding: 24px;
}

.scene-row,
.mini-line {
  height: 14px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
}

.scene-row.strong {
  width: 64%;
  background: rgba(23, 105, 255, 0.75);
}

.scene-row.short,
.mini-line.short {
  width: 44%;
}

.scene-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 52px;
}

.scene-metrics span {
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.scene-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.chip-active {
  right: 32vw;
  top: 22vh;
  color: var(--green);
  background: var(--green-soft);
}

.chip-bound {
  right: 9vw;
  bottom: 24vh;
  color: #ffffff;
  background: var(--blue);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #81a9ff;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.8rem, 12vw, 8.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.hero-copy {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
}

.button-primary {
  color: #ffffff;
  background: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
}

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

.button-danger {
  color: #ffffff;
  background: var(--red);
}

.button-small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.content-band {
  padding: 80px clamp(20px, 5vw, 64px);
  background: var(--paper);
}

.band-quiet {
  background: var(--wash);
}

.section-heading {
  width: min(760px, 100%);
  margin-bottom: 30px;
}

.product-grid,
.flow-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card,
.flow-step,
.metric-card,
.panel,
.docs-panel {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
}

.product-card,
.flow-step {
  padding: 24px;
}

.product-card p,
.flow-step p,
.docs-panel p {
  color: var(--muted);
}

.product-kicker,
.flow-number,
.helper-text {
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 800;
}

.docs-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.docs-panel code {
  display: block;
  padding: 14px 16px;
  color: #ffffff;
  background: var(--charcoal);
  border-radius: 7px;
  overflow-wrap: anywhere;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 24px;
  color: #ffffff;
  background: var(--charcoal);
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.side-nav a {
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
}

.side-nav a.active,
.side-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  min-width: 0;
  padding: 30px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.status-pill,
.badge,
.staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
}

.staff-chip {
  color: #ffffff;
  background: var(--charcoal);
  border-color: var(--charcoal);
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--amber);
  border-radius: 999px;
}

.status-pill.is-online .status-dot {
  background: var(--green);
}

.summary-grid {
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

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

.data-grid {
  margin-top: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-wide {
  grid-column: span 1;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.18rem;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.field {
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.14);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-active {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bfe9d7;
}

.badge-revoked {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f5c4c4;
}

.badge-pending {
  color: var(--amber);
  background: #fff4df;
  border-color: #f2d29b;
}

.token-button {
  max-width: 100%;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

pre {
  min-height: 300px;
  margin: 0;
  padding: 16px;
  color: #ffffff;
  background: var(--charcoal);
  border-radius: 7px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.secret-output {
  min-height: 44px;
  padding: 11px 12px;
  color: #ffffff;
  background: var(--charcoal);
  border-radius: 7px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.table-subtext {
  color: var(--subtle);
  font-size: 0.8rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-select {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 0.86rem;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.audit-panel {
  margin-top: 18px;
}

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

.audit-event {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.audit-event div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.audit-event span {
  color: var(--muted);
  font-size: 0.86rem;
}

.audit-event code {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
}

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

body.staff-dashboard {
  color: #222330;
  background:
    linear-gradient(135deg, #fffdfc 0%, #f7f1ff 42%, #eefbff 100%);
}

body.staff-dashboard.app-shell {
  grid-template-columns: 270px minmax(0, 1fr);
}

body.staff-dashboard .staff-sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 20px;
  color: #3e3f4d;
  background: rgba(247, 247, 250, 0.9);
  border-right: 1px solid rgba(154, 153, 170, 0.28);
  box-shadow: 10px 0 36px rgba(109, 111, 130, 0.08);
}

.staff-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #20212c;
}

.staff-brand span:last-child {
  display: grid;
  gap: 1px;
}

.staff-brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.staff-brand small {
  color: #8d8fa0;
  font-size: 0.72rem;
  font-weight: 800;
}

.staff-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #ffffff;
  background: linear-gradient(135deg, #7b2ff7, #b12cff);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(123, 47, 247, 0.24);
  font-weight: 900;
}

body.staff-dashboard .staff-side-nav {
  margin-top: 8px;
}

body.staff-dashboard .staff-side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  color: #6c6d79;
  border-radius: 8px;
  font-weight: 900;
}

body.staff-dashboard .staff-side-nav a.active,
body.staff-dashboard .staff-side-nav a:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #7d2df2, #b527f5);
  box-shadow: 0 14px 32px rgba(126, 45, 242, 0.23);
}

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

.nav-icon svg {
  display: block;
  fill: currentColor;
}

.staff-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: auto;
  color: #db3c4c;
  background: #fff1f3;
  border: 1px solid #f4c7ce;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.staff-main {
  padding: 28px 32px 40px;
}

.staff-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  margin-bottom: 22px;
}

.staff-topbar h1 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
}

.staff-topbar p {
  margin: 0;
  color: #747684;
  font-size: 0.9rem;
  font-weight: 700;
}

.staff-topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.staff-search {
  width: min(370px, 30vw);
}

.staff-search input {
  min-height: 42px;
  padding: 0 18px;
  color: #2f3040;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(191, 193, 207, 0.45);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.staff-status {
  color: #5d5f70;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(191, 193, 207, 0.45);
}

.staff-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.staff-profile span:last-child {
  display: grid;
  gap: 1px;
}

.staff-profile strong {
  color: #252633;
  font-size: 0.95rem;
  line-height: 1.1;
}

.staff-profile small {
  color: #777986;
  font-size: 0.76rem;
  font-weight: 800;
}

.staff-avatar,
.member-avatar {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #222330, #555669);
  border-radius: 999px;
  font-weight: 900;
}

.staff-avatar {
  width: 42px;
  height: 42px;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 24px rgba(67, 69, 84, 0.18);
}

.staff-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.staff-metric,
.staff-panel {
  border: 1px solid rgba(209, 210, 220, 0.7);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(109, 111, 130, 0.09);
}

.staff-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 108px;
  padding: 17px 18px;
  overflow: hidden;
}

.staff-metric span:first-child {
  display: block;
  color: #6d6f7e;
  font-size: 0.86rem;
  font-weight: 900;
}

.staff-metric strong {
  display: block;
  margin-top: 4px;
  color: #252633;
  font-size: 1.45rem;
  line-height: 1.12;
}

.staff-metric small {
  display: block;
  margin-top: 3px;
  color: #8d67d5;
  font-size: 0.76rem;
  font-weight: 900;
}

.metric-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(65, 67, 88, 0.16);
  font-weight: 900;
}

.metric-blue {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(217, 234, 255, 0.9));
}

.metric-blue .metric-icon {
  background: linear-gradient(135deg, #4489ff, #75a5ff);
}

.metric-green {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(218, 250, 231, 0.9));
}

.metric-green .metric-icon {
  background: linear-gradient(135deg, #35d28c, #7befb0);
}

.metric-purple {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(244, 224, 255, 0.92));
}

.metric-purple .metric-icon,
.metric-violet .metric-icon {
  background: linear-gradient(135deg, #8c35f4, #c75cff);
}

.metric-orange {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 231, 214, 0.92));
}

.metric-orange .metric-icon {
  background: linear-gradient(135deg, #ff8a39, #ffb16f);
}

.metric-violet {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 221, 255, 0.92));
}

.metric-cyan {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(217, 246, 255, 0.92));
}

.metric-cyan .metric-icon {
  background: linear-gradient(135deg, #23bdd7, #7de4f2);
}

.metric-red {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 227, 224, 0.92));
}

.metric-red .metric-icon {
  background: linear-gradient(135deg, #f04f43, #ff8076);
}

.metric-pink {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 223, 241, 0.92));
}

.metric-pink .metric-icon {
  background: linear-gradient(135deg, #ee4aa2, #ff82bd);
}

.staff-chart-grid,
.staff-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.staff-lower-grid {
  margin-top: 20px;
  align-items: start;
}

.staff-panel {
  min-width: 0;
  padding: 18px;
}

body.staff-dashboard .panel-header {
  margin-bottom: 12px;
}

body.staff-dashboard .panel-header h2 {
  color: #252633;
  font-size: 1.08rem;
  line-height: 1.2;
}

body.staff-dashboard .helper-text {
  color: #a05ade;
  font-size: 0.78rem;
}

.chart-panel {
  min-height: 310px;
}

.line-chart {
  display: grid;
  gap: 10px;
}

.line-chart svg {
  width: 100%;
  height: 240px;
  overflow: visible;
}

.chart-grid-line {
  fill: none;
  stroke: rgba(103, 108, 126, 0.12);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.purple-line {
  stroke: #9f35ff;
}

.cyan-line {
  stroke: #22bfd8;
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  color: #9a9dab;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.chart-cyan {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(226, 250, 255, 0.86));
}

.chart-purple {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(249, 239, 255, 0.88));
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: grid;
  grid-template-columns: auto 42px minmax(130px, 1fr) minmax(120px, 0.7fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(214, 216, 226, 0.65);
  border-radius: 8px;
}

.member-rank,
.member-total {
  color: #5f6170;
  font-weight: 900;
}

.member-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #ffaf6a, #9b6dff);
  font-size: 0.82rem;
}

.member-name,
.member-date {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-name strong,
.member-date strong {
  overflow: hidden;
  color: #292a36;
  font-size: 0.9rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name small,
.member-date small {
  overflow: hidden;
  color: #8a8c9a;
  font-size: 0.74rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-total {
  justify-self: end;
  font-size: 0.86rem;
}

.empty-state {
  min-height: 90px;
  display: grid;
  place-items: center;
  color: #7c7e8c;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(160, 162, 178, 0.5);
  border-radius: 8px;
  font-weight: 800;
}

.retention-content {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 238px;
}

.donut-chart {
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 999px;
  background:
    conic-gradient(#72d5b5 0 28%, #f8c76d 28% 50%, #ee7f88 50% 62%, #aa80ef 62% 78%, #89b5ff 78% 100%);
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 28%;
  background: #fbf6ff;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(199, 201, 215, 0.35);
}

.retention-legend {
  display: grid;
  gap: 12px;
  font-weight: 900;
}

.retention-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3b3c49;
}

.retention-legend i {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.legend-green {
  background: #72d5b5;
}

.legend-yellow {
  background: #f8c76d;
}

.legend-red {
  background: #ee7f88;
}

.legend-purple {
  background: #aa80ef;
}

[hidden] {
  display: none !important;
}

.view-section {
  display: none;
}

.view-section.is-active {
  display: block;
}

.license-control-grid,
.license-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.license-action-grid {
  margin-top: 20px;
}

.license-results-panel,
.license-action-result {
  margin-top: 20px;
}

.member-status-card {
  min-height: 178px;
  padding: 16px;
  color: #656777;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(214, 216, 226, 0.65);
  border-radius: 8px;
  font-weight: 800;
}

.member-summary-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.member-summary-top span:last-child {
  display: grid;
  gap: 2px;
}

.member-summary-top strong {
  color: #292a36;
  line-height: 1.15;
}

.member-summary-top small {
  color: #8a8c9a;
  font-size: 0.78rem;
  font-weight: 900;
}

.member-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.member-status-card p {
  margin: 0;
  color: #7a7c8c;
  font-size: 0.9rem;
}

.license-table td {
  vertical-align: top;
}

.license-token {
  display: block;
  max-width: min(560px, 56vw);
  padding: 8px 10px;
  color: #5a2fcf;
  background: #f3ecff;
  border: 1px solid #decfff;
  border-radius: 7px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.license-action-result pre {
  min-height: 170px;
}

.payments-grid {
  display: grid;
  gap: 20px;
}

.payments-panel {
  overflow: hidden;
}

.payment-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.payment-search-row .field {
  margin-bottom: 0;
}

.payment-table td {
  vertical-align: top;
}

.payment-transaction {
  display: block;
  max-width: min(360px, 40vw);
  padding: 8px 10px;
  color: #1d6d75;
  background: #e9fbff;
  border: 1px solid #c5edf5;
  border-radius: 7px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(24, 27, 32, 0.72), rgba(24, 27, 32, 0.82)),
    radial-gradient(circle at top right, rgba(23, 105, 255, 0.34), transparent 34%),
    var(--charcoal);
}

.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 34px;
}

.auth-card h1 {
  margin-bottom: 20px;
  font-size: clamp(2.4rem, 9vw, 4rem);
}

.auth-copy {
  color: var(--muted);
}

.auth-button {
  width: 100%;
}

.auth-result {
  min-height: 120px;
  margin-top: 18px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 18px;
  }

  .workspace-grid,
  .data-grid,
  .product-grid,
  .flow-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .scene-panel-primary {
    right: -16vw;
    width: 74vw;
  }

  .scene-panel-secondary {
    display: none;
  }

  body.staff-dashboard.app-shell {
    grid-template-columns: 1fr;
  }

  body.staff-dashboard .staff-sidebar {
    position: static;
    height: auto;
    gap: 14px;
  }

  .staff-logout {
    margin-top: 0;
    width: fit-content;
  }

  .staff-topbar,
  .staff-topbar-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .staff-search {
    width: min(100%, 520px);
  }

  .staff-metrics,
  .staff-chart-grid,
  .staff-lower-grid,
  .license-control-grid,
  .license-action-grid,
  .payment-search-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .admin-topbar,
  .docs-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-links {
    width: 100%;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: 78svh;
    padding-top: 64px;
  }

  .hero-actions,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .admin-main {
    padding: 18px;
  }

  .staff-main {
    padding: 18px 14px 28px;
  }

  .staff-metric {
    min-height: 96px;
  }

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

  .member-date,
  .member-total {
    grid-column: 3;
    justify-self: start;
  }

  .retention-content {
    grid-template-columns: 1fr;
  }

  .license-token {
    max-width: 72vw;
  }

  .payment-transaction {
    max-width: 72vw;
  }
}
