:root {
  --ink: #151b23;
  --muted: #687385;
  --paper: #f4f6f8;
  --panel: #ffffff;
  --line: #dce3ea;
  --teal: #007c75;
  --teal-dark: #075f5a;
  --blue: #315fd6;
  --amber: #bd7b00;
  --red: #c94b3c;
  --green: #0f9f6e;
  --shadow: 0 16px 36px rgba(21, 27, 35, 0.08);
}

* { box-sizing: border-box; }

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

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  background: #121820;
  color: #ffffff;
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  font-weight: 900;
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 20px; }
.brand span { color: #aebbc8; font-size: 13px; }

.nav { display: grid; gap: 8px; }
.nav a {
  color: #cfd7df;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 750;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.12); color: #ffffff; }

.account-card {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255,255,255,0.08);
}
.account-card span, .account-card p { color: #b7c2ce; }
.account-card strong, .account-card span { display: block; }
.account-card p { margin: 8px 0 0; }

.main { padding: 24px; display: grid; gap: 18px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.kicker {
  color: var(--teal-dark);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(30px, 4vw, 48px); line-height: 1; }
h2 { margin-bottom: 0; font-size: 24px; line-height: 1.1; }
h3 { margin-bottom: 8px; font-size: 19px; }
p { color: var(--muted); line-height: 1.55; }

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}
.primary { color: #ffffff; background: var(--teal); border-color: var(--teal); }
.ghost { background: transparent; }
.wide { width: 100%; }
.top-actions { display: flex; gap: 10px; }

.overview, .calibration-grid, .workspace-grid, .mission-workspace, .review-grid, .trust-grid, .candidate-workspace, .systems-grid {
  display: grid;
  gap: 18px;
}
.overview { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr); }
.calibration-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr); }
.workspace-grid { grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr); }
.mission-workspace, .review-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); }
.trust-grid, .candidate-workspace, .systems-grid { grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr); }

.role-card, .decision-card, .candidate-list, .proof-panel, .mission-builder, .work-log, .manager-review, .audit-panel, .calibration-card, .integration-card, .trust-panel, .pain-panel, .candidate-portal, .dispute-panel, .integration-map, .fit-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.role-head, .panel-head, .candidate-top, .profile-head, .field-row, .audit-table div, .modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status, .draft, .state {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #dff4ef;
  font-size: 12px;
  font-weight: 900;
}
.state-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.state { color: var(--muted); background: #e9eef3; }
.state.done { color: var(--green); background: #e1f6ee; }
.state.active { color: var(--teal-dark); background: #dff4ef; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.pipeline div {
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}
.pipeline strong, .pipeline span { display: block; }
.pipeline strong { font-size: 30px; }
.pipeline span { color: var(--muted); margin-top: 4px; }
.decision-card { background: #eef7f5; }

.weight-list, .score-breakdown, .timeline, .audit-table { display: grid; gap: 12px; }
.weight-list div, .score-breakdown div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}
.weight-list span, .score-breakdown span { color: var(--muted); }
.weight-list i, .score-breakdown i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) var(--w), #e8eef2 var(--w));
}
.handoffs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.candidate-list, .proof-panel { display: grid; gap: 12px; align-content: start; }
.candidate {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}
.candidate.selected { border-color: var(--teal); background: #f2fbf9; }
.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dfe9ff;
  color: var(--blue);
  font-weight: 900;
}
.avatar.large { width: 64px; height: 64px; font-size: 20px; }
.candidate p { margin-bottom: 10px; }
.score {
  min-width: 44px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 900;
}
.score.amber { background: var(--amber); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f5;
  font-size: 12px;
  font-weight: 800;
}
.empty-state {
  padding: 14px;
  border: 1px dashed #b9c5cf;
  border-radius: 8px;
  background: #fbfcfd;
}
.empty-state p { margin: 6px 0 0; }

.proof-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: #121820;
  color: #ffffff;
}
.proof-score span, .proof-score strong { display: block; }
.proof-score span { color: #b9c4cf; }
.proof-score strong { font-size: 34px; }
.ring {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 92%, #32404f 92% 100%);
  border: 8px solid #121820;
  box-shadow: inset 0 0 0 8px #ffffff;
}
.evidence {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}
.evidence ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  padding: 12px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.mission-builder .wide { margin-top: 14px; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0 4px; }
.stepper span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: #edf2f5;
  font-size: 12px;
  font-weight: 900;
}
.stepper .complete { color: var(--green); background: #e1f6ee; }
.stepper .active { color: var(--teal-dark); background: #dff4ef; }

.timeline div {
  position: relative;
  padding: 0 0 14px 24px;
  border-left: 2px solid var(--line);
}
.timeline div::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}
.timeline p { margin: 4px 0; }
.timeline span { color: var(--muted); font-size: 12px; font-weight: 800; }

.review-score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.review-score div {
  padding: 14px;
  border-radius: 8px;
  background: #f9fbfc;
  border: 1px solid var(--line);
}
.review-score strong, .review-score span { display: block; }
.review-score strong { font-size: 24px; }
.review-score span { color: var(--muted); }
.audit-table div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.audit-table div:last-child { border-bottom: 0; }
.audit-table span { color: var(--muted); }

.trust-checks, .pain-meter, .system-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.trust-checks div, .pain-meter div, .system-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}
.trust-checks strong, .trust-checks span, .pain-meter span, .pain-meter strong, .system-list strong, .system-list span {
  display: block;
}
.trust-checks span, .pain-meter span, .system-list span {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}
.pain-meter strong {
  margin-top: 6px;
  color: var(--teal-dark);
  font-size: 22px;
}
.candidate-task {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #eef7f5;
}
.candidate-task p { margin: 6px 0 0; }
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.payment-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #121820;
  color: #ffffff;
}
.payment-strip span { color: #b9c4cf; }
.fit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.fit-list span {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.fit-list .good { color: var(--teal-dark); background: #dff4ef; }
.fit-list .caution { color: var(--amber); background: #fff2d7; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 32, 0.52);
  z-index: 20;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(720px, 100%);
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(18, 24, 32, 0.3);
  padding: 20px;
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-actions { justify-content: end; margin-top: 18px; }
.icon-button { min-width: 72px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .overview, .calibration-grid, .workspace-grid, .mission-workspace, .review-grid, .trust-grid, .candidate-workspace, .systems-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .main, .sidebar { padding: 16px; }
  .topbar, .role-head, .panel-head, .top-actions, .decision-actions, .field-row, .modal-actions { display: grid; width: 100%; }
  .pipeline, .handoffs, .modal-grid, .review-score, .trust-checks, .pain-meter, .system-list, .upload-grid { grid-template-columns: 1fr; }
  .payment-strip { display: grid; }
  .stepper { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 34px; }
}
