/* ── VARIABLES ── */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-light: #1c2128;
  --border: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #388bfd;
  --claude: #f0883e;
  --openai: #3fb950;
  --error: #ff7b72;
  --success: #3fb950;
  --warning: #f0883e;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ── LAYOUT ── */
body { display: flex; flex-direction: column; }

#app-header {
  height: 56px;
  background: rgba(13,17,23,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 24px;
  flex-shrink: 0;
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-icon { font-size: 20px; }
.brand-title { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2; }

.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
  background: none; border: 1px solid transparent;
  color: var(--muted); padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all .15s;
  position: relative;
}
.nav-btn:hover { color: var(--text); background: var(--surface); }
.nav-btn.active { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.nav-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.nav-badge.hidden { display: none; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }
.live-indicator { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--success); letter-spacing: .05em; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(63,185,80,0.7);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63,185,80,0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(63,185,80,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63,185,80,0); }
}
.icon-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px;
  transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.spinning { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.last-updated { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

#app-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── DASHBOARD ── */
.view-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.error { color: var(--error); }
.stat-value.warning { color: var(--warning); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.section-action { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 600; }
.section-action:hover { text-decoration: underline; }

/* ── PIPELINE CARDS ── */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.pipeline-card:hover { border-color: #30363d; transform: translateY(-2px); }
.pipeline-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.pipeline-card-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-card-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pipeline-status {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 20px; border: 1px solid; flex-shrink: 0;
}
.status-running { background: rgba(56,139,253,.12); border-color: rgba(56,139,253,.35); color: var(--accent); }
.status-completed { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.35); color: var(--success); }
.status-failed { background: rgba(255,123,114,.12); border-color: rgba(255,123,114,.35); color: var(--error); }
.status-queued { background: rgba(139,148,158,.12); border-color: rgba(139,148,158,.35); color: var(--muted); }

.pipeline-card-body { padding: 14px 16px; flex: 1; }
.mini-flow {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
  justify-content: center;
}
.mini-step {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; border: 2px solid;
  flex-shrink: 0;
  transition: all .3s;
}
.mini-step.pending { background: transparent; border-color: var(--border); color: var(--muted); }
.mini-step.running { background: rgba(56,139,253,.15); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(56,139,253,.2); animation: pulse-step 1.5s infinite; }
.mini-step.completed { background: rgba(63,185,80,.15); border-color: var(--success); color: var(--success); }
.mini-step.failed { background: rgba(255,123,114,.15); border-color: var(--error); color: var(--error); }
.mini-step.skipped { background: transparent; border-color: var(--border); color: var(--muted); text-decoration: line-through; opacity: .5; }
.mini-arrow { color: var(--border); font-size: 10px; }

@keyframes pulse-step {
  0%,100% { box-shadow: 0 0 0 0 rgba(56,139,253,.3); }
  50% { box-shadow: 0 0 0 6px rgba(56,139,253,0); }
}

.pipeline-progress {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.pipeline-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 2px;
  transition: width .5s ease;
}

.pipeline-info-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}

.pipeline-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ── BUTTONS ── */
.btn {
  font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 6px; cursor: pointer; border: 1px solid;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-secondary { background: var(--surface-light); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: rgba(255,123,114,.1); border-color: rgba(255,123,114,.3); color: var(--error); }
.btn-danger:hover { background: rgba(255,123,114,.2); }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── TABLES ── */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; padding: 10px 12px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tr { cursor: pointer; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 12px; border: 1px solid; display: inline-block; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ── DETAIL LAYOUT ── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  height: calc(100vh - 104px);
}
.detail-map-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.detail-sidebar {
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}
.sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.detail-header h2 { font-size: 18px; font-weight: 700; }
.detail-header-left { display: flex; align-items: center; gap: 12px; }

/* ── MINDMAP CANVAS ── */
.canvas-wrap {
  width: 100%; height: 100%; overflow: hidden; cursor: grab; position: relative;
  background: var(--bg);
}
.canvas-wrap.dragging { cursor: grabbing; }
.canvas {
  position: absolute; transform-origin: 0 0; width: 1600px; height: 1100px;
}
.svg-bg {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Nodes */
.node {
  position: absolute;
  border-radius: 16px;
  border: 1.5px solid;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .3s;
  display: flex; flex-direction: column;
  overflow: hidden;
  user-select: none;
}
.node:hover { transform: scale(1.04); z-index: 10; }
.node-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.node-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; flex-shrink: 0;
}
.node-title { font-size: 12px; font-weight: 700; color: var(--text); }
.node-fn { font-size: 9px; font-family: monospace; color: var(--muted); margin-left: auto; flex-shrink: 0; }
.node-body { padding: 10px 14px; flex: 1; }
.model-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.model-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid;
}
.mb-claude { background: rgba(240,136,62,.12); border-color: rgba(240,136,62,.35); color: var(--claude); }
.mb-openai { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.35); color: var(--openai); }
.mb-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tok-badge {
  font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
}
.node-io { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.io-tag {
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  font-family: monospace;
}
.io-in  { background: rgba(56,139,253,.1);  border: 1px solid rgba(56,139,253,.2);  color: #388bfd; }
.io-out { background: rgba(63,185,80,.1);   border: 1px solid rgba(63,185,80,.2);   color: #3fb950; }
.fallback-row {
  margin-top: 5px; font-size: 9px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.fallback-row span { color: #f0883e; font-family: monospace; }

/* node type colors */
.nc-1 { background: #0e1825; border-color: #1c4a8a; }
.nc-2 { background: #140d24; border-color: #3d2080; }
.nc-3 { background: #1a0f06; border-color: #7a4010; }
.nc-4 { background: #0a1a10; border-color: #1a5c30; }
.nc-5 { background: #16080c; border-color: #6a1428; }
.nc-out { background: #0d1a0e; border-color: #2d7a3a; }

.nc-1 .node-num { background: rgba(56,139,253,.2); color: #388bfd; }
.nc-2 .node-num { background: rgba(188,140,255,.2); color: #bc8cff; }
.nc-3 .node-num { background: rgba(240,136,62,.2); color: #f0883e; }
.nc-4 .node-num { background: rgba(63,185,80,.2); color: #3fb950; }
.nc-5 .node-num { background: rgba(255,123,114,.2); color: #ff7b72; }

/* Node status overrides */
.node.status-running { animation: node-pulse 2s infinite; }
.node.status-failed { border-color: var(--error) !important; box-shadow: 0 0 0 3px rgba(255,123,114,.15); }
.node.status-completed { border-color: var(--success) !important; }

@keyframes node-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(56,139,253,.2); }
  50% { box-shadow: 0 0 0 8px rgba(56,139,253,0); }
}

/* Input / Output / QA */
.input-node {
  position: absolute;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
}
.in-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.field-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.field-tag { font-size: 9px; padding: 2px 7px; border-radius: 4px; background: rgba(56,139,253,.08); border: 1px solid rgba(56,139,253,.2); color: #388bfd; font-family: monospace; }

.output-node {
  position: absolute;
  background: rgba(63,185,80,.06); border: 1.5px solid rgba(63,185,80,.3);
  border-radius: 12px; padding: 12px 18px;
}

.parallel-badge {
  position: absolute;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px;
  font-size: 10px; color: var(--muted); white-space: nowrap;
}

.qa-badge {
  position: absolute;
  border: 1.5px dashed #334155;
  border-radius: 16px; padding: 10px 16px;
  font-size: 11px; color: #475569;
  display: flex; align-items: center; gap: 8px;
}

.controls {
  position: absolute; bottom: 16px; right: 16px; z-index: 50;
  display: flex; gap: 6px;
}
.ctrl-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 16px; width: 34px; height: 34px;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ctrl-btn:hover { color: var(--text); border-color: #388bfd; }

/* ── LOGS & ERRORS ── */
.log-entry {
  font-family: 'Consolas', 'Monaco', monospace; font-size: 11px; line-height: 1.6;
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.03); color: var(--muted);
}
.log-entry:last-child { border-bottom: none; }
.log-entry.error { color: var(--error); }
.log-entry.warn { color: var(--warning); }
.log-entry.info { color: var(--accent); }
.log-entry.success { color: var(--success); }
.log-time { color: #555; margin-right: 8px; user-select: none; }

.error-panel {
  background: rgba(255,123,114,.06);
  border: 1px solid rgba(255,123,114,.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}
.error-panel:last-child { margin-bottom: 0; }
.error-title { font-size: 12px; font-weight: 700; color: var(--error); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.error-step { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.error-msg { font-family: monospace; font-size: 11px; color: #ff9d97; margin-bottom: 8px; line-height: 1.5; }
.error-analysis {
  background: rgba(0,0,0,.2);
  border-left: 3px solid var(--warning);
  padding: 8px 10px;
  font-size: 11px; color: var(--text); line-height: 1.5;
}

/* ── FILES ── */
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: all .15s;
}
.file-item:hover { border-color: var(--accent); background: rgba(56,139,253,.05); }
.file-name { font-family: monospace; font-size: 12px; color: var(--text); }
.file-meta { font-size: 10px; color: var(--muted); margin-left: auto; margin-right: 10px; }
.file-action { font-size: 11px; color: var(--accent); font-weight: 600; }

/* ── EDITOR ── */
.editor-form { max-width: 1000px; margin: 0 auto; }
.editor-intro {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.profile-tabs { display: flex; gap: 3px; }
.ptab {
  padding: 5px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; background: none; color: var(--muted);
  transition: all .15s;
}
.ptab:hover { color: var(--text); }
.ptab.active { background: var(--surface); border-color: var(--border); color: var(--text); }
.ptab.aa.active { color: #fbbf24; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.06); }

.editor-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.editor-section-header {
  padding: 14px 18px;
  background: var(--surface-light);
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  user-select: none;
}
.editor-section-header::after {
  content: '▼';
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  transition: transform .2s;
}
.editor-section.collapsed .editor-section-header::after { transform: rotate(-90deg); }
.editor-section-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}
.editor-section.collapsed .editor-section-body { display: none; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-input, .form-select, .form-textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px;
}
.form-textarea { min-height: 120px; font-family: monospace; line-height: 1.5; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-hint { font-size: 11px; color: var(--muted); line-height: 1.4; }

.editor-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── ERROR CENTER ── */
.error-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.error-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.error-stat-value { font-size: 24px; font-weight: 800; color: var(--error); }
.error-stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

.error-list { display: flex; flex-direction: column; gap: 10px; }
.error-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
}
.error-list-item:hover { border-color: rgba(255,123,114,.3); }
.error-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.error-list-pipe { font-size: 12px; font-weight: 700; color: var(--text); }
.error-list-time { font-size: 11px; color: var(--muted); }
.error-list-msg { font-family: monospace; font-size: 11px; color: var(--error); margin-bottom: 6px; }
.error-list-step { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: min(900px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.7);
  transform: translateY(10px); transition: transform .2s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }

/* Modal content helpers */
.modal-section { margin-bottom: 16px; }
.modal-sec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8b949e; margin-bottom: 6px; }
.pbox {
  background: #0d1117; border: 1px solid #21262d; border-radius: 8px;
  padding: 12px 14px; font-family: 'Consolas', monospace; font-size: 11px;
  color: #c9d1d9; line-height: 1.7; white-space: pre-wrap; max-height: 300px; overflow-y: auto;
}
.pbox .kw { color: #bc8cff; }
.pbox .vr { color: #f0883e; }
.pbox .cm { color: #6e7681; }
.pbox .str { color: #3fb950; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.io-col-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #8b949e; margin-bottom: 6px; }
.io-items { display: flex; flex-direction: column; gap: 3px; }
.io-item { font-size: 11px; font-family: monospace; padding: 3px 0; color: #c9d1d9; }
.io-item::before { content: '•  '; color: #8b949e; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  z-index: 600; font-size: 13px; font-weight: 600;
  transition: transform .3s, opacity .3s;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.hidden { transform: translateY(20px); opacity: 0; pointer-events: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── UTILITIES ── */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--muted); }
.text-warning { color: var(--warning); }

/* Tabs inside detail */
.detail-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  flex-shrink: 0;
}
.detail-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; margin-bottom: -1px;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Responsive */
@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .detail-sidebar { max-height: 50vh; }
}
@media (max-width: 800px) {
  .main-nav { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pipeline-grid { grid-template-columns: 1fr; }
}
