:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #dde3ea;
  --line-strong: #c9d3df;
  --text: #172033;
  --muted: #667085;
  --soft: #eef3f7;
  --green: #11845b;
  --green-soft: #e8f7ef;
  --blue: #245fc5;
  --blue-soft: #e8f0ff;
  --amber: #b7791f;
  --radius: 8px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  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);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 750;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(460px, 1fr) 410px;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.filters-panel,
.results-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filters-panel {
  padding: 18px;
  overflow: auto;
}

.panel-title,
.results-header,
.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.section-label {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.money-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 8px;
  font-weight: 600;
}

.toggle-row input {
  width: 16px;
}

.results-panel {
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.results-header {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.results-header p,
.detail-heading p,
.empty-detail p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.source-summary {
  margin-top: 4px !important;
  color: var(--text) !important;
  font-weight: 650;
}

.source-tabs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.source-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}

.source-tabs button.active {
  border-color: #b7e0c9;
  background: var(--green-soft);
  color: var(--green);
}

.table-head,
.job-row {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1fr) 76px 82px 90px;
  gap: 12px;
  align-items: center;
}

.table-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.jobs-list {
  overflow: auto;
}

.job-row {
  width: 100%;
  min-height: 78px;
  padding: 12px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.job-row:hover,
.job-row.selected {
  background: #f7fbff;
}

.job-row.selected {
  box-shadow: inset 3px 0 0 var(--blue);
}

.job-main strong {
  display: block;
  font-size: 14px;
}

.job-main span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.score-chip,
.score-large {
  display: inline-grid;
  place-items: center;
  border: 1px solid #b7e0c9;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.score-chip {
  min-width: 44px;
  min-height: 34px;
}

.score-large {
  min-width: 62px;
  min-height: 58px;
  font-size: 23px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.fit-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.fit-label.skip {
  color: #a15c07;
}

.fit-label.unscored {
  color: var(--muted);
}

.detail-panel {
  padding: 20px;
  overflow: auto;
}

.empty-detail {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.job-detail section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-tabs {
  display: flex;
  gap: 6px;
  margin: 18px -4px 0;
  border-bottom: 1px solid var(--line);
}

.detail-tabs button {
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.detail-tabs .active {
  color: var(--green);
  border-color: var(--green);
}

.signal-list,
.risk-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #344054;
  font-size: 13px;
}

.signal-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
  margin-right: 8px;
}

.risk-list li::before {
  content: "!";
  color: var(--amber);
  font-weight: 900;
  margin-right: 8px;
}

.note-box,
.description-box,
.pitch-box,
.application-box {
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.description-box {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

.application-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  white-space: pre-wrap;
}

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

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.text-btn,
.secondary-link {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.full-width {
  width: 100%;
}

.primary-btn {
  background: var(--green);
  color: white;
}

.secondary-btn,
.secondary-link {
  background: var(--blue);
  color: white;
}

.ghost-btn {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}

.text-btn {
  min-height: 24px;
  padding: 0;
  background: transparent;
  color: var(--blue);
}

.hidden {
  display: none !important;
}

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

  .detail-panel {
    grid-column: 1 / -1;
    min-height: 460px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .topbar,
  .top-actions,
  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    gap: 12px;
    padding: 14px;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .table-head {
    display: none;
  }

  .job-row {
    grid-template-columns: 30px 1fr 54px;
  }

  .job-row .source-badge,
  .job-row .fit-label {
    display: none;
  }
}
