/* Dashboard active pages — Emany */
/* Shares base vars from hub.css */

/* ── DASHBOARD LAYOUT ──────────────────────── */
.dash-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── AI INSIGHT ────────────────────────────── */
.dash-insight {
  padding: 3.5rem 2rem 2rem;
  max-width: 780px;
  margin: 0 auto;
}

.dash-insight-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  background: rgba(32,178,170,.1);
  border: 1px solid rgba(32,178,170,.22);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.8rem;
}
.theme-kenko .dash-insight-badge {
  background: rgba(34,197,94,.1);
  border-color: rgba(34,197,94,.22);
}
.theme-shokuji .dash-insight-badge {
  background: rgba(234,179,8,.1);
  border-color: rgba(234,179,8,.22);
}

.dash-insight-text {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

.dash-insight-suggestion {
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── TABS ──────────────────────────────────── */
.dash-tabs {
  display: flex;
  gap: .25rem;
  padding: 1.5rem 2rem .5rem;
  max-width: 780px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.dash-tab {
  padding: .55rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

/* ── SECTION HEADER ────────────────────────── */
.dash-section {
  padding: 2.5rem 0 1rem;
}

.dash-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .35rem;
}

.dash-section-sub {
  font-size: .855rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── METRIC CARDS GRID ─────────────────────── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.dash-card-sublabel {
  font-size: .72rem;
  color: var(--text-dim);
}

.dash-card-status {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .5rem;
  border-radius: 6px;
}
.dash-card-status.good {
  background: rgba(34,197,94,.12);
  color: #22c55e;
}
.dash-card-status.low {
  background: rgba(239,68,68,.12);
  color: #ef4444;
}

/* Mini bar chart */
.dash-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 60px;
  padding: .5rem 0;
}

.dash-bar {
  flex: 1;
  border-radius: 3px;
  background: var(--accent);
  opacity: .55;
  min-height: 3px;
  transition: opacity .15s;
}
.dash-bar:last-child { opacity: 1; }
.dash-bar.empty { background: var(--border); opacity: .3; }

.dash-chart-labels {
  display: flex;
  gap: 4px;
}
.dash-chart-labels span {
  flex: 1;
  text-align: center;
  font-size: .62rem;
  color: var(--text-dim);
}

/* Value row */
.dash-card-value {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.dash-card-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.dash-card-unit {
  font-size: .78rem;
  color: var(--text-muted);
}

.dash-card-change {
  font-size: .75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.dash-card-change.up { color: #22c55e; }
.dash-card-change.down { color: #ef4444; }
.dash-card-change .arrow { font-size: .6rem; }

/* ── ZONES / BIOMARKERS / MACRO SECTIONS ──── */
.dash-extra {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

.dash-extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Big stat cards (biomarkers total, zones total) */
.dash-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.dash-stat-big {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
}

.dash-stat-label {
  font-size: .82rem;
  color: var(--text-muted);
}

.dash-stat-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: .5rem;
  overflow: hidden;
}

.dash-stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .4s ease;
}

/* Zone item */
.dash-zone-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
}

.dash-zone-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash-zone-label {
  font-size: .85rem;
  color: var(--text);
  flex: 1;
}

.dash-zone-value {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Macro donut placeholder */
.dash-macro-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto 1rem;
}

.dash-macro-legend {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.dash-macro-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .855rem;
}

.dash-macro-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash-macro-name {
  flex: 1;
  color: var(--text-muted);
}

.dash-macro-pct {
  font-weight: 600;
  color: var(--text);
}

.dash-macro-target {
  font-size: .72rem;
  color: var(--text-dim);
}

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 640px) {
  .dash-insight { padding: 2.5rem 1.25rem 1.5rem; }
  .dash-tabs { padding: 1rem 1.25rem .5rem; }
  .dash-container { padding: 0 1.25rem; }
  .dash-cards { grid-template-columns: 1fr; }
  .dash-extra-grid { grid-template-columns: 1fr 1fr; }
}
