:root {
  --bg: #030305;
  --surface: #0a0a10;
  --card: #0f0f16;
  --card-hover: #14141e;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(251, 191, 36, 0.35);
  --text: #fafafa;
  --muted: rgba(255, 255, 255, 0.5);
  --gold: #fbbf24;
  --orange: #f97316;
  --purple: #a78bfa;
  --blue: #60a5fa;
  --green: #34d399;
  --radius: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page-pad: clamp(16px, 2.5vw, 40px);
  --shell-w: min(1180px, calc(100vw - 2 * var(--page-pad)));
}

* { box-sizing: border-box; }

body.dash-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.dash-shell {
  width: var(--shell-w);
  margin: 0 auto;
  padding: calc(var(--site-header-h, 88px) + 24px) var(--page-pad) 64px;
}

.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 40vh;
  color: var(--muted);
  font-size: 14px;
}

.dash-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: dash-spin 0.7s linear infinite;
}

@keyframes dash-spin { to { transform: rotate(360deg); } }

.dash-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.dash-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.dash-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 52ch;
}

.dash-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  max-width: 42ch;
}

.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, background 0.2s;
}

.dash-btn-block { width: 100%; }

.dash-btn-primary {
  background: linear-gradient(135deg, #ea580c, #fbbf24);
  color: #0a0a0a;
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.28);
}

.dash-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.38);
  color: #0a0a0a;
  text-decoration: none;
}

.dash-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.dash-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
  color: var(--text);
  text-decoration: none;
}

.dash-text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
}

.dash-text-link:hover { text-decoration: underline; }

/* Guest state */
.dash-guest-hero {
  text-align: center;
  padding: 32px 0 48px;
  max-width: 560px;
  margin: 0 auto;
}

.dash-guest-hero .dash-btn { margin-top: 24px; }

.dash-guest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.dash-guest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.dash-guest-card h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.dash-guest-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.dash-guest-icon {
  display: flex;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
}

.dash-guest-icon svg { width: 22px; height: 22px; }

/* Welcome band */
.dash-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.dash-welcome-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.dash-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.dash-user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-user-name {
  font-size: 14px;
  font-weight: 700;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-plan-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold);
  width: fit-content;
}

.dash-plan-pill.is-pro {
  background: rgba(167, 139, 250, 0.15);
  color: var(--purple);
}

/* Stats */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: border-color 0.2s;
}

.dash-stat-card:hover { border-color: rgba(255, 255, 255, 0.12); }

.dash-stat-coins {
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.06), var(--card));
}

.dash-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-stat-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.dash-stat-link:hover { text-decoration: underline; }

.dash-stat-value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.dash-stat-plan { font-size: 1.35rem; }

.dash-stat-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.dash-coin-bar {
  margin-top: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dash-coin-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  width: 0%;
  transition: width 0.5s var(--ease);
}

/* Layout columns */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .dash-columns { grid-template-columns: 1fr; }
}

.dash-section { margin-bottom: 36px; }

.dash-section-head { margin-bottom: 16px; }

.dash-section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.dash-section-title {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dash-section-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Quick actions */
.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.dash-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}

.dash-action:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--card-hover);
  text-decoration: none;
  color: inherit;
}

.dash-action-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-action-icon svg { width: 22px; height: 22px; }

.dash-action-icon--gold { background: rgba(251, 191, 36, 0.12); color: var(--gold); }
.dash-action-icon--orange { background: rgba(249, 115, 22, 0.12); color: var(--orange); }
.dash-action-icon--purple { background: rgba(167, 139, 250, 0.12); color: var(--purple); }
.dash-action-icon--blue { background: rgba(96, 165, 250, 0.12); color: var(--blue); }
.dash-action-icon--green { background: rgba(52, 211, 153, 0.12); color: var(--green); }
.dash-action-icon--muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

.dash-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dash-action-text strong {
  font-size: 14px;
  font-weight: 700;
}

.dash-action-text span {
  font-size: 12px;
  color: var(--muted);
}

/* Recent grid — reuse community card sizing */
.dash-recent-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.dash-recent-grid .cg-card { border-radius: 12px; }

.dash-recent-empty {
  text-align: center;
  padding: 32px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.dash-recent-empty p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Sidebar panels */
.dash-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.dash-panel-beta {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.05), var(--card));
}

.dash-panel-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dash-panel-copy {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.dash-panel-copy strong { color: var(--gold); }

.dash-dl { margin: 0; }

.dash-dl-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.dash-dl-row:last-of-type { border-bottom: none; }

.dash-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.dash-dl dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
  max-width: 58%;
}

.dash-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
