/* === DASHBOARD NAV === */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* === MAIN LAYOUT === */
.dash-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* === HEADER === */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 12px;
}

.dash-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.65;
}

.dash-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  flex-shrink: 0;
}

/* === STATS BAR === */
.stats-bar {
  display: flex;
  gap: 12px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.chip-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.chip-label {
  font-size: 0.7rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* === REFRESH BUTTON === */
.btn-refresh {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-refresh:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.spinning {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

/* === FILTER TABS === */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-tab {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-tab:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.15);
}

.filter-tab.active {
  color: var(--accent);
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
}

.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.source-dot.tiktok { background: #ff2d55; }
.source-dot.amazon { background: #ff9900; }
.source-dot.google { background: #4285f4; }

/* === STATUS BANNER === */
.status-banner {
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-banner.hidden { display: none; }
.status-banner.info { background: rgba(0,229,255,0.08); color: var(--accent); border: 1px solid rgba(0,229,255,0.2); }
.status-banner.success { background: rgba(123,211,168,0.1); color: #7BD3A8; border: 1px solid rgba(123,211,168,0.25); }
.status-banner.warn { background: rgba(255,107,107,0.08); color: var(--accent-coral); border: 1px solid rgba(255,107,107,0.2); }

/* === PRODUCT GRID === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* === PRODUCT CARD === */
.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
}

.product-card:hover {
  border-color: rgba(0,229,255,0.15);
  transform: translateY(-2px);
}

.card-rank {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 3px 8px;
}

.card-source {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}

.source-badge.tiktok { background: rgba(255,45,85,0.12); color: #ff2d55; }
.source-badge.amazon { background: rgba(255,153,0,0.12); color: #ff9900; }
.source-badge.google { background: rgba(66,133,244,0.12); color: #4285f4; }

.category-badge {
  font-size: 0.75rem;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 3px 8px;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  padding-right: 36px;
}

.card-price {
  font-size: 0.85rem;
  color: var(--accent-coral);
  font-weight: 600;
}

/* === TOTAL SCORE BLOCK === */
.card-total-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
}

.total-label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  flex: 1;
}

.total-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

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

/* === SCORE BARS === */
.card-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  width: 78px;
  flex-shrink: 0;
}

.score-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.score-num {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* === AI REASONING === */
.card-reasoning {
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-style: italic;
  line-height: 1.55;
  border-left: 2px solid rgba(0,229,255,0.2);
  padding-left: 10px;
}

/* === CARD FOOTER === */
.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.niche-tag {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 5px;
  padding: 3px 7px;
  font-family: var(--font-display);
  font-weight: 500;
}

.card-link {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.card-link:hover { color: var(--accent); }

/* === LOADING + EMPTY === */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,229,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state.hidden { display: none; }

.empty-icon { font-size: 3rem; margin-bottom: 20px; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--fg-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.error-text {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--accent-coral);
  padding: 40px;
}

/* === EARLY ACCESS BANNER === */
.early-access-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(0,229,255,0.07) 0%, rgba(123,211,168,0.07) 100%);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.ea-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0,229,255,0.12);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}

.ea-text {
  font-size: 0.9rem;
  color: var(--fg-muted);
  flex: 1;
  min-width: 200px;
}

.ea-cta {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.ea-cta:hover {
  background: rgba(0,229,255,0.1);
  color: var(--fg);
}

/* === SCRIPT CTA BUTTON === */
.btn-script-cta {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #0a0a0f;
  background: linear-gradient(135deg, #00E5FF 0%, #7BD3A8 100%);
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 4px;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 16px rgba(0,229,255,0.2);
}

.btn-script-cta:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,229,255,0.35);
}

.btn-script-cta:active:not(:disabled) {
  transform: translateY(0);
}

.btn-script-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-actions {
    align-items: flex-start;
    width: 100%;
  }

  .stats-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .btn-refresh { width: 100%; text-align: center; }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .early-access-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ea-cta { width: 100%; text-align: center; }
}
