/* supply-pulse — vanilla dark theme. No framework. */

:root {
  --bg: #0b0f17;
  --panel: #131923;
  --panel-2: #1a2230;
  --border: #232c3d;
  --text: #e6edf3;
  --muted: #8b97aa;
  --accent: #58a6ff;
  --danger: #f85149;
  --warning: #f0b429;
  --ok: #3fb950;
  --critical: #ff6b6b;
  --high: #f78166;
  --medium: #f0b429;
  --low: #58a6ff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d1320 0%, #0b0f17 100%);
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, var(--accent), #1f6feb 60%, #0a2a55 100%);
  box-shadow: 0 0 0 2px rgba(88,166,255,0.18);
}

h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, border 120ms ease;
}

.btn:hover { background: #232d40; border-color: #2f3a52; }
.btn:disabled { opacity: 0.5; cursor: default; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

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

.filters { gap: 8px; }

.select, .input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
}

.input { min-width: 220px; }
.select:focus, .input:focus { border-color: var(--accent); }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

#timeline-chart { width: 100% !important; height: 220px !important; }

.feed-list, .blast-list {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px 110px;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  font-size: 13px;
  transition: background 100ms ease;
}

.row:last-child { border-bottom: none; }
.row:hover { background: #1f2837; }

.row .eco {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.row .summary {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .pkgs {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .when { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.row .dl { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.severity {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  display: inline-block;
  letter-spacing: 0.04em;
}

.severity.critical { background: rgba(255, 107, 107, 0.16); color: var(--critical); border: 1px solid rgba(255, 107, 107, 0.28); }
.severity.high { background: rgba(247, 129, 102, 0.16); color: var(--high); border: 1px solid rgba(247, 129, 102, 0.28); }
.severity.medium { background: rgba(240, 180, 41, 0.16); color: var(--medium); border: 1px solid rgba(240, 180, 41, 0.28); }
.severity.low { background: rgba(88, 166, 255, 0.16); color: var(--low); border: 1px solid rgba(88, 166, 255, 0.28); }
.severity.unknown { background: #1c2434; color: var(--muted); border: 1px solid var(--border); }

.detail {
  background: #0e1420;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: none;
}

.detail.open { display: block; }
.detail h3 { margin: 0 0 6px; color: var(--text); font-size: 13px; }
.detail .pkg-list {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text);
  background: #0a0f1a;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0 12px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 0 0;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  margin: 28px 0 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.footer p { margin: 4px 0; }

.blast-row {
  display: grid;
  grid-template-columns: 36px 80px 1fr 140px;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
}
.blast-row:last-child { border-bottom: none; }
.blast-row .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.blast-row .pkg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.blast-row .dl { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .row { grid-template-columns: 50px 1fr 80px 80px; }
  .row .dl { display: none; }
  .blast-row { grid-template-columns: 32px 70px 1fr 120px; }
  .input { min-width: 140px; }
  .container { padding: 16px; }
}
