:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --ink: #17202a;
  --muted: #667085;
  --line: #d7dde5;
  --panel: #ffffff;
  --accent: #0f766e;
  --warn: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.metrics,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}

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

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.status {
  min-width: 128px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.status.ok {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--accent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.metrics article {
  min-height: 116px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child {
  border-right: 0;
}

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

.metrics strong {
  display: block;
  margin-top: 14px;
  font-size: 34px;
  line-height: 1;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
}

.contract-grid article {
  min-height: 92px;
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}

.contract-grid article:last-child {
  border-right: 0;
}

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

.contract-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1;
}

.panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

button {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.button-link {
  min-height: 36px;
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.button-link:hover {
  border-color: var(--accent);
}

.manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
}

.manager-card {
  min-height: 154px;
  background: var(--panel);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  text-decoration: none;
}

.manager-card:hover {
  background: #f9fbfb;
}

.manager-card span {
  font-weight: 750;
  line-height: 1.25;
}

.manager-card strong {
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.manager-card small,
.empty {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.manager-focus {
  color: var(--warn) !important;
}

.empty {
  background: var(--panel);
  margin: 0;
  padding: 20px 24px;
}

.manager-detail[hidden],
#managerPanel[hidden] {
  display: none;
}

.detail-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 0;
  border-left: 0;
  border-right: 0;
}

.analysis-box {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.analysis-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.analysis-box p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.coaching-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  border-top: 1px solid var(--line);
}

.coaching-main,
.coaching-side,
.coaching-section {
  min-width: 0;
  background: var(--panel);
}

.coaching-side {
  border-left: 1px solid var(--line);
}

.coaching-section {
  border-top: 1px solid var(--line);
}

.subhead {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.subhead h3 {
  margin: 0;
  font-size: 16px;
}

.subhead span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  background: var(--panel);
}

.stage-card {
  min-height: 152px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 18px 20px;
}

.stage-card-head,
.coaching-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stage-card strong {
  line-height: 1.25;
}

.stage-card p,
.priority-item p,
.coaching-block p,
.evidence-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.stage-card small {
  color: var(--muted);
  font-size: 12px;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.stage-pill.green {
  border-color: rgba(15, 118, 110, 0.3);
  color: #0f766e;
  background: #f0fdfa;
}

.stage-pill.yellow {
  border-color: rgba(154, 52, 18, 0.25);
  color: #9a3412;
  background: #fff7ed;
}

.stage-pill.red {
  border-color: rgba(185, 28, 28, 0.25);
  color: #b91c1c;
  background: #fef2f2;
}

.stage-pill.gray {
  color: var(--muted);
  background: #f8fafc;
}

.score-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: #e8edf2;
}

.score-track span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.priority-list,
.coaching-plan,
.evidence-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.priority-item,
.coaching-block,
.evidence-item {
  background: var(--panel);
  padding: 18px 24px;
}

.priority-item strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.3;
}

.coach-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 16px;
}

.coaching-block h4 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.coaching-block h5 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
}

.coaching-block h5:not(:first-child) {
  margin-top: 16px;
}

.coaching-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.evidence-item {
  display: grid;
  gap: 10px;
}

.evidence-item div:first-child,
.issue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.issue-row span {
  border: 1px solid var(--line);
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.review-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.review-list article {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  background: var(--panel);
  padding: 18px 24px;
}

.review-list strong {
  display: block;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.review-list span,
.review-list small {
  color: var(--muted);
  font-size: 13px;
}

.review-list p {
  margin: 0 0 8px;
  line-height: 1.45;
  white-space: normal;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td.status-cell {
  color: var(--warn);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

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

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

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

  .coaching-layout,
  .coach-columns {
    grid-template-columns: 1fr;
  }

  .coaching-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .subhead {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics article:last-child {
    border-bottom: 0;
  }

  .contract-grid article:nth-child(2n) {
    border-right: 0;
  }

  .review-list article {
    grid-template-columns: 1fr;
  }
}
