:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --border: #e8eaef;
  --text: #1b1f2a;
  --muted: #8a92a3;
  --accent: #4f5bd5;
  --accent-dark: #3d47b0;
  --sidebar-bg: #14162a;
  --sidebar-text: #b7b9d4;
  --sidebar-active: #ffffff;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }

/* ---------- Shell layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: #fff; padding: 0 8px 26px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, #7c8cff, #4f5bd5); display: inline-block; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-text); font-size: 14px; font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.sidebar-nav a svg { flex-shrink: 0; opacity: 0.9; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 12px; padding-top: 16px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.uname { font-size: 13px; font-weight: 600; color: #fff; }
.ulogout { font-size: 12px; color: var(--sidebar-text); }
.ulogout:hover { color: #fff; }

.content { flex: 1; padding: 32px 40px; max-width: 1200px; }

/* ---------- Common ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; }

.btn {
  background: var(--accent); color: white; padding: 9px 18px; border-radius: 10px;
  border: none; cursor: pointer; font-size: 14px; font-weight: 600; display: inline-block;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f4f5f8; color: var(--text); }
.btn-danger { background: #fff; color: #c94f6d; border: 1px solid #f3cdd6; }
.btn-danger:hover { background: #fdeef0; color: #c94f6d; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(20,22,42,0.03); }
.table-card { padding: 0; overflow: hidden; }

.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-wrap { flex: 1; min-width: 260px; position: relative; display: flex; align-items: center; }
.search-wrap svg { position: absolute; left: 12px; color: var(--muted); }
.search-wrap input { width: 100%; padding-left: 38px; }

input, select, textarea, button {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
button { cursor: pointer; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { padding: 12px 20px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
table.list td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
table.list tbody tr:last-child td { border-bottom: none; }
table.list tbody tr:hover { background: #f8f9fc; cursor: pointer; }
table.list.small th, table.list.small td { padding: 8px 10px; font-size: 13px; }
.card table.list th:first-child, .card table.list td:first-child { padding-left: 20px; }

.cand-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.cand-name { font-weight: 600; font-size: 14px; }
.cand-sub { font-size: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #eef1ff; color: var(--accent); }
.badge-green { background: #e6f7ee; color: #1a9e6b; }
.badge-gray { background: #f0f1f4; color: #7a7f8f; }
.count-pill { background: #eef1ff; color: var(--accent); border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 700; margin-left: 4px; }

.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.flash { background: #fff8e1; border: 1px solid #ffe08a; color: #8a6100; padding: 10px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.flash-bare { max-width: 340px; margin: 20px auto 0; }

.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 100%; max-width: 340px; background: var(--card); padding: 32px 28px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(20,22,42,0.06); }
.login-box form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.login-box label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form select, .inline-form textarea { flex: 1; min-width: 160px; }

.notes { list-style: none; padding: 0; margin: 14px 0 0; }
.notes li { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.5; }
.notes li:last-child { border-bottom: none; }

.pill-list { display: flex; flex-direction: column; gap: 8px; }
.pill-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 10px; background: #f8f9fc; border-radius: 10px; }

.vacancy-link-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.vacancy-link-block { background: #f8f9fc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.vacancy-link-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.vacancy-link-block .inline-form { margin-bottom: 0; }
.vacancy-link-block .inline-form select { min-width: 140px; }
.vacancy-link-add-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 8px; }

.stats { display: flex; gap: 18px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 30px; text-align: center; }
.stat .num { font-size: 34px; font-weight: 700; color: var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .shell { flex-direction: column; } .sidebar { width: 100%; height: auto; position: static; } }

.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; }
.kanban-col { min-width: 240px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kanban-col h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; }
.kanban-card { display: block; background: #f8f9fc; border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; border: 1px solid transparent; }
.kanban-card:hover { border-color: var(--accent); background: #eef1ff; }
.kanban-name { font-weight: 600; font-size: 13px; color: var(--text); }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.dragging { opacity: 0.45; cursor: grabbing; }
.kanban-col.drag-over { background: #eef1ff; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,91,213,0.25); }
.kanban-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1b1f2a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: 0 6px 20px rgba(20,22,42,0.25); }
.kanban-toast-error { background: #c94f6d; }

/* ---------- Resume-style candidate card ---------- */
.resume-header { display: flex; gap: 24px; align-items: flex-start; }
.resume-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.resume-photo { width: 120px; height: 120px; border-radius: 14px; object-fit: cover; border: 1px solid var(--border); }
.avatar-xl { width: 120px; height: 120px; border-radius: 14px; font-size: 40px; }
.resume-head-info { flex: 1; min-width: 0; }
.photo-form { margin: 0; }

.small-btn { padding: 6px 12px; font-size: 12px; }
.link-btn { background: none; border: none; color: var(--muted); font-size: 12px; padding: 0; cursor: pointer; }
.link-btn:hover { color: #c94f6d; text-decoration: underline; }

.exp-row { display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.exp-row:last-of-type { border-bottom: none; }
.exp-dates { width: 150px; flex-shrink: 0; font-size: 13px; }
.exp-body { flex: 1; min-width: 0; font-size: 14px; }

.add-details { margin-top: 14px; }
.add-details summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; list-style: none; }
.add-details summary::-webkit-details-marker { display: none; }
.add-details[open] summary { margin-bottom: 4px; }

.status-history-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 4px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 140px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 13px; }
.checkbox-label input { width: auto; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; background: #eef1ff; color: var(--accent); border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.chip-btn { border: none; cursor: pointer; }
.chip-btn:hover { background: #dfe3ff; }

/* ---------- Приоритет вакансий и внутренние данные ---------- */
.prio-1 { background: #fdeef0; color: #c94f6d; }
.prio-2 { background: #fff4e5; color: #c98216; }
.prio-3 { background: #eefaf9; color: #128f88; }
.prio-0 { color: var(--muted); }
select.prio-select { padding: 4px 8px; font-size: 13px; border-radius: 8px; font-weight: 600; }
.badge.prio-1, .badge.prio-2, .badge.prio-3 { font-weight: 600; }
.internal-card { border-left: 4px solid #c98216; background: #fffdf8; }
