:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-hover: #222632;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --border: #2a2e3b;
  --accent: #4f8ff7;
  --accent-hover: #6ba1f9;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

main {
  padding: 1.5rem 0 3rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Summary grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  text-align: center;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.metric-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Signals */
.signals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.875rem;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.signal-dot.high { background: var(--red); }
.signal-dot.medium { background: var(--yellow); }
.signal-dot.low { background: var(--green); }

.signal-commodity {
  font-weight: 600;
  min-width: 5rem;
}

.signal-type {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
}

.signal-message {
  color: var(--text-muted);
}

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-container {
  min-height: 320px;
}

/* Commodity table */
.commodity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.commodity-table th,
.commodity-table td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.commodity-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.commodity-table tbody tr:hover {
  background: var(--bg-hover);
}

.change-positive { color: var(--green); }
.change-negative { color: var(--red); }

/* Section spacing */
.section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Loading & error states */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
}

.error-message {
  color: var(--red);
  padding: 1rem;
  text-align: center;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

footer p {
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .commodity-table {
    font-size: 0.8125rem;
  }

  .commodity-table th,
  .commodity-table td {
    padding: 0.5rem;
  }
}
