:root {
  --bg: #0b0e14;
  --surface: #131722;
  --border: #232838;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --positive: #2ecc71;
  --negative: #e74c3c;
  --neutral: #f1c40f;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e2e6ef;
  --text: #131722;
  --muted: #5a6270;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.topbar h1 { font-size: 1.2rem; margin: 0; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.controls input, .controls select, .controls button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.span-2 { grid-column: span 2; }

.card h2 { margin-top: 0; font-size: 1rem; color: var(--muted); }

.list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.list.compact { max-height: 260px; }

.article-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.article-item a { color: var(--accent); text-decoration: none; font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.badge.positive { background: var(--positive); color: #04140a; }
.badge.negative { background: var(--negative); color: #1a0505; }
.badge.neutral { background: var(--neutral); color: #1a1500; }

.stats { display: flex; flex-direction: column; gap: 8px; font-size: 1.1rem; }

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  font-size: 0.9rem;
}

.metric-row span {
  color: var(--muted);
  text-align: right;
}

.pagination { display: flex; justify-content: center; gap: 12px; margin-top: 10px; align-items: center; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}
