:root {
  color-scheme: light;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d8e1ea;
  --text: #16212b;
  --muted: #687888;
  --primary: #0f766e;
  --blue: #0b63ce;
  --green: #15803d;
  --amber: #b7791f;
  --gray: #64748b;
  --page-max: 1560px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

html,
body {
  height: 100%;
}

button,
input,
select {
  font: inherit;
}

.shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.header {
  background: #10202c;
  color: #fff;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.brand {
  min-width: 0;
  font-weight: 850;
  font-size: 22px;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #b9cad8;
  font-size: 13px;
  font-weight: 500;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.nav button {
  max-width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #dce8f0;
  background: transparent;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  background: #1e394b;
  color: #fff;
}

.content {
  min-width: 0;
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  padding: 30px 34px;
  display: grid;
  gap: 22px;
  align-content: start;
  overflow-y: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 22px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  padding: 22px;
  box-shadow: 0 2px 8px rgba(20, 39, 56, 0.04);
}

.panel h1,
.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

.panel h1 {
  font-size: 34px;
  line-height: 1.12;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.card:hover,
.card.active {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12);
}

.card h3 {
  margin: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(170px, 0.7fr) minmax(170px, 0.7fr);
  gap: 12px;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #edf2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status.active {
  background: #dcfce7;
  color: var(--green);
}

.status.research {
  background: #dbeafe;
  color: var(--blue);
}

.status.archive {
  background: #f1f5f9;
  color: var(--gray);
}

.status.candidate,
.status.historical {
  background: #fef3c7;
  color: var(--amber);
}

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

.metric {
  display: grid;
  gap: 6px;
}

.metric strong {
  font-size: 30px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(460px, 0.86fr);
  gap: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.list {
  display: grid;
  gap: 12px;
}

.target,
.study {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 8px;
  background: var(--surface-soft);
}

.target-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  max-width: 360px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--surface-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .hero,
  .detail,
  .cards,
  .metrics {
    grid-template-columns: 1fr;
  }

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

  .content {
    overflow: visible;
    padding: 22px;
  }
}

@media (max-width: 720px) {
  .header {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .content {
    padding: 16px;
  }

  .panel {
    padding: 18px;
  }

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

  table {
    min-width: 760px;
  }
}
