/* Кабинет рекрутера: направление «Доброжелательный».
   Тёмно-бирюзовое меню слева, светлый бирюзово-серый фон, белые карточки с крупным
   скруглением, оценка кольцом, шрифт Onest. Слой стилей общий для всех страниц кабинета;
   классы совпадают с теми, что используют шаблоны (badge, page-header, hint и т. д.). */

:root {
  --bg: #eaf3f1;
  --surface: #ffffff;
  --surface-2: #f4faf8;
  --line: #d3e5e1;
  --text: #12302d;
  --muted: #527571;
  --accent: #0c8f82;
  --accent-hover: #0a7a6f;
  --accent-soft: #d9f1ed;
  --on-accent: #ffffff;
  --side: #0f3d3a;
  --side-text: #a9cfc9;
  --side-on: #17564f;
  --ok: #0f8a54;
  --ok-bg: #d9f2e4;
  --warn: #a85a00;
  --warn-bg: #ffead0;
  --err: #c23a2b;
  --err-bg: #ffe0da;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 10px rgb(18 60 56 / 0.07);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.shell.no-side { display: block; }
.side {
  background: var(--side);
  color: var(--side-text);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 19px; padding: 2px 10px 18px; text-decoration: none; }
.brand .logo { color: #7fe0d3; width: 28px; height: 28px; }
.brand:hover { color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a {
  display: flex; align-items: center; gap: 11px;
  color: var(--side-text); text-decoration: none;
  padding: 10px 12px; border-radius: var(--radius); font-weight: 500;
}
.side nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side nav a:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.side nav a[aria-current="page"] { background: var(--side-on); color: #fff; }
.side .spacer { flex: 1; }
.side .who { border-top: 1px solid #25564f; padding: 14px 10px 0; display: grid; gap: 8px; font-size: 13px; color: #8dbcb5; }
.side .who strong { color: #fff; font-weight: 500; word-break: break-all; }
.side .who form { display: block; }
.side .who button { background: transparent; border: 1px solid #2f6a62; color: #cfe8e4; padding: 6px 14px; font-size: 13px; width: auto; }
.side .who button:hover { background: rgb(255 255 255 / 0.08); }

.content { padding: 34px 40px 56px; min-width: 0; max-width: 1120px; width: 100%; margin-inline: auto; display: block; }
.no-side .content { max-width: 440px; padding-top: 72px; }
.no-side .content > h1:first-child, .no-side .content > .auth-brand + h1 { text-align: center; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--accent); font-size: 22px; margin-bottom: 22px; }
.auth-brand .logo { width: 34px; height: 34px; }
.auth-brand .wordmark { color: var(--text); }

/* ---------- типографика ---------- */
h1 { font-size: 28px; line-height: 1.15; margin: 0 0 16px; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 18px; margin: 32px 0 10px; font-weight: 700; text-wrap: balance; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- заголовок страницы и вкладки вакансии ---------- */
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.tabs a {
  padding: 9px 16px; border-radius: 999px 999px 0 0; text-decoration: none; color: var(--muted); font-weight: 500;
  margin-bottom: -1px; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- формы ---------- */
form { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 4px; }
input, textarea, select {
  width: 100%; padding: 11px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid #c3d9d4; border-radius: var(--radius);
}
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
fieldset:disabled { opacity: 0.6; }
input[type="checkbox"], input[type="radio"] { width: auto; }

button, a.button {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; text-align: center;
  padding: 10px 20px; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--on-accent); cursor: pointer; line-height: 1.3;
}
button:hover, a.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
button:disabled { opacity: 0.5; cursor: default; }
button.secondary-button, a.button.secondary {
  background: var(--surface); color: var(--text); border-color: #c3d9d4;
}
button.secondary-button:hover, a.button.secondary:hover { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
button.danger { background: var(--err); border-color: var(--err); }
button.danger:hover { background: #a02e21; border-color: #a02e21; }
.link-button { background: none; border: 0; color: var(--err); padding: 0; font-weight: 500; text-decoration: underline; border-radius: 0; }
.link-button:hover { background: none; color: #a02e21; }
.inline-form { flex-direction: row !important; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 2; min-width: 160px; }
.inline-form input[type="number"] { flex: 0 0 96px; }
.inline-form select { flex: 1; min-width: 240px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline-flex; flex-direction: row; gap: 8px; }
.actions button:disabled { color: #9bb7b2; }

/* ---------- сообщения ---------- */
.error, .warning, .banner {
  border-radius: var(--radius); padding: 11px 16px; font-size: 14.5px; margin: 0 0 14px;
}
.error { background: var(--err-bg); color: var(--err); }
.warning { background: var(--warn-bg); color: var(--warn); }
.banner { background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.banner.warn { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.checklist { color: var(--warn); font-size: 14.5px; }
.copy-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.copy-box pre { white-space: pre-wrap; word-break: break-word; margin: 8px 0; font: inherit; font-size: 14.5px; background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }

/* ---------- таблицы ---------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden;
}
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td form { flex-direction: row; display: inline-flex; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link.active { color: var(--accent); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* ---------- значки ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-draft, .badge-origin-bank, .badge-not_opened, .status-incomplete { background: #e8efed; color: #4b6b67; }
.badge-active, .badge-completed, .status-report_ready, .verdict-correct { background: var(--ok-bg); color: var(--ok); }
.badge-closed, .badge-expired, .badge-revoked, .status-error, .verdict-incorrect { background: var(--err-bg); color: var(--err); }
.status-processing, .badge-started, .verdict-partial, .badge-origin-manual { background: var(--warn-bg); color: var(--warn); }
.status-in_progress, .badge-opened, .badge-origin-generated { background: var(--accent-soft); color: var(--accent); }
.verdict-no_answer { background: #e8efed; color: #4b6b67; }

/* ---------- оценка ---------- */
.score { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.ring {
  --p: 0; width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-block;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-soft) 0);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%);
}
.ring.big { width: 96px; height: 96px; }
.score-row { display: flex; align-items: center; gap: 22px; margin: 4px 0 16px; }
.score-big { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; margin: 0; }
.score-big small { font-size: 18px; font-weight: 500; color: var(--muted); }
.bar { background: var(--accent-soft); border-radius: 6px; height: 8px; min-width: 90px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ---------- карточка отчёта ---------- */
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; font-size: 14.5px; margin: 0 0 18px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.answer { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 14px; }
.answer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.answer .question { font-size: 17px; margin: 8px 0 12px; font-weight: 600; }
.answer audio { width: 100%; margin: 4px 0 10px; }
.transcript { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius); padding: 12px 15px; font-size: 14.5px; margin: 8px 0; }
.transcript.empty { color: var(--muted); font-style: italic; }
.quote { margin: 10px 0; padding: 10px 15px; background: var(--accent-soft); border-radius: var(--radius); color: var(--text); font-size: 14.5px; }
.why { font-size: 13.5px; color: var(--muted); }
.audio-fallback { font-size: 13.5px; }
.feedback textarea { min-height: 170px; }

/* ---------- прочее ---------- */
.questions { table-layout: auto; }
.questions td { vertical-align: top; }
.questions th:first-child, .questions td:first-child { width: 36px; }
.question-text { min-width: 340px; width: 45%; }
.question-text form { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; }
.question-text textarea { flex: 1; min-width: 0; padding: 9px 12px; }
.question-text button { flex: none; padding: 7px 14px; font-size: 13.5px; }
.row-actions .actions { flex-wrap: nowrap; gap: 12px; white-space: nowrap; }
.link-neutral { color: var(--accent); }
.link-neutral:hover { color: var(--accent-hover); }
.add-question-form { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.replace-dialog { width: min(560px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); }
.replace-dialog::backdrop { background: rgb(10 20 20 / 0.45); }
.replace-dialog h2 { margin: 0 0 4px; }
.secondary-button { background: var(--surface); color: var(--text); border-color: #c3d9d4; }
.secondary-button:hover { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.weight-form { flex-direction: row; align-items: center; gap: 8px; }
.weight-form input { width: 84px; padding: 7px 10px; }
.weight-form button { padding: 7px 14px; font-size: 13.5px; }

.weights-sum { margin: 0 0 14px; font-size: 14.5px; color: var(--ok); }
.weights-sum.weights-off { color: var(--warn); }

/* отступы между блоками страницы вакансии */
.block { margin-top: 48px; }
.block:first-of-type { margin-top: 24px; }
.block > h2 { margin-top: 0; }
.block > form + form, .block > table + form, .block > .hint + form, .block > .checklist + form,
.block > .inline-form + form { margin-top: 16px; }
.block .actions form { margin-top: 0; }
.block .hint { margin-bottom: 14px; }
.block fieldset > button { margin-top: 8px; }

/* форма выпуска ссылки: подписи над полями */
.invite-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 20px; align-items: start; margin-bottom: 12px; }
.invite-form .field { display: block; }
.invite-form .field button { margin-top: 24px; }
.invite-form .hint[hidden] { display: none; }
.site-footer { margin-top: 40px; font-size: 13px; color: var(--muted); }
.pill { display: inline-block; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 4px 14px; font-size: 13.5px; color: var(--muted); }
.pill strong { color: var(--text); }
.no-side form { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 26px; }
.no-side .hint { text-align: center; margin-top: 16px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 12px 14px; gap: 8px; }
  .brand { padding: 0 8px 0 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side .spacer { display: none; }
  .side .who { border-top: 0; padding: 0; margin-left: auto; grid-auto-flow: column; align-items: center; gap: 10px; }
  .content { padding: 22px 16px 48px; }
  h1 { font-size: 24px; }
  table { display: block; overflow-x: auto; }
  .meta { grid-template-columns: 1fr; gap: 0; }
  .meta dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, a.button, .tabs a, .side nav a { transition: background-color 0.12s, color 0.12s, border-color 0.12s; }
}

/* ---------- сообщить о баге (раздел 2.12) ---------- */
.side .bug-button { color: var(--side-text); padding: 6px 10px; text-align: left; }
.side .bug-button:hover { color: #fff; }

/* ---------- опрос после исчерпания попыток (раздел 2.13) ---------- */
.survey-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
}
.survey-dialog::backdrop { background: rgb(10 20 20 / 0.45); }
.survey-dialog h2 { margin: 0 0 6px; font-size: 20px; }
.survey-dialog form { display: flex; flex-direction: column; gap: 14px; }
.survey-dialog fieldset { border: 0; margin: 0; padding: 0; }
.survey-dialog legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.survey-dialog .choices { display: flex; gap: 14px; flex-wrap: wrap; }
.survey-dialog .choices.column { flex-direction: column; gap: 6px; }
.survey-dialog .choices label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.survey-dialog [hidden] { display: none; }
.survey-dialog .actions { display: flex; gap: 8px; }

.question-text form { flex-direction: column; align-items: stretch; gap: 4px; }

.badge-duplicate { background: var(--err-bg); color: var(--err); font-weight: 600; }
.questions tr.duplicate td { background: var(--err-bg); }
.questions tr.duplicate:hover td { background: var(--err-bg); }
