/* JobRadar — дизайн-система в стиле Apple */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --accent: #007aff;
  --accent-soft: #eaf3ff;
  --text: #1c1c1e;
  --text-2: #8e8e93;
  --field: #f2f2f7;
  --border: #e5e5ea;
  --danger: #ff3b30;
  --success: #34c759;
  --r-card: 16px;
  --r-field: 12px;
  --r-btn: 12px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }

/* ---------- Логотип ---------- */
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 14px;
}
.logo-mark.lg { width: 60px; height: 60px; }
.logo-mark.sm { width: 34px; height: 34px; border-radius: 10px; }

/* ---------- Экран авторизации ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 26px; font-weight: 700; margin: 16px 0 4px; }
.auth-head p { color: var(--text-2); margin: 0; font-size: 14px; }
.auth-card {
  background: var(--card); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 28px; width: 100%; max-width: 360px;
}

/* ---------- Поля и кнопки ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.field input {
  width: 100%; border: none; background: var(--field);
  border-radius: var(--r-field); padding: 13px 15px; font-size: 15px;
  font-family: var(--font); color: var(--text); outline: 2px solid transparent;
  transition: outline-color .15s;
}
.field input:focus { outline-color: var(--accent); }
.field input::placeholder { color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: var(--font); font-weight: 600;
  font-size: 15px; border-radius: var(--r-btn); padding: 13px 18px;
  transition: filter .15s, background .15s;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--field); color: var(--text); }
.btn-sm { padding: 9px 14px; font-size: 14px; }

.auth-alt { text-align: center; margin-top: 18px; color: var(--text-2); font-size: 14px; }
.auth-alt a { font-weight: 600; }

.form-error {
  background: #fff0ef; color: var(--danger); border-radius: var(--r-field);
  padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px;
}

/* ---------- Каркас приложения (сайдбар) ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 230px; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; flex-shrink: 0;
  height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; font-weight: 700; font-size: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 10px; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--field); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a svg { width: 19px; height: 19px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-foot a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 10px; color: var(--text-2); font-weight: 500;
}
.sidebar-foot a:hover { background: var(--field); }
.sidebar-foot a svg { width: 19px; height: 19px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
body.modal-open, body.modal-open .main { overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--card);
}
.topbar h2 { margin: 0; font-size: 20px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-2); padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--field); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.content { padding: 24px 28px; flex: 1; }

/* ---------- Панель инструментов вакансий ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.search {
  flex: 1; position: relative;
}
.search input {
  width: 100%; border: none; background: var(--card); border-radius: 999px;
  padding: 12px 16px 12px 42px; font-size: 15px; font-family: var(--font);
  box-shadow: var(--shadow-card); outline: 2px solid transparent;
}
.search input:focus { outline-color: var(--accent); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-2); width: 18px; height: 18px; }

/* ---------- Таблица вакансий ---------- */
.table-card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
table.vac { width: 100%; border-collapse: collapse; }
table.vac th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-2); padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
table.vac td { padding: 8px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.vac tr:last-child td { border-bottom: none; }
table.vac tr.done td { opacity: .5; }
.recruiter { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.recruiter .ava {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.muted { color: var(--text-2); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--field); color: var(--text-2); }
.tag.blue { background: #e5f0ff; color: #0a6cff; }
.tag.green { background: #e4f8ec; color: #1a9e4b; }
.tag.purple { background: #f0e9ff; color: #7c4dff; }
.tag.orange { background: #fff0e2; color: #e8830c; }
.tag.pink { background: #ffe9f2; color: #e5387c; }

.check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: none; color: transparent;
}
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.datecell span { display: block; }
.datecell .time { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.contact { font-weight: 500; }

.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.foot-left { display: flex; align-items: center; gap: 18px; }
.size-form { display: flex; align-items: center; gap: 8px; }
.size-form select {
  border: 1px solid var(--border); background: var(--card); border-radius: 8px;
  padding: 5px 8px; font-family: var(--font); font-size: 13px; color: var(--text); cursor: pointer;
}
.pager { display: flex; gap: 6px; align-items: center; }
.pager a, .pager span {
  min-width: 32px; height: 32px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text-2); font-weight: 600;
}
.pager .cur { background: var(--accent); color: #fff; }

/* ---------- Каналы ---------- */
.panel { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 16px; max-width: 960px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.add-row { display: flex; gap: 12px; }
.add-row input { flex: 1; border: none; background: var(--field); border-radius: var(--r-field); padding: 13px 15px; font-size: 15px; font-family: var(--font); }
.add-row .btn { width: auto; flex-shrink: 0; }
.chan { display: flex; align-items: center; gap: 12px; padding: 12px 16px !important; }
.chan .ico { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.chan .meta { flex: 1; min-width: 0; }
.chan .meta b { font-size: 14px; }
.chan .meta .sub { color: var(--text-2); font-size: 12.5px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--field); color: var(--text-2); margin-left: 8px; }
.badge-error { background: #fde8e6; color: var(--danger); }
.chan-error { background: #fff5f4; border: 1px solid #ffd4d0; }

/* ---------- Админка ---------- */
.admin-facet-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.admin-facet-row:last-of-type { border-bottom: none; }
.admin-facet-row .edit-form { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.admin-facet-row input[type=text] {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; font-family: var(--font); background: var(--card); color: var(--text);
}
.admin-facet-row input[name=name] { max-width: 160px; flex-shrink: 0; }
.badge[type=submit], button.badge { font-size: 11px; font-family: var(--font); }
.admin-features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 640px; }

/* iOS-тумблер */
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; cursor: pointer; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #d1d1d6; border-radius: 999px; transition: background .2s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track + .knob { transform: translateX(18px); }
.trash { background: none; border: none; cursor: pointer; color: var(--danger); padding: 6px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.settings-row + .settings-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Карточки тарифов (соотношение высота:ширина 3:2) ---------- */
.plan-cards { display: flex; gap: 18px; flex-wrap: wrap; }
.plan-card {
  position: relative; width: 220px; height: 330px; border-radius: 20px;
  padding: 22px; display: flex; flex-direction: column;
  font-family: var(--font);
}
.plan-badge {
  position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.25); color: #fff;
  backdrop-filter: blur(4px);
}
.plan-name { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.plan-price { font-size: 14px; font-weight: 600; opacity: .8; margin-bottom: 18px; }
.plan-features { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.plan-features li { padding-left: 18px; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
.plan-cta { margin-top: 14px; width: 100%; }
.plan-expiry { margin-top: 14px; font-size: 12.5px; opacity: .75; }

/* Free — светло-серый с тонким синим контуром */
.plan-free {
  background: #f5f6f8; border: 1.5px solid var(--accent); color: var(--text);
}
.plan-free .plan-price, .plan-free .plan-badge { color: var(--text); }
.plan-free .plan-badge { background: var(--accent-soft); color: var(--accent); }

/* Pro — переливающийся "нефтяной" градиент, премиум */
.plan-pro {
  color: #fff;
  background: linear-gradient(125deg,
    #05101f 0%, #0d1f38 16%, #142c42 30%, #1c3a44 42%,
    #24463f 52%, #362f4a 64%, #241c38 78%, #0a1626 90%, #05101f 100%);
  background-size: 320% 320%;
  animation: plan-pro-shift 16s ease infinite;
  box-shadow: 0 12px 32px rgba(10,20,40,.4);
}
.plan-pro::after {
  content: ""; position: absolute; inset: 0; border-radius: 20px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.25), transparent 40%);
}
@keyframes plan-pro-shift {
  0% { background-position: 0% 30%; }
  50% { background-position: 100% 70%; }
  100% { background-position: 0% 30%; }
}
.plan-pro .plan-cta { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); }

/* ---------- Модалка фильтров ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: var(--bg); border-radius: 18px; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); scrollbar-width: thin; scrollbar-color: #c7c7cc var(--bg); }
/* тонкий округлый скролл без стрелок, фон как у модалки */
.modal::-webkit-scrollbar, .content::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-track { background: var(--bg); border-radius: 999px; }
.content::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 999px; border: 2px solid var(--bg); }
.modal::-webkit-scrollbar-button, .content::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal .hint { color: var(--text-2); font-size: 13.5px; margin: 0 0 18px; }
.facet-group { background: var(--card); border-radius: var(--r-card); padding: 13px 14px; margin-bottom: 10px; }
.facet-group .cap { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.date-inputs { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.date-inputs input[type=date] { border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 8px 10px; font-family: var(--font); font-size: 14px; color: var(--text); }
.chan-select { width: 100%; border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px 12px; font-family: var(--font); font-size: 14px; color: var(--text); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: none; cursor: pointer; font-family: var(--font); font-weight: 600;
  font-size: 14px; padding: 9px 16px; border-radius: 999px;
  background: var(--field); color: var(--text); display: inline-flex; align-items: center; gap: 6px;
}
.chip.include { background: var(--accent); color: #fff; }
.chip.exclude { background: var(--danger); color: #fff; }
.chip .mark:not(:empty) { font-size: 13px; line-height: 1; }
.chip .mark:empty { display: none; }
.modal-actions { display: flex; gap: 12px; margin-top: 8px; }
.modal-actions .btn-primary { flex: 1; width: auto; }

/* ---------- Модалка полного текста сообщения (шире фильтров) ---------- */
.modal-msg {
  position: relative; background: var(--bg); border-radius: 18px;
  width: 100%; max-width: 760px; max-height: 88vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column;
}
.modal-msg-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.12); border-radius: 50%;
}
.modal-msg-body { overflow-y: auto; padding: 28px; scrollbar-width: thin; scrollbar-color: #c7c7cc var(--bg); }
.modal-msg-body h2 { margin: 0 0 16px; padding-right: 40px; font-size: 19px; }
.modal-msg-body p { margin: 0; white-space: pre-wrap; line-height: 1.65; color: var(--text); }
.modal-msg-body::-webkit-scrollbar { width: 8px; }
.modal-msg-body::-webkit-scrollbar-track { background: var(--bg); border-radius: 999px; }
.modal-msg-body::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 999px; border: 2px solid var(--bg); }
.modal-msg-body::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
