/*
 * Админка сотрудников (#91). Цвета, шрифты и отступы — общий с пультом набор
 * `/shared/tokens.css` (#166), подключается в index.html до этого файла. Отличие от пульта одно и
 * видно сразу: индиговая полоса «сотрудники» — чтобы окно админки нельзя было спутать с окном клиента.
 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.4; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.2; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-2); }
.quiet { color: var(--text-quiet); font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ── кнопки и поля ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-field);
  background: #ffffff; color: var(--text); cursor: pointer; font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: var(--text-2); text-decoration: none; color: var(--text); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #ffffff; }
.btn.primary:hover { background: var(--accent-dark); color: #ffffff; }
.btn.danger { border-color: var(--danger-border); color: var(--danger-text); }
.btn.danger:hover { border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 400; }
.btn.link:hover { text-decoration: underline; }
/* Кнопка-значок: разрушающее действие отдельно от рабочих, без слова (слово — в подсказке и aria-label). */
.btn.icon { width: 34px; min-height: 34px; padding: 0; justify-content: center; border-color: transparent; background: none; color: var(--text-2); }
.btn.icon:hover { border-color: var(--danger-border); color: var(--danger-text); background: var(--danger-bg); }
td.end { text-align: right; width: 1%; white-space: nowrap; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: default; pointer-events: none; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; }
.input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--border-field); border-radius: 8px;
  font-size: 15px; background: #ffffff; width: 100%;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
.input.bad { border-color: var(--danger); }
.input.code { font-family: var(--mono); font-size: 24px; letter-spacing: 0.35em; text-align: center; }
.input.code.backup { letter-spacing: 0.12em; font-size: 20px; text-transform: uppercase; }
.field .hint { font-size: 12px; color: var(--text-quiet); }
.field .error { font-size: 12px; color: var(--danger-text); }
.with-eye { position: relative; }
.with-eye .input { padding-right: 88px; }
.with-eye .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 0 10px; border: 0; background: var(--grey-bg); border-radius: 6px; font-size: 12px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; cursor: pointer; line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check .sub { display: block; color: var(--text-quiet); font-size: 12px; }
/* Строка настройки: выключатель слева, что значит его положение — справа (АРМ «Настройки», #91). */
.setting-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.setting-row .switch { flex-shrink: 0; margin-top: 2px; }.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* #132: галки инструментов «за семейство» в листе семейств; ось цены рядом с ценой каталога. */
.family-tools { display: flex; flex-direction: column; gap: 6px; }
tr.narrow-row { display: none; }
.family-tool { display: flex; gap: 8px; align-items: center; font-size: 13px; line-height: 1.3; }
.price-axis .select { min-height: 36px; font-size: 14px; }

/* ── полосы-пояснения ──────────────────────────────────────────────────────── */
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; border: 1px solid var(--border); background: var(--card);
}
.note b { font-weight: 600; }
.note .grow { flex: 1; min-width: 0; }
.note.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.note.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.note.ok { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent-text); }
.note.staff { background: var(--staff-bg); border-color: #d6d3ee; color: var(--staff); }
.note .close { border: 0; background: none; cursor: pointer; color: inherit; font-size: 18px; line-height: 1; padding: 0 4px; }

/* ── вход ──────────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.auth-card.wide { max-width: 480px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #ffffff; background: var(--staff); padding: 3px 8px; border-radius: 4px; }
.lead { font-size: 13px; color: var(--text-2); line-height: 1.55; margin: 6px 0 0; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.steps span.on { background: var(--accent); }
.steps-label { font-size: 12px; color: var(--text-quiet); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.qr { width: 200px; height: 200px; margin: 0 auto; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #ffffff; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret-box { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; font-size: 13px; color: var(--text-2); }
/* Ключ рвётся только между группами по четыре: разорванная группа читается как две. */
.secret-box .secret { font-family: var(--mono); font-size: 14px; color: var(--text); letter-spacing: 0.02em; word-break: normal; overflow-wrap: normal; }
.secret-box .row-actions { justify-content: center; }
.apps { font-size: 12px; color: var(--text-quiet); text-align: center; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); font-size: 15px; }
.codes span { padding: 8px; background: var(--grey-bg); border-radius: 6px; text-align: center; letter-spacing: 0.05em; }
.meter { display: flex; gap: 4px; }
.meter span { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.meter.l1 span:nth-child(-n+1) { background: var(--danger); }
.meter.l2 span:nth-child(-n+2) { background: var(--warn); }
.meter.l3 span:nth-child(-n+3) { background: var(--accent); }
.meter.l4 span { background: var(--accent); }
.rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-quiet); }
.rules li::before { content: '○'; display: inline-block; width: 16px; }
.rules li.ok { color: var(--accent-text); }
.rules li.ok::before { content: '✓'; }

/* ── оболочка ──────────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.nav {
  width: 240px; flex-shrink: 0; padding: 18px 14px; display: flex; flex-direction: column; gap: 2px;
  background: var(--nav); color: var(--nav-text); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-top: 4px solid var(--staff);
}
.nav .brand { padding: 4px 8px 18px; }
.nav .brand .tag { font-size: 10px; padding: 2px 6px; }
.nav .group { padding: 16px 10px 6px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--nav-quiet); }
.nav a.item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; color: var(--nav-quiet); text-decoration: none;
}
.nav a.item:hover { color: #ffffff; }
.nav a.item.on { color: #ffffff; background: var(--nav-active); }
.nav a.item .pill-role { font-size: 11px; color: var(--nav-quiet); border: 1px solid var(--nav-line); padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.nav a.item .count { font-size: 11px; background: var(--warn); color: #1c1b18; border-radius: 9px; padding: 0 6px; font-weight: 600; }
.nav .spacer { flex-grow: 1; min-height: 16px; }
.nav .foot { padding: 12px; border-radius: 8px; background: var(--nav-active); font-size: 12px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.nav .foot .who { color: #ffffff; font-weight: 500; }
.nav .foot .sub { color: var(--nav-quiet); }
.nav .foot button { min-height: 32px; border: 1px solid var(--nav-line); border-radius: 6px; background: transparent; color: var(--nav-quiet); font-size: 12px; cursor: pointer; }
.nav .foot button:hover { color: #ffffff; border-color: var(--nav-quiet); }
.topbar { display: none; }
.scrim { display: none; }

.main { flex-grow: 1; min-width: 0; max-width: 1400px; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 20px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head .left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sub { font-size: 14px; color: var(--text-2); }
.crumbs { font-size: 13px; color: var(--text-2); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { min-height: 40px; min-width: 240px; flex: 1; max-width: 380px; padding: 0 12px; border: 1px solid var(--border-field); border-radius: 8px; background: #ffffff; }
.search:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
.select { min-height: 40px; padding: 0 10px; border: 1px solid var(--border-field); border-radius: 8px; background: #ffffff; max-width: 100%; }
.select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }
.input.mono-input { font-family: var(--mono); font-size: 14px; }
.input.small { min-height: 36px; font-size: 14px; max-width: 140px; }
.warn-value { color: var(--warn); }
.line-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.line-between > :first-child { flex: 1; min-width: 200px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.input.small[type='month'] { max-width: 190px; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 17px; font-size: 13px; border: 1px solid var(--border-field); background: #ffffff; cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-text); }
a.chip { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
a.chip.on { color: var(--accent-text); }

.sheet { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sheet.pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--table-head); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sheet-head .name { font-size: 14px; font-weight: 600; }
.sheet-head .expl { font-size: 12px; color: var(--text-2); }
.sheet-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 10px 16px; background: var(--table-head); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: var(--table-head); }
td .t1 { font-weight: 500; }
td .t2 { font-size: 12px; color: var(--text-2); margin-top: 2px; }
/* Ошибка ввода строкой под полем (цены каталога): цвет ошибки сильнее серого вторичного текста. */
td .t2.danger-text { color: var(--danger-text); }

.pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.pill.ok { background: var(--accent-bg); color: var(--accent-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.danger { background: var(--danger-bg); color: var(--danger-text); }
.pill.grey { background: var(--grey-bg); color: var(--text-2); }
.pill.staff { background: var(--staff-bg); color: var(--staff); }

/* Индикатор указателей релиза (#160): цвет — у слова состояния, без «таблеток»; квадратная метка слева. */
.ptr { font-size: 13px; overflow-wrap: anywhere; }
.ptr::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; background: var(--text-2); }
.ptr.ok { color: var(--accent-text); }
.ptr.ok::before { background: var(--accent-text); }
.ptr.warn { color: var(--warn-text); }
.ptr.warn::before { background: var(--warn-text); }
.ptr.danger { color: var(--danger-text); }
.ptr.danger::before { background: var(--danger-text); }
.ptr.staff { color: var(--staff); }
.ptr.staff::before { background: var(--staff); }
.ptr-lines { display: flex; flex-direction: column; gap: 3px; }
.ptr-line { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.ptr-name { font-size: 12px; color: var(--text-2); min-width: 64px; cursor: help; }
.ptr-why { flex-basis: 100%; font-size: 12px; color: var(--danger-text); overflow-wrap: anywhere; }
.ptr-detail { color: var(--text-2); margin-top: 2px; }
.ptr-detail summary { cursor: pointer; width: fit-content; }
.ptr-detail .mono { font-size: 11px; margin-top: 2px; }
.ptr-next { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; }
.ptr-next .quiet { font-size: 12px; flex: 1 1 220px; }
td.ptr-cell { min-width: 220px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
/* #91 (постановка #1): отметка «из слепка клиента» рядом с именем эталона и версией релиза. */
.origin-pill { margin-left: 8px; font-family: inherit; font-weight: 400; vertical-align: 1px; }
/* Конфигурация поставщика слепка: что объявлено в паре поддержки — строками «что · значение». */
.vendor-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.vendor-facts dt { color: var(--text-2); }
.vendor-facts dd { margin: 0; overflow-wrap: anywhere; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--text-2); }
.tile .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .foot { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.arms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.arm { padding: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; }
.arm:hover { border-color: var(--text-quiet); text-decoration: none; color: var(--text); }
.arm .title { font-size: 16px; font-weight: 600; }
.arm .desc { font-size: 13px; color: var(--text-2); line-height: 1.45; flex-grow: 1; }

.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.state { padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.state .big { font-size: 17px; font-weight: 600; }
.state p { margin: 0; max-width: 500px; color: var(--text-2); line-height: 1.55; }
.state .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, #eeece6, #f6f5f1, #eeece6); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton[data-w='60'] { width: 60%; }
.skeleton[data-w='82'] { width: 82%; }
.skeleton[data-w='45'] { width: 45%; }
.skeleton[data-w='70'] { width: 70%; }

.roles-group { border-top: 1px solid var(--row-line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.roles-group:first-child { border-top: 0; padding-top: 0; }
.roles-group .wp { font-weight: 600; font-size: 14px; }
.role-actions { margin: 4px 0 0 28px; padding: 0; list-style: none; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.role-actions li::before { content: '· '; }

.link-box { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.link-box .input { font-family: var(--mono); font-size: 12px; flex: 1; min-width: 200px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--nav); color: #ffffff; padding: 10px 16px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); max-width: calc(100vw - 32px);
}

dialog.confirm { border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); color: var(--text); }
dialog.confirm::backdrop { background: rgba(28, 27, 24, 0.45); }
dialog.confirm .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
dialog.confirm .body p { margin: 0; color: var(--text-2); line-height: 1.55; }
dialog.confirm .foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: var(--table-head); border-top: 1px solid var(--border); flex-wrap: wrap; }

.cards { display: none; }
.card-row { padding: 14px 16px; border-bottom: 1px solid var(--row-line); display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.card-row:last-child { border-bottom: 0; }
.card-row .line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
/* Карточка-строка, которая никуда не ведёт (узкий вид таблицы без карточки): не притворяется ссылкой. */
.card-row.static { cursor: default; }

.more { padding: 12px 16px; border-top: 1px solid var(--row-line); text-align: center; }

/* ── тумблер: выдано / не выдано одним щелчком ─────────────────────────────── */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 22px; border-radius: 11px; background: #d4d0c6; position: relative; flex-shrink: 0; transition: background 0.15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: left 0.15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .track { opacity: 0.4; }
.switch input:disabled { cursor: default; }
.switch.pending .track { opacity: 0.6; }
td.sw { width: 64px; padding-right: 0; }
tr.off td .t1 { color: var(--text-2); }

/* Состав тарифа наборами (#91): блок набора с галками, отдельные инструменты, выбор набора. */
.tool-sets { display: flex; flex-direction: column; gap: 12px; }
.tool-sets > p { margin: 0; max-width: 720px; line-height: 1.5; }
.tool-sets-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.set-block { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-width: 0; }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 14px; background: var(--table-head); border-bottom: 1px solid var(--border); }
.set-title { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.set-title .name { font-weight: 600; overflow-wrap: anywhere; }
.set-note { margin: 0; padding: 12px 14px; }
.set-block td.price-cell { white-space: normal; min-width: 90px; max-width: 200px; }
.set-block td.sw { width: 56px; }
.set-block thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.set-picker { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; }
.set-picker .select { min-width: 220px; flex: 1 1 220px; }
.tool-empty { padding: 20px 16px; text-align: center; border: 1px dashed var(--border); border-radius: 8px; }
.tool-empty .big { font-size: 16px; font-weight: 600; }
.tool-empty p { margin: 6px auto 0; max-width: 520px; color: var(--text-2); line-height: 1.55; }

/* Своя цена поверх каталога: цена каталога зачёркнута слева, действующая — справа, в той же колонке. */
.was { color: var(--text-quiet); text-decoration: line-through; margin-right: 6px; }
.price-own { font-weight: 600; }
.legend { font-size: 12px; color: var(--text-2); display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--row-line); }
.group-row td { background: var(--table-head); font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 16px; }
.mini-list { display: flex; flex-direction: column; }
.mini-list .it { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--row-line); min-width: 0; }
.mini-list .it:last-child { border-bottom: 0; }
.mini-list .it > :first-child { min-width: 0; overflow-wrap: anywhere; }
.mini-list .it.price-item { flex-wrap: wrap; align-items: center; }
.mini-list .it.price-item > :first-child { flex: 1 1 240px; }
.narrow-only { display: none; }
/* Действия роли — в две колонки: список из 13 строк в одну колонку читается хуже. */
.role-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.role-acts .check { padding: 6px 0; }
/* «Внимание» в ленте: оранжевая полоса слева и отметка — не спутать с обычным «новое». */
tr.attention td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.pill.attention { background: var(--warn); color: #1c1b18; font-weight: 600; }
.pill.trial { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }
.steps-bar { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0; padding: 0; counter-reset: step; }
.steps-bar li { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; font-size: 13px; color: var(--text-quiet); white-space: nowrap; border-bottom: 2px solid transparent; }
.steps-bar li::before { counter-increment: step; content: counter(step); width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--grey-bg); color: var(--text-2); flex-shrink: 0; }
.steps-bar li.done { color: var(--text-2); }
.steps-bar li.done::before { content: '✓'; background: var(--accent-bg); color: var(--accent-text); }
.steps-bar li.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.steps-bar li.on::before { background: var(--accent); color: #ffffff; }
.wizard-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan { border: 1px solid var(--border-field); border-radius: 10px; padding: 14px 16px; background: #ffffff; display: flex; flex-direction: column; gap: 6px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.plan:hover { border-color: var(--text-2); }
.plan.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.plan .pname { font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.plan .price { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 12px; font-weight: 400; color: var(--text-2); }
.plan .what { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.fields2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.review { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 12px 16px; font-size: 14px; align-items: baseline; }
.review .k { color: var(--text-2); }
.sum-row td { font-weight: 600; background: var(--table-head); }
.bar { height: 6px; border-radius: 3px; background: var(--grey-bg); overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar.full span { background: var(--warn); }
.bar.warn span { background: var(--warn); }
.bar.muted span { background: var(--text-quiet); }
/* Ход снятия слепка в «Истории слепков» (#160): полоса с отметками, под ней стадия словами. */
.snap-progress { margin-top: 4px; max-width: 320px; }
.snap-progress .bar { flex: 1 1 120px; margin-top: 0; min-width: 80px; }
.snap-progress-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.snap-progress-stage { font-size: 12px; overflow-wrap: anywhere; margin-top: 2px; }
/* Сбой слепка для сотрудника (#160, договор 7837): причина, вид, сырой текст под «подробности». */
.snap-failure { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-width: 420px; font-size: 12px; }
.snap-failure-reason { color: var(--danger-text); overflow-wrap: anywhere; }
.snap-failure-reason.quiet { color: var(--text-2); }
.snap-failure-detail { color: var(--text-2); }
.snap-failure-detail summary { cursor: pointer; width: fit-content; }
.snap-failure-detail .mono { font-size: 11px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.cred { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.cred .v { font-family: var(--mono); overflow-wrap: anywhere; }

/* Форма просмотра из git — общий `public-new/shared/gitViewer.css`, подключён в index.html. */

/* АРМ «Инструменты»: вызовы карточками, дерево отступом по глубине (класс, не style — CSP). */
.calls { display: flex; flex-direction: column; }
.call { padding: 14px 16px; border-bottom: 1px solid var(--row-line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.call:last-child { border-bottom: 0; }
.call .line, .tree-node .line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.call .mono, .tree-node .mono { overflow-wrap: anywhere; }
.call-about { overflow-wrap: anywhere; }
.call-about summary { cursor: pointer; }
.call-about[open] summary { display: none; }
.orphans > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; color: var(--accent-text); }
.orphans[open] > summary { border-bottom: 1px solid var(--row-line); }
.call .row-actions { align-items: center; }
.call-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.call-choice .select { min-height: 34px; }
.tree { display: flex; flex-direction: column; padding: 6px 0; }
.tree-node { padding: 8px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tree-node[data-depth="1"] { padding-left: 36px; }
.tree-node[data-depth="2"] { padding-left: 56px; }
.tree-node[data-depth="3"] { padding-left: 76px; }
.tree-node[data-depth="4"] { padding-left: 96px; }
.tree-node[data-depth="5"], .tree-node[data-depth="6"] { padding-left: 116px; }
.tree-node.off .grow { opacity: 0.6; }
.tree-node .sw-line { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.tree-node .sw-line > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.code-box summary { cursor: pointer; font-size: 13px; color: var(--text-2); }

/* АРМ «Инструменты», страница инструмента и наборы (#131): значки, группы, строка вызова. */
.ico-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-bg); color: var(--accent-text); flex-shrink: 0; }
.ico-badge.big { width: 40px; height: 40px; border-radius: 10px; }
.title-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-line h1 { overflow-wrap: anywhere; }
.with-icon { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.with-icon > div { min-width: 0; }
.new-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); flex-wrap: wrap; }
.new-bar .grow { flex: 1; min-width: 160px; font-weight: 500; }
.call-group + .call-group { border-top: 1px solid var(--border); }
.group-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; background: var(--table-head); border-bottom: 1px solid var(--row-line); }
.group-head .count { font-weight: 500; color: var(--text-quiet); background: var(--grey-bg); border-radius: 9px; padding: 0 7px; letter-spacing: 0; }
.call-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--row-line); min-width: 0; }
.call-row:last-child { border-bottom: 0; }
.call-row.new { box-shadow: inset 3px 0 0 var(--warn); }
.call-row.off .call-title { color: var(--text-2); }
.call-icon { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; align-items: center; justify-content: center; background: var(--grey-bg); color: var(--text-2); flex-shrink: 0; margin-top: 1px; }
.call-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.call-main .line { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-width: 0; }
.call-title { font-size: 15px; font-weight: 600; color: var(--text); border: 0; background: none; padding: 0; text-align: left; cursor: default; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 6px; }
button.call-title { cursor: pointer; }
button.call-title:hover { color: var(--accent-dark); }
.call-title.empty { color: var(--text-quiet); font-weight: 500; font-style: italic; }
.call-sub { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; line-height: 1.45; }
.call-sub:hover .mono { color: var(--accent-dark); }
.call-about { font-size: 13px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.call-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.side-item { display: inline-flex; align-items: center; gap: 6px; }
.side-label { min-width: 62px; }
.btn.icon.pin, .btn.icon.menu-btn { color: var(--text-quiet); }
.btn.icon.pin:hover, .btn.icon.menu-btn:hover { border-color: var(--border-field); color: var(--text); background: var(--grey-bg); }
.btn.icon.pin.on, .pin-mark.on { color: var(--accent); }
.btn.icon.pin.on svg, .pin-mark.on svg { fill: var(--accent-bg); }
.pin-mark { display: inline-flex; width: 34px; justify-content: center; color: var(--border-field); }
.menu-wrap { position: relative; }
.menu-pop { position: fixed; z-index: 15; max-height: calc(100vh - 16px); overflow-y: auto; min-width: 250px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14); padding: 6px; display: flex; flex-direction: column; }
.menu-pop[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; background: none; border-radius: 6px; text-align: left; cursor: pointer; font-size: 14px; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--grey-bg); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.input.small-title { min-height: 38px; max-width: 420px; flex: 1 1 220px; font-size: 15px; }
.tree-box > summary { cursor: pointer; list-style: none; }
.tree-box > summary::-webkit-details-marker { display: none; }
.tree-box > summary .name::after { content: ' ▸'; color: var(--text-quiet); }
.tree-box[open] > summary .name::after { content: ' ▾'; }
.tree-box:not([open]) > summary { border-bottom: 0; }
dialog.confirm.wide { width: min(640px, calc(100vw - 32px)); }
dialog.confirm.wide .body { max-height: 70vh; overflow-y: auto; }
/* Наборы: состав с черновиком правки, подбор вызовов, выбор значка. */
.set-row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--row-line); min-width: 0; }
.set-row:last-child { border-bottom: 0; }
.set-row.added { background: var(--accent-bg); }
.set-row .call-main { gap: 2px; }
.set-row .t1 { font-weight: 500; overflow-wrap: anywhere; }
.set-row .btn.icon { flex-shrink: 0; }
.pill.whole { background: var(--staff-bg); color: var(--staff); }
.draft-bar { position: sticky; bottom: 12px; z-index: 12; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: 10px; background: var(--nav); color: #ffffff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
.draft-bar .grow { flex: 1; min-width: 180px; }
.draft-bar .btn:not(.primary) { background: transparent; color: #ffffff; border-color: var(--nav-line); }
.picker { display: flex; flex-direction: column; gap: 12px; }
.picker-calls { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.picker-calls .check { padding: 6px 0; }
.picker-calls .check .mono { display: block; color: var(--text-quiet); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--border-field); border-radius: 8px; cursor: pointer; color: var(--text-2); background: #ffffff; }
.icon-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent-bg); }
.icon-pick label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.set-about { margin: 0; max-width: 820px; }
.mono-label { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.set-row .t1.mono { font-size: 13px; }

/* Описание вызова для ИИ (#136): блок в раскрытой строке, сравнение «сейчас / предлагают», история версий. */
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
button.pill.attention:hover { background: var(--warn-text); color: #ffffff; }
button.pill .spinner { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
button.pill:disabled { opacity: 0.75; cursor: progress; }
.ai-block { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--table-head); border: 1px solid var(--row-line); min-width: 0; }
.ai-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ai-head b { font-size: 13px; }
.ai-text { font-size: 13px; color: var(--text); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.ai-text.long { max-height: 260px; overflow-y: auto; }
.ai-text del { background: var(--danger-bg); color: var(--danger-text); text-decoration: line-through; border-radius: 3px; }
.ai-text ins { background: var(--accent-bg); color: var(--accent-text); text-decoration: none; border-radius: 3px; font-weight: 500; }
textarea.input { min-height: 160px; padding: 10px 12px; line-height: 1.5; resize: vertical; font-size: 14px; }
.ai-count { font-size: 12px; color: var(--text-quiet); }
/* Ссылка на согласование длинная (адрес комментария) — переносится, а не уводит строку за край. */
.ai-ref { overflow-wrap: anywhere; word-break: break-all; }
.ai-head > .quiet { min-width: 0; }
.ai-version { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--row-line); min-width: 0; }
.ai-version:last-child { border-bottom: 0; }
.ai-version .line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ai-version details summary { cursor: pointer; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }

/* АРМ «Наблюдение»: ряд вызовов столбиками; высота столбика ставится из JS (CSP без inline-стилей). */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; min-width: 0; }
.bar-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-all { background: var(--accent-bg); border-top: 2px solid var(--accent); display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.bar-bad { background: var(--danger-bg); border-top: 2px solid var(--danger-text); }
.bar-all.zero { border-top: 0; }
.bar-label { font-size: 10px; color: var(--text-quiet); height: 14px; white-space: nowrap; overflow: visible; }
/* «Ошибки по дням» (#128): доля отказов столбиком; неизвестные сутки — штриховкой, а не нулём. */
.trend { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; }
.trend-scale { display: flex; flex-direction: column; justify-content: space-between; height: 146px; font-size: 10px; color: var(--text-quiet); text-align: right; }
.trend-plot { position: relative; min-width: 0; }
.trend-legend { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.trend-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.key-share::before { background: var(--danger); }
.trend-legend .key-avg::before { height: 0; border-top: 2px dashed var(--text-2); vertical-align: 3px; border-radius: 0; }
.key-thin::before { background: var(--danger); opacity: 0.35; }
.key-unknown::before, .share-bars .unknown .bar-share, .spark span.unknown { background: repeating-linear-gradient(135deg, var(--grey-bg) 0 3px, var(--border-field) 3px 5px); opacity: 1; }
.share-bars.dense { gap: 1px; }
.bar-area { flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.bar-share { width: 100%; background: var(--danger); border-radius: 3px 3px 0 0; }
.dense .bar-share { border-radius: 1px 1px 0 0; }
.bar-share.zero { height: 0; }
.share-bars .thin .bar-share { opacity: 0.35; }
.share-bars a.bar-col { text-decoration: none; }
.share-bars a.bar-col:hover .bar-area, .share-bars a.bar-col:focus-visible .bar-area { background: var(--danger-bg); }
.avg-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-2); pointer-events: none; }
.spark { display: flex; align-items: flex-end; gap: 1px; height: 26px; min-width: 120px; border-bottom: 1px solid var(--border); }
.spark span { flex: 1 1 0; min-width: 0; background: var(--danger); border-radius: 1px 1px 0 0; }
.spark span.thin { opacity: 0.35; }
.spark-cell { width: 34%; }
tr.on td, .card-row.on { background: var(--accent-bg); }
.wrap { overflow-wrap: anywhere; white-space: normal; }
.prose { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.5; } /* текст наблюдения как записал чат (АРМ «Знание») */
.danger-text { color: var(--danger-text); }
.code-view.danger-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-list .it.on { background: var(--accent-bg); }
.code-view { margin: 6px 0 0; padding: 10px 12px; background: var(--grey-bg); border-radius: 6px; font-family: var(--mono); font-size: 12px; line-height: 1.5; max-height: 420px; overflow: auto; white-space: pre; }

@media print {
  body.printing-codes > *:not(.print-codes) { display: none !important; }
}

/* ── узкий экран: навигация уезжает в выдвижную панель, таблицы становятся карточками ── */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 16px; background: var(--nav); color: var(--nav-text); border-top: 4px solid var(--staff);
    position: sticky; top: 0; z-index: 20;
  }
  .topbar .brand .tag { font-size: 10px; padding: 2px 6px; }
  .topbar .menu { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--nav-line); background: transparent; color: var(--nav-text); cursor: pointer; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; width: min(300px, 86vw); }
  .shell.nav-open .nav { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(28, 27, 24, 0.45); }
  .main { padding: 18px 16px 40px; gap: 16px; }
  h1 { font-size: 22px; }
  .search { min-width: 0; max-width: none; width: 100%; flex-basis: 100%; }
  /* minmax(0, …): иначе колонка растягивается под самую широкую таблицу и страница уезжает вбок. */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .value { font-size: 20px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .grid2 > * { min-width: 0; }
  td { padding: 10px 12px; }
  td.nowrap { white-space: normal; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .wide-only { display: none; }
  .narrow-only { display: block; }
  tr.narrow-row { display: table-row; }
  tr.has-narrow-row > td { border-bottom: 0; padding-bottom: 4px; }
  tr.narrow-row > td { padding-top: 0; }
  .fields2, .fields3, .role-acts { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .review .k { grid-column: 1 / -1; margin-top: 10px; }
  .cred { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cred .v { margin-bottom: 8px; }
  .wizard-foot .btn { flex: 1; }
  .steps-bar li:not(.on) span { display: none; }
  .cards { display: flex; flex-direction: column; }
  .head .btn { width: 100%; }
  .auth-card { padding: 22px 18px; }
  .call-row { flex-wrap: wrap; }
  .call-main { flex-basis: calc(100% - 42px); }
  .call-side { width: 100%; justify-content: flex-end; }
  .menu-pop { min-width: min(250px, calc(100vw - 48px)); }
  .input.small-title { max-width: none; }
  .draft-bar .btn { flex: 1; }
  .picker-calls { grid-template-columns: minmax(0, 1fr); }
  .set-picker .row-actions > * { flex: 1 1 100%; }
  .set-picker .row-actions .btn { flex-basis: 45%; }
  .set-head .btn { flex: 0 0 auto; }
  .tree-node[data-depth="1"] { padding-left: 26px; }
  .tree-node[data-depth="2"] { padding-left: 36px; }
  .tree-node[data-depth="3"], .tree-node[data-depth="4"], .tree-node[data-depth="5"], .tree-node[data-depth="6"] { padding-left: 46px; }
}
