/* ===== Design system — dark ops console ===== */
:root {
  --bg:        oklch(0.16 0.012 250);
  --bg-2:      oklch(0.19 0.012 250);
  --panel:     oklch(0.215 0.012 250);
  --panel-2:   oklch(0.235 0.012 250);
  --line:      oklch(0.30 0.012 250);
  --line-soft: oklch(0.26 0.012 250);
  --text:      oklch(0.96 0.005 250);
  --muted:     oklch(0.66 0.012 250);
  --dim:       oklch(0.50 0.012 250);
  --accent:    oklch(0.84 0.17 128);
  --accent-d:  oklch(0.74 0.17 128);
  --accent-ink:oklch(0.18 0.05 128);
  --ok:        oklch(0.78 0.16 152);
  --warn:      oklch(0.82 0.15 75);
  --err:       oklch(0.70 0.18 25);
  --info:      oklch(0.75 0.13 230);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body {
  background-image:
    radial-gradient(1200px 600px at 80% -10%, oklch(0.22 0.04 128 / 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, oklch(0.22 0.04 230 / 0.06), transparent 60%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ===== App layout ===== */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, oklch(0.17 0.012 250), oklch(0.155 0.012 250));
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0;
}
.brand-mark {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  background: conic-gradient(from 220deg at 50% 50%, var(--accent), oklch(0.78 0.14 200), var(--accent));
  box-shadow: inset 0 0 0 1px oklch(0.30 0.05 128), 0 0 0 1px oklch(0.18 0.012 250);
  position: relative;
}
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: var(--bg); }
.brand-name { font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; }
.brand-name .slash { color: var(--dim); }
.brand-tag {
  font-family: var(--mono); font-size: 10px; color: var(--dim); margin-left: auto;
  border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.nav-section { padding: 14px 10px 6px; }
.nav-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--dim); text-transform: uppercase; padding: 0 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px; color: var(--muted);
  font-family: var(--mono); font-size: 12.5px;
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: oklch(0.22 0.012 250); color: var(--text); }
.nav-item.active { background: oklch(0.24 0.012 250); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item .kbd { margin-left: auto; font-size: 10px; color: var(--dim); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.nav-item .ico { width: 14px; height: 14px; color: var(--dim); flex: none; }
.nav-item.active .ico { color: var(--accent); }
.sidebar-foot {
  margin-top: auto; border-top: 1px solid var(--line-soft);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--muted); flex-shrink: 0;
}
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), oklch(0.6 0.13 200));
  display: grid; place-items: center; color: var(--accent-ink);
  font-weight: 700; font-size: 10px; flex-shrink: 0;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 3px oklch(0.78 0.16 152 / 0.18);
  flex-shrink: 0;
}

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px; border-bottom: 1px solid var(--line-soft);
  background: oklch(0.165 0.012 250 / 0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--dim); }
.crumbs .here { color: var(--text); }
.topbar-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 6px 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 260px;
}
.topbar-search input { background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; flex: 1; }
.topbar-search .kbd { font-size: 10px; border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; color: var(--dim); }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--bg-2); color: var(--muted); flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); }

/* ===== Page ===== */
.page { padding: 22px 28px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.page-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  cursor: pointer; line-height: 1; text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}
.btn:hover { border-color: oklch(0.36 0.012 250); background: var(--panel); }
.btn .ico { width: 13px; height: 13px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 1px 0 oklch(0.94 0.16 128) inset, 0 0 0 1px oklch(0.55 0.16 128) inset; }
.btn-primary:hover { background: var(--accent-d); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--err); border-color: oklch(0.40 0.10 25); }
.btn-danger:hover { background: oklch(0.70 0.18 25 / 0.10); }
.btn-sm { padding: 4px 8px; font-size: 11px; }

/* ===== Panels ===== */
.panel { background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); border: 1px solid var(--line-soft); border-radius: 8px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.panel-h h3 { margin: 0; font-size: 12px; font-family: var(--mono); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.panel-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 14px; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; border: 1px solid transparent; line-height: 1; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.b-ok   { color: var(--ok);    background: oklch(0.78 0.16 152 / 0.10); border-color: oklch(0.78 0.16 152 / 0.30); }
.b-ok   .dot { background: var(--ok); }
.b-run  { color: var(--info);  background: oklch(0.75 0.13 230 / 0.10); border-color: oklch(0.75 0.13 230 / 0.30); }
.b-run  .dot { background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
.b-fail { color: var(--err);   background: oklch(0.70 0.18 25 / 0.10);  border-color: oklch(0.70 0.18 25 / 0.30); }
.b-fail .dot { background: var(--err); }
.b-warn { color: var(--warn);  background: oklch(0.82 0.15 75 / 0.10);  border-color: oklch(0.82 0.15 75 / 0.30); }
.b-warn .dot { background: var(--warn); }
.b-off  { color: var(--dim);   background: oklch(0.30 0.012 250 / 0.40); border-color: var(--line); }
.b-off  .dot { background: var(--dim); }
.b-on   { color: var(--accent); background: oklch(0.84 0.17 128 / 0.10); border-color: oklch(0.84 0.17 128 / 0.30); }
.b-on   .dot { background: var(--accent); }
.b-pend { color: var(--dim);   background: oklch(0.30 0.012 250 / 0.40); border-color: var(--line); }
.b-pend .dot { background: var(--dim); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ===== Tables ===== */
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.tbl th { text-align: left; font-weight: 500; color: var(--dim); font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); background: oklch(0.20 0.012 250 / 0.5); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: oklch(0.24 0.012 250 / 0.5); }
.tbl .num  { color: var(--muted); }
.tbl .link { color: var(--accent); cursor: pointer; }
.tbl .link:hover { text-decoration: underline; }

/* ===== Stats ===== */
.stats   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px 16px; position: relative; overflow: hidden; }
.stat .label { font-family: var(--mono); font-size: 10.5px; color: var(--dim); letter-spacing: 0.10em; text-transform: uppercase; }
.stat .value { font-family: var(--mono); font-size: 22px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.stat .delta { font-family: var(--mono); font-size: 11px; margin-top: 2px; color: var(--muted); }
.stat .delta.up   { color: var(--ok); }
.stat .delta.down { color: var(--err); }
.stat .spark { position: absolute; right: 12px; bottom: 10px; opacity: 0.85; }

/* ===== Workflow cards ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wf-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 14px; cursor: pointer; transition: border-color .15s ease, transform .15s ease; display: block; color: var(--text); text-decoration: none; }
.wf-card:hover { border-color: oklch(0.40 0.05 128 / 0.6); transform: translateY(-1px); }
.wf-card .top { display: flex; align-items: flex-start; gap: 10px; }
.wf-card .name { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.wf-card .desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.wf-card .meta { display: flex; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-soft); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.wf-card .meta .kv .k { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; display: block; }
.wf-card .meta .kv .v { color: var(--text); }
.wf-card .icon-stack { width: 34px; height: 34px; border-radius: 7px; flex: none; background: oklch(0.27 0.012 250); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.wf-card .card-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }

/* ===== Linear pipeline ===== */
.pipe { display: flex; align-items: stretch; gap: 0; padding: 22px 14px 18px; overflow-x: auto; }
.pipe-step { flex: 1 1 0; min-width: 160px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; position: relative; transition: border-color .15s ease, background .15s ease; cursor: pointer; }
.pipe-step:hover { border-color: oklch(0.40 0.06 128); }
.pipe-step.selected { border-color: var(--accent); background: oklch(0.20 0.025 128); }
.pipe-step .idx { position: absolute; top: -9px; left: 12px; font-family: var(--mono); font-size: 10px; background: var(--bg); color: var(--dim); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 3px; letter-spacing: 0.06em; }
.pipe-step .row1 { display: flex; align-items: center; gap: 8px; }
.pipe-step .name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-step .type { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
.pipe-step .row3 { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.pipe-step.ok   { box-shadow: inset 3px 0 0 var(--ok); }
.pipe-step.run  { box-shadow: inset 3px 0 0 var(--info); }
.pipe-step.fail { box-shadow: inset 3px 0 0 var(--err); }
.pipe-step.idle { box-shadow: inset 3px 0 0 var(--dim); }
.pipe-step .ico { width: 14px; height: 14px; color: var(--muted); }
.pipe-step.ok   .ico { color: var(--ok); }
.pipe-step.run  .ico { color: var(--info); }
.pipe-step.fail .ico { color: var(--err); }
.pipe-arrow { flex: 0 0 28px; display: flex; align-items: center; justify-content: center; color: var(--dim); position: relative; }
.pipe-arrow::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px); }
.pipe-arrow svg { position: relative; z-index: 1; background: var(--panel); padding: 2px; border-radius: 50%; }
.pipe-arrow.live::before { height: 1.5px; animation: flow 1.6s linear infinite; background-image: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 60px 100%; background-repeat: repeat-x; }
.pipe-arrow.live svg { color: var(--accent); }
@keyframes flow { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
.pipe-legend { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px dashed var(--line-soft); font-family: var(--mono); font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.pipe-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.step-detail { border-top: 1px solid var(--line); padding: 16px 14px; animation: fadeIn .15s ease; }
.step-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.det-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
.det-tab { padding: 6px 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .1s; }
.det-tab:hover { color: var(--text); }
.det-tab.active { color: var(--text); border-bottom-color: var(--accent); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Sparklines ===== */
.bars { display: flex; gap: 3px; align-items: flex-end; height: 34px; }
.bars .bar { width: 6px; border-radius: 1.5px; background: oklch(0.78 0.16 152 / 0.4); }
.bars .bar.ok   { background: oklch(0.78 0.16 152 / 0.7); }
.bars .bar.fail { background: oklch(0.70 0.18 25 / 0.85); }
.bars .bar.run  { background: oklch(0.75 0.13 230 / 0.85); }
.runbars { display: flex; gap: 2px; align-items: flex-end; }
.runbars .b { width: 3px; background: oklch(0.78 0.16 152 / 0.7); border-radius: 1px; }
.runbars .b.f { background: oklch(0.70 0.18 25 / 0.85); }

/* ===== Code ===== */
.code { font-family: var(--mono); font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px 14px; line-height: 1.6; white-space: pre; overflow-x: auto; overflow-y: hidden; max-width: 100%; box-sizing: border-box; }
.code .k { color: oklch(0.78 0.13 200); }
.code .s { color: oklch(0.84 0.16 90); }
.code .n { color: oklch(0.78 0.16 152); }
.code .c { color: var(--dim); }

/* ===== Two-col ===== */
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.two > * { min-width: 0; }

/* ===== Cron ===== */
.cron { display: inline-flex; gap: 1px; font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 5px; padding: 2px; }
.cron span { padding: 2px 6px; color: var(--text); border-radius: 3px; }
.cron span.dim { color: var(--dim); }
.cron span.hi  { color: var(--accent); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.tab { padding: 8px 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { margin-left: 6px; color: var(--dim); font-size: 10.5px; border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 3px; }

/* ===== Logs ===== */
.log { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; color: var(--muted); max-height: 240px; overflow: auto; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px; }
.log .ts   { color: var(--dim); }
.log .ok   { color: var(--ok); }
.log .err  { color: var(--err); }
.log .info { color: var(--info); }

/* ===== Utility ===== */
.pill { font-family: var(--mono); font-size: 10.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.hr   { height: 1px; background: var(--line-soft); border: 0; margin: 18px 0; }
.mono  { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim   { color: var(--dim); }

/* ===== Run dialog ===== */
.run-overlay { position: fixed; inset: 0; background: oklch(0.10 0.01 250 / 0.75); display: none; place-items: center; z-index: 100; backdrop-filter: blur(4px); }
.run-overlay.open { display: grid; }
.run-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: 640px; max-width: calc(100vw - 40px); box-shadow: 0 20px 60px oklch(0.05 0.01 250 / 0.6); }
.run-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.run-modal-head h4 { margin: 0; font-size: 14px; font-weight: 600; }
.run-modal-body { padding: 18px; }
.run-modal-body p { color: var(--muted); font-size: 12px; margin: 0 0 12px; font-family: var(--mono); }
.run-modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.field-label { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; display: block; }
.field-input { width: 100%; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 12px; font-family: var(--mono); font-size: 12px; color: var(--text); outline: none; }
.field-input:focus { border-color: var(--accent); }
select.field-input { cursor: pointer; }
.field-hint  { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 4px; }
.field-error { font-family: var(--mono); font-size: 11px; color: var(--err); margin-top: 6px; display: none; }
textarea.field-input { resize: vertical; min-height: 120px; }
/* run modal view toggle */
.run-view-toggle { display: none; gap: 2px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px; margin-bottom: 14px; width: fit-content; }
.run-view-toggle.visible { display: inline-flex; }
.run-view-btn { padding: 4px 12px; border-radius: 4px; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); background: transparent; border: none; cursor: pointer; line-height: 1.4; }
.run-view-btn:hover { color: var(--text); }
.run-view-btn.active { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 2px oklch(0.05 0.01 250 / 0.4); }
/* run fields rows */
.run-field-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.run-field-row:last-child { margin-bottom: 0; }
.run-field-row.is-bool { flex-direction: row; align-items: center; gap: 8px; }
.run-field-row.is-bool .field-label { margin: 0; }

/* ===== Inline form ===== */
.inline-form { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
.inline-form h4 { margin: 0 0 14px; font-size: 13px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ===== Step panels (run detail) ===== */
.step-panels { display: flex; flex-direction: column; gap: 10px; }
.step-panel { border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; background: var(--panel); }
.step-panel[data-status="running"] { border-color: oklch(0.75 0.13 230 / 0.6); }
.step-panel[data-status="success"] { border-color: oklch(0.78 0.16 152 / 0.35); }
.step-panel[data-status="failed"]  { border-color: oklch(0.70 0.18 25 / 0.5); }
.step-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; background: oklch(0.20 0.012 250 / 0.4); }
.step-panel-title  { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12.5px; }
.step-number { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--dim); font-size: 10px; font-weight: 600; flex-shrink: 0; }
.step-panel-name { font-weight: 600; }
.step-live-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 3px oklch(0.75 0.13 230 / 0.25); animation: pulse 1.4s ease-in-out infinite; }
.step-panel-right { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.step-duration { font-size: 12px; }
.step-panel-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.step-panel-body details summary { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; margin-bottom: 8px; }
.json-block { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px; overflow: auto; margin: 0; white-space: pre; }
.error-pre  { font-family: var(--mono); font-size: 11.5px; color: var(--err); background: oklch(0.70 0.18 25 / 0.08); border: 1px solid oklch(0.70 0.18 25 / 0.25); border-radius: 6px; padding: 10px 12px; overflow: auto; margin: 0; white-space: pre-wrap; }
.logs-pre   { font-family: var(--mono); font-size: 11.5px; line-height: 1.65; color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px; overflow: auto; margin: 0; white-space: pre; max-height: 320px; }
.error-block { background: oklch(0.70 0.18 25 / 0.08); border: 1px solid oklch(0.70 0.18 25 / 0.30); border-radius: 8px; padding: 14px; margin-bottom: 18px; font-family: var(--mono); font-size: 12px; color: var(--err); }
.error-block pre { margin: 8px 0 0; white-space: pre-wrap; color: var(--text); }
.run-meta-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 380px; max-width: calc(100vw - 40px); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 32px; box-shadow: 0 20px 60px oklch(0.05 0.01 250 / 0.5); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand-mark { width: 32px; height: 32px; border-radius: 8px; background: conic-gradient(from 220deg at 50% 50%, var(--accent), oklch(0.78 0.14 200), var(--accent)); position: relative; }
.login-brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 3px; background: var(--bg); }
.login-brand-name { font-family: var(--mono); font-weight: 600; font-size: 18px; }
.login-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.login-sub   { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 24px; }
.login-error { font-family: var(--mono); font-size: 12px; color: var(--err); background: oklch(0.70 0.18 25 / 0.10); border: 1px solid oklch(0.70 0.18 25 / 0.30); border-radius: 6px; padding: 8px 12px; margin-bottom: 16px; }
.login-field { margin-bottom: 14px; }
.login-submit { width: 100%; margin-top: 20px; justify-content: center; font-size: 13px; padding: 9px 14px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(0.30 0.012 250); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: oklch(0.40 0.012 250); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .two   { grid-template-columns: 1fr; }
  .grid  { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app   { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid  { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar-search { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
