/* Dashboard page styles — lives alongside theme.css */

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 40px 24px 64px;
}

/* ── Page Header ── */
.dashboard-header {
  max-width: 1120px;
  margin: 0 auto 40px;
}

.dashboard-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.dashboard-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.dashboard-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--green);
  margin-bottom: 6px;
}

.dashboard-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
}

.header-meta {
  text-align: right;
  flex-shrink: 0;
}

.header-date {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

.header-source {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--green-light);
  background: rgba(45, 92, 66, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto 48px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--green);
  line-height: 1;
  margin-bottom: 4px;
}

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

/* ── Niche Sections ── */
.niches-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.niche-section {}

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

.niche-icon-wrap {
  width: 40px;
  height: 40px;
  background: var(--green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.niche-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.niche-section-info {}

.niche-section-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--green);
}

.niche-section-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ── Product Table ── */
.product-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.product-table th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.product-table th:first-child { padding-left: 20px; }
.product-table th:last-child  { padding-right: 20px; }

.product-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.product-table tr:last-child td { border-bottom: none; }

.product-table tr:hover td { background: rgba(245, 166, 35, 0.03); }

.product-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-name-cell strong {
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
}

.product-name-cell span {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.rank-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-alt);
  color: var(--fg-muted);
  padding: 2px 8px;
  border-radius: 20px;
}

.price-cell {
  white-space: nowrap;
}

.current-price {
  font-weight: 700;
  color: var(--fg);
}

.original-price {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ── Demand Score ── */
.demand-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demand-bar-track {
  width: 80px;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.demand-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s;
}

.demand-score-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  width: 28px;
  text-align: right;
}

.source-chip {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--fg-muted);
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .page-content { padding: 24px 16px 48px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-table th:nth-child(3),
  .product-table td:nth-child(3),
  .product-table th:last-child,
  .product-table td:last-child {
    display: none;
  }
  .dashboard-header-top { flex-direction: column; }
  .header-meta { text-align: left; }
}