/* Dashboard-specific styles. Inherits theme.css vars. */

.nav-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Dashboard Layout */
.dash { padding: 40px 40px 80px; min-height: calc(100vh - 60px - 80px); }
.dash-inner { max-width: 1200px; margin: 0 auto; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}
.dash-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.dash-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.5;
}
.dash-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dash-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Price Cards */
.price-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.price-card:hover { border-color: rgba(240, 236, 228, 0.15); }

.price-metal {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.price-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1;
}
.price-unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--fg-muted);
  margin-left: 2px;
}
.price-change {
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
}
.price-change.up {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}
.price-change.down {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}
.price-change.flat {
  color: var(--fg-muted);
  background: rgba(138, 133, 128, 0.1);
}
.price-source {
  margin-top: 12px;
  font-size: 0.65rem;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* Skeleton Loading */
.price-card.skeleton { animation: pulse 1.5s ease-in-out infinite; }
.skel-line {
  height: 14px;
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 12px;
}
.w40 { width: 40%; }
.w60 { width: 60%; }
.w80 { width: 80%; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Chart Section */
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 40px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.chart-controls { display: flex; gap: 8px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--fg-muted); color: var(--fg); }
.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.chart-container { position: relative; min-height: 300px; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Alerts */
.alerts-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.alerts-list { margin-top: 16px; }
.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.alert-row:last-child { border-bottom: none; }
.alert-metal {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: capitalize;
  min-width: 100px;
}
.alert-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.alert-badge.up { color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.alert-badge.down { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.alert-price {
  font-size: 0.85rem;
  color: var(--fg);
  font-weight: 500;
}
.alert-time {
  font-size: 0.75rem;
  color: var(--fg-muted);
}
.alert-empty {
  text-align: center;
  padding: 32px;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .price-grid { grid-template-columns: repeat(2, 1fr); }
  .dash { padding: 24px 20px 60px; }
  .dash-header { flex-direction: column; }
}
@media (max-width: 600px) {
  .price-grid { grid-template-columns: 1fr; }
  .alert-row { flex-wrap: wrap; gap: 8px; }
}
