:root {
  --bg: #080a0c;
  --panel: #111519;
  --panel-2: #151b20;
  --line: #263139;
  --text: #eef5f2;
  --muted: #94a3ad;
  --green: #25f45a;
  --cyan: #19d8d8;
  --yellow: #f6c344;
  --red: #ff5a68;
  --blue: #70a7ff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #0b0e11;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  min-height: 38px;
  border: 1px solid rgba(37, 244, 90, 0.65);
  border-radius: 8px;
  background: #12351f;
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
}

button:hover {
  border-color: var(--green);
  background: #174727;
}

button.secondary {
  border-color: rgba(25, 216, 216, 0.55);
  background: #0f2b31;
}

.layout {
  padding: 22px 28px 28px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 30px;
  line-height: 1;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.detail {
  min-height: calc(100vh - 190px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  overflow: hidden;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-row {
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #34414a;
  border-radius: 8px;
  background: #0c1013;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
}

.report-list {
  max-height: calc(100vh - 292px);
  overflow: auto;
}

.report-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 14px;
  text-align: left;
}

.report-card:hover,
.report-card.active {
  background: #162028;
}

.report-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-card-title strong {
  font-size: 14px;
  line-height: 1.25;
}

.report-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #3b4952;
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.stage {
  color: var(--cyan);
  border-color: rgba(25, 216, 216, 0.5);
}

.badge.pending {
  color: var(--yellow);
  border-color: rgba(246, 195, 68, 0.55);
}

.badge.approved {
  color: var(--green);
  border-color: rgba(37, 244, 90, 0.55);
}

.badge.critical,
.badge.high {
  color: var(--red);
  border-color: rgba(255, 90, 104, 0.6);
}

.detail {
  padding: 20px;
}

.empty-state {
  display: grid;
  place-content: center;
  min-height: calc(100vh - 232px);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 10px 0 0;
}

.hidden {
  display: none;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metadata-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  min-width: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1216;
  padding: 12px;
}

.info-item strong {
  display: block;
  margin-bottom: 6px;
}

.info-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.plain-text {
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.decision-panel {
  margin-top: 18px;
  border: 1px solid rgba(25, 216, 216, 0.35);
  border-radius: 8px;
  background: #0d171a;
  padding: 16px;
}

.decision-panel h3 {
  margin-bottom: 12px;
}

.decision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.decision-panel label + label,
.decision-grid + label {
  margin-top: 12px;
}

.decision-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

#decisionMessage {
  color: var(--muted);
  font-size: 13px;
}

.raw-detail {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 800;
}

pre {
  overflow: auto;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050607;
  padding: 12px;
  color: #d9e7df;
  font-size: 12px;
}

@media (max-width: 980px) {
  .summary-band,
  .workbench,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar,
  .detail {
    min-height: auto;
  }

  .report-list {
    max-height: 430px;
  }
}

.agent-cards-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.agent-card {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.agent-card:hover {
  border-color: rgba(25, 216, 216, 0.6);
  background: #151e24;
  transform: translateY(-2px);
}

.agent-card.active {
  border-color: var(--cyan);
  background: #17272f;
  box-shadow: 0 0 12px rgba(25, 216, 216, 0.2);
}

.agent-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.agent-card .agent-card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--cyan);
  font-weight: 600;
}

.agent-card .agent-card-meta.pending {
  color: var(--yellow);
}

.detail-info-item {
  border-left: 3px solid var(--cyan) !important;
  margin-bottom: 12px;
}

.detail-info-item ul {
  padding-left: 18px;
}

.detail-info-item li {
  margin-bottom: 4px;
}
