/* HR Eva — визуальный язык по дизайн-коду платформы «Спутник» (ST-71, ST-80).
   Токены выровнены по SPUTNIK_DESIGN_CODE.md: нейтральный gray, действия — коралловый
   бренд платформы #EF4444 (hover #DC2626, сверка с продакшеном sputnikai.pro),
   радиусы 8/12/16, тени shadow-sm. */
:root {
  --bg: #F9FAFB;              /* gray-50 — фон страниц */
  --surface: #FFFFFF;         /* карточки */
  --surface-2: #F9FAFB;       /* плитки, hover */
  --line: #E5E7EB;            /* gray-200 — границы карточек */
  --line-2: #F3F4F6;          /* gray-100 — внутренние линии */
  --ink: #111827;             /* gray-900 — основной текст */
  --ink-2: #374151;           /* gray-700 — вторичный текст */
  --muted: #6B7280;           /* gray-500 */
  --primary: #EF4444;         /* red-500 — коралловый бренд Спутника: действия */
  --primary-hover: #DC2626;   /* red-600 — hover действий */
  --primary-soft: #FEF2F2;    /* red-50 — софт-фон выбранных пунктов */
  --success: #10B981;         /* emerald-500 */
  --success-bg: #ECFDF5;      /* emerald-50 */
  --warn: #F59E0B;            /* amber-500 */
  --warn-ink: #B45309;        /* amber-700 — текст предупреждений */
  --warn-bg: #FFFBEB;         /* amber-50 */
  --danger: #EF4444;          /* red-500 — опасность/риск */
  --danger-ink: #B91C1C;      /* red-700 */
  --danger-bg: #FEF2F2;       /* red-50 */
  --rose: #E11D48;            /* rose-600 — деструктивное подтверждение */
  --info: #3B82F6;            /* blue-500 */
  --info-bg: #EFF6FF;         /* blue-50 */
  --focus: rgba(239, 68, 68, 0.25); /* focus ring — primary 25% */
  --radius: 16px;             /* карточки/модалки; кнопки/поля — 12px (см. .btn/.control) */
  --radius-sm: 8px;           /* мелкие чипы-действия */
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05);                 /* shadow-sm */
  --shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.25);      /* shadow-2xl — модалки */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: inherit; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: 0 0 248px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.side-org { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 14px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.side-org .org { display: flex; gap: 10px; align-items: center; }
.org-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.org-name { font-weight: 600; font-size: 13px; }
.org-plan { font-size: 11px; color: var(--muted); }
.side-nav { padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item .cnt { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 99px; }
.nav-item.active .cnt { background: rgba(255,255,255,0.16); color: #fff; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.side-foot .who { font-size: 12.5px; font-weight: 600; }
.side-foot .sub { font-size: 11px; color: var(--muted); }

/* Topbar */
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-size: 17px; font-weight: 700; margin: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #EF4444, #DC2626); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 12px; width: 280px; color: var(--muted); font-size: 13px; }
.search .ic { width: 16px; height: 16px; flex: 0 0 16px; }
.search input { border: none; background: none; outline: none; width: 100%; color: var(--ink); }
.side-org .ic { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.icon-btn .ic { width: 16px; height: 16px; }

/* Content */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.content { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; }
.page-head h2 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; border: 1px solid transparent; padding: 9px 16px; font-size: 13.5px; font-weight: 600; transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); text-decoration: none; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-secondary:hover { background: #F3F4F6; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-danger { background: var(--danger-bg); border-color: #FECACA; color: var(--danger-ink); }
.btn-danger:hover { background: #FECACA; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; background: #F9FAFB; }
.card-foot .spacer { flex: 1; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { padding: 16px 18px; }
.tile .label { font-size: 12px; color: var(--muted); font-weight: 550; }
.tile .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.tile .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* Chips (статусы: фон -50 / текст -700) */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-success { background: var(--success-bg); color: #047857; } .chip-success .dot { background: var(--success); }
.chip-ok { background: var(--success-bg); color: #047857; } .chip-ok .dot { background: var(--success); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); } .chip-warn .dot { background: var(--warn); }
.chip-danger { background: var(--danger-bg); color: var(--danger-ink); } .chip-danger .dot { background: var(--danger); }
.chip-info { background: var(--info-bg); color: #1D4ED8; } .chip-info .dot { background: var(--info); }
.chip-neutral { background: #F3F4F6; color: #4B5563; } .chip-neutral .dot { background: #9CA3AF; }
.chip-outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }

/* Table */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: #F9FAFB; padding: 10px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #F9FAFB; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 600; }
.tbl .sub { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Progress */
.pbar { height: 6px; background: #F3F4F6; border-radius: 99px; overflow: hidden; min-width: 60px; }
.pbar > i { display: block; height: 100%; background: var(--success); border-radius: 99px; }
.pcell { display: flex; align-items: center; gap: 10px; }
.pcell .pbar { flex: 1; }
.pcell .pv { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 40px; }

/* Avatars */
.acell { display: flex; align-items: center; gap: 10px; }
.acell .ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: #fff; background: linear-gradient(135deg, #EF4444, #DC2626); flex: 0 0 32px; }
.acell .ava.g1 { background: linear-gradient(135deg, #34D399, #059669); }
.acell .ava.g2 { background: linear-gradient(135deg, #60A5FA, #2563EB); }
.acell .ava.g3 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.acell .ava.g4 { background: linear-gradient(135deg, #F472B6, #DB2777); }

/* Filters / fields */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.control { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 8px 12px; font-size: 13.5px; outline: none; min-width: 160px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.control:focus { border-color: #FCA5A5; box-shadow: 0 0 0 3px var(--focus); }

/* Pagination */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.pager .info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pager button {
  width: 30px; height: 30px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface);
}
.pager button.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager select { border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; background: var(--surface); }

/* Wizard */
.wsteps { display: flex; gap: 6px; padding: 16px 20px 0; flex-wrap: wrap; }
.wstep { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); }
.wstep .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #F3F4F6; color: var(--muted); }
.wstep.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.wstep.cur .n { background: rgba(255,255,255,0.2); color: #fff; }
.wstep.done { color: var(--ink-2); }
.wstep.done .n { background: var(--success-bg); color: #047857; }
.crumb { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Dropzone */
.drop { border: 1.5px dashed #D1D5DB; border-radius: var(--radius); background: var(--surface-2); padding: 44px 24px; text-align: center; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); cursor: pointer; }
.drop.hover, .drop:hover { border-color: #FCA5A5; background: var(--primary-soft); }
.drop .ic { width: 36px; height: 36px; margin-bottom: 10px; color: var(--muted); }
.drop .t { font-size: 14.5px; font-weight: 600; }
.drop .d { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }

/* Mobile (кабинет сотрудника) — slate-шкала PWA */
.phone { max-width: 414px; margin: 0 auto; min-height: 100vh; background: #F8FAFC; box-shadow: 0 0 0 1px #F1F5F9; display: flex; flex-direction: column; }
.mtop { position: sticky; top: 0; z-index: 50; background: rgba(248, 250, 252, 0.92); backdrop-filter: blur(10px); padding: 14px 18px 10px; display: flex; align-items: center; gap: 12px; }
.mtop .back { width: 34px; height: 34px; border-radius: 12px; background: var(--surface); border: 1px solid #F1F5F9; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
.mtop h1 { font-size: 16.5px; font-weight: 700; margin: 0; flex: 1; }
.mbody { flex: 1; padding: 6px 18px 96px; display: flex; flex-direction: column; gap: 12px; }
.mnav { position: sticky; bottom: 0; z-index: 50; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-top: 1px solid #F1F5F9; display: flex; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.mnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: #94A3B8; text-decoration: none; padding: 4px 0; transition: color 0.2s var(--ease); }
.mnav a.active { color: #0F172A; }
.mnav .ic { width: 22px; height: 22px; }

/* Boot */
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); font-size: 14px; gap: 12px; }
.boot .logo { width: 44px; height: 44px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Анимации — каноничные кривые дизайн-кода Спутника */
@keyframes sputnik-soft-rise {
  from { opacity: 0; transform: translateY(6px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.rise { animation: sputnik-soft-rise 240ms var(--ease) both; }
.rise.d1 { animation-delay: 0.05s; } .rise.d2 { animation-delay: 0.1s; }
.rise.d3 { animation-delay: 0.15s; } .rise.d4 { animation-delay: 0.2s; }

/* ST-63: форматированный текст документа (заголовки/списки/абзацы/код) */
.rich { line-height: 1.65; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.rich p { margin: 0 0 10px; }
.rich h3, .rich h4, .rich h5 { margin: 14px 0 6px; font-size: 14.5px; line-height: 1.4; }
.rich h3:first-child, .rich h4:first-child, .rich h5:first-child { margin-top: 0; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 22px; }
.rich li { margin-bottom: 4px; }
.rich code { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.rich b { font-weight: 650; }

.mtop .back .ic { width: 18px; height: 18px; }
.mbody .ic { width: 18px; height: 18px; flex-shrink: 0; }

.ic { display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; flex-shrink: 0; }
