:root {
  --ref-bg: #050815;
  --ref-bg-soft: #091226;
  --ref-panel: rgba(11, 18, 35, 0.76);
  --ref-panel-strong: rgba(12, 21, 40, 0.88);
  --ref-panel-soft: rgba(16, 26, 48, 0.56);
  --ref-border: rgba(132, 188, 255, 0.14);
  --ref-border-strong: rgba(150, 203, 255, 0.24);
  --ref-text: #edf4ff;
  --ref-muted: #90a5c5;
  --ref-accent: #7c3aed;
  --ref-accent-2: #2563eb;
  --ref-cyan: #67e4ff;
  --ref-royal: #4f7cff;
  --ref-green: #34d399;
  --ref-orange: #f59e0b;
  --ref-pink: #f472b6;
  --ref-shadow: 0 24px 70px rgba(2, 8, 22, 0.45);
}

* { box-sizing: border-box; }

.ref-portal-body,
.ref-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ref-text);
  background:
    linear-gradient(180deg, rgba(4, 8, 18, 0.26), rgba(4, 8, 18, 0.88)),
    radial-gradient(circle at 10% 10%, rgba(78, 124, 255, 0.26), transparent 0 20%),
    radial-gradient(circle at 88% 12%, rgba(155, 92, 255, 0.2), transparent 0 18%),
    radial-gradient(circle at 64% 88%, rgba(96, 225, 255, 0.08), transparent 0 20%),
    linear-gradient(180deg, #050815 0%, #091225 45%, #060d1a 100%);
  overflow-x: hidden;
}

.ref-portal-bg,
.ref-bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}

.ref-portal-body:not(.ref-cabinet-body) .ref-portal-bg,
.ref-body .ref-bg-glow {
  background:
    radial-gradient(ellipse 60% 36% at 12% 0%, rgba(85, 92, 255, 0.18), transparent 54%),
    radial-gradient(ellipse 42% 26% at 96% 14%, rgba(155, 92, 255, 0.16), transparent 50%),
    linear-gradient(rgba(104, 154, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 154, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 95%);
}

.glass-shell {
  background: linear-gradient(180deg, rgba(12, 20, 39, 0.82), rgba(7, 13, 24, 0.74));
  border: 1px solid var(--ref-border);
  box-shadow: var(--ref-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ref-portal-nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: min(1460px, calc(100vw - 28px));
  margin: 20px auto 0;
  padding: 16px 20px;
  border-radius: 24px;
}

.ref-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ref-text);
  text-decoration: none;
}

.ref-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ref-accent), var(--ref-accent-2));
  box-shadow: 0 0 26px rgba(124, 58, 237, 0.28);
  font-weight: 900;
}

.ref-brand-copy {
  display: grid;
  gap: 2px;
}

.ref-brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.ref-brand-copy small {
  color: var(--ref-muted);
  font-size: 0.78rem;
}

.ref-portal-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.ref-portal-links a,
.ref-portal-actions a {
  color: var(--ref-muted);
  text-decoration: none;
}

.ref-portal-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.ref-portal-links a:hover,
.ref-portal-links a.is-active {
  transform: translateY(-1px);
  color: var(--ref-text);
  background: linear-gradient(135deg, rgba(82, 126, 255, 0.2), rgba(150, 93, 255, 0.14));
  border-color: rgba(142, 197, 255, 0.2);
  box-shadow: 0 0 22px rgba(83, 128, 255, 0.14);
}

.ref-portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.ref-topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(9, 16, 31, 0.66);
  border: 1px solid rgba(131, 188, 255, 0.1);
}

.ref-topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(76, 124, 255, 0.84), rgba(148, 93, 255, 0.76));
  font-weight: 800;
  color: #fff;
}

.ref-topbar-copy {
  display: grid;
  gap: 3px;
}

.ref-topbar-copy strong {
  font-size: 0.92rem;
}

.ref-topbar-copy span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ref-muted);
  font-size: 0.78rem;
}

.ref-topbar-copy span i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43d37d;
  box-shadow: 0 0 12px rgba(67, 211, 125, 0.55);
}

.ref-portal-main,
.ref-shell,
.ref-landing {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.ref-kicker {
  color: #a9bdf9;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

.ref-muted {
  color: var(--ref-muted);
  line-height: 1.6;
}

.ref-error,
.ref-status-banner.is-error {
  color: #ffd7db;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.22);
  margin-bottom: 16px;
}

.ref-btn,
.ref-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: none;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ref-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--ref-accent), var(--ref-accent-2));
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.28);
}

.ref-btn:hover,
.ref-ghost-btn:hover {
  transform: translateY(-1px);
}

.ref-ghost-btn {
  color: var(--ref-text);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--ref-border);
}

.ref-form { display: grid; gap: 12px; }
.ref-form label { display: grid; gap: 6px; font-size: 0.85rem; color: #cbd5e1; }
.ref-form input, .ref-form textarea, .ref-form select,
.ref-link-box, .ref-form-inline input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--ref-border);
  background: rgba(6, 12, 24, 0.62);
  color: var(--ref-text);
}

.ref-form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.ref-tier-badge,
.ref-pill,
.ref-quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ref-border);
  background: rgba(8, 16, 31, 0.55);
  font-weight: 700;
  white-space: nowrap;
}

.ref-pill {
  color: #dce9ff;
  font-size: 0.82rem;
}

.ref-pill.is-accent {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(167, 139, 250, 0.32);
}

.ref-tier-badge.is-bronze { border-color: rgba(205, 127, 50, 0.5); }
.ref-tier-badge.is-silver { border-color: rgba(148, 163, 184, 0.5); }
.ref-tier-badge.is-gold { border-color: rgba(251, 191, 36, 0.55); color: #fde68a; }
.ref-tier-badge.is-platinum { border-color: rgba(167, 139, 250, 0.6); }

.ref-quality-badge.is-excellent { background: rgba(16,185,129,.18); color: #86efac; }
.ref-quality-badge.is-good { background: rgba(59,130,246,.18); color: #93c5fd; }
.ref-quality-badge.is-medium { background: rgba(251,191,36,.14); color: #fde68a; }
.ref-quality-badge.is-risk { background: rgba(251,146,60,.14); color: #fdba74; }
.ref-quality-badge.is-fraud_risk { background: rgba(248,113,113,.14); color: #fca5a5; }

.ref-card {
  border-radius: 26px;
  border: 1px solid var(--ref-border);
  background: linear-gradient(180deg, rgba(13, 21, 40, 0.78), rgba(8, 13, 24, 0.7));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 24px;
  box-shadow: var(--ref-shadow);
}

.ref-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.ref-card-head h3 {
  margin: 6px 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.ref-hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 22px;
  margin-bottom: 22px;
  width: 100%;
}

.ref-hub-copy,
.ref-hub-visual {
  border-radius: 34px;
  padding: 30px;
  border: 1px solid var(--ref-border);
  background: linear-gradient(180deg, rgba(11, 18, 35, 0.76), rgba(7, 13, 24, 0.68));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--ref-shadow);
  position: relative;
  overflow: hidden;
}

.ref-hub-copy::before,
.ref-hub-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 8%, rgba(84, 124, 255, 0.16), transparent 0 24%),
    radial-gradient(circle at 92% 88%, rgba(154, 93, 255, 0.14), transparent 0 24%);
  pointer-events: none;
}

.ref-hero-headline,
.ref-hero-highlights,
.ref-gamification-bar,
.ref-dash-actions,
.ref-dashboard-art,
.ref-floating-chip,
.ref-visual-orbit {
  position: relative;
  z-index: 1;
}

.ref-hero-headline {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.ref-hero-title {
  font-size: clamp(2.4rem, 4vw, 4rem);
  margin: 0;
  line-height: .94;
  letter-spacing: -0.05em;
}

.ref-hero-subtitle {
  margin: 14px 0 0;
  color: var(--ref-muted);
  line-height: 1.85;
  font-size: 1.02rem;
  max-width: 720px;
}

.ref-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ref-hero-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.ref-highlight-card {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(138, 193, 255, 0.16);
  background: rgba(8, 15, 29, 0.66);
  box-shadow: 0 18px 40px rgba(3, 10, 24, 0.24);
}

.ref-highlight-card.is-earnings {
  background: linear-gradient(135deg, rgba(58, 117, 255, 0.24), rgba(7, 14, 28, 0.84));
}

.ref-highlight-card.is-growth {
  background: linear-gradient(135deg, rgba(150, 92, 255, 0.18), rgba(7, 14, 28, 0.84));
}

.ref-highlight-label {
  display: block;
  color: var(--ref-muted);
  font-size: .84rem;
  margin-bottom: 10px;
}

.ref-highlight-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.ref-highlight-note {
  color: var(--ref-muted);
  font-size: .92rem;
}

.ref-gamification-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.ref-game-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(139, 195, 255, 0.14);
  background: rgba(8, 15, 29, 0.62);
}

.ref-game-chip span { font-size: 1rem; }

.ref-dashboard-art {
  position: relative;
  border-radius: 30px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(9, 16, 31, 0.88), rgba(6, 11, 22, 0.8));
  border: 1px solid rgba(138, 193, 255, 0.14);
  box-shadow: 0 24px 70px rgba(3, 10, 24, 0.48), 0 0 36px rgba(85, 126, 255, 0.12);
}

.ref-dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.ref-dashboard-kicker {
  display: block;
  color: #7ea8ff;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.ref-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 27, 45, 0.76);
  border: 1px solid rgba(132, 188, 255, 0.12);
  color: #dff0ff;
  font-size: 0.82rem;
}

.ref-online-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43d37d;
  box-shadow: 0 0 14px rgba(67, 211, 125, 0.55);
}

.ref-dashboard-widgets {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.ref-dashboard-widget {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(132, 188, 255, 0.12);
  background: rgba(11, 18, 35, 0.86);
  min-height: 120px;
}

.ref-dashboard-widget.is-big {
  min-height: 174px;
}

.ref-dashboard-widget.is-ring {
  display: grid;
  align-content: center;
}

.ref-widget-label {
  display: block;
  color: var(--ref-muted);
  font-size: .84rem;
}

.ref-widget-value {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.ref-progress-ring {
  --progress: 50%;
  width: 128px;
  height: 128px;
  margin: 14px auto 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(7, 13, 24, 0.98) 55%, transparent 56%),
    conic-gradient(var(--ref-cyan) 0 var(--progress), rgba(134, 147, 171, 0.18) var(--progress) 100%);
  box-shadow: inset 0 0 24px rgba(83, 129, 255, 0.16), 0 0 30px rgba(98, 197, 255, 0.14);
}

.ref-progress-ring strong {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.ref-micro-line {
  display: grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 8px;
  height: 72px;
  margin-top: 18px;
}

.ref-micro-line span,
.ref-kpi-bars span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(103, 228, 255, 0.95), rgba(79, 124, 255, 0.75));
  box-shadow: 0 0 16px rgba(103, 228, 255, 0.18);
}

.ref-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.ref-kpi-card {
  position: relative;
  overflow: hidden;
  padding: 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(132, 188, 255, 0.14);
  background: linear-gradient(180deg, rgba(12, 20, 39, 0.82), rgba(7, 13, 24, 0.7));
  box-shadow: var(--ref-shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.ref-kpi-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 56px rgba(3, 10, 24, 0.42);
  border-color: var(--ref-border-strong);
}

.ref-kpi-card::before {
  content: "";
  position: absolute;
  inset: auto -22% -50% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .9;
}

.ref-kpi-card.is-blue::before { background: radial-gradient(circle, rgba(87, 146, 255, 0.28), transparent 72%); }
.ref-kpi-card.is-violet::before { background: radial-gradient(circle, rgba(154, 97, 255, 0.28), transparent 72%); }
.ref-kpi-card.is-cyan::before { background: radial-gradient(circle, rgba(103, 228, 255, 0.28), transparent 72%); }
.ref-kpi-card.is-green::before { background: radial-gradient(circle, rgba(52, 211, 153, 0.24), transparent 72%); }
.ref-kpi-card.is-orange::before { background: radial-gradient(circle, rgba(245, 158, 11, 0.26), transparent 72%); }
.ref-kpi-card.is-pink::before { background: radial-gradient(circle, rgba(244, 114, 182, 0.24), transparent 72%); }
.ref-kpi-card.is-emerald::before { background: radial-gradient(circle, rgba(16, 185, 129, 0.26), transparent 72%); }
.ref-kpi-card.is-royal::before { background: radial-gradient(circle, rgba(79, 124, 255, 0.3), transparent 72%); }

.ref-kpi-label {
  display: block;
  color: var(--ref-muted);
  font-size: .82rem;
  margin-bottom: 10px;
}

.ref-kpi-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.ref-kpi-trend {
  display: inline-block;
  margin-top: 8px;
  color: #dceaff;
  font-size: .82rem;
}

.ref-kpi-bars {
  display: grid;
  grid-auto-flow: column;
  align-items: end;
  gap: 7px;
  height: 58px;
  margin-top: 16px;
}

.ref-split-row,
.ref-funnel-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.ref-charts-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.ref-chart-card canvas {
  width: 100% !important;
  height: 180px !important;
}

.ref-funnel-card,
.ref-link-card,
.ref-clients-card,
.ref-achievements-card,
.ref-activity-card,
.ref-side-score {
  min-height: 100%;
}

.ref-funnel-flow {
  display: grid;
  gap: 14px;
}

.ref-funnel-stage {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(8, 15, 29, 0.64);
  border: 1px solid rgba(131, 188, 255, 0.1);
}

.ref-funnel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ref-funnel-top strong {
  font-size: 1.1rem;
}

.ref-funnel-bar,
.ref-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.ref-funnel-bar span,
.ref-progress-bar span,
.ref-achievement-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ref-cyan), var(--ref-accent));
  box-shadow: 0 0 16px rgba(103, 228, 255, 0.2);
}

.ref-funnel-meta {
  margin-top: 10px;
  color: var(--ref-muted);
  font-size: 0.82rem;
}

.ref-link-box {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.ref-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ref-qr-wrap {
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 22px;
  margin-top: 16px;
}

.ref-qr-wrap svg,
.ref-qr-wrap img {
  max-width: 200px;
  height: auto;
}

.ref-qr-wrap--dark {
  background:
    radial-gradient(circle at 50% 20%, rgba(81, 129, 255, 0.14), transparent 0 32%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.98), rgba(7, 13, 24, 0.94));
  border: 1px solid rgba(139, 194, 255, 0.14);
}

.ref-link-note {
  margin-top: 12px;
  color: var(--ref-muted);
  font-size: .84rem;
  transition: color .2s ease;
}

.ref-link-note.is-copied {
  color: #9af7d0;
}

.ref-client-list,
.ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.ref-client-list li,
.ref-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.ref-client-list li:last-child,
.ref-list li:last-child {
  border-bottom: none;
}

.ref-client-amount {
  color: #dff0ff;
  font-weight: 800;
}

.ref-client-list li.is-empty {
  color: var(--ref-muted);
  justify-content: flex-start;
}

.ref-achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ref-achievement-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(131, 188, 255, 0.12);
  background: rgba(8, 15, 29, 0.62);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.ref-achievement-card.is-locked {
  opacity: .58;
  filter: saturate(.7);
}

.ref-achievement-card.is-unlocked {
  opacity: 1;
  box-shadow: 0 18px 40px rgba(3, 10, 24, 0.28);
}

.ref-achievement-card.is-bronze.is-unlocked { border-color: rgba(205, 127, 50, 0.42); box-shadow: 0 0 20px rgba(205, 127, 50, 0.12); }
.ref-achievement-card.is-silver.is-unlocked { border-color: rgba(189, 199, 212, 0.42); box-shadow: 0 0 20px rgba(189, 199, 212, 0.1); }
.ref-achievement-card.is-gold.is-unlocked { border-color: rgba(251, 191, 36, 0.5); box-shadow: 0 0 24px rgba(251, 191, 36, 0.16); }
.ref-achievement-card.is-epic.is-unlocked { border-color: rgba(167, 139, 250, 0.5); box-shadow: 0 0 24px rgba(167, 139, 250, 0.16); }
.ref-achievement-card.is-legendary.is-unlocked { border-color: rgba(103, 228, 255, 0.5); box-shadow: 0 0 28px rgba(103, 228, 255, 0.18); }

.ref-achievement-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(80, 133, 255, 0.26), rgba(156, 87, 255, 0.22));
  border: 1px solid rgba(140, 197, 255, 0.16);
}

.ref-achievement-card strong {
  display: block;
  margin-bottom: 6px;
}

.ref-achievement-card p {
  margin: 0;
  color: var(--ref-muted);
  line-height: 1.55;
  font-size: .9rem;
}

.ref-achievement-rarity {
  display: inline-flex;
  margin-top: 8px;
  color: #dce9ff;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ref-achievement-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.ref-timeline {
  display: grid;
  gap: 14px;
}

.ref-timeline-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.ref-timeline-item:last-child { border-bottom: none; }

.ref-timeline-item.is-unread .ref-timeline-icon {
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.28);
  border-color: rgba(167, 139, 250, 0.36);
}

.ref-timeline-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(11, 19, 36, 0.82);
  border: 1px solid rgba(132, 188, 255, 0.14);
  color: #dceaff;
  font-weight: 800;
}

.ref-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ref-timeline-head span {
  color: var(--ref-muted);
  font-size: .8rem;
  white-space: nowrap;
}

.ref-timeline-body p {
  margin: 0;
  color: var(--ref-muted);
  line-height: 1.65;
}

.ref-score-stack {
  display: grid;
  gap: 12px;
}

.ref-score-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(8, 15, 29, 0.64);
  border: 1px solid rgba(131, 188, 255, 0.1);
}

.ref-score-box span {
  display: block;
  color: var(--ref-muted);
  font-size: .84rem;
  margin-bottom: 8px;
}

.ref-score-box strong {
  display: block;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.ref-spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.ref-spotlight h3 {
  margin: 6px 0 8px;
}

.ref-table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--ref-border); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
.ref-table th, .ref-table td { padding: 10px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.1); text-align: left; }
.ref-table th { color: var(--ref-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ref-table-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ref-table-toolbar input { flex: 1; min-width: 180px; }

.ref-landing { padding: 32px 20px 64px; }
.ref-landing-hero { text-align: center; padding: 48px 20px; }
.ref-landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ref-landing-card {
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--ref-border);
  background: var(--ref-panel);
  backdrop-filter: blur(12px);
}
.ref-faq details {
  border: 1px solid var(--ref-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(2, 6, 23, 0.35);
}

.ref-success {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 8px;
}
.ref-required { color: #f87171; margin-left: 2px; }
.ref-admin-hint { font-size: 0.88rem; margin-top: 10px; }
.ref-admin-hint a { color: #a78bfa; }
.ref-card-wide { min-width: 0; }
.ref-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ref-status-badge.is-active {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.ref-status-badge.is-inactive {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.ref-partner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.ref-btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.ref-danger-text { color: #f87171 !important; }
.ref-delete-details summary { cursor: pointer; list-style: none; }
.ref-delete-details summary::-webkit-details-marker { display: none; }
.ref-delete-form {
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.25);
  min-width: 200px;
}
.ref-table tr.is-inactive-row { opacity: 0.72; }

.ref-onboarding-checklist { display: grid; gap: 10px; }
.ref-onboarding-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.45);
}
.ref-onboarding-step.is-done { border-color: rgba(52, 211, 153, 0.35); }
.ref-step-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(124, 58, 237, 0.25); font-weight: 800;
}

.ref-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .65s ease, transform .65s ease;
}

.ref-reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes refFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes refAmbient {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .9; }
  to { transform: translate3d(0, -14px, 0) scale(1.03); opacity: 1; }
}

.ref-hub-visual::after {
  content: "";
  position: absolute;
  inset: 18% 10% auto auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(154, 92, 255, 0.2), transparent 72%);
  filter: blur(16px);
  animation: refAmbient 10s ease-in-out infinite alternate;
  pointer-events: none;
}

.ref-visual-orbit {
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  border: 1px solid rgba(92, 136, 255, 0.12);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 36px rgba(84, 121, 255, 0.06), 0 0 42px rgba(74, 113, 255, 0.06);
}

.ref-visual-orbit--inner {
  width: 420px;
  height: 420px;
  border-color: rgba(145, 98, 255, 0.1);
}

.ref-floating-chip {
  position: absolute;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(132, 188, 255, 0.14);
  background: rgba(10, 17, 32, 0.78);
  box-shadow: 0 18px 40px rgba(3, 10, 24, 0.34);
  backdrop-filter: blur(16px);
  animation: refFloat 7s ease-in-out infinite;
}

.ref-floating-chip strong {
  display: block;
  margin-bottom: 6px;
}

.ref-floating-chip small {
  color: var(--ref-muted);
}

.ref-floating-chip.is-automation { left: 12px; top: 86px; }
.ref-floating-chip.is-level { right: 12px; top: 126px; animation-delay: -2s; }
.ref-floating-chip.is-source { left: 42px; bottom: 94px; animation-delay: -3.6s; }

.ref-floating-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(80, 133, 255, 0.28), rgba(156, 87, 255, 0.22));
  margin-bottom: 10px;
}

@media (max-width: 1240px) {
  .ref-hub-hero,
  .ref-charts-row,
  .ref-split-row,
  .ref-funnel-layout,
  .ref-contact-layout {
    grid-template-columns: 1fr;
  }

  .ref-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ref-achievements-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .ref-portal-nav {
    flex-direction: column;
    align-items: stretch;
    top: 10px;
    width: min(100vw - 20px, 100%);
  }

  .ref-portal-links {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .ref-portal-actions {
    margin-left: 0;
    justify-content: space-between;
  }

  .ref-hub-hero {
    grid-template-columns: 1fr;
  }

  .ref-hero-highlights,
  .ref-charts-row,
  .ref-split-row,
  .ref-dashboard-widgets,
  .ref-funnel-layout,
  .ref-kpi-grid,
  .ref-achievements-grid,
  .ref-contact-layout {
    grid-template-columns: 1fr;
  }

  .ref-dashboard-widgets {
    grid-template-columns: 1fr;
  }

  .ref-dashboard-widget.is-big,
  .ref-dashboard-widget.is-ring {
    min-height: 0;
  }

  .ref-charts-row,
  .ref-split-row,
  .ref-dashboard-widgets,
  .ref-dashboard-widget,
  .ref-hub-visual,
  .ref-dashboard-art {
    min-width: 0;
  }

  .ref-topbar-profile {
    flex: 1;
  }
}

@media (max-width: 720px) {
  .ref-portal-main,
  .ref-shell,
  .ref-landing {
    width: min(100vw - 20px, 100%);
    padding: 18px 0 32px;
  }

  .ref-hub-copy,
  .ref-hub-visual,
  .ref-card,
  .ref-spotlight {
    padding: 20px;
  }

  .ref-hub-visual {
    overflow: visible;
  }

  .ref-visual-orbit,
  .ref-floating-chip {
    display: none;
  }

  .ref-kpi-grid {
    grid-template-columns: 1fr;
  }

  .ref-spotlight {
    flex-direction: column;
    align-items: stretch;
  }

  .ref-timeline-item {
    grid-template-columns: 1fr;
  }

  .ref-timeline-icon {
    width: 36px;
    height: 36px;
  }

  .ref-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ref-link-actions,
  .ref-dash-actions,
  .ref-gamification-bar,
  .ref-hero-badges {
    width: 100%;
  }

  .ref-btn,
  .ref-ghost-btn {
    width: 100%;
  }
}
