:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --surface-muted: #eef3f0;
  --text: #16211c;
  --muted: #61706a;
  --faint: #8b9993;
  --border: #d9e1dd;
  --border-strong: #b9c9c1;
  --primary: #00684d;
  --primary-strong: #004d3b;
  --primary-soft: #e3f3ed;
  --teal: #087982;
  --amber: #b36b00;
  --amber-soft: #fff4dd;
  --red: #b42318;
  --red-soft: #fde8e6;
  --green-soft: #e5f5ec;
  --shadow: 0 12px 30px rgba(18, 35, 28, 0.08);
  --radius: 8px;
  --sidebar: #003f32;
  --sidebar-2: #005341;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

button {
  border: 0;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(0, 104, 77, 0.12), rgba(8, 121, 130, 0.06)),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.auth-logo,
.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.auth-title {
  margin: 18px 0 8px;
  font-size: 26px;
  line-height: 1.15;
}

.auth-copy {
  margin: 0 0 24px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 104, 77, 0.13);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.button.danger {
  background: var(--red);
}

.button.full {
  width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.alert {
  display: none;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 12px 0;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.alert.show {
  display: block;
}

.alert.error {
  color: var(--red);
  border-color: #f2b8b5;
  background: var(--red-soft);
}

.alert.success {
  color: var(--primary-strong);
  border-color: #b8dfcd;
  background: var(--green-soft);
}

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

.app-shell,
.sidebar,
.main,
.workspace,
.grid,
.panel,
.panel-header,
.panel-body,
.applicant-card,
.answers-inline,
.answers,
.score-list,
.form-grid {
  min-width: 0;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #eef9f4;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 4px;
}

.brand-mark {
  background: rgba(255, 255, 255, 0.12);
  color: #f8d65a;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle {
  color: rgba(238, 249, 244, 0.72);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: rgba(238, 249, 244, 0.82);
  text-decoration: none;
  font-weight: 700;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px 24px 34px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 18px rgba(18, 35, 28, 0.05);
}

.panel.pad {
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.panel-body {
  padding: 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar .input {
  width: min(320px, 100%);
}

.applicant-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
}

.applicant-name {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 1.2;
}

.meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.ok,
.pill.recommended {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.pill.reserve {
  color: var(--amber);
  background: var(--amber-soft);
}

.pill.reject {
  color: var(--red);
  background: var(--red-soft);
}

.answers {
  display: grid;
  gap: 10px;
}

.answers-inline {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.answers-inline-title {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.25;
}

.answers-inline .answers {
  gap: 8px;
}

.answer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.answers-inline .answer {
  padding: 10px;
}

.answer-title {
  margin: 0 0 7px;
  font-weight: 800;
  color: var(--primary-strong);
  font-size: 13px;
}

.answers-inline .answer-title {
  margin-bottom: 5px;
  font-size: 12px;
}

.answer-text {
  margin: 0;
  white-space: pre-wrap;
  color: #2d3834;
}

.score-list {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) 72px;
  gap: 12px;
  align-items: center;
}

.score-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.score-label span {
  color: var(--muted);
  font-weight: 700;
}

.score-help {
  grid-column: 1 / -1;
  margin-top: -4px;
  padding: 8px 10px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-soft);
  color: #345149;
  font-size: 12px;
  line-height: 1.35;
}

.range {
  width: 100%;
  accent-color: var(--primary);
}

.score-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}

.score-total strong {
  font-size: 34px;
  color: var(--primary);
  line-height: 1;
}

.score-total span {
  color: var(--muted);
  font-weight: 800;
}

.list {
  display: grid;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
}

.list-row:hover,
.list-row.active {
  background: var(--primary-soft);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-title {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

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

.table th {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.table td {
  color: #25302c;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

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

.metric-value {
  margin-top: 5px;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.hidden {
  display: none !important;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
  }

  .sidebar {
    position: static;
    padding: 14px;
    width: 100%;
    max-width: 100%;
  }

  .brand,
  .brand > div,
  .main,
  .workspace {
    width: 100%;
    max-width: 100%;
  }

  .nav,
  .sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    overflow-x: visible;
    max-width: 100%;
  }

  .nav-link {
    white-space: normal;
  }

  .topbar {
    height: auto;
    min-height: 60px;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .workspace {
    padding: 16px;
  }

  .panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .score-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

@media (max-width: 520px) {
  .workspace {
    padding: 14px;
  }

  .panel-header,
  .panel-body {
    padding: 14px;
  }

  .applicant-card {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
  }

  .avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }

  .applicant-name {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .meta-row {
    gap: 7px;
  }

  .pill {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
