/* ── base ────────────────────────────────────────────────────────────────── */
:root {
  --accent: #22d3ee;
  --accent-dark: #06b6d4;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --surface: #0a0f1e;
  --surface2: #0f1929;
  --border: #1a3354;
  --text: #e2f0ff;
  --muted: #7a9ec0;
  color-scheme: dark;
}

body {
  background: var(--surface);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── nav ─────────────────────────────────────────────────────────────────── */
nav a { transition: color 0.15s; }
nav a:hover { color: var(--accent); }

/* ── stat cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.35); }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-green  { background: rgba(34,197,94,.18);  color: #4ade80; }
.badge-red    { background: rgba(239,68,68,.18);   color: #f87171; }
.badge-yellow { background: rgba(245,158,11,.18);  color: #fbbf24; }
.badge-blue   { background: rgba(34,211,238,.15);  color: #22d3ee; }
.badge-gray   { background: rgba(148,163,184,.12); color: #94a3b8; }

/* ── table ───────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th {
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table th:hover { color: var(--text); }
.data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(63,63,90,0.5);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(34,211,238,0.05); }

/* ── heatmap cell colours ─────────────────────────────────────────────────── */
.hm-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── filter row ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
/* ── custom select ───────────────────────────────────────────────────────── */
.custom-select { position: relative; }
.csel-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: #0f1929; border: 1px solid #1a3354; color: #e2f0ff;
  border-radius: 0.5rem; padding: 0.5rem 0.75rem;
  font-size: 0.85rem; cursor: pointer; text-align: left;
  transition: border-color 0.15s;
}
.csel-btn:hover { border-color: rgba(34,211,238,0.45); }
.custom-select.open .csel-btn { border-color: #22d3ee; box-shadow: 0 0 0 2px rgba(34,211,238,0.15); }
.csel-chevron { width: 14px; height: 14px; color: #7a9ec0; flex-shrink: 0; transition: transform 0.2s; }
.custom-select.open .csel-chevron { transform: rotate(180deg); }
.csel-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: #0f1929; border: 1px solid #22d3ee40; border-radius: 0.5rem;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  list-style: none; margin: 0; padding: 0.25rem;
}
.custom-select.open .csel-dropdown { display: block; }
.csel-dropdown li {
  padding: 0.45rem 0.75rem; border-radius: 0.35rem; font-size: 0.85rem;
  color: #7a9ec0; cursor: pointer; transition: background 0.1s, color 0.1s;
}
.csel-dropdown li:hover { background: rgba(34,211,238,0.08); color: #e2f0ff; }
.csel-dropdown li.csel-active { color: #22d3ee; background: rgba(34,211,238,0.08); }

/* ── native selects (filter-bar) ─────────────────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #0f1929;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a9ec0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 14px;
  border: 1px solid #1a3354;
  color: #e2f0ff;
  border-radius: 0.5rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  color-scheme: dark;
  transition: border-color 0.15s;
}
select:focus { border-color: #22d3ee; box-shadow: 0 0 0 2px rgba(34,211,238,0.15); }
select:hover { border-color: rgba(34,211,238,0.4); }
select option {
  background-color: #0f1929;
  color: #e2f0ff;
}
.filter-bar select, .filter-bar input {
  background-color: #0f1929;
  border: 1px solid #1a3354;
  color: #e2f0ff;
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  outline: none;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: #22d3ee; }

/* ── panel / card ─────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

/* ── detail drawer ────────────────────────────────────────────────────────── */
#detail-drawer {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: stretch; justify-content: flex-end;
}
#detail-drawer.is-open {
  display: flex;
}
#detail-drawer .overlay {
  flex: 1;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
#detail-drawer .pane {
  width: 42rem;
  max-width: 95vw;
  background: var(--surface2);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── live demo ────────────────────────────────────────────────────────────── */
.prompt-box {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: #0f0f1a;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #a5f3fc;
}
.response-box {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: #0a0a12;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 4rem;
}
.verdict-pass { color: var(--success); }
.verdict-fail { color: var(--danger); }

/* ── spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 1.1rem; height: 1.1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.badge-yellow { background: rgba(234,179,8,0.15); color: #fde047; border-color: rgba(234,179,8,0.3); }

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.animate-fade-in { animation: fade-in 0.25s ease both; }

/* ── evaluation pipeline ──────────────────────────────────────────────────── */
.pipeline-step {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.pipeline-step:hover {
  border-color: rgba(34,211,238,0.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.pipeline-num {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.pipeline-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(34,211,238,0.35);
  background: rgba(34,211,238,0.08);
  color: #a5f3fc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}
.pipeline-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}
.pipeline-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.pipeline-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-family: 'Fira Code', monospace;
  background: rgba(34,211,238,0.07);
  border: 1px solid rgba(34,211,238,0.18);
  color: #67e8f9;
  padding: 0.15em 0.5em;
  border-radius: 0.3rem;
  white-space: nowrap;
}
