/* Maestro dashboard — light theme, Stripe/Linear/Vercel aesthetic. */

:root {
  --bg: #f5f5f3;
  --bg-elev: #ffffff;
  --border: #e8e8e3;
  --border-strong: #d9d9d3;
  --text: #0f0f0f;
  --text-muted: #6b7280;
  --text-faint: #9aa0a6;
  --accent: #16a34a;        /* green */
  --accent-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --error: #dc2626;
  --error-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.04), 0 4px 16px rgba(15, 15, 15, 0.04);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root { --bg: #f5f5f3; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

#app { max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; }

/* Header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--bg-elev); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -0.02em; }
.tagline { margin: 1px 0 0; font-size: 13px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.wallet {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; min-width: 180px;
  box-shadow: var(--shadow);
}
.wallet-label { font-size: 10px; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600; }
.wallet-row { display: flex; align-items: baseline; gap: 8px; }
.wallet-usdc { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.wallet-addr { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.badge {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a;
  white-space: nowrap;
}
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: #bbf7d0; }
.badge.err { background: var(--error-soft); color: var(--error); border-color: #fecaca; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px;
}
.stat {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; box-shadow: var(--shadow);
}
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Grid */
.grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 16px;
}
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.span-2 { grid-column: span 3; }
.span-3 { grid-column: span 6; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; margin: 0; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 14px 18px; }

/* Pulse */
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Lists */
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14px; }
.row-sub { font-size: 12px; color: var(--text-muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glyph { font-size: 20px; width: 32px; text-align: center; flex-shrink: 0; }

.pill {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  text-transform: capitalize; white-space: nowrap;
}
.pill.pending { background: var(--info-soft); color: var(--info); }
.pill.success { background: var(--accent-soft); color: var(--accent); }
.pill.failed, .pill.timeout { background: var(--error-soft); color: var(--error); }
.pill.delivered, .pill.completed { background: var(--accent-soft); color: var(--accent); }
.pill.orchestrating, .pill.hiring, .pill.synthesizing, .pill.delivering { background: var(--info-soft); color: var(--info); }

.phase { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.empty { color: var(--text-faint); font-size: 13px; padding: 18px 0; text-align: center; }

/* Feed */
.feed { max-height: 360px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.feed-dot.info { background: var(--info); }
.feed-dot.success { background: var(--accent); }
.feed-dot.warn { background: var(--warn); }
.feed-dot.error { background: var(--error); }
.feed-body { flex: 1; min-width: 0; }
.feed-label { font-weight: 600; }
.feed-detail { font-size: 12px; color: var(--text-muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: 11px; color: var(--text-faint); white-space: nowrap; font-family: var(--mono); }

/* Strategy */
.strat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.strat-summary { color: var(--text); font-size: 14px; margin: 0 0 14px; }
.risk-meter { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.risk-bar { width: 120px; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.risk-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--warn), var(--error)); }
.alloc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.alloc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.alloc-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.alloc-table tr:last-child td { border-bottom: none; }
.alloc-asset { font-family: var(--mono); font-weight: 700; }
.alloc-pct { font-family: var(--mono); font-weight: 600; text-align: right; white-space: nowrap; }
.pct-bar { height: 6px; border-radius: 999px; background: var(--accent-soft); margin-top: 4px; overflow: hidden; }
.pct-bar > i { display: block; height: 100%; background: var(--accent); }
.list-block { margin-top: 14px; }
.list-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin: 0 0 6px; }
.list-block li { font-size: 13px; margin-bottom: 3px; }
.list-block.warnings li { color: var(--warn); }
.strat-toggle { font-size: 12px; color: var(--info); cursor: pointer; text-decoration: none; user-select: none; }
pre.json {
  background: #fafaf7; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--mono); font-size: 12px; overflow-x: auto;
  max-height: 320px; margin: 12px 0 0;
}

/* Registry */
.registry { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.reg-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.reg-item.unconfigured { opacity: 0.62; }
.reg-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.reg-name { font-weight: 600; font-size: 14px; }
.reg-desc { font-size: 12px; color: var(--text-muted); margin: 0; }
.reg-meta { font-size: 11px; color: var(--text-faint); font-family: var(--mono); margin-top: 8px; }

/* Footer */
.footer {
  display: flex; justify-content: space-between; margin-top: 20px;
  font-size: 12px; color: var(--text-faint); font-family: var(--mono);
}

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .span-2 { grid-column: span 6; }
  .registry { grid-template-columns: 1fr; }
}
