/* llmprover-dashboard.css */

/* Force dark color-scheme on app shell so native controls (select, input)
   render with dark OS styling instead of white browser defaults */
.app-layout { color-scheme: dark; }

/* Tailwind preflight strips background from .form-select/.form-input in main.css.
   Re-apply here with !important so dashboard form controls render correctly. */
.app-layout .form-input,
.app-layout .form-select,
.app-layout .form-textarea {
  background-color: rgba(255,255,255,0.05) !important;
  color: rgba(255,255,255,0.85) !important;
}
.app-layout .form-select {
  -webkit-appearance: none !important;
  appearance: none !important;
}

.lp-form { max-width: 48rem; }
.lp-field { margin-bottom: 1.25rem; }
.lp-field-row { display: flex; gap: 1.5rem; }
.lp-field-row .lp-field { flex: 1; }
.lp-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.lp-checkboxes { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.lp-checkbox-label { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; cursor: pointer; }
.lp-form-actions { margin-top: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.lp-status-hint { font-size: 0.875rem; color: var(--color-muted, #6b7280); margin-top: 0.75rem; display: block; }

.lp-enrichment-banner {
  display: flex; flex-wrap: wrap; gap: 1rem;
  background: var(--color-surface-2, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.lp-enrich-item { color: var(--color-text, #111827); }

.lp-output-preview { color: var(--color-muted, #6b7280); font-size: 0.8125rem; }
.lp-output-full {
  font-size: 0.875rem; line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-height: 70vh; overflow-y: auto;
  word-break: break-word;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.5rem;
  padding: 1rem;
}

.lp-label-hint { font-weight: 400; color: var(--color-muted, #6b7280); font-size: 0.8125rem; }
.lp-rubric-row { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.75rem; }
.lp-rubric-cell { display: flex; flex-direction: column; gap: 0.25rem; }
.lp-rubric-cell.lp-rubric-cell-weight { width: 6rem; flex-shrink: 0; }
.lp-rubric-cell.lp-rubric-cell-desc { flex: 1; }
.lp-rubric-cell:first-child { flex: 1; }
.lp-rubric-cell-label { font-size: 0.75rem; color: var(--color-muted, #6b7280); font-weight: 500; }
.lp-winner-reasoning { font-size: 0.875rem; color: var(--color-muted, #6b7280); margin: 0.5rem 0 1rem; line-height: 1.5; }

.lp-provider-row { margin-bottom: 0.5rem; padding: 0.6rem 0.75rem; border-radius: 0.375rem; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.03); }
.lp-provider-row-expanded { display: flex; flex-direction: column; gap: 0.375rem; }
.lp-provider-label { font-weight: 500; }
.lp-model-checkboxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.375rem 1rem; padding-left: 1.5rem; margin-top: 0.25rem; }
@media (max-width: 640px) { .lp-model-checkboxes { grid-template-columns: repeat(2, 1fr); } }
.lp-model-checkbox-label { font-size: 0.8125rem; color: var(--color-muted, #6b7280); }
.lp-model-checkbox-label input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Benchmark suite drawer tabs */
.lp-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--color-border, #e2e8f0); margin-bottom: 1rem; }
.lp-tab { background: none; border: none; padding: 0.5rem 1rem; cursor: pointer; color: var(--color-muted, #64748b); font-size: 0.875rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lp-tab-active { color: var(--color-primary, #6366f1); border-bottom-color: var(--color-primary, #6366f1); font-weight: 500; }

/* Drift charts */
.lp-chart-wrap { margin: 1.25rem 0; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 0.625rem; padding: 1rem; }
.lp-chart-title { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--color-muted, #64748b); }

/* Upgrade / limit nudges */
.lp-upgrade-nudge {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0.5rem;
  background: var(--color-surface-2, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-left: 3px solid var(--color-primary, #6366f1);
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text, #111827);
}
.lp-nudge-limit { border-left-color: #f59e0b; }
.lp-nudge-icon { flex-shrink: 0; }
.lp-nudge-link {
  color: var(--color-primary, #6366f1);
  text-decoration: underline;
  white-space: nowrap;
}
.lp-nudge-topup { color: #10b981; }

/* Export */
.lp-export-bar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.lp-export-controls { display: flex; gap: 0.5rem; align-items: center; }
.lp-date-input { width: 9rem; font-size: 0.8125rem; }
.lp-export-format { width: 6rem; font-size: 0.8125rem; }

/* RAG ingest status badges */
.lp-ingest-badge { display: inline-block; font-size: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 0.25rem; font-weight: 500; white-space: nowrap; }

/* Benchmark prompt rows */
.lp-prompt-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem; }
.lp-prompt-row-input { flex: 1; resize: vertical; }
.lp-prompt-row-remove { flex-shrink: 0; margin-top: 0.25rem; }

/* Benchmark drift scorecard */
.lp-scorecard { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.lp-scorecard-card {
  flex: 1; min-width: 8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}
.lp-scorecard-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.lp-scorecard-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted, #6b7280); margin-bottom: 0.25rem; }
.lp-scorecard-provider { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.9); }
.lp-scorecard-value { font-size: 0.8rem; color: var(--color-muted, #6b7280); margin-top: 0.125rem; }

/* Side-by-side chart row */
.lp-chart-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.lp-chart-wrap-half { flex: 1; min-width: 14rem; }

.py-help-tip {
  max-height: min(18rem, 80vh);
  overflow-y: auto;
}
.lp-ingest-ready   { background: #d1fae5; color: #065f46; }
.lp-ingest-failed  { background: #fee2e2; color: #991b1b; }
.lp-ingest-pending { background: #fef3c7; color: #92400e; }

/* App window — fixed frame height so Next button doesn't jump between frames */
.aw-frame-pane { min-height: 18rem; }

/* Cost projection widget */
.lp-cost-projection {
  background: rgba(255,255,255,0.06);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1.25rem;
}

/* Cost estimator (suite form) */
.lp-estimator-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}
.lp-estimator-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid rgba(255,255,255,0.15);
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
}
.lp-hint-box {
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid var(--color-primary, #6366f1);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.lp-estimator-box-warn {
  border-left-color: #f59e0b;
  background: rgba(245,158,11,0.06);
}
.lp-estimator-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.2rem 0;
}
.lp-estimator-label {
  min-width: 5rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
}
.lp-estimator-breakdown {
  color: rgba(255,255,255,0.35);
  font-size: 0.75rem;
}
.lp-estimator-budget {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.75rem;
}
.lp-estimator-budget-ok   { color: #10b981; }
.lp-estimator-budget-warn { color: #f59e0b; font-weight: 500; }

/* Leaderboard sortable header */
.lp-th-sort { cursor: pointer; user-select: none; }

/* Filter chips (leaderboard, analytics sub-tabs) */
.lp-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lp-chip {
  font-size: 0.75rem; font-weight: 500; font-family: var(--font-mono, monospace);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  background: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.lp-chip:hover { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.2); }
.lp-chip-active { border-color: var(--color-primary, #6366f1) !important; color: var(--color-primary, #6366f1) !important; }
.lp-chip-group-sep { width: 1px; background: rgba(255,255,255,0.1); margin: 0 0.25rem; align-self: stretch; }

/* Context block (paste / vector store toggle) */
.lp-context-block {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
}
.lp-context-summary {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
}
.lp-context-summary::-webkit-details-marker { display: none; }
.lp-context-summary::before { content: '\25B6\00A0'; font-size: 0.7rem; opacity: 0.5; }
details.lp-context-block[open] .lp-context-summary::before { content: '\25BC\00A0'; }
.lp-context-body { padding: 0.75rem 0.875rem; border-top: 1px solid var(--color-border, #e2e8f0); }
.lp-context-toggle { display: flex; gap: 0; margin-bottom: 0.75rem; border: 1px solid var(--color-border, #e2e8f0); border-radius: 0.375rem; overflow: hidden; width: fit-content; }
.lp-ctx-tab {
  background: none;
  border: none;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--color-muted, #6b7280);
}
.lp-ctx-tab-active {
  background: var(--color-primary, #6366f1);
  color: #fff;
  font-weight: 500;
}

/* ── Failed provider row ────────────────────────────────────────────────── */
.lp-result-error-cell { opacity: 0.45; }
.lp-result-error-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(239,68,68,0.15);
  color: #f87171;
  margin-left: 0.375rem;
  vertical-align: middle;
  white-space: nowrap;
}
.lp-result-error-msg {
  font-size: 0.75rem;
  color: #f87171;
  opacity: 0.7;
  font-style: italic;
}

/* ── Eval scoring context banner ─────────────────────────────────────────── */
.lp-scoring-context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface-raised, #f3f4f6);
  border-left: 3px solid var(--color-primary, #6366f1);
  border-radius: 0 0.25rem 0.25rem 0;
  font-size: 0.8rem;
}
.lp-scoring-context-label {
  font-weight: 600;
  color: var(--color-primary, #6366f1);
  white-space: nowrap;
  margin-right: 0.25rem;
}
.lp-scoring-context-body {
  color: var(--color-text-secondary, #6b7280);
  font-style: italic;
  line-height: 1.4;
}
.lp-scoring-criterion {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--color-primary-subtle, #ede9fe);
  color: var(--color-primary, #6366f1);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
