/* HR · БагатоЛосося — дизайн-система */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --line: #ebebef;
  --line-2: #f1f1f4;
  --text: #16161d;
  --text-2: #4a4a57;
  --muted: #8a8a98;
  --accent: #f2643d;
  --accent-2: #ff8a5c;
  --accent-soft: #fff1ec;
  --ok: #17a34a;  --ok-soft: #e9f8ef;
  --warn: #c77700; --warn-soft: #fff5e1;
  --bad: #e5484d; --bad-soft: #fdeeee;
  --info: #3b6ef6; --info-soft: #edf2ff;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,20,40,.04), 0 2px 8px rgba(20,20,40,.04);
  --shadow-lg: 0 8px 30px rgba(20,20,40,.08);
  --side: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  background: var(--bg); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; }
a.link, .link { color: var(--info); }
a.link:hover { text-decoration: underline; }
h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { flex: none; vertical-align: -3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 700; letter-spacing: -.02em; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 4px 12px rgba(242,100,61,.35); font-size: 13px; }
.logo small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; letter-spacing: 0; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; }
.side a.nv { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text-2);
  font-weight: 500; margin-bottom: 2px; }
.side a.nv:hover { background: var(--line-2); color: var(--text); }
.side a.nv.on { background: var(--accent-soft); color: var(--accent); }
.side a.nv .cnt { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 20px; padding: 1px 7px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); }
.side .me .nm { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me form { margin-left: auto; }
.iconbtn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--line-2); color: var(--text); }

main { padding: 28px 36px 80px; max-width: 1280px; width: 100%; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* мобільний */
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 18px 16px 96px; }
  h1 { font-size: 21px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 20;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .cnt { position: absolute; top: 0; right: 28%; background: var(--accent); color: #fff; font-size: 10px; border-radius: 10px; padding: 0 5px; }
  .mtop { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 16px; }
}
@media (min-width: 901px) { .mtop { display: none; } }

/* ---------- блоки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.cols > div > .card + .card, .stack > * + * { margin-top: 16px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mb { margin-bottom: 16px; }

/* показники */
.stat { position: relative; overflow: hidden; }
.stat .lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.stat .val small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.stat .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.bubble { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--c-soft, var(--info-soft)); color: var(--c, var(--info)); }
.stat.bal::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.kpi { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }

/* кнопки */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 500; line-height: 1.3; white-space: nowrap;
  transition: background .12s, box-shadow .12s, transform .05s; }
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(242,100,61,.3); }
.btn.primary:hover { background: #e4552f; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #12893d; }
.btn.bad { color: var(--bad); }
.btn.bad:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg a .n { color: var(--muted); margin-left: 4px; }

/* форми */
label.f, form.stack label { display: block; font-weight: 500; font-size: 13px; margin: 14px 0 6px; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=url], input[type=tel],
select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242,100,61,.15); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a98' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
select[multiple] { background-image: none; padding-right: 12px; }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; }
.help { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.errorlist { color: var(--bad); margin: 6px 0; padding-left: 18px; font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters > * { width: auto; flex: 0 1 auto; }
.filters input[type=search] { flex: 1 1 240px; padding-left: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a98' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 16px 16px; margin: 16px 0; }
.fieldset legend { font-weight: 600; padding: 0 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }

.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 11px 16px; border-radius: 12px; background: var(--ok-soft); color: #0f6b33; margin-bottom: 8px; font-weight: 500; }
.messages li.error { background: var(--bad-soft); color: #a3262b; }

/* таблиці */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table.hover tr:hover td { background: var(--surface-2); }
.card:not(.flush) table th { background: none; padding-left: 0; }
.card:not(.flush) table td { padding-left: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.who-cell .t { line-height: 1.25; }
.who-cell .t .s { color: var(--muted); font-size: 12.5px; }

.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none;
  background: var(--av); background: linear-gradient(135deg, color-mix(in srgb, var(--av) 75%, #fff), var(--av)); letter-spacing: .02em; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.pending, .pill.queued, .pill.hired, .pill.on_hold { background: var(--warn-soft); color: var(--warn); }
.pill.approved, .pill.employed, .pill.active, .pill.open { background: var(--ok-soft); color: var(--ok); }
.pill.rejected, .pill.terminated, .pill.disqualified, .pill.cancelled { background: var(--bad-soft); color: var(--bad); }
.pill.withdrawn, .pill.skipped, .pill.closed, .pill.draft { background: var(--line-2); color: var(--muted); }
.pill.hot { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--line-2); font-size: 12px; color: var(--text-2); }

/* порожній стан */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { color: #c9c9d3; margin-bottom: 8px; }

/* список подій / таймлайн */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 16px 26px; }
.tl li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--line); }
.tl .dot.approved { border-color: var(--ok); background: var(--ok); }
.tl .dot.rejected { border-color: var(--bad); background: var(--bad); }
.tl .dot.pending { border-color: var(--warn); }

/* календар */
.cal { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.cal th, .cal td { padding: 0; border-bottom: 1px solid var(--line-2); text-align: center; min-width: 30px; height: 40px; background: var(--surface); }
.cal th { height: 44px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.cal th .dw { display: block; font-weight: 500; color: var(--muted); font-size: 10px; }
.cal th.name, .cal td.name { text-align: left; padding: 0 14px; min-width: 210px; position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--line); }
.cal .we { background: #fafafc; }
.cal th.today { color: var(--accent); }
.cal td.today, .cal th.today { box-shadow: inset 1px 0 0 rgba(242,100,61,.35), inset -1px 0 0 rgba(242,100,61,.35); }
.cal td.off { padding: 6px 0; }
.cal td.off a { display: block; height: 24px; background: var(--c); opacity: .9; }
.cal td.off.s a { border-radius: 7px 0 0 7px; margin-left: 3px; }
.cal td.off.e a { border-radius: 0 7px 7px 0; margin-right: 3px; }
.cal td.off.s.e a { border-radius: 7px; }
.cal td.off.pend a { opacity: .4; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.5) 4px 8px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* дошка вакансії */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; scroll-snap-type: x proximity; }
.col { background: #efeff3; border-radius: var(--r); min-width: 270px; width: 270px; padding: 10px; scroll-snap-align: start; }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 600; font-size: 13px; }
.col-h .n { background: var(--surface); border-radius: 20px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.col-h .k { font-size: 10.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.cand { background: var(--surface); border-radius: 12px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.cand:hover { box-shadow: var(--shadow-lg); }
.cand .top { display: flex; gap: 10px; align-items: center; }
.cand .nm { font-weight: 600; line-height: 1.25; }
.cand .meta { color: var(--muted); font-size: 12px; display: flex; gap: 10px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.cand .late { color: var(--bad); font-weight: 500; }
.cand .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.cand .acts select { padding: 5px 26px 5px 8px; font-size: 12px; border-radius: 8px; background-position: right 6px center; }

/* графіки-смуги */
.chart { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 48px; gap: 12px; align-items: center; font-size: 13px; }
.bar .track { background: var(--line-2); border-radius: 6px; height: 10px; overflow: hidden; }
.bar .fill { background: linear-gradient(90deg, var(--info), #6c93ff); height: 100%; border-radius: 6px; min-width: 3px; }
.bar .fill.bad { background: linear-gradient(90deg, #ff8a8d, var(--bad)); }
.bar .fill.acc { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.funnel .bar { grid-template-columns: minmax(140px, 240px) 1fr 54px 64px 70px; }
@media (max-width: 700px) {
  .bar { grid-template-columns: 110px 1fr 40px; }
  .funnel .bar { grid-template-columns: 110px 1fr 40px; }
  .funnel .bar .x { display: none; }
}
.cols-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.cols-chart .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.cols-chart .c .b { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #8aa8ff, var(--info)); }
.cols-chart .c .lb { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cols-chart .c .tv { font-size: 11px; font-weight: 600; }

/* авторизація */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #ffe3d8 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e3eaff 0, transparent 55%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth .logo { padding: 0 0 22px; }

/* налаштування */
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.set-nav a:hover { background: var(--line-2); }
.set-nav a.on { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.set-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .set-wrap { grid-template-columns: 1fr; } .set-nav { flex-direction: row; overflow-x: auto; } .set-nav a { white-space: nowrap; } }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch:last-child { border-bottom: 0; }
.sentence { font-size: 15px; line-height: 1.6; padding: 14px 16px; border-radius: var(--r-sm); background: var(--accent-soft); color: #7a2e17; margin: 8px 0 4px; }
.filters input[type=date], .filters select, .filters input[type=text] { width: auto; flex: 0 1 auto; }
.filters input[type=search] { width: auto; }
/* календар: відпустка — одна смуга з підписом */
.cal td.bar { padding: 6px 2px; }
.cal td.bar a { display: flex; align-items: center; height: 26px; border-radius: 8px; background: var(--c); color: #fff;
  font-size: 11.5px; font-weight: 600; padding: 0 8px; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cal td.bar a span { overflow: hidden; text-overflow: ellipsis; }
.cal td.bar a.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal td.bar a.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal td.bar a.pend { background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(255,255,255,.35) 5px 10px); opacity: .8; }
.cal td.bar a:hover { filter: brightness(1.05); text-decoration: none; }
.cal.fixed { table-layout: fixed; }
.cal.fixed th, .cal.fixed td { min-width: 0; }
.cal.fixed td.name a { overflow: hidden; }
.cal.fixed td.name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
