@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg-0: #f4f7f5;
  --bg-1: #e7f2ee;
  --panel: #ffffff;
  --line: #d7e4df;
  --text: #10241d;
  --muted: #4f675f;
  --brand: #0b8f65;
  --brand-2: #125f8a;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #027a48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #dff3eb 0%, transparent 36%),
    radial-gradient(circle at 100% 0%, #e3eef8 0%, transparent 32%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 48%);
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

h3 {
  font-size: 22px;
}

h4 {
  font-size: 15px;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 920px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(16, 36, 29, 0.06);
}

.narrow {
  max-width: 430px;
}

.command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.command-actions {
  min-width: min(100%, 480px);
  display: grid;
  gap: 8px;
}

.intel-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.intel-left {
  display: grid;
  gap: 10px;
}

.radar-deck {
  display: grid;
  gap: 10px;
}

.radar-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(150deg, rgba(11, 143, 101, 0.08), rgba(18, 95, 138, 0.02));
  cursor: pointer;
}

.radar-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(11, 143, 101, 0.35);
}

.radar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.radar-name {
  font-weight: 700;
  font-size: 14px;
}

.radar-stats {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.radar-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
}

.radar-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.radar-open {
  margin-top: 8px;
  width: 100%;
}

.insight-board {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  min-height: 540px;
}

.insight-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.intel-tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.intel-tab-btn {
  border: 1px solid var(--line);
  background: #f8fbfa;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.intel-tab-btn.active {
  border-color: var(--brand);
  background: rgba(11, 143, 101, 0.12);
  color: #075a40;
}

.entity-subtabs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
}

.entity-subtab-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.entity-subtab-btn.active {
  border-color: var(--brand-2);
  background: rgba(18, 95, 138, 0.10);
  color: #0e4361;
}

.entity-tab-pane {
  display: none;
  margin-top: 10px;
}

.entity-tab-pane.active {
  display: block;
}

.tab-pane {
  display: none;
  margin-top: 12px;
}

.tab-pane.active {
  display: block;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.score-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: linear-gradient(180deg, rgba(18, 95, 138, 0.05), rgba(18, 95, 138, 0));
}

.card .k,
.score-card .k {
  font-size: 12px;
  color: var(--muted);
}

.card .v,
.score-card .v {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}

.insight-section {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fcfffd;
}

.brief-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.timeline-bars {
  display: grid;
  gap: 7px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 55px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.bar-day,
.bar-value {
  color: var(--muted);
}

.bar-track {
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 12px;
  background: #eff5f2;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(11, 143, 101, 0.07), rgba(18, 95, 138, 0.03));
}

form {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 14px;
}

button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
}

button.ghost {
  background: #fff;
  color: var(--brand);
}

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input {
  flex: 1;
}

.quick-list {
  display: grid;
  gap: 6px;
}

.quick-item {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 9px;
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.alert-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.alert-title,
.evidence-title {
  font-weight: 700;
}

.alert-summary {
  margin-top: 6px;
  font-size: 13px;
}

.alert-action {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  font-weight: 700;
}

.severity-high {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.severity-medium {
  border: 1px solid #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}

.severity-low {
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  background: #eff6ff;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.evidence-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(130deg, rgba(2, 122, 72, 0.06), rgba(18, 95, 138, 0.02));
}

.evidence-headline {
  font-size: 13px;
  margin-top: 6px;
}

.evidence-context {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.evidence-meta {
  margin-top: 6px;
  font-size: 12px;
}

.evidence-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.evidence-kind {
  display: inline-block;
  min-width: 60px;
  font-size: 11px;
  color: var(--brand-2);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1160px) {
  .intel-layout {
    grid-template-columns: 1fr;
  }

  .score-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .score-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-form {
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 72px minmax(0, 1fr) 42px;
  }
}
