:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202532;
  background: #f4f6f8;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #1f5eff;
  background: #1f5eff;
  color: #fff;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  color: #25304a;
  background: #fff;
  border-color: #ccd4e0;
}

button.danger {
  background: #c92a2a;
  border-color: #c92a2a;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.topbar p {
  margin: 0;
  color: #687086;
}

.system-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.agent,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
}

.agent.online,
.badge.success {
  color: #0b6335;
  background: #dff8e9;
}

.agent.offline,
.badge.neutral {
  color: #687086;
  background: #e9edf2;
}

.badge.info {
  color: #0b4aa2;
  background: #e2eeff;
}

.badge.warn {
  color: #8a5200;
  background: #fff0cf;
}

.badge.danger {
  color: #931f1f;
  background: #ffe3e3;
}

.heartbeat {
  color: #687086;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.panel,
.error {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 16px;
}

.error {
  color: #9f1d1d;
  border-color: #ffc9c9;
  background: #fff5f5;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0 0 3px;
  font-size: 18px;
}

.panel-title span {
  color: #687086;
  font-size: 13px;
}

.cases-table {
  overflow: auto;
  max-height: 480px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #edf0f4;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #687086;
  font-size: 12px;
  text-transform: uppercase;
}

tr.selected,
tbody tr:hover {
  background: #f7faff;
}

.empty {
  color: #687086;
  background: #f8fafc;
  border: 1px dashed #cfd8e3;
  border-radius: 6px;
  padding: 16px;
}

.run-facts {
  margin: 0;
  display: grid;
  gap: 10px;
}

.run-facts div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.run-facts dt {
  color: #687086;
}

.run-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.danger-text {
  color: #9f1d1d;
}

.run-actions,
.review-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.review-panel,
.log-panel {
  margin-top: 18px;
}

.review-raw,
.file-list pre,
#logBox {
  border-radius: 6px;
  border: 1px solid #d7dee8;
  background: #111827;
  color: #d8dee9;
  padding: 12px;
  overflow: auto;
}

.review-raw {
  max-height: 260px;
}

.file-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

details {
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 8px 10px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 10px;
}

#logBox {
  margin: 0;
  height: 340px;
  white-space: pre-wrap;
}

.artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.artifacts span {
  border-radius: 999px;
  background: #eef2f7;
  color: #344054;
  padding: 5px 9px;
  font-size: 12px;
}

@media (max-width: 980px) {
  .grid,
  .topbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .system-status {
    align-items: flex-start;
  }
}
