/* ==========================================================================
   Dashboard Refresh — Editorial Dark Design System
   Playfair Display + DM Sans · Warm gold accents · Refined texture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600;1,700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #090807;
  --bg-surface: #141211;
  --bg-elevated: #1c1a18;
  --bg-elevated-hover: #242220;
  --bg-card: #1a1816;
  --bg-card-hover: #22201d;
  --text-primary: #ece6df;
  --text-secondary: #a69e95;
  --text-muted: #736b63;
  --accent-gold: #d4a373;
  --accent-gold-light: #e8c99b;
  --accent-gold-dim: #8a764a;
  --accent-gold-glow: rgba(212, 163, 115, 0.08);
  --accent-gold-glow-strong: rgba(212, 163, 115, 0.18);
  --accent-emerald: #3d8a6a;
  --accent-emerald-bg: rgba(61, 138, 106, 0.1);
  --accent-coral: #c4545a;
  --accent-coral-bg: rgba(196, 84, 90, 0.1);
  --accent-sky: #5a8fa8;
  --accent-sky-bg: rgba(90, 143, 168, 0.1);
  --accent-amber: #c99a4a;
  --border: #2a2724;
  --border-light: #3a3734;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
  --easing: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.35s;
}

/* ---- Base Overrides ---- */
body.dashboard-page {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.dashboard-page h1, .dashboard-page h2, .dashboard-page h3, 
.dashboard-page h4, .dashboard-page h5, .dashboard-page h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ---- Layout ---- */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 48px;
  position: relative;
}

/* ---- Background Texture ---- */
.dashboard-container::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(212, 163, 115, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(212, 163, 115, 0.02) 0%, transparent 70%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.008) 2px,
      rgba(255, 255, 255, 0.008) 4px
    );
  pointer-events: none;
  z-index: 0;
}

.dash-header {
  position: relative;
  z-index: 1;
}

/* ---- Top Navigation ---- */
.dash-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.dash-top-nav .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.dash-top-nav .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: var(--radius-sm);
  position: relative;
  box-shadow: 0 0 20px rgba(212, 163, 115, 0.15);
}

.dash-top-nav .logo-icon::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1.5px solid rgba(0,0,0,0.2);
  border-radius: 4px;
}

.dash-top-nav .logo h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.dash-top-nav .logo h2 span {
  color: var(--accent-gold);
  font-style: italic;
}

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

/* ---- Buttons ---- */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--duration) var(--easing);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-ghost:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-gold {
  background: var(--accent-gold);
  color: #090807;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--duration) var(--easing);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-gold:hover {
  background: var(--accent-gold-light);
  box-shadow: 0 0 24px rgba(212, 163, 115, 0.2);
}

.btn-danger {
  background: var(--accent-coral);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--duration) var(--easing);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger:hover {
  background: #d65a60;
  box-shadow: 0 0 20px rgba(196, 84, 90, 0.2);
}

/* ---- Auth View ---- */
.auth-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  position: relative;
  z-index: 1;
  padding: 20px 0;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold), var(--accent-gold-light));
}

.auth-card h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}

.auth-card input {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--duration) var(--easing);
  outline: none;
}

.auth-card input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.08);
}

.auth-card input::placeholder {
  color: var(--text-muted);
}

.pwd-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.pwd-wrap input {
  margin-bottom: 0;
  padding-right: 44px;
}

.pwd-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--duration);
  width: 20px;
  height: 20px;
}

.pwd-toggle:hover {
  color: var(--text-secondary);
}

.auth-toggle-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-toggle-link {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 6px;
}

.auth-toggle-link:hover {
  color: var(--accent-gold-light);
  text-decoration: underline;
}

.auth-error {
  color: var(--accent-coral);
  margin-top: 16px;
  text-align: center;
  font-size: 0.9rem;
}

/* Auth sub-views */
.auth-unverified-view,
.auth-signup-success-view,
.auth-exists-view,
.auth-rate-limited-view {
  text-align: center;
}

.auth-unverified-view h2,
.auth-signup-success-view h2,
.auth-exists-view h2,
.auth-rate-limited-view h2 {
  margin-bottom: 12px;
}

.auth-unverified-view p,
.auth-signup-success-view p,
.auth-exists-view p,
.auth-rate-limited-view p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.bug-report-link {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.bug-report-link p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* ---- Auth Divider ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 22px 0 18px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}
.auth-divider span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  opacity: 0.7;
}

/* ---- Google Login Button ---- */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--easing);
  position: relative;
  overflow: hidden;
}
.btn-google::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(66,133,244,0.04), rgba(234,67,53,0.04));
  opacity: 0;
  transition: opacity var(--duration) var(--easing);
}
.btn-google:hover {
  border-color: var(--text-muted);
  background: var(--bg-elevated-hover);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(66,133,244,0.08);
}
.btn-google:hover::before {
  opacity: 1;
}
.btn-google:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-sm);
}
.btn-google svg {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.btn-google span,
.btn-google svg + * {
  position: relative;
  z-index: 1;
}

/* ---- Dashboard View ---- */
.dashboard-view {
  position: relative;
  z-index: 1;
  animation: dashFadeIn 0.6s var(--easing) forwards;
}

@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  flex-wrap: wrap;
}

.dash-hero-left h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.15;
}

.dash-hero-left p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  max-width: 500px;
  line-height: 1.6;
}

.dash-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Dash Grid ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

/* ---- Dash Card ---- */
.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--duration) var(--easing);
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-dim), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--easing);
}

.dash-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.dash-card:hover::before {
  opacity: 1;
}

.dash-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-card h3 .gold-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-gold);
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---- Stats Row ---- */
.stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
  gap: 16px;
}

.stat-item {
  padding: 8px 16px;
  position: relative;
}

.stat-item .val {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: block;
  line-height: 1.1;
}

.stat-item .lbl {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  display: block;
}

/* ---- Progress Overview ---- */
.progress-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .progress-overview {
    grid-template-columns: 1fr;
  }
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-circle {
  position: relative;
  flex-shrink: 0;
}

.progress-stat-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-stat-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1;
}

.progress-stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-stat-sub {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
}

/* Section Breakdown */
.section-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}

.section-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.section-progress-card {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--easing);
}

.section-progress-card:hover {
  border-color: var(--border-light);
  background: var(--bg-elevated-hover);
}

.section-progress-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.section-icon.qa {
  background: rgba(212, 163, 115, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 163, 115, 0.2);
}

.section-icon.dilr {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
  border: 1px solid rgba(90, 143, 168, 0.2);
}

.section-icon.varc {
  background: var(--accent-coral-bg);
  color: var(--accent-coral);
  border: 1px solid rgba(196, 84, 90, 0.2);
}

.section-progress-info {
  flex: 1;
}

.section-progress-info .section-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.section-progress-info .section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-bar-track {
  background: var(--border);
  height: 5px;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s var(--easing);
}

.progress-bar-fill.gold {
  background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold));
}

.progress-bar-fill.sky {
  background: linear-gradient(90deg, rgba(90, 143, 168, 0.6), var(--accent-sky));
}

.progress-bar-fill.coral {
  background: linear-gradient(90deg, rgba(196, 84, 90, 0.6), var(--accent-coral));
}

.toggle-breakdown-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--easing);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toggle-breakdown-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* ---- Guest Preview ---- */
.guest-preview {
  position: relative;
  z-index: 1;
}

.guest-cta-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.guest-cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.guest-cta-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.guest-cta-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.guest-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.guest-heatmap-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.guest-heatmap-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* ---- Heatmap (legacy compat) ---- */
.activity-grid {
  min-height: 100px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.activity-grid.legacy {
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  gap: 3px;
}

.activity-col {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
}

.activity-cell {
  width: 12px;
  height: 12px;
  background: var(--border);
  border-radius: 2px;
}

.activity-cell[data-level="1"] {
  background: #1a3a2a;
}

.activity-cell[data-level="2"] {
  background: #2a5a3a;
}

.activity-cell[data-level="3"] {
  background: #3d8a6a;
}

.activity-cell[data-level="4"] {
  background: #5aaa7a;
}

/* Heatmap legend */
.heatmap-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.heatmap-legend .activity-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ---- Topic Strength ---- */
.topic-strength-card {
  position: relative;
}

.weakest-topic-banner {
  display: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--accent-coral-bg);
  border: 1px solid rgba(196, 84, 90, 0.2);
  margin-bottom: 20px;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.topic-strength-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.topic-strength-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.topic-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.topic-filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--duration) var(--easing);
}

.topic-filter-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.topic-filter-btn.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #090807;
}

.topic-strength-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-row {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--easing);
}

.topic-row:hover {
  background: var(--bg-elevated-hover);
  border-color: var(--border-light);
}

.topic-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.topic-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.topic-section-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-section-badge.section-qa {
  background: rgba(212, 163, 115, 0.12);
  color: var(--accent-gold);
}

.topic-section-badge.section-dilr {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
}

.topic-section-badge.section-varc {
  background: var(--accent-coral-bg);
  color: var(--accent-coral);
}

.topic-strength-badge {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

.topic-strength-badge.weak {
  background: var(--accent-coral-bg);
  color: var(--accent-coral);
}

.topic-strength-badge.average {
  background: rgba(201, 154, 74, 0.15);
  color: var(--accent-amber);
}

.topic-strength-badge.strong {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
}

.topic-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.topic-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--easing);
  background: linear-gradient(90deg, var(--accent-coral), var(--accent-amber), var(--accent-emerald));
}

.topic-row-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topic-strength-fallback {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.topic-strength-fallback svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.topic-strength-fallback p {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.topic-strength-fallback strong {
  color: var(--accent-gold);
}

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.dash-card table {
  width: 100%;
  border-collapse: collapse;
}

.dash-card th {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dash-card td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.dash-card tbody tr {
  transition: background var(--duration) var(--easing);
}

.dash-card tbody tr:hover {
  background: var(--bg-elevated);
}

/* ---- Chart ---- */
.chart-container {
  margin-top: 20px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 200px;
}

/* ---- Animations ---- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-card {
  animation: fadeSlideUp 0.5s var(--easing) forwards;
  opacity: 0;
}

.dash-card:nth-child(1) { animation-delay: 0.05s; }
.dash-card:nth-child(2) { animation-delay: 0.1s; }
.dash-card:nth-child(3) { animation-delay: 0.15s; }
.dash-card:nth-child(4) { animation-delay: 0.2s; }
.dash-card:nth-child(5) { animation-delay: 0.25s; }

.guest-cta-card {
  animation: fadeSlideUp 0.5s var(--easing) forwards;
  opacity: 0;
  animation-delay: 0.05s;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 0 24px 40px;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 0 16px 32px;
  }

  .dash-top-nav {
    flex-wrap: wrap;
    padding: 16px 0 20px;
    margin-bottom: 28px;
  }

  .dash-hero {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
  }

  .dash-hero-left h1 {
    font-size: 1.65rem;
  }

  .dash-card {
    padding: 20px;
  }

  .dash-card h3 {
    font-size: 1rem;
  }

  .stats-row {
    gap: 8px;
  }

  .stat-item .val {
    font-size: 1.5rem;
  }

  .auth-card {
    padding: 28px 24px;
  }

  .guest-cta-card {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dash-hero-actions {
    width: 100%;
  }

  .dash-hero-actions .btn-ghost,
  .dash-hero-actions .btn-gold {
    flex: 1;
    justify-content: center;
  }
}

/* ---- Scrollbar ---- */
.dashboard-page ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dashboard-page ::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-page ::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.dashboard-page ::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ---- Heatmap component compat ---- */
.heatmap-grid-container {
  margin-top: 8px;
}

.heatmap-day-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.heatmap-day-cell:hover {
  transform: scale(1.4);
  border-color: var(--text-muted);
}

.heatmap-day-cell.outside-year {
  opacity: 0.3;
}

.heatmap-day-cell[data-level="0"] { background: var(--border); }
.heatmap-day-cell[data-level="1"] { background: #1a3a2a; }
.heatmap-day-cell[data-level="2"] { background: #2a5a3a; }
.heatmap-day-cell[data-level="3"] { background: #3d8a6a; }
.heatmap-day-cell[data-level="4"] { background: #5aaa7a; }

/* ---- Dictionary Popup ---- */
.dictionary-popup { display: none; }
