/* Intelligence dashboard — matches Bryan purple theme */
.dashboard-view {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: auto;
  background: linear-gradient(180deg, var(--bg-app, #0d0d14) 0%, #0a0a12 100%);
  padding: 1rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-view[hidden] {
  display: none !important;
}

.dash-header {
  text-align: center;
  position: relative;
  padding: 1.5rem 0 0.5rem;
  min-height: 140px;
}

.dash-header-brain {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  opacity: 0.25;
  pointer-events: none;
}

.dash-brain-score {
  position: relative;
  z-index: 1;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(124, 58, 237, 0.5);
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.4));
}

.dash-brain-delta {
  color: #86efac;
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.dash-brain-delta.negative {
  color: #fca5a5;
}

.dash-tier {
  color: #c4b5fd;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}

.dash-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  max-width: 48rem;
  margin: 0.5rem auto 0;
}

.dash-section {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.dash-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #e2e8f0;
}

.dash-chart-wrap {
  width: 100%;
  overflow: auto;
}

.dash-chart-svg {
  display: block;
  width: 100%;
  min-width: 320px;
  height: 200px;
}

.dash-domains {
  display: grid;
  gap: 0.75rem;
}

.dash-domain-row {
  display: grid;
  grid-template-columns: 140px 1fr 52px 48px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.dash-domain-name {
  color: #cbd5e1;
}

.dash-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.dash-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6d28d9, #7c3aed);
  border-radius: 6px;
  transition: width 1.2s ease-out;
}

.dash-kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.dash-kb-search {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: #0d0d14;
  color: #f1f0ff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.85rem;
}

.dash-kb-list {
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-kb-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}

.dash-kb-card-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.dash-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.35);
  color: #e9d5ff;
}

.dash-feed {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.dash-feed-item {
  display: flex;
  gap: 0.5rem;
  border-left: 2px solid rgba(124, 58, 237, 0.5);
  padding-left: 0.5rem;
  color: #cbd5e1;
}

.dash-feed-item.type-idle { border-color: #a78bfa; }
.dash-feed-item.type-benchmark { border-color: #34d399; }
.dash-feed-item.type-loss { border-color: #f87171; }
.dash-feed-item.type-research { border-color: #38bdf8; }
.dash-feed-item.type-distill { border-color: #fbbf24; }

.dash-queue-list {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
  max-height: 200px;
  overflow: auto;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.dash-queue-pri {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
}
.dash-queue-pri.high { background: #f87171; }
.dash-queue-pri.medium { background: #fbbf24; }
.dash-queue-pri.low { background: #64748b; }

.dash-style-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.dash-mono-bar {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.02em;
}

.dash-bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.dash-bench-table th,
.dash-bench-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.5rem;
  text-align: center;
}

.dash-bench-table th {
  color: #94a3b8;
  font-weight: 500;
}

.dash-bench-up { color: #86efac; }
.dash-bench-down { color: #f87171; }
.dash-bench-same { color: #94a3b8; }

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.dash-stats-grid span.val {
  color: #e2e8f0;
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.dash-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dash-close-row {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0;
}

.dash-kb-content {
  display: none;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  color: #94a3b8;
  max-height: 120px;
  overflow: auto;
  font-size: 0.8rem;
}
.dash-kb-content.open { display: block; }

.dash-growth-line {
  text-align: center;
  color: #a78bfa;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

@media (max-width: 600px) {
  .dash-domain-row {
    grid-template-columns: 1fr;
  }
}
