/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #080810;
  --bg1: #0e0e1a;
  --bg2: #13131f;
  --bg3: #1a1a2e;
  --border: rgba(255, 255, 255, 0.06);
  --border-hi: rgba(255, 255, 255, 0.12);
  --text: #e8e8f0;
  --text-dim: #7a7a9a;
  --text-faint: #3a3a5a;

  --indigo: #6366f1;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --pink: #ec4899;

  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.7);

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg1);
}

::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--indigo);
}

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 16, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 20px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-tag {
  font-size: 10px;
  font-family: var(--mono);
  background: var(--bg3);
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}

.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: all 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg2);
}

.nav-link.active {
  color: var(--text);
  background: var(--bg3);
  border: 1px solid var(--border-hi);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.3s;
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.status-dot.err {
  background: var(--red);
}

.status-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ─── Main & Views ──────────────────────────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ─── Dashboard Header ──────────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dash-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ─── KPI Cards ─────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

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

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, transform 0.15s;
}

.kpi-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-1px);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

.icon-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
}

.icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

.kpi-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1;
}

/* ─── Charts ─────────────────────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  margin-bottom: 16px;
}

.charts-row-full {
  grid-template-columns: 1fr;
}

@media (max-width: 1000px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

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

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
}

.chart-badge {
  font-size: 10px;
  background: var(--bg3);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.chart-body {
  position: relative;
  height: 180px;
}

.chart-body canvas {
  height: 180px !important;
}

.chart-empty {
  display: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.chart-empty.visible {
  display: flex;
}

.chart-empty.visible~canvas {
  display: none;
}

/* ─── Recent Runs (dashboard) ────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
}

.recent-runs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-run-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 160px 1fr 90px 80px 80px 80px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  transition: border-color 0.15s;
}

.recent-run-row:hover {
  border-color: var(--border-hi);
}

.rr-id {
  font-family: var(--mono);
  color: var(--indigo);
  font-size: 11px;
}

.rr-name {
  font-weight: 600;
  font-size: 13px;
}

.rr-stat {
  font-family: var(--mono);
  text-align: right;
  color: var(--text-dim);
}

.rr-quality {
  font-weight: 700;
  text-align: right;
}

.rr-quality.high {
  color: var(--green);
}

.rr-quality.med {
  color: var(--amber);
}

.rr-quality.low {
  color: var(--red);
}

.empty-state-sm {
  text-align: center;
  padding: 24px;
  color: var(--text-faint);
  font-size: 13px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ─── Page header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ─── Pipeline Quick Grid ────────────────────────────────────────────────────── */
.pipeline-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.pipeline-quick-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: all 0.2s;
}

.pipeline-quick-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg3);
}

.pqc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pqc-name {
  font-size: 14px;
  font-weight: 600;
}

.pqc-source {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  text-transform: uppercase;
}

.pqc-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.pqc-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.pqc-meta span strong {
  color: var(--text);
}

.pqc-actions {
  display: flex;
  gap: 8px;
}

/* ─── Pipeline List ─────────────────────────────────────────────────────────── */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.2s;
}

.pipeline-row:hover {
  border-color: var(--border-hi);
}

.pl-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.pl-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.pl-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pl-tag {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.pl-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-shrink: 0;
}

.pl-stat {
  text-align: center;
}

.pl-stat-val {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.pl-stat-label {
  font-size: 10px;
  color: var(--text-dim);
}

.pl-actions {
  display: flex;
  gap: 8px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--indigo);
  color: #fff;
}

.btn-primary:hover {
  background: #4f51e4;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border-hi);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ─── Status badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-running {
  background: rgba(99, 102, 241, 0.12);
  color: var(--indigo);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-failed {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ─── Data Tabs ──────────────────────────────────────────────────────────────── */
.data-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.data-tab {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.data-tab:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.data-tab.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}

.data-panel {
  display: none;
}

.data-panel.active {
  display: block;
}

/* ─── Data Table ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--bg2);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--mono);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--bg2);
}

.table-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px !important;
  font-family: var(--font);
}

.anomaly-yes {
  color: var(--red);
}

.anomaly-no {
  color: var(--text-faint);
}

.val-pos {
  color: var(--green);
}

.val-neg {
  color: var(--red);
}

.signal-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--font);
}

.signal-bullish {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.signal-bearish {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.signal-neutral {
  background: rgba(122, 122, 154, 0.15);
  color: var(--text-dim);
}

.event-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text-dim);
}

/* ─── Run History ───────────────────────────────────────────────────────────── */
.run-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.run-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 170px 1fr 90px 80px 80px 80px auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.run-id {
  font-family: var(--mono);
  color: var(--indigo);
  font-size: 11px;
}

.run-pipeline {
  font-weight: 600;
  font-size: 13px;
}

.run-stat {
  font-family: var(--mono);
  text-align: right;
  color: var(--text-dim);
}

.run-quality {
  font-weight: 700;
}

.run-quality.high {
  color: var(--green);
}

.run-quality.med {
  color: var(--amber);
}

.run-quality.low {
  color: var(--red);
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  border-color: rgba(99, 102, 241, 0.5) !important;
  background: var(--bg3) !important;
}

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--bg1);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  font-family: var(--mono);
}

.modal-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

/* Steps */
.steps-track {
  display: flex;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 70px;
}

.step-item::before {
  content: '';
  position: absolute;
  top: 13px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item:last-child::before {
  display: none;
}

.step-item.done::before {
  background: var(--indigo);
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg2);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-bottom: 6px;
  transition: all 0.3s;
}

.step-item.running .step-dot {
  border-color: var(--indigo);
  background: rgba(99, 102, 241, 0.15);
  animation: pulse-border 1.2s ease infinite;
}

.step-item.done .step-dot {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.15);
}

.step-item.failed .step-dot {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.15);
}

@keyframes pulse-border {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
  }
}

.step-label {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

.step-item.done .step-label {
  color: var(--green);
}

.step-item.running .step-label {
  color: var(--indigo);
}

/* Progress bar */
.progress-wrap {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.progress-bar-bg {
  background: var(--bg3);
  border-radius: 8px;
  height: 5px;
  margin-bottom: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--grad);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Quality checks */
.quality-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.quality-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.quality-check {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.qc-name {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.qc-bar-bg {
  background: var(--bg3);
  border-radius: 4px;
  height: 3px;
  margin-bottom: 5px;
  overflow: hidden;
}

.qc-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.qc-pass .qc-bar-fill {
  background: var(--green);
}

.qc-warn .qc-bar-fill {
  background: var(--amber);
}

.qc-fail .qc-bar-fill {
  background: var(--red);
}

.qc-stats {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Aggregations */
.agg-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.agg-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.agg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.agg-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.agg-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.agg-value {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
}

.agg-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.agg-kpi {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}

.agg-kpi-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.agg-kpi-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
}

.agg-kpi-value.text-green {
  color: var(--green);
}

.agg-kpi-value.text-red {
  color: var(--red);
}

.agg-kpi-value.text-amber {
  color: var(--amber);
}

.agg-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .agg-charts-row {
    grid-template-columns: 1fr;
  }
}

.agg-chart-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  position: relative;
  height: 200px;
}

.agg-chart-wrap canvas {
  height: 200px !important;
}

/* Logs */
.log-section {
  padding: 16px 24px;
}

.log-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.log-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--mono);
}

.log-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line-error {
  color: var(--red);
}

.log-line-warn {
  color: var(--amber);
}

.log-line-success {
  color: var(--green);
}

.log-line-info {
  color: var(--indigo);
}

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  max-width: 320px;
  animation: slideIn 0.2s ease;
}

.toast.success {
  border-left: 3px solid var(--green);
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.info {
  border-left: 3px solid var(--indigo);
}

@keyframes slideIn {
  from {
    transform: translateX(16px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ─── Misc ──────────────────────────────────────────────────────────────────── */
.text-dim {
  color: var(--text-dim);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-amber {
  color: var(--amber);
}

.text-indigo {
  color: var(--indigo);
}

.mono {
  font-family: var(--mono);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}