/* =====================================================================
   CRM Рекрутинг — стилі
   Шрифти системні: нічого не тягнемо з зовнішніх CDN.
   ===================================================================== */

:root {
  --brand: #1E3A5F;
  --brand-dark: #142744;
  --accent: #B84A3D;
  --success: #2D6A4F;
  --warning: #C89F3E;
  --info: #3B82F6;
  --bg: #F5F6F8;
  --panel: #FFFFFF;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #111827;
  --text-2: #4B5563;
  --text-3: #6B7280;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand); }

/* --- Бічна панель ---------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-dark);
  color: #E4E7EC;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  overflow-y: auto;
  z-index: 30;
}
.sidebar-brand { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .title { color: #fff; font-weight: 700; font-size: 15px; }
.sidebar-brand .subtitle {
  color: rgba(255,255,255,.5); font-size: 11px; margin-top: 2px;
  text-transform: uppercase; letter-spacing: .05em;
}
.nav-section {
  padding: 14px 20px 6px; color: rgba(255,255,255,.35);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; color: rgba(255,255,255,.72);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  border-left: 2px solid transparent;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.07); border-left-color: var(--warning); }
.nav-item.soon { opacity: .55; }
.nav-item .tag {
  margin-left: auto; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .04em; color: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 0 5px;
}
.user-block {
  margin-top: auto; padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.user-block .user-info .name { color: #fff; font-size: 13px; font-weight: 600; }
.user-block .user-info .role { color: rgba(255,255,255,.5); font-size: 11px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--warning); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.brand { background: var(--brand); color: #fff; }

/* --- Основна область ------------------------------------------------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; }
.topbar .spacer { flex: 1; }
.content { padding: 20px 24px 48px; }
.page-hint { color: var(--text-3); font-size: 13px; margin: -6px 0 16px; }

/* --- Кнопки ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 13px; border-radius: 5px; border: 1px solid transparent;
  cursor: pointer; line-height: 1.2; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--accent); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --- Картки ---------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.card + .card { margin-top: 12px; }
.card-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-weight: 600; font-size: 14px; }
.card-body { padding: 16px; }
.card-body.p0 { padding: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }

/* --- KPI ------------------------------------------------------------- */
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.kpi .label { font-size: 11px; text-transform: uppercase; color: var(--text-3); font-weight: 600; letter-spacing: .03em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* --- Форми ----------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=search], select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 5px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,58,95,.10);
}
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); }
.checkline input { margin-top: 2px; }

/* --- Таблиці --------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .03em;
  padding: 10px 12px; background: #FAFBFC; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFC; }
.table .muted { color: var(--text-3); font-size: 12px; }
.table-wrap { overflow-x: auto; }

/* --- Позначки -------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px;
}
.pill-neutral { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.pill-ok { background: #D1FAE5; color: #065F46; }
.pill-warn { background: #FEF3C7; color: #92400E; }
.pill-danger { background: #FEE2E2; color: #991B1B; }
.pill-info { background: #DBEAFE; color: #1E40AF; }

/* --- Сповіщення ------------------------------------------------------ */
.alert { padding: 11px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.alert-info    { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* --- Екран входу ----------------------------------------------------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #142744 0%, #1E3A5F 100%);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-head { text-align: center; margin-bottom: 20px; color: #fff; }
.auth-head .title { font-size: 20px; font-weight: 700; }
.auth-head .subtitle { font-size: 12px; opacity: .65; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.auth-card { background: #fff; border-radius: 10px; padding: 26px 24px; box-shadow: 0 12px 40px rgba(0,0,0,.28); }
.auth-card h2 { font-size: 17px; margin: 0 0 4px; }
.auth-card .lead { font-size: 13px; color: var(--text-3); margin: 0 0 18px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 11.5px; color: rgba(255,255,255,.5); }
.code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px; letter-spacing: 12px; text-align: center; padding: 12px 8px;
}

/* --- Різне ----------------------------------------------------------- */
.tempbox {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px; font-weight: 700; letter-spacing: 2px;
  background: var(--bg); border: 1px dashed var(--border-strong);
  border-radius: 6px; padding: 14px 18px; display: inline-block; user-select: all;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--panel); font-size: 12.5px; color: var(--text-2);
  cursor: pointer; text-decoration: none;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }

@media (max-width: 860px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .main { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
