/* neout/agents dashboard — design tokens inherited from index.html
   (the marketing landing) so the brand is consistent across both
   screens. Navy + emerald, JetBrains for code, Plus Jakarta for body. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --navy-900: #0a0f1e;
  --navy-800: #0f1729;
  --navy-700: #151f36;
  --navy-600: #1a2744;
  --navy-500: #1e2f52;
  --navy-400: #2a3a5c;
  --emerald: #10b981;
  --emerald-2: #34d399;
  --emerald-hover: #0d9668;
  --emerald-glow: rgba(16,185,129,0.15);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --red: #ef4444;
  --amber: #f59e0b;
  --max-w: 1200px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy-800);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.875em; }

/* ============ NAV ============ */
.app-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 23, 41, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-weight: 700; font-size: 17px;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center;
}
.logo .slash { color: var(--text-dim); font-weight: 400; }
.logo .accent { color: var(--emerald); font-weight: 700; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-link {
  color: var(--text-muted); text-decoration: none; font-size: 14px;
  font-weight: 500;
}
.nav-link:hover { color: var(--text); }
.nav-user {
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 8px;
  background: var(--navy-700);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-ghost, .btn-secondary, .btn-icon {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 150ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--emerald);
  color: white;
  padding: 8px 14px;
}
.btn-primary:hover { background: var(--emerald-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border: 1px solid var(--border-light);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--navy-700);
  border-color: var(--border-light);
}

.btn-secondary {
  background: var(--navy-700);
  color: var(--text);
  padding: 8px 14px;
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--navy-600); }

.btn-full { width: 100%; padding: 12px 14px; font-size: 15px; }
.btn-danger {
  background: transparent;
  color: var(--red);
  padding: 4px 8px;
  border: 1px solid transparent;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.icon-btn {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
}

/* ============ AUTH SCREEN ============ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-700);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 36px;
}
.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none !important; }
.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.field input {
  font-family: inherit;
  background: var(--navy-800);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  transition: border-color 150ms;
}
.field input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}
.form-error {
  color: var(--red);
  font-size: 13px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px 12px;
  border-radius: 8px;
}
.form-success {
  color: var(--emerald-2);
  font-size: 13px;
  background: var(--emerald-glow);
  border: 1px solid rgba(16,185,129,0.35);
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
}
.auth-forgot {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
}
.auth-forgot a {
  color: var(--text-muted); text-decoration: none;
}
.auth-forgot a:hover { color: var(--emerald); text-decoration: underline; }
.auth-foot {
  margin-top: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-foot a {
  color: var(--emerald);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.auth-foot a:hover { text-decoration: underline; }

/* ============ DASHBOARD LAYOUT (Hyperbrowser pattern) ============ */
/* The dashboard switches off the global top nav and replaces it with
   a persistent left sidebar + scrollable main area. The body gets
   .has-sidebar class via JS while the dashboard route is active. */
body.has-sidebar > .app-nav { display: none; }
body.has-sidebar { background: var(--navy-900); }

.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; } /* mobile: collapse, top nav re-shows */
  body.has-sidebar > .app-nav { display: block; }
}

.dash-sidebar {
  background: var(--navy-900);
  border-right: 1px solid var(--border);
  padding: 22px 14px 14px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.dash-logo {
  font-weight: 700; font-size: 16px;
  color: var(--text); text-decoration: none;
  padding: 0 10px 18px;
  display: inline-block;
}
.dash-logo .slash { color: var(--text-dim); font-weight: 400; }
.dash-logo .accent { color: var(--emerald); }

.dash-nav {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: auto;
}
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  text-decoration: none; border-radius: 6px;
  transition: background 120ms, color 120ms;
  white-space: nowrap;
}
.dash-nav-item:hover { background: var(--navy-700); color: var(--text); }
.dash-nav-item.active {
  background: var(--navy-700);
  color: var(--text);
}
.dash-nav-item.active::before {
  content: ""; width: 3px; height: 16px; border-radius: 2px;
  background: var(--emerald);
  margin-left: -10px; margin-right: 7px;
}
.dash-nav-item.ghost { color: var(--text-dim); font-size: 13px; }
.dash-nav-item.ghost:hover { color: var(--text-muted); }
.dash-nav-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--emerald); flex-shrink: 0;
}
.dash-nav-item .ext { margin-left: auto; font-size: 11px; color: var(--text-dim); }

.dash-sidebar-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}

.dash-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.dash-user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--emerald);
  color: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  text-transform: uppercase; flex-shrink: 0;
}
.dash-user-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.dash-user-name {
  color: var(--text); font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-user-email {
  color: var(--text-dim); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-user-signout {
  background: transparent; border: 1px solid var(--border-light);
  color: var(--text-muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px;
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-user-signout:hover { color: var(--red); border-color: rgba(239,68,68,0.4); }

.dash-main {
  padding: 28px 36px 64px;
  max-width: 1240px;
  width: 100%;
}
@media (max-width: 880px) {
  .dash-main { padding: 20px 16px 48px; }
}

.dash-shell {
  /* Legacy outer wrapper, retained for compatibility with the old
     single-column layout if .dash-layout is ever absent. */
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 64px;
  width: 100%;
}
.dash-header {
  margin-bottom: 24px;
}
.dash-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.dash-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}
.dash-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  max-width: 640px;
}
.dash-actions {
  display: flex; gap: 8px; align-items: center;
}
.dash-actions .btn-ghost {
  font-size: 13px; padding: 6px 12px;
}

/* Metrics row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}
.metric {
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 96px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.metric-head {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 12px;
}
.metric-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--emerald);
}
.metric-label {
  font-weight: 500;
  letter-spacing: .02em;
}
.metric-num {
  font-size: 28px; font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.05;
  margin-top: 6px;
}
.metric.warn .metric-num { color: var(--amber); }
.metric.bad  .metric-num { color: var(--red); }
.metric.good .metric-num { color: var(--emerald-2); }
.metric-sub {
  color: var(--text-dim); font-size: 11.5px;
  margin-top: 3px;
}

/* Cards */
.card {
  background: var(--navy-700);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  padding: 18px 22px 6px;
}
.card-head.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-head h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-head p {
  font-size: 13px;
  color: var(--text-muted);
}
.card-body { padding: 12px 22px 20px; }

/* Generic helpers */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12px; }
code {
  background: var(--navy-800);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text);
}

/* ============ PLAYGROUND ============ */
.playground .card-head.row { align-items: center; }
.pg-status {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--navy-800); color: var(--text-muted);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.pg-status.idle { color: var(--text-muted); }
.pg-status.queued { background: rgba(99,102,241,0.15); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.pg-status.running {
  background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.3);
}
.pg-status.running::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #fbbf24; animation: pulse 1.5s ease-in-out infinite;
}
.pg-status.completed { background: var(--emerald-glow); color: var(--emerald-2); border-color: rgba(16,185,129,0.35); }
.pg-status.failed { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.35); }

.pg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 18px;
  margin-top: 10px;
}
@media (max-width: 1100px) { .pg-grid { grid-template-columns: 1fr; } }

.pg-form { display: flex; flex-direction: column; gap: 14px; }
.pg-field { display: flex; flex-direction: column; gap: 6px; }
.pg-field > span {
  font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: baseline; gap: 8px;
}
.pg-hint { color: var(--text-dim); font-size: 11px; font-weight: 400; }
.pg-field input,
.pg-field select,
.pg-field textarea {
  font-family: inherit;
  background: var(--navy-800);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 120ms;
}
.pg-field textarea { font-family: inherit; line-height: 1.45; }
.pg-field input:focus,
.pg-field select:focus,
.pg-field textarea:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}
.pg-field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%2394a3b8'><path d='M3 4l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 32px;
}
.pg-row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }

/* Task templates */
.pg-templates {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 8px;
}
.pg-tpl {
  font-family: inherit;
  background: var(--navy-800);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms;
  white-space: nowrap;
}
.pg-tpl:hover {
  color: var(--emerald);
  border-color: var(--emerald);
  background: var(--emerald-glow);
}

/* Hide step counter when idle to reduce visual noise. */
.playground:has(.pg-status.idle) .pg-step { display: none; }

/* Running-state summary (Hyperbrowser pattern) — replaces the form
   when a task is queued/running/completed/failed so the user sees a
   stable, read-only view of the config their agent is operating on. */
.pg-summary {
  display: flex; flex-direction: column; gap: 18px;
}
.pg-summary-row { display: flex; flex-direction: column; gap: 6px; }
.pg-summary-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.pg-summary-task {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.pg-summary-id {
  display: flex; align-items: center; gap: 8px;
}
.pg-summary-id code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text);
  background: var(--navy-800); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px;
  flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-copy-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy-800);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px; cursor: pointer;
  font-size: 13px; font-family: inherit;
  text-decoration: none;
  transition: color 120ms, border-color 120ms;
}
.pg-copy-btn:hover { color: var(--emerald); border-color: var(--emerald); }

.pg-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.pg-summary-value {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.pg-summary-actions {
  display: flex; gap: 10px; margin-top: 4px;
}

/* Stronger Stop button — red when actually running, calmer otherwise. */
.btn-danger {
  background: #ef4444;
  color: white;
  border: 1px solid #ef4444;
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px; cursor: pointer;
  transition: background 120ms, transform 120ms;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pg-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.pg-link {
  color: var(--text-muted); font-size: 12.5px; text-decoration: none;
  padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
}
.pg-link:hover { color: var(--emerald); border-color: var(--emerald); }
.pg-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px;
}

.pg-preview {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 360px;
}
.pg-preview-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.pg-step { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--text-dim); }
.pg-preview-body {
  flex: 1; min-height: 320px;
  position: relative;
  background: var(--navy-900);
}
.pg-preview-body iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: white;
}
.pg-preview-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  color: var(--text-dim); font-size: 13px;
}
.pg-preview-icon {
  font-size: 36px; opacity: 0.5;
  font-family: 'JetBrains Mono', monospace;
}
.pg-result {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--navy-900);
  max-height: 280px; overflow: auto;
}
.pg-result pre {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  color: var(--text);
}

/* Loading shimmer */
.skel {
  background: linear-gradient(90deg, var(--navy-600) 0%, var(--navy-500) 50%, var(--navy-600) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 6px;
  height: 16px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Key list */
.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.key-meta { flex: 1; min-width: 0; }
.key-name { font-weight: 600; font-size: 14px; }
.key-prefix { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.key-dates { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* Minted-key banner */
.minted {
  background: var(--emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.minted-label {
  display: flex; align-items: center; gap: 6px;
  color: var(--emerald-2);
  font-weight: 600;
  font-size: 14px;
}
.minted-key {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.minted-key code {
  flex: 1;
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 0;
  word-break: break-all;
}
.minted-actions { display: flex; gap: 8px; }

/* Mint form */
.mint-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}
.mint-form input {
  flex: 1;
  font-family: inherit;
  background: var(--navy-800);
  border: 1px solid var(--border-light);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.mint-form input:focus {
  outline: none;
  border-color: var(--emerald);
}

/* Quick actions row */
.quick-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.quick-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}
.quick-links a:hover { color: var(--emerald); background: var(--navy-800); }

/* Balance */
.balance {
  font-size: 28px;
  font-weight: 700;
  color: var(--emerald-2);
}
.balance .unit {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  margin-left: 4px;
}

/* Credit ledger ("Recent activity") */
.ledger {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.ledger > summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.ledger > summary::-webkit-details-marker { display: none; }
.ledger > summary::before {
  content: "+ ";
  color: var(--text-dim);
  font-weight: 400;
}
.ledger[open] > summary::before { content: "− "; }
.ledger-table {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ledger-head, .ledger-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px 90px;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.ledger-head {
  background: var(--navy-900);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.ledger-row + .ledger-row { border-top: 1px solid var(--border); }
.ledger-row { color: var(--text); }
.ledger-row .right { text-align: right; }
.ledger-row .dim { color: var(--text-dim); }
.ledger-row .pos { color: var(--emerald-2); font-weight: 600; }
.ledger-row .neg { color: var(--red); font-weight: 600; }
.ledger-sub {
  font-size: 11px; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}
@media (max-width: 720px) {
  .ledger-head, .ledger-row {
    grid-template-columns: 100px 1fr 60px 70px;
    font-size: 11.5px;
    padding: 8px;
  }
}

/* Pack grid */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.pack {
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.pack-label { font-weight: 600; font-size: 14px; }
.pack-meta { color: var(--text-muted); font-size: 13px; margin: 4px 0 12px; }

/* Signing-secret block */
.secret-block {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.secret-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.secret-label {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 180px;
}
.secret-label > span:first-child {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.secret-label .hint {
  font-size: 11.5px; color: var(--text-dim);
}
.secret-label code {
  background: transparent; border: 0; padding: 0; color: inherit;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
}
.secret-value {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 280px;
}
.secret-input {
  flex: 1;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--navy-900);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  width: 100%;
}
.secret-snippet { margin-top: 12px; }
.secret-snippet summary {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; list-style: none;
  padding: 4px 0;
}
.secret-snippet summary::-webkit-details-marker { display: none; }
.secret-snippet summary::before {
  content: "+ "; color: var(--text-dim);
}
.secret-snippet[open] summary::before { content: "− "; }
.secret-snippet pre {
  margin-top: 8px;
  background: var(--navy-900);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Webhook list */
.webhook-list { display: flex; flex-direction: column; gap: 10px; }
.webhook-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.webhook-meta { flex: 1; min-width: 0; }
.webhook-url {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.webhook-events { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.chip {
  background: var(--navy-700);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.webhook-status { font-size: 12px; color: var(--text-dim); }

/* Jobs table */
.jobs-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.thead, .trow {
  display: grid;
  grid-template-columns: 120px 90px 110px 90px 80px 1fr 150px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.thead {
  background: var(--navy-800);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.trow + .trow { border-top: 1px solid var(--border); }
.trow { cursor: pointer; }
.trow:hover { background: var(--navy-800); }
.trow.active { background: var(--navy-800); border-left: 3px solid var(--emerald); padding-left: 11px; }
.trow .mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.trow .actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Job drawer: opens below the table when a row is clicked. */
.card-drawer {
  margin: 0 22px 20px;
  background: var(--navy-800);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.card-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.card-drawer-head > div {
  display: flex; align-items: center; gap: 10px;
}
.card-drawer-head .mono { font-size: 12px; color: var(--text-muted); }
.card-drawer-body { padding: 14px; }
.card-drawer-body .kv {
  display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}
.card-drawer-body .kv .k { color: var(--text-muted); }
.card-drawer-body .kv .v { color: var(--text); word-break: break-word; }
.card-drawer-body .kv .v.dim { color: var(--text-muted); }
.card-drawer-body pre {
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.5;
  background: var(--navy-900);
  padding: 12px; border-radius: 8px;
  max-height: 360px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.card-drawer-body .drawer-section {
  margin-top: 12px;
}
.card-drawer-body .drawer-section h4 {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px;
}
.trow .actions button {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.trow .actions button:hover { color: var(--emerald); border-color: var(--emerald); }
.trow .actions a {
  color: var(--emerald);
  text-decoration: none;
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
}

/* Status pills */
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill.queued    { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.pill.running   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.pill.completed { background: var(--emerald-glow); color: var(--emerald-2); }
.pill.failed    { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* Empty state */
.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  background: var(--navy-800);
  border: 1px dashed var(--border-light);
  border-radius: 10px;
}
.empty-icon { font-size: 32px; opacity: 0.5; margin-bottom: 10px; }
.empty p { font-size: 14px; margin-bottom: 14px; }
.empty pre {
  text-align: left;
  background: var(--navy-900);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin-top: 14px;
  overflow-x: auto;
}

/* Dashboard footer */
.dash-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.dash-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.dash-footer a:hover { color: var(--emerald); }

/* Toasts */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--navy-700);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in 200ms ease-out;
}
.toast.ok { border-left: 3px solid var(--emerald); }
.toast.err { border-left: 3px solid var(--red); }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 720px) {
  .thead, .trow {
    grid-template-columns: 90px 70px 90px 70px 1fr 110px;
    gap: 8px;
    font-size: 12px;
    padding: 8px 10px;
  }
  .thead .col-credits, .trow .col-credits { display: none; }
  .mint-form { flex-direction: column; }
  .auth-card { padding: 24px; }
}
