:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d8dde6;
  --line-strong: #b7c0cf;
  --text: #172033;
  --muted: #5d6a7e;
  --accent: #0f766e;
  --accent-dark: #115e59;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Segoe UI, Roboto, Arial, sans-serif;
  font-size: 15px;
}

body.detail-open {
  overflow: hidden;
}

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

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

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

main {
  width: min(1420px, calc(100% - 32px));
  margin: 18px auto 36px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.summary div {
  min-height: 82px;
  padding: 14px 16px;
  background: var(--surface);
}

.summary span,
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.toolbar {
  display: grid;
  grid-template-columns: 170px 170px 180px 180px minmax(220px, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.tab-button {
  min-width: 155px;
}

.tab-button.active {
  border-color: var(--accent);
  background: #e6f4f1;
  color: var(--accent-dark);
  font-weight: 700;
}

.profile-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

input,
select,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

input,
select {
  height: 40px;
}

textarea {
  min-height: 156px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

button {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

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

.primary-button {
  min-width: 150px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.results {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.applications-view {
  margin-top: 18px;
}

.applications-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.applications-heading select {
  width: 180px;
}

.applications-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.application-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.application-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.application-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.application-details div {
  min-height: 58px;
  padding: 10px 12px;
  background: #ffffff;
}

.application-details span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.application-details strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
}

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

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef1f5;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

td:first-child,
th:first-child {
  width: 82px;
}

.job-title {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.job-title:hover {
  color: var(--accent);
}

.link-button {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 30px;
  border-radius: 6px;
  background: #e6f4f1;
  color: var(--accent-dark);
  font-weight: 800;
}

.status-select {
  min-width: 135px;
}

.application-controls {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
  min-width: 180px;
}

.small-button {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.inline-date {
  width: 160px;
  color: var(--muted);
  font-size: 11px;
}

.inline-date input {
  height: 34px;
  margin-top: 4px;
  font-size: 13px;
}

.follow-up-line {
  color: var(--muted);
  font-size: 13px;
}

.follow-up-line.due {
  color: #92400e;
  font-weight: 700;
}

.follow-up-line.overdue {
  color: #991b1b;
  font-weight: 700;
}

.follow-up-line.done {
  color: var(--accent-dark);
  font-weight: 700;
}

.empty {
  padding: 28px;
  text-align: center;
}

.form-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--accent-dark);
  font-weight: 600;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(23, 32, 51, 0.42);
}

.detail-card {
  width: min(720px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 22px;
  background: var(--surface);
  box-shadow: -10px 0 30px rgba(23, 32, 51, 0.18);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-facts div {
  min-height: 64px;
  padding: 11px 12px;
  background: #ffffff;
}

.detail-facts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-facts strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.detail-actions {
  margin-top: 16px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--accent-dark);
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.detail-section p {
  max-width: 68ch;
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .panel-heading,
  .applications-heading,
  .application-card-header {
    flex-direction: column;
  }

  main {
    width: calc(100% - 20px);
  }

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

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

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

  .application-details {
    grid-template-columns: 1fr;
  }

  .detail-card {
    padding: 18px;
  }

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