.portal-page {
  min-height: 100vh;
  background: #08060b !important;
}

.portal-page [hidden] { display: none !important; }

.portal-page::before,
.portal-page::after { display: none; }

.portal-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 12%, rgba(198,28,255,.16), transparent 30%),
    radial-gradient(circle at 86% 72%, rgba(105,18,145,.12), transparent 34%),
    linear-gradient(rgba(230,155,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,155,255,.025) 1px, transparent 1px);
  background-size: auto, auto, 84px 84px, 84px 84px;
}

.portal-topbar {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.portal-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(205,50,255,.35));
}

.portal-back,
.sidebar-bottom a {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}

.portal-back:hover,
.sidebar-bottom a:hover { color: #fff; }

.portal-eyebrow {
  display: block;
  color: #e49aff;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 136px 0 12vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .72fr);
  align-items: center;
  gap: clamp(56px, 9vw, 130px);
}

.login-copy h1 {
  margin: 20px 0 26px;
  color: #fff;
  font-size: clamp(3.2rem, 6.5vw, 6.4rem);
  line-height: .94;
  letter-spacing: 0 !important;
}

.login-copy h1 span {
  color: transparent;
  background: linear-gradient(110deg, #a917e5, #ed83ff 52%, #a917e5);
  -webkit-background-clip: text;
  background-clip: text;
}

.login-copy > p {
  max-width: 600px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

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

.login-proof div {
  padding: 18px 0;
  border-top: 1px solid rgba(232,160,255,.18);
}

.login-proof strong,
.login-proof span { display: block; }
.login-proof strong { color: #fff; font-size: .9rem; }
.login-proof span { margin-top: 5px; color: var(--muted-dim); font-size: .78rem; }

.login-panel {
  padding: 42px;
  border: 1px solid rgba(232,160,255,.16);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(31,22,39,.92), rgba(14,10,18,.88));
  box-shadow: 0 36px 100px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
}

.login-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232,160,255,.2);
  border-radius: 50%;
  background: rgba(198,28,255,.08);
  box-shadow: 0 0 34px rgba(198,28,255,.12);
}
.login-mark img { width: 54px; height: 54px; object-fit: contain; }
.login-panel h2 { margin: 10px 0 14px; font-size: 2rem; letter-spacing: 0 !important; }
.login-panel > p { color: var(--muted); font-size: .9rem; line-height: 1.7; }

.discord-login {
  width: 100%;
  min-height: 54px;
  margin-top: 28px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  color: #fff;
  background: #5865f2;
  box-shadow: 0 14px 34px rgba(88,101,242,.22), inset 0 1px 0 rgba(255,255,255,.22);
  font-weight: 750;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.discord-login:hover { color: #fff; background: #6874f5; transform: translateY(-2px); box-shadow: 0 18px 42px rgba(88,101,242,.3); }
.discord-login:active { transform: scale(.98); }
.discord-symbol { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #5865f2; font-size: .75rem; font-weight: 900; }
.login-panel .login-fineprint { margin-top: 18px; color: var(--muted-dim); font-size: .72rem; line-height: 1.55; }
.login-alert { margin-top: 18px; padding: 11px 13px; border: 1px solid rgba(255,100,130,.22); border-radius: 6px; background: rgba(255,70,105,.08); color: #ffb3c1; font-size: .78rem; }
.login-alert.is-success { color: #9ee5b0; border-color: rgba(90,220,120,.2); background: rgba(70,200,100,.07); }

.dashboard-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.dashboard-sidebar {
  position: fixed;
  inset: 94px auto 0 0;
  z-index: 4;
  width: 240px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(232,160,255,.1);
  background: rgba(10,7,13,.82);
  backdrop-filter: blur(28px);
}

.dashboard-nav { margin-top: 72px; display: grid; gap: 5px; }
.dashboard-nav-item {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #8f8397;
  background: transparent;
  font: 650 .84rem var(--font-body);
  text-align: left;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.dashboard-nav-item span { color: #65596c; font-size: .63rem; }
.dashboard-nav-item:hover { color: #fff; background: rgba(255,255,255,.035); transform: translateX(2px); }
.dashboard-nav-item.is-active { color: #f2c8ff; border-color: rgba(219,99,255,.14); background: rgba(198,28,255,.09); }
.dashboard-nav-item.is-active span { color: #d95cff; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 13px; padding: 20px 13px 0; border-top: 1px solid rgba(255,255,255,.07); }

.dashboard-main { grid-column: 2; min-width: 0; padding: 124px clamp(26px, 5vw, 76px) 72px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 54px; }
.dashboard-header h1 { margin-top: 8px; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: 0 !important; }

.profile-chip { min-width: 210px; padding: 8px 12px 8px 8px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(232,160,255,.13); border-radius: 7px; background: rgba(23,16,29,.72); }
.profile-chip img,
.profile-initial { width: 38px; height: 38px; border-radius: 6px; }
.profile-chip img { object-fit: cover; }
.profile-initial { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#c61cff,#7410a0); font-weight: 850; }
.profile-chip div { min-width: 0; }
.profile-chip strong,
.profile-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip strong { color: #fff; font-size: .8rem; }
.profile-chip div span { color: var(--muted-dim); font-size: .68rem; }

.dashboard-loading { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); }
.dashboard-loading > span { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,.1); border-top-color: #d94cff; border-radius: 50%; animation: portalSpin .8s linear infinite; }
@keyframes portalSpin { to { transform: rotate(360deg); } }
.dashboard-error { max-width: 560px; padding: 38px; border: 1px solid rgba(255,100,130,.16); background: rgba(255,70,105,.045); }
.dashboard-error p { margin: 10px 0 24px; color: var(--muted); }

.dashboard-view { display: none; }
.dashboard-view.is-active { display: block; animation: panelIn .35s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card {
  min-height: 152px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(232,160,255,.12);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(27,19,34,.9), rgba(14,10,18,.82));
  box-shadow: 0 18px 52px rgba(0,0,0,.23), inset 0 1px 0 rgba(255,255,255,.045);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.metric-card:hover { transform: translateY(-3px); border-color: rgba(226,123,255,.24); box-shadow: 0 24px 64px rgba(0,0,0,.32), 0 0 28px rgba(198,28,255,.05); }
.metric-card > span { color: var(--muted); font-size: .75rem; font-weight: 650; }
.metric-card strong { margin: 13px 0 auto; color: #fff; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1; }
.metric-card small { margin-top: 15px; color: var(--muted-dim); font-size: .67rem; }
.metric-featured { border-color: rgba(222,105,255,.23); background: linear-gradient(145deg, rgba(95,19,123,.42), rgba(21,13,27,.9)); }
.metric-featured strong { color: #f0b6ff; }

.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr); gap: 14px; }
.equal-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.dashboard-panel { padding: 26px; border: 1px solid rgba(232,160,255,.12); border-radius: 7px; background: rgba(18,13,23,.78); box-shadow: 0 18px 52px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading span { display: block; margin-bottom: 5px; color: #a697af; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }
.panel-heading h2 { font-size: 1.15rem; letter-spacing: 0 !important; }
.panel-heading button { border: 0; color: #d989f3; background: transparent; font: 650 .72rem var(--font-body); }

.activity-list,
.data-list { display: grid; }
.activity-row,
.data-row { min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; border-top: 1px solid rgba(255,255,255,.065); }
.activity-row:first-child,
.data-row:first-child { border-top: 0; }
.row-copy { min-width: 0; }
.row-copy strong,
.row-copy span { display: block; }
.row-copy strong { overflow: hidden; color: #f8f2fa; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.row-copy span { margin-top: 5px; color: var(--muted-dim); font-size: .68rem; }
.row-value { text-align: right; }
.row-value strong,
.row-value span { display: block; }
.row-value strong { color: #efd2f7; font-size: .82rem; }
.row-value span { margin-top: 5px; color: var(--muted-dim); font-size: .64rem; text-transform: capitalize; }
.status-voided,
.status-reversed { color: #ff9bb0 !important; text-decoration: line-through; }
.empty-state { padding: 42px 10px; color: var(--muted-dim); font-size: .78rem; text-align: center; }

.referral-mini > p { color: var(--muted); font-size: .8rem; line-height: 1.65; }
.referral-code { margin-top: 24px; padding: 12px 12px 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px dashed rgba(232,160,255,.22); border-radius: 6px; background: rgba(198,28,255,.055); }
.referral-code span { color: #f0c1ff; font: 750 .84rem var(--font-body); }
.referral-code button,
.copy-referral { padding: 8px 12px; border: 1px solid rgba(232,160,255,.17); border-radius: 5px; color: #fff; background: rgba(198,28,255,.14); font: 700 .68rem var(--font-body); transition: background .2s ease, transform .2s ease; }
.referral-code button:hover,
.copy-referral:hover { background: rgba(198,28,255,.24); transform: translateY(-1px); }
.referral-mini-stats { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid rgba(255,255,255,.07); }
.referral-mini-stats div { padding-top: 18px; }
.referral-mini-stats strong,
.referral-mini-stats span { display: block; }
.referral-mini-stats strong { color: #fff; font-size: 1.2rem; }
.referral-mini-stats span { margin-top: 4px; color: var(--muted-dim); font-size: .64rem; }

.section-intro { margin-bottom: 32px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-intro h2 { margin-top: 8px; font-size: clamp(2rem,4vw,3.2rem); letter-spacing: 0 !important; }
.section-intro > p { max-width: 480px; color: var(--muted); font-size: .84rem; line-height: 1.7; }
.metric-grid-compact { margin-bottom: 14px; }
.metric-grid-compact .metric-card { min-height: 116px; }
.referral-hero-panel { margin-bottom: 14px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid rgba(230,143,255,.2); border-radius: 7px; background: linear-gradient(110deg, rgba(102,19,132,.42), rgba(25,15,32,.88)); }
.referral-hero-panel span,
.referral-hero-panel strong { display: block; }
.referral-hero-panel span { color: #c5b3cb; font-size: .68rem; }
.referral-hero-panel strong { margin-top: 7px; max-width: 62vw; overflow: hidden; color: #fff; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.referral-people-panel { margin-top: 14px; }

.portal-toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 12px 16px; border: 1px solid rgba(230,143,255,.22); border-radius: 6px; color: #fff; background: rgba(20,13,26,.96); box-shadow: 0 18px 50px rgba(0,0,0,.42); font-size: .76rem; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.portal-toast.is-visible { opacity: 1; transform: none; }
.form-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

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

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; padding-top: 118px; }
  .login-copy { text-align: center; }
  .login-copy > p { margin-inline: auto; }
  .dashboard-shell { display: block; padding-top: 78px; }
  .dashboard-sidebar { position: sticky; top: 78px; width: 100%; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid rgba(232,160,255,.1); }
  .dashboard-sidebar .portal-brand span,
  .sidebar-bottom { display: none; }
  .dashboard-nav { margin: 0 0 0 auto; display: flex; gap: 2px; }
  .dashboard-nav-item { width: 42px; min-height: 40px; padding: 0; justify-content: center; font-size: 0; }
  .dashboard-nav-item span { font-size: .66rem; }
  .dashboard-main { padding: 28px 18px 60px; }
  .dashboard-header { margin-bottom: 34px; }
}

@media (max-width: 560px) {
  .portal-topbar,
  .login-shell { width: min(100% - 32px, 1180px); }
  .login-shell { gap: 44px; }
  .login-copy h1 { font-size: clamp(2.7rem, 14vw, 4.2rem); }
  .login-proof { grid-template-columns: 1fr; }
  .login-panel { padding: 28px 22px; }
  .profile-chip { min-width: 0; padding: 7px; }
  .profile-chip div { display: none; }
  .dashboard-header { align-items: flex-start; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; }
  .section-intro { display: block; }
  .section-intro > p { margin-top: 15px; }
  .dashboard-panel { padding: 20px; }
  .referral-hero-panel { align-items: flex-start; flex-direction: column; }
  .referral-hero-panel strong { max-width: calc(100vw - 78px); }
}
