:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #161a22; --muted: #6b7280; --line: #e6e8ec;
  --side: #121621; --side-ink: #c9cedb; --accent: #4f46e5; --accent-soft: #eef0ff;
  --green: #15803d; --green-soft: #e8f6ec; --amber: #b45309; --amber-soft: #fdf3e2;
  --red: #b91c1c; --red-soft: #fdecec; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Manrope, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: #fff; padding: 2px 8px 22px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 15px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; font-weight: 600; }
nav a:hover { background: #1c2230; color: #fff; }
nav a.on { background: #232a3b; color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.me { display: flex; gap: 10px; align-items: center; }
.me b { display: block; color: #fff; font-size: 13px; }
.me small { color: #8b93a7; font-size: 12px; }
.link { background: none; border: 0; color: #8b93a7; padding: 0; cursor: pointer; text-align: left; font-size: 12px; }
.link:hover { color: #fff; }

main { padding: 26px 30px 60px; min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.head .sub { color: var(--muted); margin-top: 2px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumbs a:hover { color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: #c8ccd6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 18px 20px; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover td { background: #fafbfc; }
.t-title { font-weight: 700; }
.t-sub { color: var(--muted); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f0f1f4; color: #374151; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.minibar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #eef0f3; width: 140px; }
.minibar span { display: block; height: 100%; }

.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; background: #e8eaf6; color: #3730a3; }
.av.lg { width: 56px; height: 56px; font-size: 18px; }

/* Канбан */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 248px; background: #eceef2; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col h3 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.col h3 .cnt { color: var(--muted); font-weight: 700; }
.col.reject { background: #f6eded; }
.col.reserve { background: #f5f0e6; }
.kc { background: var(--panel); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 0 rgba(17,24,39,.06), 0 0 0 1px var(--line); cursor: grab; }
.kc:hover { box-shadow: 0 2px 8px rgba(17,24,39,.08), 0 0 0 1px #d4d7de; }
.kc .top { display: flex; gap: 9px; align-items: center; }
.kc b { display: block; font-size: 13.5px; }
.kc small { color: var(--muted); font-size: 12px; }
.kc .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.empty-col { color: #9aa1ae; font-size: 12.5px; text-align: center; padding: 18px 0; }

/* Поиск и фильтры */
.searchbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.search { flex: 1 1 360px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.search input { border: 0; outline: 0; padding: 10px 0; width: 100%; background: none; }
.search:focus-within { border-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
select, input[type=text], input[type=date], input[type=tel], input[type=email], input[type=number], textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 8px 10px; outline: 0; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12.5px; margin: -4px 0 14px; }
.hint code { background: #eceef2; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Карточка кандидата */
.drawer-bg { position: fixed; inset: 0; background: rgba(17,22,33,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); z-index: 11; transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.12); }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-bg { opacity: 1; pointer-events: auto; }
.dr-head { background: var(--panel); padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: flex-start; }
.dr-head h2 { margin: 0; font-size: 20px; }
.dr-head .x { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; }
.dr-body { padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; font-size: 13.5px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; }
.sec-t { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.vac-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vac-row:last-child { border-bottom: 0; }
.vac-row .grow { flex: 1; min-width: 160px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li.note::before { background: #9aa1ae; }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .txt { margin-top: 3px; background: var(--panel); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; font-size: 13px; white-space: pre-wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.note-form { display: flex; gap: 8px; }
.note-form textarea { flex: 1; min-height: 40px; resize: vertical; }

/* Модальное окно */
.modal-bg { position: fixed; inset: 0; background: rgba(17,22,33,.4); display: none; place-items: center; z-index: 20; padding: 16px; }
.modal-bg.on { display: grid; }
.modal { background: var(--panel); border-radius: 14px; width: min(520px, 100%); padding: 22px 24px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select { color: var(--ink); font-weight: 500; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.warn { background: var(--amber-soft); color: var(--amber); padding: 10px 12px; border-radius: 9px; font-size: 13px; margin-top: 12px; }
.warn a { text-decoration: underline; font-weight: 700; }

/* Аналитика */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px; }
.kpi b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.fun-row { display: grid; grid-template-columns: 210px 1fr 64px 70px; gap: 12px; align-items: center; padding: 7px 0; }
.fun-row .lbl { font-weight: 600; font-size: 13.5px; }
.fun-row .bar { height: 26px; background: #eef0f6; border-radius: 6px; overflow: hidden; }
.fun-row .bar span { display: flex; align-items: center; height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); color: #fff; font-size: 12px; font-weight: 700; padding-left: 8px; border-radius: 6px; min-width: 28px; }
.fun-row .c { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.fun-row .c small { display: block; color: var(--muted); font-size: 11px; }
.rej { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rej:last-child { border-bottom: 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: all .2s; z-index: 30; pointer-events: none; font-weight: 600; }
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; gap: 6px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  nav { flex-direction: row; }
  nav a span { display: none; }
  .side-foot { display: none; }
  main { padding: 18px 16px 50px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .fun-row { grid-template-columns: 120px 1fr 52px; }
  .fun-row .c:last-child { display: none; }
  .list .hide-m { display: none; }
  .form { grid-template-columns: 1fr; }
}

/* ---- Дополнения под интерфейс ---- */
.count { color: var(--muted); font-weight: 600; font-size: 18px; margin-left: 4px; }
.row-g { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search.sm { flex: 0 1 260px; }
.btn.ghost { background: none; color: var(--muted); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.link.dark { color: var(--muted); font-size: 13px; }
.link.dark:hover { color: var(--ink); }
.link.acc { color: var(--accent); font-weight: 600; font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 22px 0; }
.center { text-align: center; padding: 8px; }
.red { color: var(--red); }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.xl { width: 72px; height: 72px; font-size: 22px; border-radius: 14px; }
.who { display: inline-flex; gap: 8px; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: color-mix(in srgb, var(--c) 85%, #000); background: color-mix(in srgb, var(--c) 8%, #fff); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.kpis.five { grid-template-columns: repeat(5, 1fr); }
.kpi small { display: block; color: #a0a6b2; font-size: 11px; margin-top: 1px; }
.kpi b { margin-top: 10px; text-align: right; }
.kpi b.sm { font-size: 15px; text-align: left; }
.kpi .q { font-style: normal; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid #c5cad3; font-size: 10px; color: var(--muted); cursor: help; }

.strip-wrap { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.strip { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 4px; }
.chip { flex: 0 0 132px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; min-height: 72px; }
.chip span { color: var(--c); font-size: 12px; font-weight: 700; line-height: 1.25; }
.chip b { align-self: flex-end; font-size: 20px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--c); }
.chip.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); background: color-mix(in srgb, var(--c) 6%, #fff); }
.seg { display: inline-flex; flex-direction: column; gap: 2px; background: #eceef2; border-radius: 10px; padding: 3px; align-self: flex-start; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg.wide { flex-direction: row; margin-bottom: 14px; }

.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cards { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.cc { padding: 14px 16px 6px; cursor: pointer; }
.cc:hover { border-color: #d0d4dc; }
.cc-main { display: grid; grid-template-columns: 56px 1.3fr 1fr 1fr; gap: 14px; padding-bottom: 10px; }
.cc-who b { font-size: 15px; }
.cc-contacts { display: flex; flex-direction: column; margin-top: 6px; font-size: 13px; }
.cc-col { font-size: 13px; }
.cc-col small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.cc-col small + div { margin-bottom: 6px; }
.cc .vac-row { border-top: 1px solid var(--line); border-bottom: 0; padding: 9px 0; }
.vr-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.vr-act { display: flex; gap: 6px; }

.with-filter { display: flex; gap: 14px; align-items: flex-start; }
.fpanel { width: 320px; flex: none; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.fpanel label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; }
.fpanel select, .fpanel input { width: 100%; font-weight: 500; }
.fp-h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.fp-box { background: #f3f5fb; margin: 0 -16px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.fp-t { font-weight: 700; font-size: 13px; }
.kw { display: flex; flex-direction: column; gap: 6px; }
.and { font-size: 11px; font-weight: 800; color: var(--accent); text-align: center; }
.two { display: flex; gap: 6px; }
.fpanel .actions { position: sticky; bottom: -16px; background: var(--panel); padding: 10px 0 0; margin-top: 0; }

.dr-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: #e9eefb; border-bottom: 1px solid var(--line); }
.dr-bar input { flex: 1; }
.dr-bar .x { border: 0; background: none; cursor: pointer; font-size: 26px; color: var(--muted); line-height: 1; }
.dr-head { border-bottom: 0; }
.dr-head .grow { flex: 1; }
.dr-head h2 { font-size: 18px; line-height: 1.25; }
.dr-head .mid { font-weight: 500; }
.dr-contacts { margin-top: 8px; font-size: 13.5px; }
.dr-side { text-align: right; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.sec-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sec-h b { font-size: 16px; color: #4b5563; }
.pad-x { padding: 4px 18px 8px; }
.timeline.pad-x { padding-top: 14px; }
.timeline li.reject::before { background: var(--red); }

.form.one { grid-template-columns: 1fr; margin-top: 12px; }
.form textarea { color: var(--ink); }
.pick { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pick-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }

.an-f { padding: 12px 14px; }
.sec-t2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.sec-t2 small { display: block; font-size: 11.5px; color: #a0a6b2; font-weight: 600; }
.fun-head, .fun-row { display: grid; grid-template-columns: 200px 56px 1fr 120px 52px; gap: 10px; align-items: center; }
.fun-head { font-size: 11.5px; color: var(--muted); font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fun-row { padding: 6px 0; }
.fun-row .lbl { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fun-row .bar { display: flex; height: 22px; background: #f1f3f6; border-radius: 4px; overflow: hidden; }
.fun-row .bar span { display: block; height: 100%; padding: 0; min-width: 0; border-radius: 0; }
.fun-row .c { text-align: left; }
.fun-row .c small { display: inline; color: var(--accent); font-size: 11.5px; }
.fun-row .pct { color: var(--accent); font-size: 12px; font-weight: 700; }
.fun-row .rj { color: var(--red); font-weight: 700; text-align: right; }
.fun-row.sub .lbl { padding-left: 22px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.fun-row.notype .lbl { color: var(--muted); }
.tw { width: 18px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; flex: none; }
.note { margin: 12px 0 0; font-size: 12px; }
.side-t { display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.rj-g { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 12px 0 2px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.list.plain tbody tr { cursor: default; }
.list.plain tbody tr:hover td { background: none; }
.sub-st { padding-left: 4px; font-size: 12.5px; }

@media (max-width: 900px) {
  .kpis.five { grid-template-columns: 1fr 1fr; }
  .cc-main { grid-template-columns: 44px 1fr; }
  .av.lg { width: 44px; height: 44px; font-size: 14px; }
  .with-filter { flex-direction: column-reverse; }
  .fpanel { width: 100%; position: static; max-height: none; }
  .strip-wrap { flex-direction: column; }
  .seg { flex-direction: row; }
  .fun-head { display: none; }
  .fun-row { grid-template-columns: 1fr 70px; }
  .fun-row .bar, .fun-row .pct, .fun-row .rj { display: none; }
  .dr-head { flex-wrap: wrap; }
  .dr-side { text-align: left; }
  .vac-row { flex-direction: column; align-items: flex-start; }
}
.search input[type=text] { border: 0; padding: 10px 0; background: none; }
@media (min-width: 901px) { .shell { background: linear-gradient(90deg, var(--side) 228px, var(--bg) 228px); } }
@media (max-width: 900px) { .hide-m { display: none !important; } .search { flex-basis: 100%; } }
