/* ===========================
   IRONCORE — Dashboard Styles
   =========================== */

/* Navbar update */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid var(--border);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.nav-link:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.nav-link.active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim); }
.nav-link-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.nav-link-primary:hover { background: #e64500; border-color: #e64500; }

/* Dashboard Layout */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
}

/* Header */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}
.dash-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dash-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.dash-breadcrumb a:hover { color: var(--text); }
.dash-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.dash-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.dash-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.5rem;
}
.dash-meta .tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
}
.dash-meta .ai-tag {
  color: var(--good);
  border-color: rgba(61, 255, 143, 0.2);
  background: rgba(61, 255, 143, 0.07);
}

/* Score Hero */
.score-hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 3rem;
  margin-bottom: 2rem;
}
.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--accent-dim);
  flex-shrink: 0;
}
.score-value {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--text);
  line-height: 1;
}
.score-unit {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.score-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.score-details {
  flex: 1;
}
.score-trend {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.trend-up { color: var(--good); }
.trend-down { color: var(--accent); }
.trend-flat { color: var(--text-muted); }
.score-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}
.metric-card-header {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.metric-big {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.metric-big.good { color: var(--good); }
.metric-big.warn { color: var(--warn); }
.metric-big.bad { color: var(--accent); }
.metric-unit {
  font-size: 1rem;
  color: var(--text-muted);
}
.metric-bar-wrap {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.metric-bar {
  height: 100%;
  background: var(--text-muted);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.metric-card .good .metric-bar { background: var(--good); }
.metric-card .warn .metric-bar { background: var(--warn); }
.metric-card .bad .metric-bar { background: var(--accent); }
.metric-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Coach Section */
.coach-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}
.coach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.coach-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.coach-refresh {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}
.coach-refresh:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.coach-refresh:disabled { opacity: 0.5; cursor: default; }

.recommendations {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.2s;
}
.rec-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
}
.rec-priority-high { border-color: rgba(255, 77, 0, 0.3); }
.rec-priority-medium { border-color: rgba(255, 184, 0, 0.2); }
.rec-priority-low { border-color: var(--border); }
.rec-priority {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.rec-priority-high .rec-priority { background: var(--accent-dim); color: var(--accent); }
.rec-priority-medium .rec-priority { background: rgba(255, 184, 0, 0.1); color: var(--warn); }
.rec-priority-low .rec-priority { background: var(--surface-2); color: var(--text-muted); }
.rec-drill {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.rec-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* History Section */
.history-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
}
.history-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
}
.history-table th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.history-table td {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: var(--font-mono) !important; }
.good { color: var(--good) !important; }
.warn { color: var(--warn) !important; }
.bad { color: var(--accent) !important; }

/* Responsive */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .dashboard { padding: 2rem 1.5rem 4rem; }
  .score-hero { flex-direction: column; padding: 2rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dash-header { flex-direction: column; gap: 1rem; }
  .coach-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}