:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1f2430;
  --text-muted: #6b7280;
  --accent: #3b5bdb;
  --accent-hover: #2f4bc0;
  --danger: #d64550;
  --success: #2f9e44;
  --radius: 10px;

  /* Тёмная боковая панель */
  --rail-bg: #2f3746;
  --rail-hover: #3a4353;
  --rail-active: #39435a;
  --rail-icon-bg: #414b5c;
  --rail-avatar-bg: #5b6578;
  --rail-text: #b7c0cd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Узкая тёмная панель слева: иконка сверху, подпись снизу (как в amoCRM) */
.layout { display: flex; min-height: 100vh; align-items: stretch; }

.rail {
  width: 78px;
  flex: 0 0 78px;
  background: var(--rail-bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 4px 0;
}

.rail-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 6px;
  color: var(--rail-text);
  flex: none;
}
.rail-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rail-avatar-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.rail-workday { border-top: 1px solid var(--rail-hover); border-bottom: 1px solid var(--rail-hover); flex: none; }
.rail-workday-reminder .rail-icon { background: var(--danger); color: #fff; }

/* Пунктов меню больше, чем помещается по высоте на невысоких экранах —
   список сам прокручивается (min-height:0 обязателен внутри flex-колонки,
   иначе flex-item не сжимается и прокрутка не включается), а профиль сверху
   и «Выйти» снизу остаются на месте. */
.rail-nav { display: flex; flex-direction: column; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; min-height: 0; }
.rail-nav::-webkit-scrollbar { display: none; }

.rail-nav a,
.rail-logout button,
.rail-workday button,
.rail-workday-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 3px;
  color: var(--rail-text);
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  flex: none;
}
.rail-workday-status { cursor: default; }
.rail-nav a:hover,
.rail-logout button:hover,
.rail-workday button:hover { background: var(--rail-hover); color: #fff; text-decoration: none; }
.rail-nav a.active { background: var(--rail-active); color: #fff; font-weight: 600; }

.rail-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rail-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.rail-nav a.active .rail-icon { background: var(--accent); color: #fff; }
.rail-label { display: block; max-width: 100%; overflow-wrap: anywhere; }
.rail-logout { flex: none; }

.rail-logout { margin-top: auto; }

.main { flex: 1; min-width: 0; }

.container { max-width: 1440px; margin: 0 auto; padding: 24px; }
/* таблицы с длинными пометками (Обороты) — на всю ширину экрана */
.container-wide { max-width: none; }
/* «Сверка» закреплена у правого края: при прокрутке вбок пометка остаётся на виду.
   Только когда это последний столбец — иначе (группа с «Статус патента») закрепление
   накрыло бы соседний столбец. */
.sheet th.sticky-right:last-child, .sheet td.sticky-right:last-child {
  position: sticky; right: 0; z-index: 2; background: var(--surface);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.18);
}
.sheet thead th.sticky-right:last-child { background: var(--bg); z-index: 4; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; }

/* ── Шапка с подписью (2026-08-18, переделано 2026-08-19 и трижды
   2026-08-20) ──────────────────────────────────────────────────────────
   Одна колонка: заголовок, подпись, кнопки — друг за другом сверху вниз.
   Не рядом колонками: у подписи высота «резиновая» (зависит от того,
   сколько слов поместилось в строку), у кнопок — всегда одна и та же
   маленькая. Рядом эти высоты почти никогда не совпадают, и в колонке
   покороче остаётся пустота до конца соседней. Друг под другом пустоты
   в принципе неоткуда взяться — и наложить кнопки на текст тоже нельзя,
   раз они не делят место, а идут по очереди.

   Отдельная пометка page-head-note, а не общее правило: шапки без подписи
   устроены по-разному (кнопка «← К списку», подзаголовки), и общее
   правило имело бы над ними не то же самое действие.

   display:flex + flex-direction:column вместо flex у .page-head (оба
   класса висят на одном div) — так же вертикально, но order у детей
   работает только во флексе/сетке. align-items и justify-content
   сбрасываем явно: они пришли бы от .page-head (там ряд, тут — колонка,
   и center/space-between в колонке толкают заголовок в середину строки). */
.page-head-note {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.page-head-note > h1,
.page-head-note > h2 { order: 0; }
.page-head-note > .page-note { order: 1; margin: 10px 0 0; }
/* margin-top отдельным свойством, не сокращённым margin: тот сбросил бы
   margin-left: auto у .head-actions (ниже) — кнопки уехали бы влево вместо
   привычного места у правого края */
.page-head-note > .head-actions {
  order: 2;
  margin-top: 0;
}
/* на страницах-форм кнопка стоит прямо в шапке, без обёртки .head-actions —
   ей та же логика: последней, прижата вправо, без растяжки в высоту */
.page-head-note > .btn,
.page-head-note > form {
  order: 2;
  display: block;
  width: max-content;
  margin: 0 0 0 auto;
}

/* Панель всегда вертикальная — на узком экране просто уже */
@media (max-width: 760px) {
  .rail { width: 46px; flex: 0 0 46px; }
  .rail-icon { width: 18px; height: 18px; font-size: 10px; }
  .rail-avatar { width: 18px; height: 18px; font-size: 10px; }
  .rail-nav a, .rail-logout button { padding: 3px 2px; font-size: 7px; }
  .container { padding: 16px 12px; }

  /* на узком экране кнопкам просторнее во всю ширину, чем прижатыми
     вправо узким столбиком */
  .page-head-note > .head-actions,
  .page-head-note > .btn,
  .page-head-note > form {
    width: 100%;
    margin: 12px 0 0;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }

/* Широкая таблица прокручивается внутри карточки, а не растягивает страницу */
.card { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; }
th .col-btn { white-space: normal; }
tr:hover td { background: #fafbfc; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active { background: #ebfbee; color: var(--success); }
.badge-terminated { background: #fff4e6; color: #e8590c; }
.badge-closed { background: #f1f3f5; color: var(--text-muted); }
.badge-unassigned { background: #fff4e6; color: #e8590c; }
.status-new { background: #ffe3ec; color: #a61e4d; }
.status-in_progress { background: #fff9db; color: #e67700; }
.status-won { background: #ebfbee; color: var(--success); }
.status-lost { background: #f1f3f5; color: var(--text-muted); }

.btn {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: inherit;   /* без этого <button> берёт системный шрифт браузера,
                              а <a> — шрифт страницы: рядом в одном ряду они
                              выходили разной высоты */
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
/* «Сохранить» — везде пастельно-синяя: заметнее серой (не сливается с фоном),
   но мягче сплошного синего «Создать» и красного «Удалить» */
.btn-save { background: #e8ecfd; color: var(--accent); border-color: #c9d1f7; }
.btn-save:hover { background: #d7deff; border-color: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
/* Второй клик у data-confirm (см. confirm-inline.js) — заметная рамка,
   пока не кликнули ещё раз или не прошли 4 секунды */
[data-confirm].confirm-armed { outline: 2px solid #7a1a20; outline-offset: 2px; }
.btn-check { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-check:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

form.inline { display: inline; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 70px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }

.event {
  border-left: 3px solid var(--border);
  padding: 6px 0 6px 14px;
  margin-bottom: 10px;
}
.event.handoff { border-left-color: var(--accent); }
.event.import { border-left-color: var(--text-muted); }
.event-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.event-text { white-space: pre-wrap; }

/* Список-таблица, где каждая строка — отдельная форма */
.rows { padding: 0; }
.rows-head,
.rows-row {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.rows-head {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.rows-row:last-child { border-bottom: none; }
.rows-row input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: var(--surface);
  color: var(--text);
}
.rows-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rows-empty { padding: 14px 16px; }

/* Тариф по документам: ступень, граница по документам, ставка */
.rows-documents .rows-head,
.rows-documents .rows-row {
  grid-template-columns: minmax(160px, 2fr) minmax(90px, 1fr) minmax(90px, 1fr) auto;
}

/* Тарифная сетка: строки — обороты, столбцы — режимы */
.matrix { border-collapse: collapse; min-width: 100%; }
.matrix th, .matrix td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.matrix thead th {
  background: var(--bg);
  text-align: left;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  min-width: 130px;
}

/* строка (диапазон оборота) и угловая ячейка не уезжают при прокрутке вбок —
   в широкой тарифной сетке иначе теряешь, для какого диапазона колонка */
.matrix-row-head {
  background: var(--bg);
  text-align: left;
  font-weight: 500;
  position: sticky;
  left: 0;
  z-index: 2;
}
.matrix-corner { position: sticky; left: 0; z-index: 4; }
.matrix input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.matrix .rate-cell { text-align: right; font-size: 15px; font-weight: 600; }
.matrix tbody td { min-width: 120px; }
.matrix-corner { width: 300px; min-width: 300px; }

/* Границы диапазона: два поля в строку во всю ширину, «удалить» — ниже.
   Раньше они делили место со ссылкой и числа обрезались: «200 000» показывалось как «20(». */
.band-bounds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.band-bounds input { font-size: 14px; text-align: right; }
.band-bounds form { grid-column: 1 / -1; }
.band-bounds .link-danger { text-align: left; }
.matrix-add form { display: flex; flex-direction: column; gap: 6px; }
.link-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
  white-space: nowrap;
}
.link-danger:hover { text-decoration: underline; }

/* Список доплат с галочками */
.checklist { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checkitem {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 0;
  cursor: pointer;
}
.checkitem input { width: auto; }

.save-state { font-size: 12px; color: var(--text-muted); min-width: 76px; }
.save-state.save-ok { color: var(--success); }
.save-state.save-error { color: var(--danger); }

/* Узкое окно: поля сверху, кнопки отдельной строкой под ними */
@media (max-width: 900px) {
  .rows-head { display: none; }
  .rows-row {
    grid-template-columns: 1fr 110px;
    row-gap: 8px;
  }
  .rows-actions { grid-column: 1 / -1; }
}

/* Строка с несохранённой правкой */
.row-dirty { background: #fff9db; }
tr.row-dirty td { background: #fff9db; }
.btn-attention {
  background: var(--success);
  border-color: var(--success);
  animation: pulse-save 1.2s ease-in-out infinite;
}
@keyframes pulse-save {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.error { color: var(--danger); font-size: 14px; margin-bottom: 12px; }
/* Серые пояснения. Один вид на всю программу — раньше .hint в таблице и .hint
   отдельным абзацем выглядели по-разному: у абзаца не было ни межстрочного
   интервала, ни предела ширины, и он читался тяжелее соседней подписи. */
.hint { color: var(--text-muted); font-size: 13px; line-height: 1.55; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 320px; }

/* Свод выплат */
.payroll-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.payroll-head span { color: var(--text-muted); font-size: 14px; }
/* левая часть шапки: у первой карточки — фильтры периода и сотрудника,
   у остальных (когда карточек несколько) — имя бухгалтера вместо них */
.payroll-head-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.payroll-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
}
.payroll-total strong { font-size: 22px; }

/* Фильтр по периоду и сотруднику — в самой шапке карточки, где раньше
   стояло только имя бухгалтера. Бледный: это не обязательный выбор
   (по умолчанию «Все сотрудники» и текущий месяц), поэтому не должен
   спорить взглядом с суммой справа в той же строке. */
.payroll-filters { display: flex; gap: 8px; }
.select-muted {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--surface);
}
/* Обороты не переносим посреди числа — иначе разряды читаются как разные суммы */
td.num { text-align: right; white-space: nowrap; }

/* Экран массового заполнения */
.bulk-apply {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.bulk-apply select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.bulk-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.matrix .regime-system {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  background: var(--bg);
}

/* Вкладки внутри раздела */
.subnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.subnav a {
  padding: 9px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
/* «Бухгалтерия»: ряды «ИП» / «ООО» / сводные, у каждого подпись слева (2026-10-17) */
.accounting-nav { flex-direction: column; gap: 0; }
.accounting-nav .subnav-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }
.accounting-nav .subnav-links { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 0; min-width: 0; }
.accounting-nav .subnav-row + .subnav-row { border-top: 1px dashed var(--border); }
.subnav-label {
  min-width: 130px;
  padding: 9px 8px 9px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

/* Доступы: моноширинный шрифт для логинов и паролей */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret .btn { padding: 4px 10px; font-size: 12px; }
.secret-value { color: var(--danger); font-weight: 600; }

/* Первая колонка (покупатель/клиент) не уезжает при прокрутке вбок — во всех
   таблицах программы, не только в сводной. Где перед ней есть галочка
   выделения — она тоже закреплена (.sticky-col-check), сдвинутая колонка
   покупателя тогда идёт с отступом на её ширину. */
.sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  white-space: normal;
  z-index: 2;
}
.sticky-col-check {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
}
.sticky-col-check + .sticky-col { left: 34px; }
thead .sticky-col, tfoot .sticky-col,
thead .sticky-col-check, tfoot .sticky-col-check { background: var(--bg); z-index: 4; }

.summary-table { min-width: 100%; }
.summary-table th, .summary-table td { white-space: nowrap; font-size: 13px; }
.summary-table .sticky-col { white-space: normal; min-width: 210px; }
.summary-table tfoot th { background: var(--bg); border-top: 2px solid var(--border); }
.summary-table .charge { color: var(--accent); }

/* журнал правок доступов */
.link-btn {
  background: none; border: 0; padding: 0; margin-right: 12px;
  color: var(--accent); font-size: 13px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.log-row td { background: var(--bg-soft, #f7f8fa); }
.log-body ul { margin: 4px 0 10px; padding-left: 18px; }
.log-body li { margin-bottom: 2px; }

/* доступы: ссылка на платформу и замок на логине/пароле */
.with-link { display: flex; align-items: center; gap: 6px; }
.with-link input { flex: 1; min-width: 0; }
.with-link a { font-size: 15px; text-decoration: none; }
.locked { display: flex; align-items: center; gap: 4px; }
.locked input { flex: 1; min-width: 220px; }
.locked input[readonly] { background: var(--bg-soft, #f1f2f4); color: var(--text-muted); }
.pencil {
  background: none; border: 0; padding: 2px; cursor: pointer;
  font-size: 13px; line-height: 1; opacity: .55;
}
.pencil:hover { opacity: 1; }
/* кнопка «Копировать» у логинов — везде одинаковая, как в «Финансах» (18.11.2026); в «Доступах» — под полем */
.copy-login { margin-left: 4px; padding: 1px 6px; font-size: 11px; line-height: 1.4; border: 1px solid var(--border, #e3e5ea);
  border-radius: 6px; background: #fff; color: #555; cursor: pointer; white-space: nowrap; vertical-align: middle; }
.copy-login:hover { background: #f6f1e7; }
.copy-login.done { background: #e6f4ea; color: #2f7a3d; border-color: #b7dfc0; }
.copy-login-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; }
.copy-login-wrap > input { width: 100%; min-width: 0; box-sizing: border-box; }
.copy-login-wrap > .copy-login, .locked > .copy-login { margin-left: 0; }
/* «Доступы»: логин во всю ширину ячейки, под ним ✏️ и «Копировать» */
.locked:has(> .copy-login) { flex-wrap: wrap; }
.acc-table td .locked:has(> .copy-login) > input:not([type="checkbox"]), .locked:has(> .copy-login) > input { flex: 1 1 100%; width: 100%; min-width: 9em; }
.secret-copy { margin-left: 4px; }
td textarea { width: 100%; resize: vertical; min-height: 64px; font: inherit; }

/* доступы: форма добавления сверху, свёрнутая */
.add-box > summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  color: var(--accent); list-style: none;
}
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 14px; }
.no-link { margin-left: 6px; font-size: 11px; opacity: .7; }

/* --- Раздел «Задачи» --- */
.task-group td { background: #f8f9fa; border-top: 1px solid var(--border); }
.task-group strong { font-size: 14px; }
.client-search { margin-bottom: 6px; }

.status-done { background: #ebfbee; color: var(--success); }
.status-finished { background: #d3f9d8; color: #2b8a3e; }
.status-postponed { background: #f1f3f5; color: var(--text-muted); }
.status-rejected { background: #ffe3e3; color: #c92a2a; }
.status-cancelled { background: #f1f3f5; color: var(--text-muted); }
.status-awaiting_payment { background: #fff4e6; color: #e8590c; }
.status-call { background: #e5dbff; color: #6741d9; }
.status-review { background: #e3fafc; color: #0b7285; }
.status-urgent { background: #ffe3e3; color: #c92a2a; }

/* инструкция по выгрузке чеков за наличку */
.receipts-note {
  margin-top: 6px; padding: 8px 10px; border-radius: 6px;
  background: #fff; border: 1px solid var(--border);
  white-space: pre-wrap; line-height: 1.5; max-width: 900px;
}

/* Меню в заголовке колонки: сортировка, скрытие, фильтр */
.tcol-wrap { position: relative; display: inline-block; }
.tcol { position: relative; display: inline-block; }
.tcol > summary {
  cursor: pointer; list-style: none;
  border-bottom: 1px dashed var(--border);
}
.tcol > summary::-webkit-details-marker { display: none; }
.tcol-sort { margin-left: 4px; color: var(--accent); }
/* fixed, а не absolute: у .card стоит overflow-x:auto и он обрезал бы меню */
.tcol-menu {
  position: fixed; z-index: 30; min-width: 260px; max-width: 320px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px;
  text-transform: none; font-weight: 400;
}
.tcol-action {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text);
}
.tcol-action:hover { background: #f1f3f5; }
.tcol-filter { border-top: 1px solid var(--border); margin-top: 6px; padding: 8px 10px 4px; }
.tcol-filter .tcol-input {
  width: 100%; margin-top: 4px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit;
}
.filters-summary { margin-bottom: 10px; }

/* столбец с активным фильтром: навёл на шапку — сбоку крестик,
   снимает фильтр сразу, без открытия меню */
.tcol-quick-clear {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; right: -26px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--danger); color: #fff; cursor: pointer; font-size: 11px; line-height: 1;
  z-index: 2;
}
.tcol-quick-clear:hover { background: #b8394a; }

/* справочник платформ: только чтение */
.url-cell { word-break: break-all; font-size: 12px; }
.receipts-cell { white-space: pre-wrap; line-height: 1.45; }

/* меню столбца: сортировка, скрытие, фильтр */
th[data-menu] { position: sticky; top: 0; z-index: 3; padding: 0; }
.col-btn {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 10px 12px; font: inherit; color: inherit; text-transform: inherit;
  letter-spacing: inherit; display: flex; align-items: center; gap: 6px;
}
.col-btn:hover { background: rgba(0, 0, 0, .04); }
.col-btn .caret { opacity: .45; font-size: 10px; }
th.sorted .col-btn, th.filtered .col-btn { color: var(--accent); }
th.filtered .col-btn::after { content: '•'; color: var(--accent); }
th.sorted[data-dir="asc"] .col-btn::after { content: '↑'; color: var(--accent); }
th.sorted[data-dir="desc"] .col-btn::after { content: '↓'; color: var(--accent); }

.col-menu[hidden] { display: none; }
/* position: fixed, а не absolute: карточка таблицы прокручивается вбок
   (overflow-x: auto) и обрезала бы выпавшее меню — до фильтра было не добраться.
   Место считает скрипт: см. table-menu.js */
.col-menu {
  position: fixed; z-index: 30; min-width: 268px; max-width: 320px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20, 25, 40, .16); padding: 6px;
  text-transform: none; letter-spacing: normal; font-weight: 400;
}
.col-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.col-menu button:hover { background: var(--bg-soft, #f1f2f4); }
.col-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 2px; }
.col-filter { padding: 6px 10px 8px; }
.col-filter label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.col-filter input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px;
}
.col-hidden { display: none; }

/* столбец с активным фильтром или сортировкой: видно сразу (не только по наведению) —
   красный крестик сбоку от шапки снимает и то, и другое, без открытия меню */
.col-quick-clear {
  display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--danger); color: #fff; cursor: pointer; font-size: 11px; line-height: 1;
  z-index: 2;
}
th.filtered .col-quick-clear, th.sorted .col-quick-clear { display: inline-flex; align-items: center; justify-content: center; }
.col-quick-clear:hover { background: #b8394a; }

/* Кнопка «+ Создать задачу»: тот же add-box, но summary выглядит кнопкой */
.add-box.task-create { padding: 12px 16px; }
.add-box.task-create > summary {
  display: inline-block;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.add-box.task-create[open] { padding: 20px; }
.add-box.task-create[open] > summary { margin-bottom: 16px; }

/* обороты за квартал: итог считает программа, его не правят */
.quarter-total { text-align: right; font-weight: 600; white-space: nowrap; }

/* всё должно помещаться на экран: переносим по словам, а не тянем в ширину */
table { table-layout: auto; }
th, td { overflow-wrap: break-word; word-break: normal; }
td input, td select, td textarea { width: 100%; min-width: 0; box-sizing: border-box; }

/* Столбцы с числами — по содержимому, без лишнего простора: цифре незачем
   растягивать колонку на всю ширину. Текстовые поля (заметки, комментарии) —
   наоборот, пошире по умолчанию, чтобы переносов было меньше и легче читалось. */
td:has(> input[inputmode="numeric"]) { white-space: nowrap; }
td textarea { min-width: 160px; }
/* min-width, а не просто width: 100% от td с width:1% — иначе браузер берёт
   свою узкую дефолтную ширину поля (~70px), в которую не влезает сумма за
   квартал (это сумма трёх месяцев — цифр заметно больше, чем в одном месяце) */
.turnover-input, .expense-input { text-align: right; font-size: 13px; padding-left: 4px; padding-right: 4px; min-width: 120px; }
/* доход за квартал на «Обороты Патент» — отдельное поле на каждый патент,
   если их у клиента в этом квартале несколько */
.patent-income-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.patent-income-row:last-child { margin-bottom: 0; }
.patent-income-row .hint { white-space: nowrap; }
/* формы на отдельных страницах не растягиваем во всю ширину экрана */
.field input, .field select, .field textarea { max-width: 560px; }

/* Правка прямо в строке списка задач */
.cell-input {
  width: 100%; min-width: 7rem; padding: 5px 7px; font-size: 13px; font-family: inherit;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text);
}
.cell-input:hover { border-color: var(--border); background: #fff; }
.cell-input:focus { border-color: var(--accent); background: #fff; outline: none; }
textarea.cell-input { resize: vertical; min-height: 30px; }

/* стрелка «назад» в карточке и на формах */
.back-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 34px;
  border: 1px solid var(--border); border-radius: 9px;
  background: #fff; color: var(--text); font-size: 18px; line-height: 1;
  text-decoration: none;
}
.back-arrow:hover { background: var(--bg-soft, #f1f2f4); color: var(--accent); }

/* Отметка автосохранения. [hidden] нужен с !important: правила вида
   .btn { display: inline-block } иначе перебивают его. */
[hidden] { display: none !important; }
.autosave-status { display: inline-block; min-width: 5.5rem; font-size: 12px; }
.autosave-status.autosave-failed { color: var(--danger, #c92a2a); font-weight: 600; }

/* Ячейка названия задачи: поле правки и ссылка на карточку рядом */
.title-cell { display: flex; align-items: center; gap: 6px; }
.title-cell .cell-input { min-width: 22rem; }
.title-cell a { text-decoration: none; flex: none; }

/* отметка «оплачено» под суммой */
.paid-mark {
  display: block; width: 100%; margin-top: 4px;
  padding: 2px 4px; font-size: 11px; font-weight: 600;
  border: 1px solid #f19d38; border-radius: 6px;
  background: #fff4de; color: #8a5a10;          /* опл — жёлтым */
}
.paid-mark.not-paid {
  border-color: #e03131; background: #ffe9e9; color: #b02525;   /* не опл — красным */
}
.paid-mark.offset-paid { border-color: #b197d8; background: #f1e9fb; color: #5a3f8a; }   /* из переплаты — лиловым */

/* Массовое удаление задач */
.bulk-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bulk-bar .btn[disabled] { opacity: .45; cursor: default; }
.bulk-pick, #bulk-all { width: 16px; height: 16px; cursor: pointer; }
/* у поля статуса свой фон — рамку не подсвечиваем поверх него */
.cell-input.status-pick { border-color: transparent; font-weight: 600; }


/* сверка в сводной — текст в несколько строк */
.summary-table .check-cell { white-space: normal; min-width: 0; line-height: 1.4; }

/* «Обороты» — плотная таблица-ведомость: столбцы уже, вся картина на экране */
.sheet th, .sheet td { padding: 6px 5px; font-size: 12px; vertical-align: top; }
.sheet th { font-size: 11px; letter-spacing: 0; }
.sheet .col-btn { padding: 8px 5px; }
.sheet textarea { font-size: 12px; min-height: 42px; padding: 4px 5px; }
.sheet .turnover-input, .sheet .expense-input { font-size: 12px; padding: 4px 4px; }
.sheet .paid-mark { font-size: 10px; padding: 1px 2px; margin-top: 2px; min-width: 72px; }
.sheet .quarter-total { font-size: 12px; }

/* суммы к уплате: оплаченные жёлтым, неоплаченные красным */
.sum-paid { color: #8a5a10; white-space: nowrap; }
.sum-unpaid { color: #b02525; white-space: nowrap; }
.summary-table .check-note { width: 100%; min-width: 0; font-size: 11px; resize: vertical; }

/* Всплывающее окно (передача задачи) */
.modal {
  border: 0; border-radius: var(--radius); padding: 24px;
  width: min(520px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(20, 25, 40, .25);
  color: var(--text); background: var(--surface);
}
.modal::backdrop { background: rgba(20, 25, 40, .45); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.handoff-target {
  margin: 0 0 14px; padding: 8px 12px; border-radius: 8px;
  background: #f1f3f5; font-weight: 600; font-size: 14px;
}

/* Шаблоны единым списком: заголовок разворачивается, шаги — отступом */
.tpl-head td { background: #f8f9fa; }
.tpl-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--accent); text-align: left;
}
.tpl-arrow { display: inline-block; width: 1em; color: var(--text-muted); }
.tpl-step > td { padding-top: 4px; padding-bottom: 4px; }
.step-line { display: flex; align-items: center; gap: 8px; padding-left: 20px; }
.step-title { flex: 1; min-width: 12rem; }
.step-performer { max-width: 15rem; }
.tpl-tools > td { padding: 14px 8px 18px 8px; }
.step-launch { max-width: 14rem; }

/* полоса «клиент уже уходил» в карточке вернувшегося */
.was-gone {
  border: 1px solid #e8a33d; background: #fff8ec;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.was-gone.our-fault { border-color: var(--danger); background: #fff0f0; }

/* «Выплата бухгалтеру»: строка без данных для расчёта — заведена задача, см.
   app.services.payroll_watch. .sticky-col прописан отдельно — у него свой
   background и без этого правила он перекрыл бы подсветку. */
tr.row-no-data td { background: #fff0f0; }
tr.row-no-data td.sticky-col { background: #fff0f0; }

/* Зелёная кнопка — запуск процесса по клиенту */
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #2b8a3e; border-color: #2b8a3e; }

/* Жёлтая кнопка — «Завершено» в строке задачи */
.btn-warning { background: #f59f00; color: #fff; border-color: #f59f00; }
.btn-warning:hover { background: #e08e00; border-color: #e08e00; }

/* Плитки статистики */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-tile { flex: 1; min-width: 150px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-alarm .stat-value { color: var(--danger); }

/* уменьшение патента: уменьшен — жёлтым, нет — красным */
.reduce-mark {
  width: 100%; padding: 3px 4px; font-size: 12px; font-weight: 600;
  border: 1px solid #f19d38; border-radius: 6px;
  background: #fff4de; color: #8a5a10;
}
.reduce-mark.not-reduced {
  border-color: #e03131; background: #ffe9e9; color: #b02525;
}

/* Карточка таймера задачи */
.timer-card { border-left: 3px solid var(--success); }

/* Таймер в списке задач */
.timer-btn { padding: 6px 10px; font-size: 13px; }
.timer-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #ebfbee; border: 1px solid #b2f2bb; color: #2b8a3e;
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}
.timer-hint { margin-bottom: 12px; }

/* Глазик у поля с паролем: показать/скрыть набранное */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 40px; }
.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  opacity: .45;
}
.pw-eye:hover { opacity: .8; }
.pw-eye.pw-eye-on { opacity: 1; }


/* ── Единый вид кнопок действий на странице (2026-08-18, дополнено 2026-08-19,
   переведено в строку 2026-08-20) ──
   Порядок слева направо: зелёная «Создать», за ней жёлтые действия над
   отмеченными строками, синяя — самостоятельное действие вроде «Проверить»
   (ничего не отмечено, не разрушительно — просто запустить проверку/расчёт
   заново), последней красная — удаление или расторжение.
   Так на любой странице глаз ищет нужную кнопку в одном и том же порядке.
   Строка, а не столбик: кнопки лежат под текстом-подписью, тянуть их вниз
   колонкой незачем — а строка короче и не спорит по ширине с текстом.
   Синий — `.btn-check`, тот же оттенок, что и обычная (немодифицированная)
   `.btn` — брать его для любой будущей кнопки того же типа. */
.head-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;   /* строка прижата к правому краю */
  gap: 12px;
  width: auto;
  margin-left: auto;
}
.head-actions form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.head-actions .btn {
  width: auto;
  min-width: 98px;   /* короткие подписи («Создать», «Удалить») выходят одной ширины */
  padding: 4px 10px;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}
.head-actions .hint { text-align: right; }
.head-actions select { width: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }

/* зелёная — создание, главное действие страницы */
.btn-create { background: var(--success); color: #fff; border-color: var(--success); }
.btn-create:hover { background: #2b8a3e; border-color: #2b8a3e; }

/* серая подпись под кнопками: что они делают и что вообще на странице */
/* ── Подпись страницы (2026-08-18) ────────────────────────────────────────
   Один вид на всю программу: что за раздел и что делают кнопки. Раньше то же
   самое писали то классом .hint, то .page-note — и выглядело по-разному.
   Теперь .hint остаётся для мелких пометок внутри таблиц и рядом с полями,
   а объяснение страницы — всегда .page-note.

   Внутри абзацы: сплошной текст на пять строк никто не дочитывает. */
.page-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  /* на всю ширину шапки (2026-08-20) — раньше узкая колонка в 78ch
     оставляла пустое место справа рядом с кнопками */
  margin: 0 0 16px;
}
.page-note p { margin: 0 0 8px; }
.page-note p:last-child { margin-bottom: 0; }
.page-note strong { color: var(--text-muted); font-weight: 600; }

/* свёрнутая подсказка (2026-10-02, static/page-note-toggle.js): по умолчанию видна
   только кнопка, текст — после клика */
.page-note:not(.page-note-open) > .page-note-body { display: none; }
.page-note-body { margin-top: 8px; }
.page-note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.page-note-toggle:hover { background: var(--bg); }
.page-note-toggle-icon { font-size: 11px; }

/* Система у строки сетки: «УСН», «АУСН» или пусто — строка подходит любой */
.matrix .band-system { margin-top: 6px; font-size: 13px; color: var(--text-muted); }

/* структура расчёта УСН на карточке клиента */
.calc-usn { width: 100%; font-size: 13px; }
.calc-usn td, .calc-usn th { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.calc-usn tr.minus td { color: var(--danger); }
.calc-usn tr.total td { background: #fff8ec; border-top: 2px solid var(--border); }

/* Список с галочками выделения: первая колонка — сама галочка */
.rows-pickable .rows-head,
.rows-pickable .rows-row {
  grid-template-columns: 24px minmax(160px, 2fr) minmax(90px, 1fr) auto;
}

/* Подпись под границами диапазона: «6 млн – 15 млн» — чтобы не считать нули.
   Строка сетки — это <th>, у него в общем правиле CAPS: здесь он не нужен. */
.band-short {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
/* Сами поля с границами компактнее — рядом с подписью длинное число не нужно крупным */
.matrix .band-bounds input { font-size: 13px; padding: 5px 7px; }

/* расчёт УСН, раскрывающийся под строкой на вкладке «Обороты» */
.calc-box { padding: 8px 10px; }
.calc-box .calc-usn { width: auto; min-width: 320px; }
.calc-row td { background: var(--bg-soft, #f7f8fa); }

/* «Год» на «Бухгалтерии»: таблицы кварталов клиента подряд, каждая — обычная страница внутри рамки */
.year-client { margin: 18px 0 4px; }
.year-q-title { margin: 22px 0 8px; }
.year-frame { width: 100%; border: 0; display: block; min-height: 120px; background: transparent; }
/* страница внутри «Года» (embed=1): только таблица, без меню слева, без своей прокрутки */
body.embed { background: transparent; }
.embed .layout { min-height: 0; display: block; }
.embed .container { padding: 0; max-width: none; }
.embed .card:has(table), .embed .card[style*="overflow-x"] { max-height: none; }
/* «Сообщение клиенту» в «Годе» тоже есть (2026-10-15): окно на время показа растягивает вставку квартала, см. turnovers.html */
.client-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Зафиксированная шапка таблиц ──────────────────────────────
   Верхняя строка любой таблицы остаётся видимой при прокрутке.
   Для узких таблиц (без горизонтального скролла) шапка липнет к
   верху экрана. Для широких — карточка получает высоту и вертикальный
   скролл, шапка липнет к верху карточки. */
thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--border);
}
/* второй ряд шапки (сводная, где есть подзаголовки) — ниже первого */
thead tr:nth-child(2) th { top: 38px; }

/* широкие таблицы прокручиваются внутри карточки — тогда шапка держится */
.card[style*="overflow-x"] {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}
/* липкий первый столбец сводной должен перекрывать шапку в углу */
.summary-table thead .sticky-col { z-index: 4; }

/* ── Зафиксированная шапка таблиц (2026-08-18) ────────────────────────────
   Верхняя строка любой таблицы стоит на месте при прокрутке — иначе на
   длинных списках непонятно, что в столбце.

   Почему с высотой карточки: у карточек есть overflow-x (широкие таблицы
   листаются вбок), из-за этого карточка сама становится областью прокрутки
   и «липкость» считается от её верха. Пока у карточки нет своей высоты,
   вертикальной прокрутки внутри не происходит и шапка уезжает вместе с
   листом. Задаём высоту — прокрутка идёт внутри таблицы, шапка стоит. */
.card:has(table) {
  max-height: calc(100vh - 210px);
  overflow: auto;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}
/* у столбцов с меню фон серый — как у остальной шапки таблиц-списков */
th[data-menu] { background: var(--surface); z-index: 3; }
.matrix thead th { background: var(--bg); }
.summary-table thead th { background: var(--bg); }
.summary-table thead .sticky-col { z-index: 4; }

/* Галочка выделения строки тарифной сетки — сбоку, не над строкой: раньше
   отъедала свою строку сверху и всё ниже съезжало вниз без надобности. */
.band-row-flex { display: flex; align-items: flex-start; gap: 8px; }
.band-row-content { flex: 1; min-width: 0; }
.band-pick { flex: none; margin-top: 8px; }

/* три расчёта в ряд по горизонтали под строкой */
.calc-cols { display: flex; gap: 24px; flex-wrap: wrap; padding: 8px 10px; }
.calc-cols .calc-box { padding: 0; }
.calc-cols .calc-usn { min-width: 300px; }

/* Ступени по документам с галочками: галочка, ступень, граница, ставка, для кого */
.rows-documents.rows-pickable .rows-head,
.rows-documents.rows-pickable .rows-row {
  grid-template-columns: 24px minmax(160px, 2fr) minmax(90px, 1fr) minmax(90px, 1fr) minmax(110px, 1fr) auto;
}

/* ── Архив задач и выбор «что показывать» (2026-08-18) ────────────────────
   «Удалить» задачу теперь не стирает её, а прячет в архив — работу видно, но
   она не идёт в расчёт. Строка архивной задачи приглушена и не редактируется
   на месте, только «Восстановить». Три вкладки — Активные / Выполненные /
   Удалённые — решают, что читать: см. TASK_TABS в tasks_pages.py. Кнопка
   стоит над таблицей, справа, ближе к столбцу «Статус» — от него и зависит,
   что в выборку попало. */
.row-archived { opacity: .6; background: var(--bg); }
.row-archived td { pointer-events: none; }
.row-archived form { pointer-events: auto; }

/* Строка задачи красится по статусу только буквами, не фоном целиком (просьба
   2026-10-05, «как в Планфиксе») — цвет задаётся инлайном на <tr> (row_text_color,
   см. app/db/task_statuses.py), а инпуты/селекты внутри сами по себе цвет не
   наследуют, если не сказать явно. */
.task-row-status input, .task-row-status select, .task-row-status textarea { color: inherit; }

/* «Список шагов» на «Шаблонах» — своя строка над таблицей (у «Показывать»
   на «Всех задачах» теперь свой ряд в head-actions, см. tasks_all.html). */
.view-picker-row { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 0 10px; }

/* Кнопка «Показывать»/«Список шагов» — details.tcol (тот же вид, что у меню
   столбца), но пастельный фон вместо обычной белой кнопки: это не действие
   вроде «Создать» или «Удалить», а переключатель того, что уже на экране. */
.view-picker > summary {
  display: inline-block;
  padding: 7px 12px;
  background: #e6fcf5;
  border: 1px solid #96f2d7;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  white-space: nowrap;
}
.view-picker > summary::-webkit-details-marker { display: none; }
.view-picker-menu { padding: 8px; text-align: left; }

/* Та же пастельная кнопка, но простая ссылка — переход в другой справочник,
   а не действие и не переключатель показа. */
.pastel-link {
  display: inline-block;
  padding: 8px 14px;
  background: #e6fcf5;
  border: 1px solid #96f2d7;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text);
}
.pastel-link:hover { background: #d3f9ec; text-decoration: none; }
.view-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.view-option:hover { background: #f1f3f5; }
.view-option-box { width: 16px; height: 16px; accent-color: var(--success); flex: none; }

/* Пункты-действия в такой же пастельной панели (шаблоны: «Развернуть все» /
   «Свернуть все») — не выбор состояния, поэтому без галочки, просто кнопка. */
.tpl-menu-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--text);
}
.tpl-menu-action:hover { background: #f1f3f5; }

/* Исполнители задачи — одна кнопка-попап на всех: основной и остальные
   выглядят одинаково, список внутри и решает, кто из них главный (это
   видно только базе — для статистики и передачи по цепочке). */
.assignee-picker { display: inline-block; }
.assignee-picker > summary {
  display: inline-block;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignee-picker > summary:hover { background: #f1f3f5; }
.assignee-picker > summary::-webkit-details-marker { display: none; }
.assignee-menu { padding: 6px; text-align: left; }
.assignee-search {
  width: 100%; margin-bottom: 6px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit;
}
.assignee-list { max-height: 260px; overflow-y: auto; }

/* Имя вместо галочки: жмёшь прямо по строке, отмеченное — подсвечено.
   Сам чекбокс остаётся в разметке (форма и клавиатура его видят), но
   визуально спрятан — не мешает читать список коротких фамилий. */
.assignee-chip {
  position: relative;
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.assignee-chip:hover { background: #f1f3f5; }
.assignee-chip.picked,
.assignee-chip:has(> input:checked) { background: #e6fcf5; color: #087f5b; font-weight: 600; }
.assignee-chip input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}


/* Логотип программы — он же кнопка аккаунта: ведёт на «О программе» */
.rail-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  color: var(--rail-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 4px;
  text-decoration: none;
  font-size: 11px;
  text-align: center;
}
.rail-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}
.rail-brand .rail-label { font-weight: 600; color: #fff; }
.rail-brand:hover { text-decoration: none; }
.rail-brand:hover .rail-brand-icon { opacity: 0.85; }
.rail-brand.active { background: var(--rail-active); }

/* Номер бухгалтера перед именем клиента (как «П45» в «Финансах») */
.resp-badge {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.4;
  padding: 0 6px; margin-right: 4px; border-radius: 6px; vertical-align: baseline;
  background: #eef0ff; color: #4a56c8; white-space: nowrap;
}

/* Кнопка «✉ Сообщение» — как в «Финансах»: синяя, компактная, под суммой платежа */
.btn-msg {
  display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1.5; cursor: pointer; white-space: nowrap;
}
.btn-msg:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* «отправлено: 12.09, 19.09 · 2 из 3» — серым под кнопкой сообщения */
.msg-hist { font-size: 10px; line-height: 1.3; color: #8a90a0; margin-top: 2px; max-width: 12em; white-space: normal; }
.msg-hist:empty { display: none; }
.msg-hist-limit { color: #c0392b; font-weight: 600; }

.resp-badge-raz { background: #fff1d6; color: #9a5b00; }
/* «ЗАКР» — клиент на закрытии/ликвидации (2026-10-19) */
.resp-badge-zakr { background: #f3e4f5; color: #7a3b8f; }

/* рабочая таблица зарплатного отдела (ЗП ИП/ООО): узкие ячейки, чтобы всё влезло без горизонтальной прокрутки */
.payroll-sheet { table-layout: fixed; width: 100%; }
.payroll-sheet th, .payroll-sheet td { padding: 3px 4px; vertical-align: top; }
.payroll-sheet th { font-size: 11px; white-space: normal; overflow-wrap: normal; hyphens: none; text-transform: none; letter-spacing: 0; }
.payroll-sheet .sheet-cell { width: 100%; min-width: 0; font-size: 12px; padding: 3px 3px; text-align: center; box-sizing: border-box; }
.payroll-sheet .sheet-comment { width: 100%; min-width: 0; font-size: 12px; padding: 3px 4px; resize: none; box-sizing: border-box; overflow: hidden; }
.payroll-sheet .payroll-num { min-width: 0; width: 100%; box-sizing: border-box; }
.payroll-sheet .sheet-link { width: 100%; max-width: 100%; min-width: 0; font-size: 11px; padding: 2px 4px; box-sizing: border-box; }
.payroll-sheet .link-btn { margin-left: 6px; background: none; border: 0; color: var(--muted, #6b7480); font-size: 11px; cursor: pointer; padding: 0; text-decoration: underline; }
.payroll-sheet .section-row td { background: #f3ede6; padding: 8px 6px; }
.payroll-sheet .row-left { opacity: .8; }
.chain-tag { font-size: 12px; font-weight: 700; color: #7c4a1d; margin: 0 0 3px 0; line-height: 1.25; }

/* «Доступы»: компактная таблица (2026-10-20) - поля выглядят как текст, рамка только при наведении/правке,
   без min-width, чтобы всё влезало в экран; повтор клиента - бледным */
.acc-table { width: 100%; }
.acc-table td { vertical-align: top; padding: 6px 8px; }
.acc-table td input:not([type="checkbox"]), .acc-table td textarea {
  width: 100%; min-width: 0; box-sizing: border-box; padding: 2px 4px;
  border: 1px solid transparent; background: transparent; box-shadow: none; font: inherit;
}
.acc-table td input:not([type="checkbox"]):hover, .acc-table td textarea:hover { border-color: var(--border, #d0d4da); }
.acc-table td input:not([type="checkbox"]):focus, .acc-table td textarea:focus { border-color: var(--accent, #6b8f71); background: #fff; outline: none; }
.acc-table .locked input { flex: 1; min-width: 0; }
.acc-table .locked input[readonly] { background: transparent; color: inherit; }
.acc-table .locked input::placeholder { color: var(--text-muted, #8a8f98); }
.acc-table .secret { flex-wrap: nowrap; gap: 2px; }
.acc-table textarea { resize: vertical; min-height: 2.4em; line-height: 1.3; }
.acc-table .acc-ico { background: none; border: 0; padding: 2px 4px; cursor: pointer; opacity: .75; font-size: 12px; white-space: nowrap; }
.acc-table .acc-ico:hover { opacity: 1; text-decoration: underline; }
.acc-table .acc-repeat { color: var(--text-muted, #8a8f98); font-size: 12px; }
.acc-table .secret-value { white-space: nowrap; }
/* 13.11.2026 (Гульнара, скрин Гарфутдиновых): платформа, записанная длинной ссылкой без пробелов, распирала столбец и
   наезжала на соседние, а логин/пароль/код сжимались до одной буквы. Ссылку переносим, полям даём минимальную ширину. */
.acc-table td.acc-platform { overflow-wrap: anywhere; word-break: break-word; max-width: 16em; }
.acc-table td .locked input:not([type="checkbox"]) { min-width: 9em; }
.acc-table td .secret input:not([type="checkbox"]) { min-width: 5em; }
.acc-table td input[name="shop_name"]:not([type="checkbox"]) { min-width: 7em; }
.acc-table td input[name="code_hint"]:not([type="checkbox"]) { min-width: 4em; }
.acc-table td textarea[name="note"] { min-width: 12em; }


/* ══════════════════════════════════════════════════════════════════
   «Задачи» — вид как в «Финансах» (перенос 2026-11-02):
   процесс тёплым блоком, кнопки таймера перед названием, название и
   комментарий по словам, контрагент ссылкой, полоса «идёт таймер»
   закреплена сверху, на узком экране строки — карточками.
   ══════════════════════════════════════════════════════════════════ */

/* Процесс одним блоком: заголовок и шаги на тёплом фоне, полоса слева,
   граница и отступ после. Отдельные задачи остаются белыми. */
.task-group.chain-head td, tr.in-chain > td, tr.in-chain > td.sticky-col-check { background: #fefaf4; }
.task-group.chain-head td { border-top: 2px solid #efd9b8; }
.task-group.chain-head > td:first-child, tr.in-chain > td:first-child { box-shadow: inset 4px 0 0 #e3c08c; }
tr.in-chain.chain-last > td { border-bottom: 2px solid #efd9b8; }
tr.in-chain:hover > td { background: #fcf4e8; }
tr.chain-gap > td { height: 12px; padding: 0; border: 0; background: transparent; }
tr.chain-gap:hover > td { background: transparent; }

/* Название и комментарий — по словам, поле растёт по высоте */
.title-cell textarea.title-wrap { flex: 1 1 auto; resize: none; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; font: inherit; }
textarea.cell-input.comment-wrap {
  min-width: 26rem; resize: none; overflow: hidden; white-space: normal;
  overflow-wrap: anywhere; line-height: 1.35; font: inherit;
}

/* Кнопка работы перед названием: розовая, пока задача не идёт, оранжевая — пока идёт */
.timer-front { flex: none; display: inline-block; margin: 0; }
.timer-gap { width: 34px; }
.title-cell .timer-btn { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 14px; line-height: 1; }
.timer-btn.timer-off { background: #c2255c; color: #fff; border-color: #a61e4d; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.timer-btn.timer-off:hover { background: #a61e4d; }
.timer-btn.timer-on { background: #f76707; color: #fff; border-color: #d9480f; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.timer-btn.timer-on:hover { background: #e8680a; }
.timer-btn.timer-done { background: #f08c00; color: #fff; border-color: #e67700; box-shadow: 0 1px 2px rgba(0,0,0,.25); font-weight: 700; }
.timer-btn.timer-done:hover { background: #e67700; }
.timer-btn.timer-back { background: #fff; color: #e67700; border-color: #e67700; font-weight: 700; font-size: 16px; }
.timer-btn.timer-back:hover { background: #fff4e6; }
.timer-col { display: flex; flex-direction: column; gap: 4px; flex: none; }
.timer-row { display: flex; gap: 6px; align-items: center; }

/* Узкая полоса «идёт таймер», не бросается в глаза */
.timer-bar-company { font-weight: 700; color: #1b5e20; }
.timer-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #ebfbee; border: 1px solid #b2f2bb; color: #2b8a3e;
  border-radius: var(--radius); padding: 4px 10px; margin-bottom: 10px;
  font-size: 12px; line-height: 1.6; min-height: 0;
}
.timer-bar-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.timer-bar-stop { padding: 1px 7px; font-size: 11px; line-height: 1.3; min-height: 0; }

/* Верх списка задач закреплён: полоса «идёт таймер» (или подсказка) всегда
   занимает одно место и остаётся на виду при прокрутке */
.timer-zone { position: sticky; top: 0; z-index: 25; min-height: 38px; padding: 2px 0 4px; background: var(--bg); display: flex; align-items: center; }
.timer-zone > .timer-bar, .timer-zone > .timer-hint { margin: 0; width: 100%; }

/* Исполнители: имена прямо в столбце с крестиком на каждом; строка выбранных
   фишками сверху меню, как в Планфиксе */
.assignee-picker > summary {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  gap: 0 4px; padding: 2px 0; cursor: pointer; list-style: none;
  font-size: 13px; color: var(--accent); max-width: 8rem;
  border: 0; background: none; border-radius: 0;
}
.assignee-picker > summary:hover { text-decoration: underline; background: none; }
.assignee-picker > summary::-webkit-details-marker { display: none; }
.assignee-tag-inline { white-space: nowrap; }
.assignee-tag-inline:not(:last-child)::after { content: ", "; color: var(--text-muted); }
.assignee-x-inline {
  border: 0; background: none; color: var(--text-muted); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0 1px 0 2px; opacity: .6;
}
.assignee-x-inline:hover { opacity: 1; color: var(--danger); }
.assignee-empty { color: var(--text-muted); }
.assignee-menu { padding: 6px; text-align: left; }
.assignee-picked { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.assignee-picked:empty { display: none; }
.assignee-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #e6fcf5; color: #087f5b; font-weight: 600;
  border-radius: 20px; padding: 3px 6px 3px 10px; font-size: 12px; white-space: nowrap;
}
.assignee-tag-x {
  border: 0; background: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; opacity: .7;
}
.assignee-tag-x:hover { opacity: 1; }
/* зелёная галочка у исполнителя, который уже закрыл свою часть общей задачи */
.assignee-done { color: #2b8a3e; font-weight: 700; }

/* «Задачи»: уже поля по краям, плотнее ячейки — экран не делился на пустоту */
.container:has(input[form="bulk-tasks"]) { padding-left: 10px; padding-right: 10px; }
table.table-responsive-cards th, table.table-responsive-cards td { padding: 8px 5px; }
table.table-responsive-cards textarea.cell-input.comment-wrap { min-width: 15rem; width: 100%; }
table.table-responsive-cards .title-cell .cell-input { min-width: 9rem; }
.chain-tag { font-size: 12px; font-weight: 700; color: #7c4a1d; margin: 0 0 3px 40px; line-height: 1.25; }

/* Кнопки компактной колонкой слева, справа от них название по словам.
   Контрагент — текстом с переносом по словам (ИНН строкой ниже). */
table.table-responsive-cards .title-cell { flex-wrap: nowrap; align-items: flex-start; gap: 6px 8px; }
table.table-responsive-cards .title-cell .timer-col { flex-direction: column; align-items: stretch; width: max-content; gap: 4px; }
table.table-responsive-cards .title-cell .timer-row { gap: 4px; }
table.table-responsive-cards .title-cell .timer-btn { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
table.table-responsive-cards .title-cell .timer-btn.timer-back { font-size: 14px; }
table.table-responsive-cards .title-cell textarea.title-wrap { flex: 1 1 auto; min-width: 8rem; }
table.table-responsive-cards td.sticky-col { min-width: 380px; }
table.table-responsive-cards .client-cell { width: 150px; max-width: 150px; }
.client-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; cursor: pointer; padding: 3px 0; }
.client-name:hover { text-decoration: underline dotted; }
.client-name .client-inn { display: block; }
.start-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.start-cell input[type="date"] { width: 9.2em; min-width: 0; }

/* Выравнивание строк: колонка кнопок и номер шага одной ширины у всех строк,
   чтобы название начиналось с одного места */
table.table-responsive-cards .title-cell .timer-col, table.table-responsive-cards .title-cell .timer-gap { min-width: 72px; }
table.table-responsive-cards .title-cell .step-num { flex: none; width: 1.5em; text-align: right; }

/* комментарий к задаче — широкая колонка, там написано, что именно делаем */
table.table-responsive-cards td[data-label="Комментарий к задаче"] { width: 36%; }

.step-num { color: var(--muted, #8a7f72); min-width: 1.6rem; text-align: right; }

/* «Задачи»: название и комментарий мельче, исполнители и статус уже,
   контрагент поуже, кнопки ближе к названию. Только на широком экране —
   на узком работает карточный вид таблицы. */
@media (min-width: 1000px) {
  table.table-responsive-cards td.sticky-col { min-width: 400px; width: 30%; }
  table.table-responsive-cards thead th.sticky-col { min-width: 400px; }
  table.table-responsive-cards textarea.cell-input.comment-wrap { min-width: 400px; width: 100%; }
  table.table-responsive-cards textarea.cell-input.title-wrap,
  table.table-responsive-cards textarea.cell-input.comment-wrap { font-size: 13px; line-height: 1.3; }
  table.table-responsive-cards .client-cell { width: 120px; max-width: 120px; }
  table.table-responsive-cards .client-name { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
  table.table-responsive-cards .title-cell { gap: 4px; }
  table.table-responsive-cards .title-cell .timer-col { width: 72px; min-width: 0; max-width: 72px; }
  table.table-responsive-cards .title-cell .timer-gap { min-width: 72px; width: 72px; }
  /* исполнители: слово в шапке не распирает столбец, имена — столбиком */
  table.table-responsive-cards th.col-responsible .tcol > summary,
  table.table-responsive-cards th.col-status .tcol > summary { font-size: 10px; letter-spacing: 0; }
  table.table-responsive-cards .assignee-picker > summary { max-width: 5.5rem; font-size: 12px; line-height: 1.25; }
  table.table-responsive-cards .assignee-tag-inline { display: block; white-space: normal; overflow-wrap: anywhere; }
  table.table-responsive-cards .assignee-tag-inline:not(:last-child)::after { content: none; }
  table.table-responsive-cards td .cell-input.status-pick { max-width: 8rem; font-size: 12px; padding: 3px 4px; }
  table.table-responsive-cards .start-cell input[type="date"] { width: 8.2em; font-size: 12px; }
}

/* Мобильная вёрстка «Задач»: строка превращается в карточку — каждая ячейка
   подписывается своим столбцом через data-label */
@media (max-width: 760px) {
  .table-responsive-cards table,
  .table-responsive-cards tbody,
  .table-responsive-cards tr,
  .table-responsive-cards td { display: block; width: auto; }
  .table-responsive-cards thead { display: none; }
  .table-responsive-cards tbody > tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 6px 8px;
    background: var(--surface);
  }
  .table-responsive-cards td {
    border-bottom: 1px dashed var(--border);
    padding: 7px 0;
  }
  .table-responsive-cards td:last-child { border-bottom: none; }
  .table-responsive-cards tr.chain-gap { display: none; }
  .table-responsive-cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    margin-bottom: 3px;
  }
  /* sticky-col имел смысл только при горизонтальной прокрутке таблицы —
     в карточках он просто обычная ячейка */
  .table-responsive-cards .sticky-col,
  .table-responsive-cards .sticky-col-check { position: static; }
}

/* «Расчётка»: группы по системам налогообложения (11.11.2026) */
tr.sheet-group-start td { border-top: 2px solid #d8c9a8; }
tr.sheet-group-total td { background: #fbf4e4; font-size: .9em; color: #6b5a3a; }

/* ── Полоса прокрутки вбок сверху над широкими таблицами (2026-11-11) ──────────
   Нижнюю полосу не видно (на Mac она скрыта, пока не листаешь) — над таблицей своя, всегда видимая (top-scroll.js).
   Свой вид полос = Chrome на Mac показывает их всегда, а не только при прокрутке. */
.top-scroll { overflow-x: auto; overflow-y: hidden; height: 16px; margin: 0 0 4px; }
.top-scroll > div { height: 1px; }
.top-scroll::-webkit-scrollbar, .card::-webkit-scrollbar, .board::-webkit-scrollbar { height: 12px; width: 12px; }
.top-scroll::-webkit-scrollbar-track, .card::-webkit-scrollbar-track, .board::-webkit-scrollbar-track { background: #f1ede6; border-radius: 6px; }
.top-scroll::-webkit-scrollbar-thumb, .card::-webkit-scrollbar-thumb, .board::-webkit-scrollbar-thumb { background: #c9b8a3; border-radius: 6px; border: 2px solid #f1ede6; }
.top-scroll::-webkit-scrollbar-thumb:hover, .card::-webkit-scrollbar-thumb:hover, .board::-webkit-scrollbar-thumb:hover { background: #a8916f; }

/* Описание вкладки «Помощника» (18.11.2026, templates/_helper_about.html): для чего вкладка и как ею пользоваться.
   Тёплый пастельный фон, без голубого; свёрнутость запоминает static/helper-about.js */
.helper-about {
  background: #fbf4e6;
  border: 1px solid #ecdcb8;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #4a3f2c;
  max-width: 1100px;
  overflow-wrap: break-word;
}
.helper-about-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.helper-about-head b { color: #7a5a24; }
.helper-about-toggle {
  border: 1px solid #e3cf9f; background: #fff9ec; color: #7a5a24; border-radius: 6px;
  padding: 2px 10px; font-size: 12.5px; cursor: pointer; flex: none;
}
.helper-about-toggle:hover { background: #f6e8c8; }
.helper-about-body { margin-top: 6px; }
.helper-about-body p { margin: 0 0 6px; }
.helper-about-body ol { margin: 0; padding-left: 22px; }
.helper-about-body li { margin: 0 0 4px; }
.helper-about.collapsed .helper-about-body { display: none; }

/* «Помощник»: вкладки по группам ИП → ИП и ООО → ООО → Зарплатный отдел (17.11.2026), подпись группы перед вкладками */
.helper-nav { align-items: center; }
.helper-nav-group {
  font-size: 11px; font-weight: 700; color: #7a5a24; background: #fbf4e6; border: 1px solid #ecdcb8;
  border-radius: 10px; padding: 2px 9px; margin: 0 2px 0 10px; white-space: nowrap;
}
.helper-nav-group:first-child { margin-left: 0; }
/* 23.11.2026: каждая группа вкладок — с новой строки */
.helper-nav { flex-wrap: wrap; }
.helper-nav-break { flex-basis: 100%; height: 0; }
.helper-nav-break + .helper-nav-group { margin-left: 0; }

/* поиск клиента на вкладках «Помощника» (17.11.2026, static/helper-search.js) */
.helper-search { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; flex-wrap: wrap; }
.helper-search input { width: 320px; max-width: 100%; }
select.helper-search-open { height: auto; padding: 4px; background: #fff; }   /* раскрытый список найденных клиентов (19.11.2026) */

/* статус запроса выгрузки из 1С (17.11.2026, _onec_status.html): тёплые цвета, без голубого */
.onec-st { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.onec-st-queued, .onec-st-working { background: #fbf0c8; color: #7a5a24; }
.onec-st-done { background: #e6f2e4; color: #2f6b34; }
.onec-st-error { background: #fde3dc; color: #a33a1c; }
.onec-st-missed { background: #fde8cf; color: #8a4a12; }   /* 23.11.2026: ночная выгрузка не прошла — нажать «Запросить из 1С» */
.onec-spin { width: 10px; height: 10px; border: 2px solid #e2b84a; border-top-color: transparent; border-radius: 50%;
  animation: onec-spin 0.9s linear infinite; }
@keyframes onec-spin { to { transform: rotate(360deg); } }

/* «Раскрыть» длинные списки строк в «Прочих поступлениях/списаниях» и у ФНС (18.11.2026) */
.ol-hidden { display: none !important; }
.ol-toggle { display: block; background: #fff4e5; border: 1px solid #f2d3a7; color: #8a4b0f; border-radius: 6px;
  padding: 2px 8px; margin: 3px 0; font-size: 12px; cursor: pointer; }
.ol-toggle:hover { background: #ffe9cc; }

/* «в т.ч.» в ЕНС — свой цвет, не зелёный (18.11.2026): по кварталам, внизу «итого ФВЗ и 1% ПФР к списанию» */
.ens-breakdown { color: #7a4e12 !important; }
.ens-breakdown b { color: #5c3a0c; }

/* «Помощник»: колесико «Обрабатываю…» во время разбора файла / расчёта (19.11.2026) */
.helper-busy { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center;
  gap: 10px; padding: 10px 16px; background: #fff7e8; border: 1px solid #f0c97a; border-radius: 10px; color: #6b4a0c;
  font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.helper-busy[hidden] { display: none; }
.helper-busy-spin { width: 18px; height: 18px; border: 3px solid #e2b84a; border-top-color: transparent; border-radius: 50%;
  animation: onec-spin 0.9s linear infinite; }
.helper-busy-time { font-weight: 400; color: #8a6a2a; }

/* «← Вернуться к списку» в «Помощнике» (19.11.2026) */
.helper-back { display: inline-block; margin: 0 0 10px; }

/* крутилка при загрузке файла (upload-spinner.js, 20.11.2026) */
.upload-wait { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0 10px; font-size: 13px; color: #8a5a2b; }
.upload-wait .onec-spin { display: inline-block; width: 14px; height: 14px; }
label.btn.upload-busy { opacity: .55; pointer-events: none; }

/* 25.11.2026: цвет в комментариях — редактор поверх textarea (static/rich-note.js) */
.rich-note { position:relative; }
.rich-note-ed { min-height:3.6em; padding:4px 6px; border:1px solid var(--border, #d6d3cf); border-radius:6px; background:#fff;
                white-space:pre-wrap; word-break:break-word; font:inherit; font-size:13px; line-height:1.35; outline:none; }
.rich-note-ed:focus { border-color:#b9a27a; box-shadow:0 0 0 2px #f3e6cc; }
.rich-note-bar { display:none; gap:4px; margin-top:3px; }
.rich-note:focus-within .rich-note-bar { display:flex; }
.rich-note-dot { width:14px; height:14px; border-radius:50%; border:1px solid rgba(0,0,0,.15); padding:0; cursor:pointer; }
.rich-note-plain { background:#fff; position:relative; }
.rich-note-plain::after { content:"A"; font-size:9px; line-height:12px; color:#444; position:absolute; left:3px; top:0; }
