:root {
  color-scheme: dark;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  background: #05070b;
  color: #f4f7fb;
  --bg: #05070b;
  --surface: rgba(10, 15, 22, 0.88);
  --surface-solid: #0b1018;
  --surface-raised: #101722;
  --surface-soft: #0d131c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f7fb;
  --muted: #8993a5;
  --muted-strong: #aeb7c6;
  --lime: #c8ff45;
  --cyan: #47d8ff;
  --teal: #25cbbd;
  --violet: #8b6cff;
  --pink: #ff4778;
  --green: #6ce3a2;
  --yellow: #f6ca62;
  --red: #ff7d89;
  --sidebar-width: 286px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--text);
}

body::after {
  position: fixed;
  z-index: -2;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 0.7px, transparent 0.7px);
  background-size: 4px 4px;
  content: "";
  opacity: 0.24;
  pointer-events: none;
}

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

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--lime);
  color: #071006;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

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

.page-effects {
  position: fixed;
  z-index: -3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.13;
}

.aurora-violet {
  top: -260px;
  left: -170px;
  width: 620px;
  height: 620px;
  background: var(--violet);
}

.aurora-cyan {
  top: 20%;
  right: -350px;
  width: 700px;
  height: 700px;
  background: var(--cyan);
  opacity: 0.1;
}

.aurora-lime {
  right: 12%;
  bottom: -280px;
  width: 520px;
  height: 520px;
  background: var(--lime);
  opacity: 0.045;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font: 700 16px/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.brand img {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(71, 216, 255, 0.2);
  border-radius: 11px;
  object-fit: contain;
  box-shadow: 0 0 24px rgba(71, 216, 255, 0.12);
}

.gate-screen {
  display: grid;
  width: min(100% - 48px, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  grid-template-rows: auto 1fr;
}

.gate-brand {
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.gate-card {
  display: grid;
  width: min(100%, 510px);
  align-self: center;
  justify-self: center;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 48px;
  background:
    linear-gradient(145deg, rgba(139, 108, 255, 0.1), transparent 46%),
    rgba(9, 14, 21, 0.92);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.gate-card h1 {
  margin: 7px 0 12px;
  font: 600 clamp(31px, 5vw, 43px)/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.05em;
}

.gate-card > p:last-of-type {
  max-width: 360px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.gate-orbit {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 25px;
  place-items: center;
  border: 1px solid rgba(71, 216, 255, 0.24);
  border-radius: 50%;
}

.gate-orbit::before {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(200, 255, 69, 0.24);
  border-radius: 50%;
  content: "";
}

.gate-orbit i {
  position: absolute;
  top: 3px;
  left: 28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px rgba(200, 255, 69, 0.8);
  animation: orbit 1.4s linear infinite;
  transform-origin: 5px 30px;
}

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

.gate-symbol {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(200, 255, 69, 0.42);
  border-radius: 21px;
  background: rgba(200, 255, 69, 0.06);
  color: var(--lime);
  font: 700 19px/1 "Space Grotesk", sans-serif;
}

.gate-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 19px;
  font-size: 12px;
  font-weight: 800;
}

.button-primary {
  background: var(--lime);
  color: #071006;
}

.button-primary:hover {
  box-shadow: 0 12px 32px rgba(200, 255, 69, 0.14);
  transform: translateY(-1px);
}

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

.button-secondary:hover {
  border-color: rgba(71, 216, 255, 0.38);
  color: var(--text);
}

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

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  padding: 27px 22px 22px;
  background: rgba(6, 9, 14, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  padding: 0 9px;
}

.program-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 36px;
  border: 1px solid rgba(200, 255, 69, 0.13);
  border-radius: 14px;
  padding: 13px;
  background: linear-gradient(110deg, rgba(200, 255, 69, 0.055), rgba(71, 216, 255, 0.025));
}

.program-mark-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(200, 255, 69, 0.28);
  border-radius: 11px;
  color: var(--lime);
  font-size: 18px;
}

.program-mark div {
  display: grid;
  gap: 3px;
}

.program-mark small,
.program-mark strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program-mark small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.program-mark strong {
  font: 600 13px/1.2 "Space Grotesk", sans-serif;
}

.nav-label {
  margin: 0 10px 10px;
  color: #687386;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.nav-item {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item:hover {
  border-color: var(--line);
  color: var(--text);
}

.nav-item.is-active {
  border-color: rgba(200, 255, 69, 0.2);
  background: linear-gradient(90deg, rgba(200, 255, 69, 0.09), rgba(71, 216, 255, 0.025));
  color: #f3ffd6;
}

.nav-number {
  color: var(--lime);
  font: 700 9px/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
}

.nav-item > span:last-child {
  font-size: 13px;
  font-weight: 700;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.user-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.user-card > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.user-card strong,
.user-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card strong {
  font-size: 12px;
}

.user-card small {
  color: var(--muted);
  font-size: 10px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(71, 216, 255, 0.3);
  border-radius: 12px;
  background: rgba(71, 216, 255, 0.06);
  color: var(--cyan);
  font: 700 11px/1 "Space Grotesk", sans-serif;
}

.avatar-small {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 9px;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.sidebar-actions a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.sidebar-actions a:hover {
  border-color: rgba(71, 216, 255, 0.3);
  color: var(--text);
}

.mobile-header {
  display: none;
}

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

.dashboard-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(24px, 4vw, 62px);
  background: rgba(5, 7, 11, 0.78);
  backdrop-filter: blur(18px);
}

.dashboard-topbar > div:first-child {
  display: grid;
  gap: 4px;
}

.topbar-context {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.dashboard-topbar > div:first-child strong {
  font: 600 16px/1.1 "Space Grotesk", sans-serif;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.period-control {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px 0 14px;
  background: rgba(255, 255, 255, 0.025);
}

.period-control span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.period-control select {
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 23px 0 9px;
  background-color: var(--surface-raised);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.account-pill {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px 5px 5px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

.account-pill:hover {
  border-color: rgba(71, 216, 255, 0.3);
  color: var(--text);
}

.dashboard-view {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 62px);
}

.welcome-panel {
  position: relative;
  display: grid;
  min-height: 304px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(30px, 4vw, 52px);
  background:
    linear-gradient(124deg, rgba(139, 108, 255, 0.16), transparent 48%),
    linear-gradient(330deg, rgba(71, 216, 255, 0.1), transparent 43%),
    rgba(8, 12, 18, 0.9);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.26);
}

.welcome-panel::after {
  position: absolute;
  top: -125px;
  right: 6%;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(200, 255, 69, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(200, 255, 69, 0.03);
  content: "";
}

.welcome-copy,
.welcome-program {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.welcome-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
}

.welcome-copy .eyebrow span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(200, 255, 69, 0.8);
}

.welcome-copy h1 {
  margin: 19px 0 20px;
  font: 600 clamp(44px, 5vw, 72px)/0.94 "Space Grotesk", sans-serif;
  letter-spacing: -0.06em;
}

.welcome-copy h1 em {
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.welcome-copy > p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.welcome-program {
  display: grid;
  min-width: 190px;
  justify-items: end;
  border-left: 1px solid var(--line);
  padding-left: 32px;
}

.welcome-program-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-program > strong {
  margin: 9px 0 17px;
  color: var(--lime);
  font: 600 48px/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.05em;
}

.status-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  border: 1px solid rgba(108, 227, 162, 0.3);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(108, 227, 162, 0.055);
  color: var(--green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-pill.inactive,
.status-pill.suspended,
.status-pill.disabled {
  border-color: rgba(255, 125, 137, 0.3);
  background: rgba(255, 125, 137, 0.055);
  color: var(--red);
}

.status-pill.paused {
  border-color: rgba(246, 202, 98, 0.3);
  background: rgba(246, 202, 98, 0.055);
  color: var(--yellow);
}

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

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

.metric-card::after {
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--metric-accent, var(--cyan));
  content: "";
  filter: blur(43px);
  opacity: 0.11;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 17px;
  font: 600 clamp(22px, 2.5vw, 31px)/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: #6f798a;
  font-size: 10px;
}

.metric-card.metric-lime { --metric-accent: var(--lime); }
.metric-card.metric-green { --metric-accent: var(--green); }
.metric-card.metric-violet { --metric-accent: var(--violet); }
.metric-card.metric-yellow { --metric-accent: var(--yellow); }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.15);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 21px 23px;
}

.panel-heading h2 {
  margin: 6px 0 0;
  font: 600 20px/1.15 "Space Grotesk", sans-serif;
  letter-spacing: -0.035em;
}

.panel-period {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.text-button {
  border: 0;
  padding: 5px;
  background: transparent;
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.text-button:hover {
  color: #efffc9;
}

.chart-legend {
  display: flex;
  gap: 15px;
  padding: 17px 23px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.legend-clicks {
  background: var(--cyan);
}

.legend-sales {
  background: var(--lime);
}

.daily-chart {
  display: flex;
  min-height: 226px;
  align-items: end;
  gap: clamp(3px, 0.6vw, 8px);
  overflow-x: auto;
  padding: 20px 23px 24px;
}

.chart-day {
  display: grid;
  min-width: 18px;
  flex: 1 0 18px;
  grid-template-rows: 170px auto;
  gap: 9px;
  align-items: end;
  text-align: center;
}

.chart-bars {
  display: flex;
  height: 170px;
  align-items: end;
  justify-content: center;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.chart-bar {
  display: block;
  width: min(45%, 9px);
  min-height: 3px;
  border-radius: 3px 3px 1px 1px;
}

.chart-bar-clicks {
  background: linear-gradient(to top, rgba(71, 216, 255, 0.25), var(--cyan));
}

.chart-bar-sales {
  background: linear-gradient(to top, rgba(200, 255, 69, 0.28), var(--lime));
}

.chart-day small {
  color: #626d7e;
  font-size: 8px;
  white-space: nowrap;
}

.chart-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.quick-links {
  display: grid;
  gap: 10px;
  padding: 17px;
}

.quick-link {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.018);
}

.quick-link > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-link strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-link code {
  overflow: hidden;
  color: var(--muted);
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(71, 216, 255, 0.24);
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(71, 216, 255, 0.045);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.copy-button:hover {
  border-color: rgba(71, 216, 255, 0.55);
  background: rgba(71, 216, 255, 0.09);
}

.table-panel {
  overflow: hidden;
}

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

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

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 15px 20px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #6f798a;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted-strong);
  font-size: 11px;
}

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

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.018);
}

.table-primary {
  display: grid;
  gap: 3px;
}

.table-primary strong {
  color: var(--text);
  font-size: 12px;
}

.table-primary small {
  color: #6f798a;
  font-size: 9px;
}

.table-amount {
  color: var(--text) !important;
  font-weight: 800;
}

.table-commission {
  color: var(--lime) !important;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted-strong);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-paid,
.badge-approved,
.badge-available,
.badge-completed,
.badge-active {
  border-color: rgba(108, 227, 162, 0.27);
  background: rgba(108, 227, 162, 0.045);
  color: var(--green);
}

.badge-pending,
.badge-processing,
.badge-reserved,
.badge-scheduled {
  border-color: rgba(246, 202, 98, 0.28);
  background: rgba(246, 202, 98, 0.045);
  color: var(--yellow);
}

.badge-refunded,
.badge-reversed,
.badge-canceled,
.badge-cancelled,
.badge-voided,
.badge-failed,
.badge-suspended {
  border-color: rgba(255, 125, 137, 0.27);
  background: rgba(255, 125, 137, 0.045);
  color: var(--red);
}

.empty-state,
.error-state,
.loading-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 34px;
  text-align: center;
}

.state-copy {
  display: grid;
  max-width: 390px;
  justify-items: center;
}

.state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font: 700 13px/1 "Space Grotesk", sans-serif;
}

.state-copy strong {
  font: 600 16px/1.2 "Space Grotesk", sans-serif;
}

.state-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.retry-button {
  min-height: 34px;
  margin-top: 15px;
  border: 1px solid rgba(200, 255, 69, 0.3);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(200, 255, 69, 0.055);
  color: var(--lime);
  font-size: 10px;
  font-weight: 800;
}

.loading-line {
  width: min(100%, 310px);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.loading-line::after {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(71, 216, 255, 0.38), transparent);
  content: "";
  animation: loading 1.25s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes loading {
  to { transform: translateX(340%); }
}

.view-heading {
  display: flex;
  min-height: 142px;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 27px;
}

.view-heading h1 {
  margin: 8px 0 9px;
  font: 600 clamp(35px, 4vw, 52px)/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.055em;
}

.view-heading p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.identity-chip {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(200, 255, 69, 0.18);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(200, 255, 69, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.identity-chip strong {
  color: var(--lime);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

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

.link-card {
  position: relative;
  display: grid;
  min-height: 220px;
  overflow: hidden;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 25px;
  background:
    linear-gradient(145deg, rgba(139, 108, 255, 0.08), transparent 48%),
    var(--surface);
}

.link-card::after {
  position: absolute;
  right: -40px;
  bottom: -55px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--cyan);
  content: "";
  filter: blur(65px);
  opacity: 0.07;
}

.link-card-head,
.link-card-actions {
  position: relative;
  z-index: 1;
}

.link-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.link-card h2 {
  margin: 6px 0 8px;
  font: 600 20px/1.1 "Space Grotesk", sans-serif;
  letter-spacing: -0.035em;
}

.link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.link-index {
  color: var(--lime);
  font: 700 10px/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
}

.link-address {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--muted-strong);
  font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.link-card-actions .copy-button {
  min-height: 40px;
}

.open-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 16px;
}

.open-button:hover {
  border-color: rgba(200, 255, 69, 0.3);
  color: var(--lime);
}

.info-strip {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  border: 1px solid rgba(71, 216, 255, 0.13);
  border-radius: 14px;
  padding: 15px 18px;
  background: rgba(71, 216, 255, 0.025);
}

.info-strip > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(71, 216, 255, 0.26);
  border-radius: 50%;
  color: var(--cyan);
  font: 700 11px/1 "Space Grotesk", sans-serif;
}

.info-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.info-strip strong {
  color: var(--muted-strong);
}

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

.balance-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 21px;
  background: var(--surface);
}

.balance-card span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.balance-card strong {
  display: block;
  margin-top: 13px;
  font: 600 29px/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.balance-card.pending strong { color: var(--yellow); }
.balance-card.available strong { color: var(--lime); }
.balance-card.paid strong { color: var(--green); }

.payout-summary {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 18px;
  border: 1px solid rgba(200, 255, 69, 0.15);
  border-radius: 18px;
  padding: 25px 28px;
  background:
    linear-gradient(115deg, rgba(200, 255, 69, 0.055), transparent 48%),
    var(--surface);
}

.payout-summary div {
  display: grid;
  gap: 9px;
}

.payout-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.payout-summary strong {
  color: var(--lime);
  font: 600 33px/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.payout-summary p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
}

.pagination {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 20px;
}

.pagination > span {
  color: var(--muted);
  font-size: 10px;
}

.pagination-buttons {
  display: flex;
  gap: 7px;
}

.page-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 800;
}

.page-button:hover:not(:disabled) {
  border-color: rgba(200, 255, 69, 0.3);
  color: var(--lime);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100% - 44px));
  border: 1px solid rgba(108, 227, 162, 0.28);
  border-radius: 12px;
  padding: 13px 16px;
  background: rgba(10, 20, 19, 0.96);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
  color: #d9ffea;
  font-size: 11px;
  font-weight: 700;
}

.toast.error {
  border-color: rgba(255, 125, 137, 0.3);
  background: rgba(26, 13, 18, 0.96);
  color: #ffdbe0;
}

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

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

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

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

  .sidebar {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 13px 20px 12px;
  }

  .sidebar-brand,
  .program-mark,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .dashboard-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    padding: 0 12px;
  }

  .mobile-header {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    background: rgba(5, 7, 11, 0.88);
  }

  .mobile-account-link {
    color: var(--lime);
    font-size: 10px;
    font-weight: 800;
  }

  .dashboard-topbar {
    top: 0;
    min-height: 68px;
    padding: 0 24px;
  }

  .account-pill {
    display: none;
  }
}

@media (max-width: 720px) {
  .gate-screen {
    width: min(100% - 28px, 1180px);
  }

  .gate-card {
    padding: 36px 22px;
  }

  .dashboard-view {
    padding: 30px 18px 48px;
  }

  .dashboard-topbar {
    padding: 0 18px;
  }

  .dashboard-topbar > div:first-child {
    gap: 0;
  }

  .dashboard-topbar .topbar-context {
    display: none;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .welcome-panel {
    min-height: 390px;
    grid-template-columns: 1fr;
    align-items: end;
    gap: 28px;
    padding: 28px 23px;
  }

  .welcome-copy h1 {
    font-size: clamp(40px, 13vw, 60px);
  }

  .welcome-program {
    min-width: 0;
    justify-items: start;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 20px;
    padding-left: 0;
  }

  .welcome-program > strong {
    margin-bottom: 12px;
    font-size: 38px;
  }

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

  .metric-card {
    min-height: 112px;
    padding: 15px;
  }

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

  .quick-links,
  .links-grid,
  .balance-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    padding: 18px;
  }

  .daily-chart {
    padding-right: 18px;
    padding-left: 18px;
  }

  .view-heading {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
    padding: 10px 0 22px;
  }

  .view-heading h1 {
    font-size: 39px;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .data-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    padding: 15px 17px;
  }

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

  .data-table td {
    display: grid;
    gap: 5px;
    border: 0;
    padding: 8px 5px;
    white-space: normal;
  }

  .data-table td::before {
    color: #697486;
    content: attr(data-label);
    font-size: 7px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .payout-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .payout-summary p {
    text-align: left;
  }
}

@media (max-width: 460px) {
  .mobile-header {
    padding: 0 16px;
  }

  .mobile-header .brand {
    font-size: 14px;
  }

  .mobile-header .brand img {
    width: 34px;
    height: 34px;
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .nav-number {
    display: none;
  }

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

  .metric-card {
    min-width: 0;
  }

  .metric-card span {
    min-height: 22px;
  }

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

  .open-button {
    width: 100%;
  }

  .data-table tr {
    grid-template-columns: 1fr;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 17px;
  }

  .pagination-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .gate-actions {
    display: grid;
  }
}

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