/* Оформление кабинета (07.10.2026): светлый «dashboard» в духе присланного
   макета — мягкий голубой фон, скруглённые карточки с лёгкой тенью, боковое
   меню на фирменном вертикальном фоне «1 Интегратор Битрикс24», пункты меню
   с иконками. Режим «стекло» (прозрачность) включается в Настройках:
   html[data-glass="1"] — полупрозрачные карточки/меню с размытием фона.
   Цветовые токены в :root; тёмная схема — [data-theme=dark]. */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,500;0,600;0,700;0,800;0,900;1,600&display=swap');

:root {
  --bg: #e6f0fc;
  --card: #ffffff;
  --card-border: rgba(150, 180, 225, .35);
  --line: #c6d7f0;
  --text: #1f2f50;
  --mut: #667a9c;
  --accent: #3f7fd6;
  --accent-2: #6aa6ec;
  --accent-ink: #ffffff;
  --blue-light: #a9c5ea;
  --blue-deep: #2c4f85;
  --ok: #1fa06d;
  --bad: #e2502b;
  --amber: #e0a73b;
  --radius: 20px;
  --radius-sm: 12px;
  --border-w: 1.5px;
  --shadow: 0 8px 28px rgba(58, 104, 178, .13);
  --shadow-sm: 0 3px 10px rgba(58, 104, 178, .14);
  --page-bg:
    radial-gradient(900px 520px at 85% -5%, rgba(126, 178, 244, .55), transparent 70%),
    radial-gradient(760px 520px at 20% 105%, rgba(166, 206, 252, .65), transparent 70%),
    linear-gradient(135deg, #eaf3ff 0%, #d6e6fa 100%);
}
:root[data-theme="dark"] {
  --bg: #0f1b32;
  --card: #16233f;
  --card-border: rgba(160, 190, 235, .18);
  --line: #2b4066;
  --text: #eaf1fb;
  --mut: #9fb2d1;
  --accent: #5486d6;
  --accent-2: #3a6bb8;
  --accent-ink: #0f1b32;
  --blue-light: #3a5a8a;
  --blue-deep: #88abe3;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, .35);
  --page-bg: linear-gradient(135deg, #0f1b32, #12223f);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page-bg) fixed, var(--bg); color: var(--text);
  font: 500 15px/1.5 'Nunito', -apple-system, "Segoe UI", Arial, sans-serif;
}
#app { min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px; border: var(--border-w) solid var(--accent);
  background: transparent; color: var(--accent); cursor: pointer; font: inherit;
  font-weight: 700; font-size: 14px;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink);
  border-color: transparent; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 6px 16px rgba(63, 127, 214, .35); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--mut); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

input, select {
  padding: 10px 13px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--line);
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--text);
  font: inherit; font-weight: 600; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

.card {
  background: var(--card); border: var(--border-w) solid var(--card-border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.mut { color: var(--mut); font-size: 13px; font-weight: 600; }
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--text);
  border: 1.5px solid var(--line);
}
.badge-ok { background: #d7f3e3; color: var(--ok); border-color: var(--ok); }
.badge-bad { background: #fbe0d6; color: var(--bad); border-color: var(--bad); }
.badge-amber { background: #faecd2; color: #8a660f; border-color: var(--amber); }
.badge-accent { background: #dce8f8; color: var(--blue-deep); border-color: var(--accent); }

/* ---------- экран входа ---------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center;
  background: url('/assets/brand-bg.webp') center / cover no-repeat, var(--bg);
}
.login-card { width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-error { color: var(--bad); font-size: 13px; font-weight: 700; min-height: 18px; }

/* ---------- каркас после входа ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

/* Боковое меню: вертикальный фирменный фон (без логотипа внизу — логотип
   стоит в шапке меню), как в макете. Фон — отдельным слоем, чтобы в режиме
   «стекло» его можно было сделать полупрозрачным. */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 2px;
  isolation: isolate; border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 6px 0 28px rgba(58, 104, 178, .10);
}
.sidebar::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: url('/assets/sidebar-bg.jpg') center bottom / cover no-repeat, #eef4fd;
}
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 2px 6px 16px; }
.sidebar .brand .brand-mark {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background-image: url('/assets/brand-logo.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(46, 100, 180, .28);
}
.sidebar .brand .brand-title { font-weight: 900; font-size: 16px; line-height: 1.2; }
.sidebar .brand .brand-sub { font-size: 12px; font-weight: 700; color: var(--mut); word-break: break-word; }
.sidebar .group-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--mut);
  padding: 12px 12px 4px; letter-spacing: .08em;
}
.sidebar a.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: #3d5075; text-decoration: none; font-size: 14px; font-weight: 700;
  transition: background .12s ease, color .12s ease;
}
.sidebar a.nav-item .nav-ico { width: 20px; height: 20px; flex: none; display: inline-flex; opacity: .85; }
.sidebar a.nav-item .nav-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar a.nav-item:hover { background: rgba(255, 255, 255, .65); color: var(--accent); }
.sidebar a.nav-item.active { background: rgba(255, 255, 255, .85); color: var(--accent); box-shadow: var(--shadow-sm); }
.sidebar.compact a.nav-item { padding: 6px 12px; }
.sidebar.compact .group-label { padding-top: 8px; }
.sidebar .nav-spacer { flex: 1; min-height: 12px; }
.sidebar .side-user { color: #fff; font-size: 12px; font-weight: 700; padding: 8px 12px 0; text-shadow: 0 1px 6px rgba(10, 40, 90, .45); word-break: break-word; }
.sidebar .side-logout {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: transparent; border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700;
  color: #fff; text-shadow: 0 1px 6px rgba(10, 40, 90, .45); width: 100%; text-align: left;
}
.sidebar .side-logout:hover { background: rgba(255, 255, 255, .18); }
.sidebar .side-logout svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Правая часть окна (топбар + контент). Фон — мягкий голубой градиент. */
.content-area { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 22px 32px 6px;
}
.topbar .welcome { font-size: 26px; font-weight: 900; color: var(--accent); letter-spacing: -.01em; }
.topbar .top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.main { padding: 14px 32px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
h2 { margin: 0 0 4px; font-size: 22px; color: var(--text); }

/* Плитка «герой» (как «Ваш баланс» в макете) — синий градиент, белый текст. */
.card-hero {
  background: linear-gradient(135deg, #6aa6ec 0%, #3f7fd6 55%, #2f66bd 100%);
  color: #fff; border-color: transparent;
}
.card-hero .mut { color: rgba(255, 255, 255, .8); }
.card-hero .progress { background: rgba(255, 255, 255, .28); border-color: transparent; }
.card-hero .progress-fill { background: #fff; }

/* ---------- общие элементы экранов ---------- */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; color: var(--mut); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 10px; border-bottom: var(--border-w) solid var(--line); }
table.tbl td { padding: 11px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; font-weight: 600; }
table.tbl tr:last-child td { border-bottom: none; }

.banner { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; border: var(--border-w) solid transparent; }
.banner-error { background: #fbe0d6; color: var(--bad); border-color: rgba(226, 80, 43, .3); }
.banner-ok { background: #d7f3e3; color: var(--ok); border-color: rgba(31, 160, 109, .3); }

.form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.form-row label { font-weight: 700; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(22, 40, 78, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: 16px;
}
.modal-card { width: 380px; max-width: 100%; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(20, 50, 110, .35); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Галерея «Нанять сотрудника» — портфолио шаблонов (01.10.2026). */
.template-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 6px; }
.template-card { cursor: pointer; align-items: center; padding: 14px 10px; transition: transform .1s ease, box-shadow .1s ease; }
.template-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(58, 104, 178, .22); }
.template-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); }

/* Бриф найма — 3-шаговый визард, повторяет реальный мастер Agent Factory
   (01.10.2026). */
.wizard-steps { margin: 2px 0 10px; }
fieldset { border: 1.5px dashed color-mix(in srgb, var(--line) 90%, transparent); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 12px; }
fieldset legend { font-weight: 800; font-size: 13px; padding: 0 6px; }
textarea { padding: 10px 13px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--line); background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; width: 100%; resize: vertical; }

.progress { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.progress-amber { background: var(--amber); }
.progress-bad { background: var(--bad); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 14px; }
.kv .mut { align-self: center; }

.empty-state { padding: 30px; text-align: center; color: var(--mut); font-weight: 700; }

.icon-btn { padding: 6px 12px; font-size: 13px; }

.card-list { display: flex; flex-direction: column; gap: 12px; }
.section-card h3 { margin: 0 0 8px; font-size: 17px; }
.article-row { padding: 11px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.article-row:first-child { border-top: none; }
.article-row mark { background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 0 2px; font-weight: 800; }

/* Переключатель (Настройки → Оформление). */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s ease; }
.switch .slider::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(20, 40, 90, .35); transition: transform .15s ease; }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- режим «стекло» (Настройки → Оформление) ---------- */
html[data-glass="1"] body {
  background:
    radial-gradient(520px 420px at 12% 8%, rgba(90, 160, 255, .55), transparent 70%),
    radial-gradient(620px 460px at 88% 22%, rgba(150, 120, 255, .38), transparent 70%),
    radial-gradient(700px 520px at 60% 100%, rgba(80, 200, 240, .45), transparent 70%),
    linear-gradient(135deg, #dcebff 0%, #bcd6f8 100%) fixed;
}
html[data-glass="1"][data-theme="dark"] body {
  background:
    radial-gradient(520px 420px at 12% 8%, rgba(70, 120, 220, .5), transparent 70%),
    radial-gradient(620px 460px at 88% 22%, rgba(110, 80, 200, .4), transparent 70%),
    linear-gradient(135deg, #0b1630, #13294d) fixed;
}
html[data-glass="1"] .card,
html[data-glass="1"] .modal-card {
  background: rgba(255, 255, 255, .34);
  border-color: rgba(255, 255, 255, .7);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 8px 32px rgba(46, 90, 170, .16), inset 0 1px 0 rgba(255, 255, 255, .8);
}
html[data-glass="1"][data-theme="dark"] .card,
html[data-glass="1"][data-theme="dark"] .modal-card { background: rgba(22, 35, 63, .45); border-color: rgba(160, 190, 235, .25); }
html[data-glass="1"] .card-hero {
  background: linear-gradient(135deg, rgba(106, 166, 236, .78), rgba(47, 102, 189, .78));
  border-color: rgba(255, 255, 255, .45);
}
html[data-glass="1"] .sidebar { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
html[data-glass="1"] .sidebar::before { opacity: .58; }
html[data-glass="1"] .sidebar a.nav-item:hover { background: rgba(255, 255, 255, .45); }
html[data-glass="1"] .sidebar a.nav-item.active { background: rgba(255, 255, 255, .6); }
html[data-glass="1"] input, html[data-glass="1"] select, html[data-glass="1"] textarea { background: rgba(255, 255, 255, .45); }
html[data-glass="1"] .login-card { background: rgba(255, 255, 255, .5); }
html[data-glass="1"] .badge { background: rgba(255, 255, 255, .45); }

/* Узкие экраны: меню сверху, без липкости. */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-radius: 0 0 var(--radius) var(--radius); }
  .topbar, .main { padding-left: 16px; padding-right: 16px; }
  .topbar .welcome { font-size: 21px; }
}

/* выбор сотрудников портала (карточка агента / мастер найма) */
.picker-chips { flex-wrap: wrap; gap: 6px; }
.picker-box { position: relative; }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 260px; overflow-y: auto;
  background: var(--card); border: var(--border-w) solid var(--card-border); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(30, 60, 120, .18);
}
.picker-item { padding: 8px 12px; cursor: pointer; }
.picker-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ── 19.10.2026: обычные окна — полоса прокрутки внутри скругления (раньше срезала правые углы) ── */
.modal-card { clip-path: inset(0 round var(--radius)); }

/* ── Широкая панель: карточки агента и клиента ── */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 60; padding: 24px;
  background: rgba(22, 40, 78, .45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.sheet {
  width: min(1120px, 100%); height: min(880px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: var(--border-w) solid var(--card-border); border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(20, 50, 110, .35);
}
html[data-glass="1"] .sheet { background: rgba(255, 255, 255, .78); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
html[data-glass="1"][data-theme="dark"] .sheet { background: rgba(22, 35, 63, .86); }
.sheet-head {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 16px 18px 16px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.sheet-title { min-width: 0; }
.sheet-title h3 { margin: 0; font-size: 19px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-sub { color: var(--mut); font-size: 13px; font-weight: 600; margin-top: 2px; }
.sheet-sub:empty { display: none; }
.sheet-head-extra { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sheet-close {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: var(--border-w) solid var(--line);
  background: transparent; color: var(--mut); font-size: 16px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s, border-color .12s;
}
.sheet-head-extra:empty + .sheet-close { margin-left: auto; }
.sheet-close:hover { color: var(--bad); border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.sheet-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sheet.no-nav .sheet-main { grid-template-columns: minmax(0, 1fr); }
.sheet-nav {
  padding: 16px 10px; overflow: auto; display: flex; flex-direction: column; gap: 3px;
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.sheet-nav button {
  text-align: left; border: none; background: transparent; padding: 10px 14px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: 14px; color: var(--mut); cursor: pointer; transition: background .12s, color .12s;
}
.sheet-nav button:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.sheet-nav button.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.sheet-body { overflow: auto; padding: 20px 26px 28px; min-width: 0; position: relative; }
.sheet-foot {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.sheet-foot .foot-note { margin-right: auto; color: var(--mut); font-size: 12px; font-weight: 600; max-width: 520px; }
.sheet-foot .banner { margin-right: auto; }

/* разделы и поля */
.sec {
  border: var(--border-w) solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: var(--radius-sm);
  padding: 16px 18px 6px; margin-bottom: 16px; background: color-mix(in srgb, var(--card) 70%, transparent);
}
.sec h4 { margin: 0 0 14px; font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sec-intro { color: var(--mut); font-size: 13px; font-weight: 600; margin: -6px 0 14px; }
.field { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 6px 18px; align-items: start; margin-bottom: 14px; }
.field-label { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; padding-top: 10px; }
.field-control { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field-control > input, .field-control > select, .field-control > textarea { width: 100%; }
.field-note { color: var(--mut); font-size: 12px; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; padding-top: 9px; }
.check input { width: auto; margin-top: 2px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kv-tile { border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: var(--radius-sm); padding: 10px 12px; }
.kv-tile .k { color: var(--mut); font-size: 12px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.kv-tile .v { font-size: 16px; font-weight: 800; margin-top: 3px; word-break: break-word; }

/* подсказка «?» и её всплывающее окно */
.hint {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; border: 1.5px solid var(--line); color: var(--mut); font-size: 11px; font-weight: 900;
  cursor: help; user-select: none; line-height: 1; transition: color .12s, border-color .12s;
}
.hint:hover, .hint:focus { color: var(--accent); border-color: var(--accent); outline: none; }
.tip-box {
  position: fixed; z-index: 200; display: none; max-width: 320px; padding: 10px 12px; border-radius: 12px;
  background: #1c2a47; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(10, 25, 60, .35); pointer-events: none;
}

/* таблица агентов в карточке клиента */
.agents-tbl td { vertical-align: top; }
.agents-tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.restart-note { font-size: 12px; font-weight: 700; color: var(--mut); }
.restart-note.pending { color: #8a660f; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }

@media (max-width: 860px) {
  .sheet-overlay { padding: 0; align-items: stretch; }
  .sheet { width: 100%; height: 100%; border-radius: 0; border: none; }
  .sheet-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sheet-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding: 8px 10px; }
  .sheet-nav button { white-space: nowrap; padding: 8px 12px; }
  .sheet-body { padding: 16px; }
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field-label { padding-top: 0; }
  .sheet-head { padding: 12px 12px 12px 16px; flex-wrap: wrap; }
  .sheet-head-extra { order: 3; width: 100%; justify-content: flex-start; margin-left: 0; }
}

.plain-fieldset { border: none; padding: 0; margin: 0; }
.plain-fieldset > legend { display: none; }
.agents-tbl .actions .btn, .sheet-head-extra .btn { white-space: nowrap; }
.kv-tile .k span:first-child { flex: 1; }

/* ── ЛКМК: окно приложения в Битрикс24 (html[data-embed="b24"], js/embed_b24.js) ──
   Вид — ТОТ ЖЕ, что у клиентского приложения. Отличие только в механике фрейма: высота фрейма подгоняется под
   содержимое (BX24.fitWindow), поэтому у фрейма нет своей полосы прокрутки (требование Маркетплейса, 1280 px);
   на 100vh не тянем (фрейм рос бы бесконечно) — кабинет занимает не меньше высоты, которую Битрикс24 отвёл окну
   приложения при открытии (--frame-min, ставит js/embed_b24.js), иначе меню и фон обрываются посередине окна;
   окна и панели открываются от верха страницы. */
html[data-embed="b24"] #app, html[data-embed="b24"] .shell, html[data-embed="b24"] .content-area { min-height: var(--frame-min, 0px); }
html[data-embed="b24"] .sidebar { position: relative; height: auto; overflow: visible; }  /* relative — фон меню (::before) остаётся внутри меню */
/* фон меню — размером с окно и прижат к низу (на длинных страницах не растягивается), выше — фирменный светлый цвет */
html[data-embed="b24"] .sidebar::before { background-size: auto var(--frame-min, 100%); }
html[data-embed="b24"] body { position: relative; background-attachment: scroll; }
html[data-embed="b24"] .modal-overlay, html[data-embed="b24"] .sheet-overlay {
  position: absolute; inset: 0 0 auto 0; min-height: 100%; align-items: flex-start; place-items: start center;
}
html[data-embed="b24"] .modal-card { max-height: none; margin-top: 16px; }
html[data-embed="b24"] .sheet { height: 760px; margin-top: 8px; }

/* ── 28.10.2026: галерея найма, тарифы, список AI-сотрудников, документация, база знаний ── */
.modal-card.hire-modal { width: min(1180px, 96vw); max-width: none; height: min(860px, 92vh); position: relative; gap: 12px; overflow: hidden; }
.hire-body { flex: 1; min-height: 0; overflow: auto; margin: 0 -6px; padding: 4px 6px; }
.hire-modal .template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; margin-top: 6px; padding-bottom: 6px; }
.hire-modal .template-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 16px 12px; }
.template-avatar { width: 140px; height: 140px; }
.hire-modal .template-avatar { width: 140px; height: 140px; border-width: 3px; }
.template-plus { display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--accent); background: var(--bg); }
.template-name { font-weight: 800; font-size: 16px; text-align: center; }
.template-desc {
  text-align: center; font-size: 13px; line-height: 1.4; color: var(--mut); font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em;
}
.tpl-more {
  margin-top: auto; background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px;
}
.tpl-more:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tpl-arrow { display: inline-block; font-size: 15px; transition: transform .15s ease; }
.tpl-more:hover .tpl-arrow { transform: translateY(2px); }
.tpl-pop { position: absolute; inset: 0; z-index: 5; background: rgba(15, 30, 60, .5); backdrop-filter: blur(2px); align-items: center; justify-content: center; padding: 20px; border-radius: inherit; }
.tpl-pop-card {
  position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--card); border: var(--border-w) solid var(--card-border);
  border-radius: var(--radius); padding: 24px; box-shadow: 0 20px 60px rgba(20, 50, 110, .4); display: flex; flex-direction: column; gap: 12px;
}
.tpl-pop-card p { margin: 0; line-height: 1.5; }
.tpl-pop-x { position: absolute; top: 10px; right: 10px; }
.tpl-pop-head { display: flex; gap: 16px; align-items: center; padding-right: 36px; }
.tpl-pop-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow-sm); flex: none; }
.tpl-pop-ex { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }

.tariff-grid { align-items: stretch; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tariff-card { display: flex; flex-direction: column; }
.tariff-card.is-current { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok), var(--shadow); }
.push-bottom { margin-top: auto; padding-top: 4px; }
.tok-block { border-top: 1px dashed var(--line); padding-top: 10px; }
.pkg-modal { width: min(900px, 96vw); max-width: none; gap: 12px; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pkg-card { display: flex; flex-direction: column; }

.bot-facts { display: flex; flex-direction: column; gap: 3px; }
h5.subhead { margin: 18px 0 10px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--mut); border-top: 1px dashed var(--line); padding-top: 12px; }
.kb-list .tbl td { vertical-align: middle; }
.kb-preview { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; margin: 0; font: 13px/1.5 inherit; background: color-mix(in srgb, var(--bg) 60%, transparent); border-radius: var(--radius-sm); padding: 12px; }

.doc-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-toc a { padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 800; font-size: 13px; text-decoration: none; }
.doc-toc a:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.doc-section h3 { margin: 0 0 10px; }
.doc-section p { margin: 0 0 10px; line-height: 1.55; }
.doc-section ul, .doc-section ol { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.doc-note { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 14px; line-height: 1.5; font-weight: 600; }
.doc-roles { display: flex; flex-direction: column; gap: 8px; }
.doc-role { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; }
.doc-role summary { cursor: pointer; line-height: 1.5; }
.doc-role[open] { background: color-mix(in srgb, var(--bg) 40%, transparent); }
.doc-role p { margin: 8px 0 0; }
.doc-role ul { margin: 4px 0 0; }
@media (max-width: 720px) { .modal-card.hire-modal { height: 94vh; } .tpl-pop-head { flex-direction: column; align-items: flex-start; } }
html[data-embed="b24"] .modal-card.hire-modal { height: 760px; margin-top: 8px; }
