/* =========================================================
   dashboard.css — BloomAgent referral dashboard styles
   Design tokens from theme.css apply everywhere.
   ========================================================= */

/* ── Layout ──────────────────────────────────────────────── */
.dash-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
}

.dash-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.dash-greeting {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.dash-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dash-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 65px);
  padding: 2rem 1.5rem;
}

/* ── Section titles ──────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* ── Tier banner ─────────────────────────────────────────── */
.tier-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1px solid transparent;
  flex-wrap: wrap;
}

.tier-banner.tier-bronze {
  background: linear-gradient(135deg, rgba(180,120,60,0.15), rgba(180,120,60,0.05));
  border-color: rgba(180,120,60,0.25);
}
.tier-banner.tier-silver {
  background: linear-gradient(135deg, rgba(160,170,185,0.15), rgba(160,170,185,0.05));
  border-color: rgba(160,170,185,0.25);
}
.tier-banner.tier-gold {
  background: linear-gradient(135deg, rgba(212,165,116,0.2), rgba(212,165,116,0.05));
  border-color: rgba(212,165,116,0.35);
}

.tier-banner-left { display: flex; align-items: center; gap: 1rem; }
.tier-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: capitalize;
}
.tier-discount { font-size: 0.9rem; color: var(--fg-muted); margin: 0; }
.tier-discount strong { color: var(--fg); }

.tier-banner-right { flex: 1; min-width: 180px; }
.tier-next-label { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 0.5rem; }

.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ── Stats row ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--fg);
}
.stat-num.accent { color: var(--accent); }
.stat-num.muted  { color: var(--fg-muted); }
.stat-label { font-size: 0.8rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Link section ────────────────────────────────────────── */
.link-section {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.5rem;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.link-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--accent);
  word-break: break-all;
  font-family: 'DM Mono', monospace, var(--font-body);
}

.copy-btn {
  background: var(--accent-deep);
  color: var(--fg);
  border: none;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--accent); }
.copy-btn:active { transform: scale(0.97); }
.copy-btn.copied { background: #4a8c6a; }

.link-hint { font-size: 0.8rem; color: var(--fg-muted); }

/* ── Tiers ladder ────────────────────────────────────────── */
.tiers-section {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.5rem;
}
.tiers-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.tier-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.04);
  transition: border-color 0.2s;
}
.tier-row.active {
  border-color: var(--accent);
  background: rgba(212,165,116,0.06);
}
.tier-icon { font-size: 1.4rem; width: 2rem; text-align: center; }
.tier-info { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.tier-info strong { font-size: 0.95rem; font-weight: 600; }
.tier-req { font-size: 0.78rem; color: var(--fg-muted); }
.tier-reward { font-size: 0.85rem; color: var(--accent); white-space: nowrap; }
.tier-current-dot { color: var(--accent); font-size: 0.5rem; margin-left: 0.5rem; }

/* ── Referrals table ─────────────────────────────────────── */
.referrals-section {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 1.5rem;
}
.referrals-table-wrap { overflow-x: auto; }
.referrals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.referrals-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.referrals-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.referrals-table tr:last-child td { border-bottom: none; }
.muted { color: var(--fg-muted); }

.status-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}
.status-pending { background: rgba(212,165,116,0.15); color: var(--accent); }
.status-booked  { background: rgba(74,140,106,0.15); color: #6ec99a; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--fg-muted);
}

/* ── Join card ───────────────────────────────────────────── */
.join-card, .ref-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}

.join-badge, .ref-invite-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.join-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.join-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.join-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.8rem; color: var(--fg-muted); font-weight: 500; }
.field input {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: rgba(168,159,150,0.5); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: -0.01em;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.error-msg {
  background: rgba(201,135,143,0.15);
  border: 1px solid rgba(201,135,143,0.3);
  color: var(--rose);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Tier preview on join page */
.tier-preview { margin-top: 0.5rem; }
.tier-preview-label { font-size: 0.75rem; color: var(--fg-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; }
.tier-chips { display: flex; flex-direction: column; gap: 0.4rem; }
.tier-chip {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-elevated);
}
.tier-chip.bronze { border-left: 3px solid #b47840; }
.tier-chip.silver { border-left: 3px solid #a0aab9; }
.tier-chip.gold   { border-left: 3px solid var(--accent); }

/* ── Discount badge (ref landing) ────────────────────────── */
.discount-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(212,165,116,0.1);
  border: 1px solid rgba(212,165,116,0.25);
  border-radius: 12px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
}
.discount-pct {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}
.discount-label { font-size: 0.85rem; color: var(--fg-muted); }

/* ── Success card (after ref claim) ──────────────────────── */
.success-card {
  background: rgba(74,140,106,0.1);
  border: 1px solid rgba(74,140,106,0.25);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
}
.success-card h2 { font-family: var(--font-display); font-weight: 800; margin-bottom: 0.5rem; }
.success-card p { font-size: 0.9rem; color: var(--fg-muted); margin-bottom: 0.75rem; }

.discount-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.discount-code-box span {
  font-family: 'DM Mono', monospace, var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.discount-code-box button {
  background: var(--accent-deep);
  color: var(--fg);
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .tier-banner { flex-direction: column; align-items: flex-start; }
  .tier-banner-right { width: 100%; }
  .dash-main { padding: 1.5rem 1rem 3rem; }
}
