:root {
  --bg: #f8fbff;
  --panel: #ffffff;
  --line: #dbe5f2;
  --line-strong: #c7d5e8;
  --text: #07142f;
  --muted: #5a6b87;
  --blue: #1268ff;
  --blue-soft: #eaf2ff;
  --green: #12a454;
  --green-soft: #eaf8ef;
  --orange: #ff8a00;
  --orange-soft: #fff4e5;
  --red: #ff3434;
  --red-soft: #fff0f0;
  --violet: #7165d8;
  --gray: #8794a7;
  --shadow: 0 18px 50px rgba(40, 68, 110, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 46%, #f6f9fd 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.topbar,
.filters,
main,
footer {
  width: min(1500px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 28px 0 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

button,
select,
input {
  font: inherit;
}

.icon-button,
.ghost-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(40, 68, 110, 0.06);
}

.ghost-button {
  background: #fbfdff;
}

.icon {
  color: var(--blue);
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: 1.25fr repeat(5, minmax(140px, 1fr)) auto;
  gap: 16px;
  margin-bottom: 20px;
}

.filters label {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.filters select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  outline: none;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  min-width: 0;
  overflow: hidden;
}

.section-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  justify-content: flex-start;
}

.section-title span {
  font-size: 26px;
  font-weight: 900;
}

h2 {
  font-size: 24px;
  line-height: 1.15;
}

h3,
.aside-title {
  font-size: 16px;
  margin-bottom: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.metric-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 18px;
  min-width: 0;
}

.metric-card h3,
.stat-card h3 {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.metric-value {
  display: block;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1;
}

.delta {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 18px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px 24px;
  min-width: 0;
}

.donut-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 36px;
}

.donut {
  width: 210px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) 0 1deg, var(--orange) 1deg 2deg, var(--blue) 2deg 3deg, var(--violet) 3deg 4deg, var(--gray) 4deg 360deg);
  position: relative;
}

.donut::after {
  content: "";
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
}

.donut span {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.donut small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.legend {
  display: grid;
  gap: 13px;
}

.legend-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

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

.action-list,
.compact-list,
.insight-list {
  display: grid;
  gap: 8px;
}

.key-action,
.compact-row,
.insight {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 44px;
  padding: 5px 0;
}

.key-action:last-child,
.compact-row:last-child,
.insight:last-child {
  border-bottom: 0;
}

.opportunity-strip,
.priority-strip,
.status-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
  margin: 20px 0 14px;
}

.stat-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 26px;
  font-weight: 900;
}

.stat-card strong {
  display: block;
  font-size: 26px;
}

.stat-card small {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  background: #fbfdff;
}

td {
  font-size: 13px;
  font-weight: 650;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 7px;
  border: 1px solid currentColor;
  padding: 0 10px;
  font-weight: 900;
  font-size: 12px;
}

.pill.green { color: var(--green); background: var(--green-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.orange { color: var(--orange); background: var(--orange-soft); }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.gray { color: var(--gray); background: #f4f6f9; }
.pill.violet { color: var(--violet); background: #f2f0ff; }

.score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 3px solid var(--green);
  font-weight: 900;
}

.spark {
  width: 62px;
  height: 24px;
}

.ranking-layout {
  display: grid;
  grid-template-columns: 260px 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.mini-card-grid {
  display: grid;
  gap: 12px;
}

.stacked-chart {
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 16px;
  align-items: end;
}

.bar-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bar {
  width: min(42px, 100%);
  height: 150px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(to top, var(--violet) 0 24%, var(--blue) 24% 49%, var(--orange) 49% 72%, var(--green) 72% 100%);
}

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

.search-box {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box input {
  min-height: 42px;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.status-tabs {
  grid-template-columns: repeat(5, auto);
  justify-content: start;
}

.status-tab {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.status-tab.active {
  border-color: #9cc0ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.empty {
  padding: 32px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

footer {
  color: var(--muted);
  text-align: center;
  padding: 28px 0 40px;
}

@media (max-width: 1180px) {
  .filters,
  .metric-grid,
  .two-column,
  .ranking-layout,
  .split-panel {
    grid-template-columns: 1fr 1fr;
  }

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

  .donut-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .filters,
  main,
  footer {
    width: min(100% - 24px, 1500px);
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .filters,
  .metric-grid,
  .two-column,
  .opportunity-strip,
  .priority-strip,
  .ranking-layout,
  .split-panel {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px 14px;
  }

  .search-box {
    display: grid;
  }

  .search-box input {
    min-width: 0;
    width: 100%;
  }
}
