/* Catyro — Intelligent Data Processing Platform */

:root {
  --primary: #0078d4;
  --primary-hover: #005a9e;
  --danger: #d13438;
  --danger-hover: #a4262c;
  --success: #107c10;
  --warn: #ca5010;
  --purple: #8764b8;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1b1b1b;
  --text-secondary: #605e5c;
  --border: #e1dfdd;
  --header-bg: #0078d4;
  --radius: 8px;
}

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

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ── Header ──────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.logo svg { flex-shrink: 0; }

.logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* ── Navigation ──────────────────────────────────────────── */
.main-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav-link:hover {
  background: #e8e8e8;
  color: var(--text);
}

.nav-link.active {
  background: var(--primary);
  color: #fff;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: #eef;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 4px;
}

/* ── States ──────────────────────────────────────────────── */
.state {
  text-align: center;
  padding: 60px 24px;
}

.state h2 { margin-bottom: 12px; }

.muted { color: var(--text-secondary); margin-top: 8px; }

.spinner {
  width: 36px; height: 36px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}

/* ── Job Header ──────────────────────────────────────────── */
.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Primary Action (prominent accept button) ────────────── */
.primary-action {
  background: linear-gradient(135deg, #e6f4ea 0%, #f0f9f0 100%);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  text-align: center;
}
.primary-action-msg {
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-secondary);
}
.btn-accept {
  display: inline-block;
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--success);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-accept:hover { background: #0b5e0b; transform: translateY(-1px); }
.btn-accept:active { transform: translateY(0); }
.btn-accept:disabled { background: #999; cursor: not-allowed; transform: none; }

.client-name-field {
  margin-bottom: 16px;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.client-name-field label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
.client-name-field input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color .15s;
}
.client-name-field input:focus {
  border-color: var(--primary);
}
.client-name-field input.input-error {
  border-color: var(--danger);
  animation: shake .3s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.job-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.job-header .meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Section Panels ──────────────────────────────────────── */
.section-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.section-title {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.section-body {
  padding: 16px 18px;
}

/* ── Agent Timeline ──────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid var(--border);
  transition: border-color .15s;
}

.timeline-completed { border-left: 3px solid var(--success); }
.timeline-running   { border-left: 3px solid var(--primary); background: #f0f6ff; }
.timeline-failed    { border-left: 3px solid var(--danger); background: #fef0f0; }
.timeline-pending   { border-left: 3px solid var(--border); opacity: .7; }

.timeline-dot {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  margin-top: 1px;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-icon { font-size: 15px; }

.timeline-duration {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 10px;
}

.timeline-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.timeline-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* ── Mapping Stats ───────────────────────────────────────── */
#mapping-stats {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  flex-wrap: wrap;
}

.stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  background: var(--bg);
}

.stat-green { background: #e6f4ea; }
.stat-yellow { background: #fff4e5; }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.stat-green .stat-value { color: var(--success); }
.stat-yellow .stat-value { color: var(--warn); }

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ── Mapping Cards ───────────────────────────────────────── */
.mapping-grid {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mapping-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid var(--border);
}

.mapping-card-high { border-left: 3px solid var(--success); }
.mapping-card-low  { border-left: 3px solid var(--warn); }

.mapping-source {
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.mapping-arrow {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 700;
}

.mapping-target {
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}

.mapping-conf {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: #e6f4ea;
  padding: 2px 10px;
  border-radius: 10px;
  text-align: center;
  justify-self: end;
}

.conf-low {
  color: var(--warn);
  background: #fff4e5;
}

.mapping-reason,
.mapping-samples {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.mapping-samples code {
  background: #eee;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 11px;
}

.mapping-select-wrap {
  display: flex;
  align-items: center;
}

.mapping-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  min-width: 180px;
  cursor: pointer;
}

.mapping-select:focus {
  border-color: var(--primary);
  outline: none;
}

.instructions-box {
  padding: 10px 18px;
  background: #fff4e5;
  border-bottom: 1px solid #ffe0b2;
  font-size: 12px;
  color: var(--warn);
}

/* ── Sheet / Raw Data ────────────────────────────────────── */
.sheet-section {
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.sheet-header h3 { font-size: 14px; }

.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: var(--header-bg);
  color: #fff;
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:nth-child(even) { background: #fafafa; }
tr:hover { background: #f0f6ff; }

details summary {
  cursor: pointer;
  user-select: none;
  color: var(--primary);
  font-weight: 500;
}

/* ── Action Bar ──────────────────────────────────────────── */
.action-bar {
  gap: 12px;
  justify-content: center;
  padding: 20px 0;
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.btn {
  padding: 12px 36px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  .mapping-card {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .mapping-arrow { display: none; }
  #mapping-stats { gap: 8px; }
  .stat { min-width: 70px; padding: 8px; }
  .stat-value { font-size: 20px; }
  .job-header { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   Home Page
   ═══════════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}
.hero h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(0,120,212,.1);
}
.feature-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.home-clients {
  text-align: center;
  margin-bottom: 48px;
}
.home-clients h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 20px;
}
.client-logos {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.client-logo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.client-logo-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(0,120,212,.1);
}
.client-logo-icon {
  font-size: 24px;
}

/* ═══════════════════════════════════════════════════════════
   Solutions Page
   ═══════════════════════════════════════════════════════════ */
.solutions-hero {
  text-align: center;
  padding: 40px 20px 32px;
}
.solutions-hero h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}
.solutions-hero p {
  font-size: 15px;
  color: var(--text-secondary);
}

.client-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}
.client-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8f9fb 0%, #f0f2f5 100%);
  border-bottom: 1px solid var(--border);
}
.client-icon {
  font-size: 32px;
}
.client-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}
.client-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px 24px;
}
.solution-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  background: #fafbfc;
  transition: border-color .15s;
}
.solution-card:hover {
  border-color: var(--primary);
}
.solution-coming-soon {
  opacity: .65;
}
.solution-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--success);
  margin-bottom: 12px;
}
.badge-soon {
  background: var(--text-secondary);
}
.solution-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}
.solution-card > p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}
.solution-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.solution-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: #e3f2fd;
  color: #0d47a1;
}
.solution-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.solution-stack span {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  background: #f0f0f0;
  color: var(--text-secondary);
}

@media (max-width: 700px) {
  .hero h2 { font-size: 24px; }
  .main-nav { gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .solutions-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .topology-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   Products / Agentic AI Evaluator
   ═══════════════════════════════════════════════════════════ */
.home-products {
  text-align: center;
  margin-bottom: 48px;
}
.home-products h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 20px;
}

.product-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}
.product-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fb 100%);
  border-bottom: 1px solid var(--border);
}
.product-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.product-icon {
  font-size: 32px;
}
.product-header h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.product-tagline {
  font-size: 13px;
  color: var(--text-secondary);
}
.product-intro {
  padding: 24px 24px 0;
}
.product-intro p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  max-width: 800px;
}
.product-intro strong {
  color: var(--primary);
}
.product-overview {
  padding: 16px 24px 8px;
}
.product-overview p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Evaluation Layers */
.eval-layer {
  margin: 16px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.layer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-weight: 600;
}
.layer-number {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
}
.layer-header h4 {
  font-size: 16px;
  font-weight: 700;
}
.layer-1 {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-bottom: 2px solid #81c784;
}
.layer-1 .layer-number { background: #43a047; }
.layer-2 {
  background: linear-gradient(135deg, #e3f2fd 0%, #e8eaf6 100%);
  border-bottom: 2px solid #64b5f6;
}
.layer-2 .layer-number { background: #1e88e5; }
.layer-3 {
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 100%);
  border-bottom: 2px solid #ce93d8;
}
.layer-3 .layer-number { background: #8e24aa; }

.layer-body {
  padding: 20px;
}
.layer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}
.layer-desc em {
  color: var(--text);
  font-style: italic;
}
.layer-desc strong {
  color: var(--text);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.metric-card {
  padding: 16px;
  border-radius: 6px;
  background: #fafbfc;
  border: 1px solid var(--border);
  transition: border-color .15s;
}
.metric-card:hover {
  border-color: var(--primary);
}
.metric-icon {
  font-size: 22px;
  margin-bottom: 8px;
}
.metric-card h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.metric-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Topology & Reporting */
.product-feature-section {
  padding: 20px 24px 24px;
}
.product-feature-section > h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.topology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.topo-card {
  padding: 18px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f8f9fb 0%, #f0f2f5 100%);
  border: 1px solid var(--border);
}
.topo-card h5 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.topo-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}
.topo-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.topo-items span {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: #e3f2fd;
  color: #0d47a1;
}

/* ═══════════════════════════════════════════════════════════
   Eval Dashboard
   ═══════════════════════════════════════════════════════════ */

/* Upload Section */
.eval-upload-section {
  margin-bottom: 28px;
}
.eval-upload-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.eval-upload-box h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.eval-upload-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.eval-upload-method label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.eval-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
  background: #fafafa;
}
.eval-textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.eval-file-input {
  padding: 10px;
  font-size: 13px;
}
.eval-demo-btn {
  display: block;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.eval-demo-btn:hover {
  color: var(--primary-hover);
}

/* Report Header */
.eval-report-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.eval-report-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.eval-report-title h3 {
  font-size: 22px;
  font-weight: 700;
}
.eval-report-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.eval-meta-item {
  font-size: 12px;
  color: var(--text-secondary);
}
.eval-score-big {
  font-size: 32px;
  font-weight: 800;
  margin-left: auto;
}
.score-pass { color: #107c10; }
.score-fail { color: #d13438; }

/* Layer Cards */
.eval-layers-section {
  margin-bottom: 24px;
}
.eval-layers-section h4,
.eval-metrics-section h4,
.eval-traces-section h4,
.eval-failures-section h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.eval-layer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.eval-layer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.eval-layer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.eval-layer-label {
  font-size: 14px;
  font-weight: 700;
}
.eval-layer-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  color: #fff;
}
.layer-pass { background: #107c10; }
.layer-fail { background: #d13438; }

.eval-layer-card-body {
  padding: 16px;
  text-align: center;
}
.eval-layer-score {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.eval-layer-pct {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}
.eval-layer-range {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
}
.eval-layer-bar {
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}
.eval-layer-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

/* Metric Breakdown */
.eval-metrics-section {
  margin-bottom: 24px;
}
.eval-metrics-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.eval-metric-group {
  margin-bottom: 20px;
}
.eval-metric-group:last-child {
  margin-bottom: 0;
}
.eval-metric-group h5 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
.eval-metric-bar-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eval-metric-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 50px;
  gap: 12px;
  align-items: center;
}
.eval-metric-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.eval-metric-bar-container {
  width: 100%;
}
.eval-metric-bar-bg {
  height: 10px;
  background: #e8e8e8;
  border-radius: 5px;
  overflow: hidden;
}
.eval-metric-bar-val {
  height: 100%;
  border-radius: 5px;
  transition: width .4s ease;
}
.eval-metric-pct {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

/* Trace Results */
.eval-traces-section {
  margin-bottom: 24px;
}
.eval-traces-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.eval-trace-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #107c10;
  border-radius: var(--radius);
  padding: 16px;
}
.eval-trace-item.trace-failed {
  border-left-color: #d13438;
}
.eval-trace-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.eval-trace-id {
  font-size: 14px;
  font-weight: 600;
  font-family: "SF Mono", "Fira Code", monospace;
}
.eval-trace-score {
  font-size: 18px;
  font-weight: 800;
  margin-left: auto;
}
.eval-trace-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eval-trace-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid;
  background: #fff;
}
.eval-trace-failures {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.eval-trace-failure {
  font-size: 12px;
  color: var(--warn);
  padding: 2px 0;
}

/* Failures Section */
.eval-failures-section {
  margin-bottom: 24px;
}
.eval-failures-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.eval-failure-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.eval-failure-item:last-child {
  border-bottom: none;
}
.eval-failure-layer {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

@media (max-width: 700px) {
  .eval-upload-methods { grid-template-columns: 1fr; }
  .eval-layer-cards { grid-template-columns: 1fr; }
  .eval-metric-bar-row { grid-template-columns: 100px 1fr 40px; }
}
