:root {
  --background: #0a0a0f;
  --background-gradient: radial-gradient(ellipse at center, #1a0f2e 0%, #0a0a0f 70%);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-elevated: rgba(255, 255, 255, 0.08);
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --secondary: #c084fc;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --text-accent: #fbbf24;
  --nebula-purple: rgba(147, 51, 234, 0.1);
  --nebula-blue: rgba(59, 130, 246, 0.08);
  --card-background: rgba(255, 255, 255, 0.05);
  --card-border: rgba(139, 92, 246, 0.2);
  --card-hover: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.35);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

/* Ensure hidden views and inactive account tabs never render. */
[hidden],
.auth-panel [hidden],
.auth-panel .login-form[hidden] {
  display: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--background);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before { background: var(--background-gradient); }

body::after {
  background:
    radial-gradient(circle at 16% 20%, var(--nebula-purple), transparent 28%),
    radial-gradient(circle at 84% 16%, var(--nebula-blue), transparent 24%),
    radial-gradient(circle at 50% 90%, rgba(139, 92, 246, 0.09), transparent 30%);
}

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

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.14);
  background: rgba(10, 10, 15, 0.72);
}

.nav-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.18rem;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.38);
}

.brand span span { color: var(--primary-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.96rem;
  transition: 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.nav-cta,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 750;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-cta,
.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 34px rgba(139, 92, 246, 0.28);
}

.nav-cta { padding: 10px 18px; }
.primary-btn, .secondary-btn { padding: 13px 22px; }

.secondary-btn {
  color: var(--text-primary);
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.nav-cta:hover,
.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(139, 92, 246, 0.32);
}

.mobile-toggle {
  display: none;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 1.1rem;
}

.page-hero {
  padding: 84px 0 38px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--primary-light);
  border: 1px solid rgba(139, 92, 246, 0.24);
  background: rgba(139, 92, 246, 0.11);
  font-weight: 700;
  font-size: 0.92rem;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-accent);
  box-shadow: 0 0 18px var(--text-accent);
}

h1, h2, h3 { margin: 0; letter-spacing: -0.045em; }

h1 {
  max-width: 820px;
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  line-height: 0.95;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff, var(--primary-light) 44%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero p {
  color: var(--text-secondary);
  max-width: 760px;
  line-height: 1.75;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.section { padding: 42px 0 76px; }

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

.section-title h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.section-title p {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

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

.panel,
.stat-panel,
.empty-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--card-background);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.panel::before,
.stat-panel::before,
.empty-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(139, 92, 246, 0.18), transparent 34%);
  pointer-events: none;
}

.stat-panel {
  min-height: 142px;
  padding: 24px;
}

.stat-panel span {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--primary-light);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.22);
  font-weight: 750;
  font-size: 0.82rem;
}

.stat-panel strong {
  display: block;
  margin-top: 18px;
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.stat-panel small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
}

.empty-panel {
  grid-column: 1 / -1;
  min-height: 340px;
  padding: 26px;
}

.empty-panel h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

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

.placeholder-box {
  min-height: 190px;
  border-radius: 24px;
  border: 1px dashed rgba(167, 139, 250, 0.26);
  background: rgba(255, 255, 255, 0.035);
}

.footer {
  padding: 44px 0;
  border-top: 1px solid rgba(139, 92, 246, 0.14);
  background: rgba(0, 0, 0, 0.18);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer p { margin: 8px 0 0; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); }
.footer-links a:hover { color: var(--primary-light); }

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.nav-links a:focus-visible {
  outline: 3px solid rgba(167, 139, 250, 0.72);
  outline-offset: 4px;
}

@media (max-width: 920px) {
  .dashboard-shell,
  .empty-grid { grid-template-columns: 1fr; }
  .section-header { align-items: start; flex-direction: column; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 28px, 1120px); }
  .mobile-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 86px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(10, 10, 15, 0.96);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { text-align: center; }
  .nav-cta { width: 100%; }
  .hero-actions { flex-direction: column; }
  .primary-btn, .secondary-btn { width: 100%; }
}


/* Revenue dashboard additions */
.app-main { min-height: calc(100vh - 80px); }
.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  border-radius: 30px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.32);
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 0%, rgba(139, 92, 246, 0.2), transparent 36%);
  pointer-events: none;
}
.auth-shell { padding: 70px 0 80px; }
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: stretch;
}
.auth-card, .auth-side { padding: 30px; }
.auth-card h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
.auth-copy, .hero-subtitle {
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 720px;
}
.login-form {
  display: grid;
  gap: 12px;
  margin-top: 30px;
  max-width: 520px;
}
.login-form label { color: var(--text-secondary); font-weight: 750; }
.login-form input {
  min-height: 54px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  padding: 0 16px;
  font: inherit;
  outline: none;
}
.login-form input:focus { border-color: rgba(167, 139, 250, 0.72); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14); }
.full-btn { width: 100%; border: 0; cursor: pointer; font: inherit; }
.secondary-btn { cursor: pointer; font: inherit; }
.secondary-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.form-status { min-height: 22px; color: var(--primary-light); margin: 4px 0 0; }
.auth-side { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.auth-side img { width: 74px; height: 74px; border-radius: 22px; box-shadow: 0 0 34px rgba(139,92,246,.42); }
.auth-side p { color: var(--text-secondary); line-height: 1.7; }
.mini-list { display: grid; gap: 10px; margin-top: 10px; }
.mini-list span {
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid rgba(139,92,246,.18);
  background: rgba(255,255,255,.045);
  color: var(--text-secondary);
}
.dashboard-view { padding: 64px 0 80px; }
.dashboard-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.top-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.danger-lite { border-color: rgba(248, 113, 113, 0.25); }
.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  color: var(--text-secondary);
}
.status-strip span { font-weight: 700; color: var(--text-primary); }
.status-strip small { color: var(--text-muted); }
.revenue-shell { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.revenue-card strong { font-size: clamp(1.65rem, 4vw, 2.25rem); }
.data-grid { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: 18px; }
.table-card { padding: 24px; }
.wide-card { min-width: 0; }
.compact-header { margin-bottom: 16px; }
.compact-header .section-title h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); }
.compact-header .section-title p { font-size: .96rem; margin-top: 8px; }
.table-wrap { overflow: auto; position: relative; z-index: 1; border-radius: 18px; border: 1px solid rgba(139,92,246,.16); }
table { width: 100%; border-collapse: collapse; min-width: 560px; background: rgba(0,0,0,.13); }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
th { color: var(--primary-light); font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; background: rgba(139,92,246,.09); }
td { color: var(--text-secondary); font-size: .95rem; }
tr:last-child td { border-bottom: 0; }
.money-cell { color: var(--text-primary); font-weight: 800; white-space: nowrap; }
.status-cell { color: #c4b5fd; font-weight: 750; text-transform: capitalize; }
.empty-cell { color: var(--text-muted); text-align: center; padding: 24px 14px; }
button.primary-btn, button.secondary-btn { border: 1px solid rgba(139, 92, 246, 0.28); }
button.primary-btn { border-color: transparent; }

@media (max-width: 1100px) {
  .revenue-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; }
  .dashboard-top { align-items: start; flex-direction: column; }
  .top-actions, .top-actions button { width: 100%; }
  .status-strip { flex-direction: column; }
}
@media (max-width: 620px) {
  .auth-card, .auth-side, .table-card { padding: 20px; border-radius: 24px; }
  .revenue-shell { grid-template-columns: 1fr; }
  table { min-width: 720px; }
}

/* Account access additions */
.auth-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin-top: 24px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}
.auth-tab {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: var(--text-secondary);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.auth-tab:hover,
.auth-tab.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(139, 92, 246, .88), rgba(124, 58, 237, .88));
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.24);
}
.label-muted {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .86em;
}
.form-status[data-tone="error"] { color: #fca5a5; }
.user-badge {
  display: inline-flex;
  margin: 14px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: var(--primary-light);
  background: rgba(139, 92, 246, 0.1);
  font-weight: 750;
}

@media (max-width: 620px) {
  .auth-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; border-radius: 18px; }
  .auth-tab { width: 100%; border-radius: 14px; }
}

/* Polished account screen */
body.auth-active .navbar,
body.auth-active .footer {
  display: none;
}

body.auth-active .app-main {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  padding: 34px 0 28px;
  display: flex;
  align-items: center;
}

.auth-page {
  display: grid;
  gap: 28px;
}

.auth-brand {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  font-weight: 900;
  letter-spacing: -0.06em;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  color: var(--text-primary);
  text-shadow: 0 0 26px rgba(139, 92, 246, 0.18);
}

.auth-brand-accent {
  margin-left: 6px;
  background: linear-gradient(135deg, var(--primary-light), #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.86fr);
  gap: 26px;
  align-items: center;
}

.auth-info-panel,
.auth-panel {
  border-color: rgba(167, 139, 250, 0.22);
  background:
    radial-gradient(circle at 72% 94%, rgba(139, 92, 246, 0.24), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.032));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-info-panel {
  min-height: 610px;
  padding: clamp(28px, 4.4vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-info-panel h1 {
  max-width: 720px;
  margin-top: 18px;
  font-size: clamp(2.45rem, 5.2vw, 4.55rem);
  line-height: 0.96;
}

.auth-info-panel .auth-copy {
  max-width: 690px;
  margin: 18px 0 0;
  font-size: 1.05rem;
}

.auth-feature-list {
  display: grid;
  gap: 18px;
  margin-top: 34px;
  max-width: 620px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-weight: 650;
}

.auth-feature-icon,
.access-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #ddd6fe;
  border: 1px solid rgba(167, 139, 250, 0.24);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(37, 99, 235, 0.18));
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.24);
  font-weight: 900;
}

.access-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 42px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.access-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.access-strip p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.access-link,
.auth-switch-note button {
  border: 0;
  background: transparent;
  color: var(--primary-light);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.access-link:hover,
.auth-switch-note button:hover {
  color: var(--text-primary);
}

.auth-panel {
  padding: clamp(18px, 2.5vw, 30px);
}

.auth-panel-content {
  position: relative;
  z-index: 1;
  padding: clamp(18px, 2.4vw, 28px) 8px 2px;
}

.auth-panel .auth-tabs {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(5, 8, 22, 0.5);
}

.auth-panel .auth-tab {
  min-height: 52px;
  border-radius: 13px;
  font-size: 0.98rem;
}

.auth-panel .auth-tab.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.74), rgba(37, 99, 235, 0.34));
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.form-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.form-heading p {
  margin: 10px 0 10px;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-panel .login-form {
  max-width: none;
  margin-top: 0;
  gap: 12px;
}

.auth-panel .login-form label {
  margin-top: 6px;
  color: #dbe3f2;
  font-size: 0.94rem;
}

.auth-panel .login-form input {
  min-height: 56px;
  border-radius: 16px;
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(6, 10, 27, 0.74);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.auth-panel .login-form input::placeholder {
  color: rgba(209, 213, 219, 0.48);
}

.auth-panel .full-btn {
  min-height: 56px;
  margin-top: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #a855f7, #7c3aed 52%, #5b7cfa);
  box-shadow: 0 18px 44px rgba(139, 92, 246, 0.34);
}

.auth-switch-note {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  text-align: center;
}

.form-status {
  position: relative;
  z-index: 1;
  min-height: 24px;
  margin: 14px 8px 0;
  text-align: center;
  font-weight: 750;
}

.form-status:empty {
  margin-top: 0;
  min-height: 0;
}

.auth-footerline {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-footerline a {
  color: var(--text-secondary);
}

.auth-footerline a:hover {
  color: var(--primary-light);
}

@media (max-width: 1080px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-info-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 22px 0;
    align-items: start;
  }
  .auth-layout {
    gap: 18px;
  }
  .auth-info-panel,
  .auth-panel {
    border-radius: 24px;
  }
  .access-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .access-link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 460px) {
  .auth-info-panel,
  .auth-panel {
    padding: 22px;
  }
  .auth-info-panel h1 {
    font-size: 2.35rem;
  }
  .auth-feature-item {
    align-items: flex-start;
  }
}
