/* ============================================================
   DebugHub Dashboard Styles
   Palette: slate background, amber accent (instrument-panel feel)
   ============================================================ */

:root {
  --bg: #0c0f14;
  --surface: #161b22;
  --border: #2a313c;
  --accent: #e8a33d;
  --text: #e6e6e6;
  --muted: #8a93a1;
  --pass: #5fd98a;
  --fail: #ff6b6b;
  --active: #e8a33d;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 3rem;
}

/* ---------- header ---------- */

header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.subtitle {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* ---------- gate screen ---------- */

.gate {
  max-width: 420px;
  margin: 3rem auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.gate p { color: var(--muted); margin-bottom: 1rem; font-size: 0.85rem; }

.gate button {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent);
  color: #1a1300;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
}

.gate .status-line {
  margin-top: 1rem;
  font-size: 0.8rem;
  word-break: break-all;
}

.status-pass { color: var(--pass); }
.status-fail { color: var(--fail); }

/* ---------- app selector ---------- */

.app-selector {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.app-selector label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.app-selector select {
  width: 100%;
  padding: 0.7rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.export-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- tab nav ---------- */

.tab-nav {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.tab-nav button {
  flex: 0 0 auto;
  padding: 0.5rem 0.9rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

.tab-nav button.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- content area ---------- */

main {
  padding: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state .big {
  font-style: italic;
  font-weight: 700;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* ---------- session card ---------- */

.session-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.session-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.lamp.pass { background: var(--pass); box-shadow: 0 0 6px var(--pass); }
.lamp.fail { background: var(--fail); box-shadow: 0 0 6px var(--fail); }
.lamp.active { background: var(--active); box-shadow: 0 0 6px var(--active); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.session-id {
  font-weight: 700;
  font-size: 0.85rem;
}

.session-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.15rem 0;
}

.session-row .label { color: var(--muted); }
.session-row .value { color: var(--text); text-align: right; }

.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
}

.status-badge.pass { color: var(--pass); border: 1px solid var(--pass); }
.status-badge.fail { color: var(--fail); border: 1px solid var(--fail); }
.status-badge.active { color: var(--active); border: 1px solid var(--active); }

/* ---------- checkpoints timeline ---------- */

.timeline {
  position: relative;
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.timeline-item .lamp {
  position: absolute;
  left: -1.45rem;
  top: 0.2rem;
}

.timeline-body { flex: 1; }

.timeline-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.timeline-meta {
  display: flex;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.timeline-session {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: italic;
  margin-top: 0.15rem;
}

/* ---------- errors tab ---------- */

.error-card {
  border: 1px solid var(--fail);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.error-explanation {
  font-style: italic;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.error-meta {
  display: flex;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
}

.error-card details {
  margin-top: 0.4rem;
}

.error-card summary {
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.error-raw {
  background: #0a0d11;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  margin-top: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.72rem;
}

/* ---------- wallets tab ---------- */

.wallet-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.wallet-addr {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.rate-bar {
  margin-top: 0.5rem;
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.rate-bar-fill {
  height: 100%;
  background: var(--pass);
}
