/* ─── Dashboard Layout ─────────────────────────────────────────────────────── */
.dash-body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  min-height: 100vh;
  padding-bottom: 4rem;
}

.dash-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid #222;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dash-nav-brand { text-decoration: none; font-size: 0.85rem; letter-spacing: 0.1em; }
.dash-nav-sep   { color: #333; }
.dash-nav-page  { color: var(--fg-muted); font-size: 0.85rem; }
.mono           { font-family: var(--mono); }
.muted          { color: var(--fg-muted); }
.accent         { color: var(--accent); }

.dash-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ─── Panels ───────────────────────────────────────────────────────────────── */
.panel {
  background: var(--bg-surface);
  border: 1px solid #222;
  border-radius: 8px;
  padding: 1.5rem;
}

.panel-title {
  font-size: 0.85rem;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title .btn {
  margin-left: auto;
}

.panel-icon { color: var(--accent); }
.spin { animation: spin 2s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── Form ─────────────────────────────────────────────────────────────────── */
.bench-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 160px;
}

.form-group--wide { flex: 3; min-width: 300px; }

.form-label {
  font-size: 0.75rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-transform: uppercase;
}
.form-label .req { color: var(--accent); }

.form-input {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); }

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-error { color: #ff4444; font-size: 0.85rem; font-family: var(--mono); }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 1.25rem;
  transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { margin-right: 0.25rem; }

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) { opacity: 0.85; }

.btn-ghost {
  background: transparent;
  border: 1px solid #333;
  color: var(--fg-muted);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm  { padding: 0.3rem 0.75rem; font-size: 0.75rem; }
.btn-xs  { padding: 0.2rem 0.5rem; font-size: 0.7rem; }

/* ─── Live Stats ───────────────────────────────────────────────────────────── */
.live-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  flex: 1;
  min-width: 120px;
}

.stat-label {
  font-size: 0.7rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--fg);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-family: var(--mono);
  margin-top: 0.25rem;
}

.progress-bar-wrap {
  background: #1a1a1a;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 0.4rem 0;
}
.progress-bar {
  background: var(--accent);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ─── Status Badges ────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.status-completed { background: rgba(0,200,100,0.15); color: #00c864; border: 1px solid rgba(0,200,100,0.3); }
.status-running   { background: rgba(255,107,53,0.15); color: var(--accent); border: 1px solid rgba(255,107,53,0.3); }
.status-failed    { background: rgba(255,50,50,0.15); color: #ff4444; border: 1px solid rgba(255,50,50,0.3); }

/* ─── Result Grid ──────────────────────────────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.result-card {
  background: #111;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 0.875rem 1rem;
  text-align: center;
}

.result-label {
  font-size: 0.7rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
}

.result-val {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--mono);
}

/* ─── Runs Table ───────────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }

.runs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.runs-table th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #222;
  white-space: nowrap;
}

.run-row {
  cursor: pointer;
  transition: background 0.1s;
}
.run-row:hover { background: #1a1a1a; }
.run-row td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #1a1a1a;
  white-space: nowrap;
}
.run-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.loading-msg, .empty-msg, .error-msg {
  padding: 2rem;
  text-align: center;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.error-msg { color: #ff4444; }

/* ─── Detail Section ──────────────────────────────────────────────────────── */
.detail-header { margin-bottom: 1rem; }
.detail-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.detail-meta { font-size: 0.75rem; color: var(--fg-muted); word-break: break-all; }

/* ─── Histogram ──────────────────────────────────────────────────────────── */
.hist-section { margin-top: 1.5rem; }
.hist-title {
  font-size: 0.75rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}
.hist-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding: 0 0.25rem;
  background: #111;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 0.75rem 0.5rem 0.25rem;
}
.hist-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.hist-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.8;
}
.hist-label {
  font-size: 0.55rem;
  font-family: var(--mono);
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 36px;
  text-align: center;
}
