.static-menu-page #rag-app .entity-page {
  --entity-accent: var(--menu-accent, #f06b4f);
  --entity-soft: rgba(240, 107, 79, .09);
  --entity-line: var(--console-line, #e1e4e8);
  --entity-muted: var(--console-muted, #747a84);
}

.entity-message,
.entity-blocker,
.entity-failure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 12px 15px;
  border: 1px solid #ead6cb;
  border-left: 3px solid var(--entity-accent);
  border-radius: 6px;
  background: #fff9f5;
  color: #695f59;
  font-size: .64rem;
}

.entity-message button {
  border: 0;
  background: transparent;
  color: var(--entity-muted);
  font-size: 1rem;
  cursor: pointer;
}

.entity-blocker,
.entity-failure {
  align-items: flex-start;
  border-color: #edcfc9;
  border-left-color: #b95142;
  background: #fff6f4;
}

.entity-blocker strong,
.entity-blocker span,
.entity-failure strong,
.entity-failure span,
.entity-failure small { display: block; }
.entity-blocker strong,
.entity-failure strong { color: #823f35; font-size: .72rem; }
.entity-blocker span,
.entity-failure span { margin-top: 4px; }
.entity-failure small { margin-top: 5px; color: var(--entity-muted); }

.entity-metric-rail,
.entity-run-header {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--entity-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--console-shadow-soft, 0 4px 14px rgba(32, 37, 43, .04));
}

.entity-metric-rail article,
.entity-run-header > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--entity-line);
}
.entity-metric-rail article:last-child,
.entity-run-header > div:last-child { border-right: 0; }
.entity-metric-rail span,
.entity-run-header span { display: block; color: var(--entity-muted); font-size: .57rem; }
.entity-metric-rail strong,
.entity-run-header strong { display: block; margin-top: 4px; color: var(--console-ink, #30343a); font-size: .9rem; line-height: 1.15; }
.entity-metric-rail small { display: block; margin-top: 5px; color: var(--entity-muted); font-size: .55rem; }

.entity-run-header { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.entity-run-header .graph-status-pill { margin-top: 5px; }

.entity-stage-progress {
  margin: -4px 0 16px;
  padding: 13px 16px;
  border: 1px solid var(--entity-line);
  border-radius: 8px;
  background: #fff;
}

.entity-stage-progress > div:first-child {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  color: var(--entity-muted);
  font-size: .58rem;
}

.entity-stage-progress strong {
  color: var(--console-ink, #30343a);
  font-size: .66rem;
}

.entity-stage-progress b {
  color: #b34e34;
  text-align: right;
  font-size: .65rem;
}

.entity-stage-progress-track {
  height: 7px;
  margin: 9px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceff2;
}

.entity-stage-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef7655, #d85b3b);
}

.entity-stage-progress small {
  color: var(--entity-muted);
  font-size: .56rem;
}

.entity-toolbar-actions,
.entity-batch-bar > div,
.entity-panel > footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.entity-toolbar-actions select,
.entity-candidate-filters select { min-width: 118px; }

.entity-scope-table th:nth-child(1) { width: 20%; }
.entity-scope-table th:nth-child(2) { width: 18%; }
.entity-scope-table th:nth-child(3) { width: 12%; }
.entity-scope-table th:nth-child(4) { width: 14%; }
.entity-scope-table th:nth-child(5) { width: 11%; }
.entity-scope-table th:nth-child(6) { width: 12%; }
.entity-scope-table th:nth-child(7) { width: 13%; }

.entity-run-table th:nth-child(1) { width: 14%; }
.entity-run-table th:nth-child(2) { width: 9%; }
.entity-run-table th:nth-child(3) { width: 15%; }
.entity-run-table th:nth-child(4) { width: 10%; }
.entity-run-table th:nth-child(5) { width: 13%; }
.entity-run-table th:nth-child(6) { width: 10%; }
.entity-run-table th:nth-child(7) { width: 12%; }
.entity-run-table th:nth-child(8) { width: 17%; }

.entity-scope-table td strong,
.entity-scope-table td small,
.entity-run-table td strong,
.entity-run-table td small,
.entity-candidate-table td strong,
.entity-candidate-table td small { display: block; }
.entity-scope-table td small,
.entity-run-table td small,
.entity-candidate-table td small { margin-top: 3px; color: var(--entity-muted); font-size: .56rem; line-height: 1.4; }

.entity-scope-table .kb-row-action,
.entity-run-table .kb-row-action,
.entity-candidate-table .kb-row-action { text-align: right; }
.entity-run-table .kb-row-action .button,
.entity-candidate-table .kb-row-action .button { margin: 2px 0 2px 4px; padding: 4px 7px; font-size: .56rem; }

.entity-create-layout,
.entity-run-layout,
.entity-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .65fr);
  align-items: start;
  gap: 16px;
}

.entity-panel {
  overflow: hidden;
  border: 1px solid var(--entity-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--console-shadow-soft, 0 4px 14px rgba(32, 37, 43, .04));
}
.entity-panel > header { padding: 15px 17px 12px; border-bottom: 1px solid var(--entity-line); }
.entity-panel > header h2 { margin: 0; font-size: .78rem; }
.entity-panel > header p { margin: 4px 0 0; color: var(--entity-muted); font-size: .6rem; }
.entity-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border-top: 1px solid var(--entity-line); background: #fafbfc; }

.entity-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px;
}
.entity-form-grid .wide { grid-column: 1 / -1; }
.entity-form-grid > label { display: grid; gap: 7px; }
.entity-form-grid > label > span { color: var(--entity-muted); font-size: .62rem; font-weight: 700; }
.entity-form-grid input,
.entity-form-grid select,
.entity-form-grid textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 8px 11px;
  border: 1px solid #d7dbe0;
  border-radius: 5px;
  background: #fff;
  color: var(--console-ink, #30343a);
  font: inherit;
  font-size: .68rem;
}
.entity-form-grid textarea { resize: vertical; line-height: 1.6; }

.entity-choice-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--entity-line);
  border-radius: 6px;
}
.entity-choice-field legend { padding: 0 5px; color: var(--entity-muted); font-size: .62rem; font-weight: 700; }
.entity-choice-field label { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #e2e5e9; border-radius: 5px; cursor: pointer; }
.entity-choice-field input { width: auto; min-height: auto; margin-top: 2px; accent-color: var(--entity-accent); }
.entity-choice-field strong,
.entity-choice-field small { display: block; }
.entity-choice-field strong { font-size: .68rem; }
.entity-choice-field small { margin-top: 3px; color: var(--entity-muted); font-size: .56rem; line-height: 1.45; }

.entity-config-note { display: grid; gap: 4px; padding: 11px 13px; border-left: 3px solid var(--entity-accent); background: #fff9f5; color: #6c625d; font-size: .62rem; }
.entity-config-note strong { color: #504741; }

.entity-preview dl,
.entity-run-facts dl { margin: 0; }
.entity-preview dl div,
.entity-run-facts dl div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--entity-line); }
.entity-preview dt,
.entity-run-facts dt { color: var(--entity-muted); font-size: .59rem; }
.entity-preview dd,
.entity-run-facts dd { margin: 0; color: var(--console-ink, #30343a); font-size: .64rem; }
.entity-preview footer { justify-content: flex-end; }

.entity-stage-list { margin: 0; padding: 0; list-style: none; }
.entity-stage-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 58px; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--entity-line); }
.entity-stage-list li:last-child { border-bottom: 0; }
.entity-stage-list i { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #d7dbe0; border-radius: 6px; color: #7a8089; font-style: normal; font-size: .55rem; }
.entity-stage-list strong,
.entity-stage-list span { display: block; }
.entity-stage-list strong { font-size: .68rem; }
.entity-stage-list span { margin-top: 3px; color: var(--entity-muted); font-size: .56rem; }
.entity-stage-list b { color: var(--entity-muted); font-size: .57rem; text-align: right; }
.entity-stage-list .completed i { border-color: #9fc9b6; background: #e9f5ef; color: #267155; }
.entity-stage-list .current i { border-color: #efb4a5; background: var(--entity-soft); color: #b04e36; }
.entity-stage-list .failed i { border-color: #e6aaa0; background: #fdeae7; color: #a74839; }
.entity-stage-list .failed b { color: #a74839; }
.entity-stage-list .cancelled i { background: #f0f1f3; color: #777d86; }

.entity-candidate-filters { flex-wrap: wrap; justify-content: flex-end; }
.entity-candidate-filters .kb-search-field input { min-width: 200px; }
.entity-batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--entity-line); background: #fafbfc; color: var(--entity-muted); font-size: .61rem; }
.entity-candidate-table th:nth-child(1) { width: 4%; }
.entity-candidate-table th:nth-child(2) { width: 18%; }
.entity-candidate-table th:nth-child(3) { width: 9%; }
.entity-candidate-table th:nth-child(4) { width: 14%; }
.entity-candidate-table th:nth-child(5) { width: 9%; }
.entity-candidate-table th:nth-child(6) { width: 8%; }
.entity-candidate-table th:nth-child(7) { width: 10%; }
.entity-candidate-table th:nth-child(8) { width: 28%; }
.entity-candidate-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--entity-accent); }
.entity-candidate-table tr.is-selected td { background: var(--entity-soft); }

.entity-add-panel { margin-bottom: 16px; }
.entity-add-panel > footer { justify-content: flex-end; }

.entity-detail-layout { grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); margin-bottom: 16px; }
.entity-evidence-panel ol { margin: 0; padding: 0; list-style: none; }
.entity-evidence-panel li { padding: 15px 17px; border-bottom: 1px solid var(--entity-line); }
.entity-evidence-panel li:last-child { border-bottom: 0; }
.entity-evidence-panel li span,
.entity-evidence-panel li strong,
.entity-evidence-panel li small { display: block; }
.entity-evidence-panel li span { color: var(--entity-accent); font-size: .55rem; font-weight: 700; }
.entity-evidence-panel li strong { margin-top: 3px; font-size: .67rem; }
.entity-evidence-panel li small { margin-top: 3px; color: var(--entity-muted); font-size: .55rem; }
.entity-evidence-panel blockquote { margin: 10px 0 0; padding: 10px 12px; border-left: 2px solid #e3b4a7; background: #fcfaf9; color: #5f5b58; font-size: .62rem; line-height: 1.7; }

.entity-page .button:disabled { cursor: not-allowed; opacity: .5; }
