/* ПАСПОРТ ФАЙЛА: assets/app.css — общие стили. Мобильная вёрстка обязательна (PROMPT §1.6).
 * Сначала телефон, потом широкий экран (от 760px). Кнопки и ссылки меню — не меньше 44px по высоте.
 * Блоки: шапка и меню (.top, .bar.wide, details.menu.narrow), карточки (.card), плитки разделов (.tiles),
 * списки (table.list — на телефоне строки становятся карточками), формы, сообщения, пагинация (.pager). */

:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7280; --accent: #1f6feb; --accent-soft: #e8f1ff;
  --danger: #c62828; --ok: #1b7f3b; --warn: #fff4d6; --line: #e3e6eb; --radius: 10px; --lead-price-bg: #e6f4ea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --card: #1d2128; --text: #e6e8eb; --muted: #9aa3ad; --accent: #5b9dff; --accent-soft: #1c2b44;
    --danger: #ff6b6b; --ok: #4cc27a; --warn: #3a3220; --line: #2c323b; --lead-price-bg: #17331f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 16px 0 8px; }
code { font-size: 13px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }

/* Шапка и меню */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 6px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top .brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); padding: 8px 0; }
.top .topup-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--text); }
.top .topup-sum { font-weight: 600; }
.top .topup-sum.empty { color: var(--danger); }
.top .topup-btn { padding: 6px 14px; border-radius: 8px; background: var(--ok); color: #fff; font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; }
.top nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; }
.top nav a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.top .me { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.bar.wide { display: none; }
details.menu { margin-left: auto; }
details.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu[open] summary { background: var(--accent-soft); }
details.menu[open] { flex-basis: 100%; margin-left: 0; }
details.menu nav { flex-direction: column; margin: 8px 0; }
details.menu .me { padding: 8px 12px 12px; border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .bar.wide { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
  details.menu.narrow { display: none; }
}
/* Двухуровневый пункт меню («Фильтры»): <details class="sub"> */
.top nav details.sub { position: relative; }
.top nav details.sub summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--accent, inherit); }
.top nav details.sub summary::-webkit-details-marker { display: none; }
.top nav details.sub summary.current, .top nav details.sub[open] summary { background: var(--accent-soft); font-weight: 600; }
.top nav .sub-list { display: flex; flex-direction: column; padding: 4px 0 4px 12px; }
@media (min-width: 760px) {
  .bar.wide nav .sub-list { position: absolute; z-index: 10; top: 100%; left: 0; min-width: 200px; padding: 4px; background: var(--card);
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
}
.as-banner { background: var(--warn); padding: 8px 16px; border-bottom: 1px solid #f0d68a; font-size: 14px; }

/* Карточки и плитки разделов */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { display: flex; align-items: center; min-height: 64px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; background: var(--bg); }
.tile:hover { border-color: var(--accent); }
.tile.plan { display: block; font-weight: normal; }
.tile.plan h3 { margin: 0 0 4px; }

/* Формы */
label { display: block; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
/* Вопросы опросника оператор читает клиенту вслух: крупнее и цветом основного текста. */
label.quiz-q { font-size: 18px; line-height: 1.4; color: var(--text); }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=tel], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
button { min-height: 44px; padding: 10px 16px; font-size: 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
button.small { min-height: 32px; padding: 6px 10px; font-size: 14px; }
button.link { min-height: 0; background: none; color: var(--accent); padding: 0; font-size: inherit; text-decoration: underline; }
button.danger { background: var(--danger); }
form.inline { display: inline; }
form.secondary { margin-top: 12px; }
textarea.code { font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; padding: 10px; margin-bottom: 12px; }

/* Сообщения */
.flash { background: var(--accent-soft); padding: 10px 12px; border-radius: 8px; }
.error-box { background: #fdecea; color: #5c1a14; border: 1px solid #f5c2bd; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.error-box ul { margin: 6px 0 0; padding-left: 18px; }

/* Списки: на телефоне строка таблицы — карточка, подписи берутся из data-label */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td.title { font-weight: 600; }
table.refusals tr.refusal-main > td { border-bottom: 0; }
table.refusals tr.refusal-more > td { padding-top: 0; }
table.refusals .refusal-note select, table.refusals .refusal-note input[type=text] { width: 100%; min-width: 160px; margin-bottom: 4px; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 759px) {
  table.list thead { display: none; }
  table.list tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.list td { display: block; border: 0; padding: 2px 0; }
  table.list td.num { text-align: left; }
  table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* Пагинация */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }

/* Разделы со вкладками, заголовок с кнопкой, фильтры, формы в две колонки (справочники и далее) */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 8px; text-decoration: none; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.head-row h1 { margin: 0; }
a.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { width: auto; flex: 1 1 200px; margin: 0; }
.form .grid2 { display: grid; gap: 0 16px; }
@media (min-width: 760px) { .form .grid2 { grid-template-columns: 1fr 1fr; } }
label.check { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); }
label.check input { width: 20px; height: 20px; margin: 0; }
.hint { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
input:disabled, select:disabled, textarea:disabled { opacity: .75; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); }
.badge.hidden { background: var(--line); color: var(--muted); }
.badge.draft { background: var(--warn); }
.theme-group { margin: 10px 0 16px; }
.theme-group h3 { margin: 0 0 4px; }
.theme-sub { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.theme-sub-off { display: none; color: var(--danger, #b42318); font-size: 12px; }
label.theme-sub:has(input:not(:checked)) .theme-sub-name { text-decoration: line-through; color: var(--muted); }
label.theme-sub:has(input:not(:checked)) .theme-sub-off { display: inline; }
.theme-sub.is-inherited .theme-sub-name { text-decoration: line-through; color: var(--muted); }
.badge.off { background: var(--line); color: var(--muted); text-decoration: line-through; }
.indent { display: inline-block; }
.indent.d1 { width: 16px; } .indent.d2 { width: 32px; } .indent.d3 { width: 48px; }
.indent.d4 { width: 64px; } .indent.d5 { width: 80px; } .indent.d6 { width: 96px; }
@media (max-width: 759px) { .indent { display: none; } }

/* Партнёры (PLAN 2.3): факты в карточке, метки тем, список галочек, данные старой системы */
.facts { display: grid; gap: 8px 16px; margin: 12px 0 0; }
@media (min-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips .badge { margin: 0; font-size: 13px; }
.badge.blocked, .badge.deleted { background: var(--danger); color: #fff; }
.badge.active { background: var(--accent-soft); }
.checklist { max-height: 420px; overflow-y: auto; margin: 8px 0 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.checklist label.check { min-height: 36px; margin: 0; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
pre.legacy { overflow-x: auto; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; }
button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.filters a.reset { display: inline-flex; align-items: center; min-height: 32px; }
.presence { margin: 12px 0; padding: 12px; border-radius: 8px; background: var(--warn); }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.desk-list { list-style: none; margin: 8px 0 0; padding: 0; }
.desk-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.desk-list a { font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 8px 10px; margin: 6px 0; border-radius: 8px; background: var(--accent-soft); }
.feed li.feed-in { background: var(--card); border: 1px solid var(--line); }
.feed-rec { margin-top: 6px; }
.feed-rec audio { width: 100%; max-width: 280px; height: 32px; vertical-align: middle; }

/* Оплата: шаг выбора способа и страница СБП (app/views/pay_method.php, pay_sbp.php) */
form.pay-method { margin: 0 0 12px; }
form.pay-method button { width: 100%; min-height: 52px; font-size: 1.05rem; }
img.qr { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
a.button.small { min-height: 32px; padding: 0 10px; font-size: 14px; }
a.button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }

/* Профиль партнёра: проверки (PLAN 7.1–7.2) */
.notice { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
ul.steps { list-style: none; padding: 0; margin: 8px 0 12px; }
ul.steps li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.steps li:last-child { border-bottom: 0; }
ul.steps li.done::before { content: "✓ "; color: var(--ok); font-weight: 600; }
ul.steps li.todo::before { content: "○ "; color: var(--muted); }
.copy { font: 14px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
button.copy-value { display: inline; min-height: 0; margin: 0; padding: 4px 8px; font: 15px/1.4 ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all; text-align: left; background: var(--bg); color: var(--text); border: 1px dashed var(--line); border-radius: 8px; cursor: pointer; }
button.copy-value:hover { border-style: solid; }
button.copy-value.small { font-size: 13px; padding: 2px 8px; }
.copy-note { margin-left: 6px; color: var(--ok); font-size: 13px; }
.copy-note[hidden] { display: none; }

/* Карточка партнёра: только что выданная ссылка подключения бота */
.bot-link-ready { border-color: var(--accent); }
.bot-link-ready .bot-link-msg { white-space: pre-wrap; margin: 8px 0 12px; }
.bot-link-ready .bot-link-urls { list-style: none; padding: 0; margin: 12px 0 0; }
.bot-link-ready .bot-link-urls li { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.bot-link-ready .bot-link-urls a { word-break: break-all; }

/* Кабинет вебмастера: цифры периода (PLAN 7.4) */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.stats div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--bg); }
.stats b { display: block; font-size: 22px; }
.stats span { font-size: 13px; color: var(--muted); }
.filters button { align-self: flex-end; }

/* Документы (PLAN 9) */
.doc { max-width: 860px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.doc h1 { font-size: 24px; } .doc h2 { font-size: 19px; margin-top: 24px; } .doc h3 { font-size: 16px; }
.doc blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.version { border-top: 1px solid var(--line); padding: 8px 0; }
pre.diff { overflow-x: auto; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; }
pre.diff .add { background: #e6f4ea; color: #1e4620; display: block; }
pre.diff .del { background: #fdecea; color: #5c1a14; display: block; text-decoration: line-through; }
pre.diff .ctx { color: var(--muted); display: block; }
textarea.doc-edit { min-height: 480px; }
label.check span { color: var(--text); }

/* Поиск по вводу в карточке обращения (assets/inquiry.js): тема и город */
.combo-list { margin-top: 4px; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); }
.combo-item { padding: 10px 12px; cursor: pointer; font-size: 15px; line-height: 1.3; }
.combo-item.active, .combo-item:hover { background: var(--accent-soft); }
.combo-sub { display: block; font-size: 12px; color: var(--muted); }
.combo-none { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.combo-more { color: var(--accent, #2563eb); font-size: 14px; }   /* «Показать остальные» в поиске темы (ТЗ Даши #461) */

.combo-list[hidden] { display: none; }
.quiz-other[hidden] { display: none; }
.on-duty { margin-top: 4px; }

button.chip { min-height: 44px; padding: 6px 12px; font-size: 14px; background: var(--card); color: var(--text); border: 1px solid var(--line); }
button.chip:hover { background: var(--accent-soft); }

/* Онлайн-экран аккаунта и админа: сообщения партнёров (app/views/online_inbox.php, online_thread.php, assets/online.js) */
table.inbox { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; min-width: 1100px; }
table.inbox th.freq, table.inbox td.freq { width: 88px; }
.inbox-wrap { overflow-x: auto; }
table.inbox th.sub, table.inbox td.sub { width: 112px; }
table.inbox td.sub div { white-space: nowrap; }
table.inbox th.marks, table.inbox td.marks { width: 240px; }
table.inbox th.num, table.inbox td.num { width: 96px; }
main:has(.online) { max-width: 1400px; }   /* таблице нужна ширина: иначе короткие действия обрезаются */
table.inbox th, table.inbox td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.inbox th { font-weight: 600; color: var(--text); }
table.inbox .num { text-align: right; font-variant-numeric: tabular-nums; }
table.inbox .dt { width: 118px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.inbox .who { width: 240px; overflow: hidden; font-variant-numeric: tabular-nums; }
table.inbox .who .p-ref { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
table.inbox .who .badge.p-old, table.inbox .who .badge.blocked { display: none; }   /* блокировка — в столбце проблемы */
table.inbox .who > span { margin-left: 4px; }
table.inbox th.msg, table.inbox td.msg { width: auto; }
table.inbox td.msg .badge.fin { float: right; margin: 3px 0 0 6px; background: #eef0f3; color: #1d2330; }
/* Последнее событие: цвет = автор и исход, всегда вместе с подписью; тёмный текст на светлом фоне и в тёмной теме. Две строки максимум, длинное обрезается */
a.last-ev { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; padding: 3px 8px; border-radius: 6px; color: #1d2330; text-decoration: none; line-height: 1.35; }
a.last-ev:hover { outline: 1px solid var(--accent); }
.le-line { display: block; }
.le-partner { background: #dcecff; }
.le-staff { background: #eef0f3; }
.le-good { background: #d9f2e1; }
.le-warn { background: #fff0b8; }
.le-none { background: #eef0f3; }
a.last-ev.le-seen { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }   /* событие уже открывали: без цвета; новое снова цветное */
table.inbox th.act, table.inbox td.act { width: 148px; }
.hide-form { margin: 0; }
.hide-who { font-size: 12px; line-height: 1.3; margin-bottom: 3px; }
.thread-head-hide { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-head-hide .hide-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.thread-head-hide .hide-who { margin: 0; }
.online-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; max-width: 90vw; padding: 8px 16px; border-radius: 6px; background: #1d2330; color: #fff; font-size: 14px; }
.pmark { display: inline-block; margin: 1px 0; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.4; color: #1d2330; }
.pmark-warn { background: #ffe082; }
.pmark-bad { background: #c62828; color: #fff; }
.pmark-info { background: #eef0f3; font-weight: 400; }
.online-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 10px; }
.online-filters .tabs { margin: 0; }
.online-filters .tabs .badge:not(.hidden) { background: var(--accent); color: #fff; }
.online-filters .tabs .badge.hidden { color: var(--text); }
.online-search label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; }
.online-search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.online-search input[type=date] { width: auto; padding: 3px 6px; font-size: 14px; }
.online-search input[type=search] { width: 240px; padding: 3px 8px; font-size: 14px; }
.online-empty { margin: 12px 0; }
.thread-head-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-right: 80px; }
.thread-head-facts { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 4px; font-size: 14px; }
.thread-head-marks { margin-top: 4px; }
.thread-more { margin: 0 0 6px; font-size: 13px; }
.thread-pane .ev { font-size: 14px; margin-top: 6px; }
.record-hit { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 6px; }
.ev { font-size: 12px; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.ev-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.ev a.ev-open { color: inherit; text-decoration: none; white-space: pre-line; }
.ev a.ev-open:hover { color: var(--accent); }
.ev-arrow { color: var(--muted); }
.ev-res { font-weight: 600; }
.ev-good { color: #1f8a4c; }
.ev-bad { color: #c0392b; }
.ev-wait { color: #b26a00; }
.ev-detail { display: block; }
.thread-tabs[hidden] { display: none; }
.thread-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pane-title { font-size: 15px; margin: 8px 0; }
.thread-tabs:not([hidden]) ~ .thread-pane .pane-title { display: none; }
.thread-pane .thread-notes-list { max-height: 48vh; overflow-y: auto; margin-top: 8px; }
.comment-imp1 { border-left: 3px solid #b26a00; padding-left: 8px; background: color-mix(in srgb, #b26a00 8%, transparent); }
.comment-imp2 { border-left: 3px solid #c0392b; padding-left: 8px; background: color-mix(in srgb, #c0392b 12%, transparent); }
.comment-call { font-size: 13px; margin: 6px 0; }
.comments-hidden { margin-top: 10px; }
table.inbox tr.unread td.dt { box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }   /* окно ещё не открывали */
table.inbox tr.thread-detail > td { background: var(--accent-soft); padding: 6px 8px 10px; }
table.thread-list { background: var(--card); }
table.thread-list .full { white-space: pre-wrap; overflow-wrap: anywhere; }
table.thread-list tr.tech { color: var(--muted); }
table.thread-list tr.out .full { padding-left: 16px; }
table.thread-list tr.bot { color: var(--muted); font-size: 12px; }
table.thread-list tr.bot .full { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
table.thread-list details.reply summary { cursor: pointer; list-style: none; }
table.thread-list details.reply summary::-webkit-details-marker { display: none; }
table.thread-list details.reply summary:hover, table.thread-list details.reply[open] summary { background: var(--accent-soft); }
table.thread-list details.reply form { margin-top: 4px; }

/* Баланс партнёра: пополнение (app/views/cabinet_balance.php, #topup) */
.topup { border: 2px solid var(--ok); }
.topup .quick-sums { display: flex; flex-wrap: wrap; gap: 8px; }
.topup .quick-sums .button { min-width: 110px; justify-content: center; }
ol.pay-steps { margin: 16px 0 8px; padding-left: 22px; }
ol.pay-steps li { margin: 4px 0; }

/* Партнёры: общий «№ + имя», отметки и телефон с кнопками (задачи 31.10, п. 10, 11, 17, 27) */
.p-ref a { font-weight: 600; }
/* Звёздочка «Обработать потом» (ТЗ Даши #842): пустая — серая, отмечен — ярко-жёлтая; одинаковая во всех разделах */
.p-star { display: inline-block; background: none; border: 0; padding: 0 3px 0 0; margin: 0; font-size: 1.15em; line-height: 1; color: #9aa0a6; cursor: pointer; vertical-align: baseline; box-shadow: none; min-height: 0; width: auto; }
.p-star:hover, .p-star:focus-visible { color: #f5b400; }
.p-star.on { color: #ffc400; text-shadow: 0 0 1px #b38600; }
.online-later td { vertical-align: top; }
.p-blocked, .p-blocked a { color: var(--danger); }
.row-blocked { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.row-recent td { background: color-mix(in srgb, var(--ok) 9%, transparent); }   /* «TG»: активен в Telegram за 2 месяца (ТЗ Даши #680) */
.card-blocked { border: 2px solid var(--danger); }
.badge.p-new { background: #1f8a4c; color: #fff; }
.badge.p-old { background: var(--line); }
.phone-box { white-space: nowrap; }
.phone-box .copy-value { padding: 0 6px; }
.phone-act { text-decoration: none; padding: 0 3px; }
.nowrap { white-space: nowrap; }

/* Окно переписки онлайн-таблицы (app/views/online_thread.php) */
.tabs .badge { font-size: 13px; padding: 3px 12px; text-decoration: none; }
.badge.fin { background: #b45309; color: #fff; }
dialog.thread-dialog { width: min(980px, 96vw); max-height: 92vh; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
dialog.thread-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-close { float: right; }
.thread-head { margin-bottom: 8px; }
.thread-scroll { max-height: 48vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.case + .case { border-top: 2px solid var(--line); margin-top: 10px; padding-top: 6px; }
.case-head { margin: 0 0 6px; font-size: 12px; }
.bubble { max-width: 82%; margin: 4px 0; padding: 6px 10px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line); }
.bubble.in { background: var(--accent-soft); margin-right: auto; }
.bubble.out { background: color-mix(in srgb, #1f8a4c 16%, transparent); margin-left: auto; }
.bubble.bot, .bubble.tech { color: var(--muted); font-size: 12px; background: transparent; margin-left: auto; }
.bubble.tech { margin-left: 0; margin-right: auto; }
.bubble.taken { margin: 4px auto; font-size: 13px; background: transparent; text-align: center; }
.thread-actions-more { font-size: 12px; margin: 0; }
.bubble .full { white-space: normal; overflow-wrap: anywhere; }
.bubble-head { font-size: 12px; }
.reply-to { display: inline; font-size: 12px; margin-left: 6px; cursor: pointer; }
.att-thumb { display: block; max-width: 240px; max-height: 180px; margin-top: 4px; border-radius: 6px; }
.att-video { display: block; max-width: 320px; margin-top: 4px; }
.comment { margin: 4px 0; font-size: 13px; line-height: 1.35; }
.comment p { margin: 1px 0; }
.comment details summary { font-size: 12px; }

/* Карточка обращения: варианты опросника кнопками, отмена сверху, завершение разговора (О3–О5, О8, О13) */
.quiz-q { border: 0; padding: 0; margin: 0 0 10px; }
.quiz-q legend, .quiz-q .quiz-title { font-weight: 700; padding: 0; }
.quiz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.quiz-chip { display: inline-block; cursor: pointer; font-weight: 400; margin: 0; }
.quiz-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.quiz-chip input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.quiz-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.cancel-box summary { cursor: pointer; }
.closing-box { padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px; }
.closing-box p { margin: 2px 0 0; }
#coop-fields[hidden] { display: none; }

/* Баннер нового разговора вне экрана смены (assets/incoming.js) */
.incoming-banner { display: block; position: sticky; top: 0; z-index: 50; padding: 10px 14px; background: var(--danger); color: #fff; font-weight: 700; text-align: center; text-decoration: none; }

/* Заявка lidam.ru/o в карточке (app/views/inquiry_lidam.php): чат и форма различимы */
/* Тема обращения сверху карточки (ТЗ Даши #443) */
.topic-box { padding: 8px 12px; margin: 8px 0 12px; border-radius: 6px; border-left: 5px solid var(--accent); background: var(--accent-soft, #eef); }
.topic-box p { margin: 2px 0; }
.topic-box .topic-main { font-size: 1.15em; }
.topic-box.topic-none { border-left-color: #c2410c; background: rgba(194, 65, 12, .08); }
.topic-box.topic-line { border-left-color: var(--line); background: transparent; }
.lidam-box { padding: 8px 10px; margin: 8px 0; border-left: 4px solid var(--line); border-radius: 4px; }
.lidam-box.is-chat { border-left-color: #b45309; }
.lidam-box.is-form { border-left-color: var(--accent); }

/* История общения с партнёром и отметки менеджеров (ADR-087) */
.p-hist-line { display: block; font-size: 11px; font-weight: 400; line-height: 1.3; }
a.p-hist { color: var(--muted); text-decoration: underline dotted; }
a.p-hist:hover { color: var(--accent); }
table.inbox .who > span.p-cmts { margin-left: 0; }
.p-cmts { display: block; margin-top: 2px; }
a.p-cmt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; white-space: normal; font-size: 11px; font-weight: 400; line-height: 1.3; color: inherit; text-decoration: none; margin-top: 1px; }
a.p-cmt:hover { color: var(--accent); }
a.p-cmt-none, a.p-cmt-more { color: var(--muted); text-decoration: underline dotted; }
.p-marks { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--muted); }
.p-mark { cursor: help; white-space: nowrap; text-decoration: underline dotted; }
.hist-pop { position: fixed; z-index: 1000; width: min(460px, 94vw); max-height: min(420px, 70vh); overflow-y: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 400; white-space: normal; text-align: left; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
.hist-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-of-type { border-bottom: 0; }
.hist-row p { margin: 0; }
.hist-row .full { white-space: normal; overflow-wrap: anywhere; }
.hist-head h2 { margin-top: 0; }
.hist-list { max-height: 72vh; overflow-y: auto; }
.hist-more-box { margin: 8px 0 0; text-align: center; }
.note-lead { display: inline-block; margin-left: 8px; font-size: 12px; color: var(--muted); }
.note-lead input { width: 90px; }

/* Заявка глазами партнёра (ADR-091): ответ крупнее вопроса, стоимость и кнопки заметны, на телефоне без горизонтальной прокрутки */
.lead-card { border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; }
.lead-card h2 { margin: 0; font-size: 18px; color: var(--accent); }
.lead-sheet { max-width: 640px; margin-left: auto; margin-right: auto; }
.lead-price { display: inline-block; margin: 6px 0 0; padding: 3px 10px; border-radius: 8px; background: var(--lead-price-bg); color: var(--ok); font-size: 21px; font-weight: 700; }
.lead-price-note { margin: 2px 0 0; color: var(--ok); font-weight: 600; }
.lead-noncall { display: inline-block; margin: 10px 0 0; padding: 4px 10px; border-radius: 8px; background: var(--warn); font-weight: 600; }
.qa { margin: 6px 0 0; overflow-wrap: anywhere; }
.qa dt { font-size: 13px; line-height: 1.25; color: var(--accent); margin-top: 9px; }
.qa dd { margin: 1px 0 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.lead-file { display: block; }
.lead-media { margin-top: 12px; }
.lead-media-t { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.lead-media audio { width: 100%; max-width: 420px; }
.lead-actions { display: flex; gap: 12px; margin-top: 10px; }
.lead-actions form { flex: 1; max-width: 220px; margin: 0; }
.btn-take, .btn-menu { display: block; width: 100%; max-width: 260px; flex: 1; box-sizing: border-box; padding: 14px 18px; border: 0; border-radius: 12px; color: #fff; font-size: 19px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .18); transition: transform .08s, filter .15s; }
.btn-take { background: linear-gradient(180deg, #22a04b, #157a35); }
.btn-menu { background: linear-gradient(180deg, #2f80ff, #1a5fd0); }
.btn-take:hover, .btn-menu:hover { filter: brightness(1.08); }
.btn-take:active, .btn-menu:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
@media (max-width: 600px) { .lead-actions form, .btn-take, .btn-menu { max-width: none; } }
/* Компактная заявка (ТЗ Даши #359 п. 6): строка «Подпись: ответ», ответ жирный, без пустых промежутков */
.qa-c { margin: 6px 0 0; overflow-wrap: anywhere; }
.qa-c p { margin: 3px 0; font-size: 16px; line-height: 1.35; }
.qa-l { color: var(--muted); }
.lead-card .head-row .lead-price { margin: 0; font-size: 18px; padding: 2px 10px; }
.lead-when, .lead-recall { margin: 4px 0 0; font-size: 14px; }
.lead-recall { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--warn); font-weight: 700; }
.pm-tiles { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; max-width: 460px; }
.feed-links { display: flex; gap: 8px; margin: 8px 0; }
.feed-links a { padding: 7px 16px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; }
.lead-sheet .lead-card { margin-top: 0; }
.pm-tile { display: block; padding: 13px 16px; border-radius: 12px; color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; }
.pm-green { background: #1b7f3b; } .pm-blue { background: #1f6feb; } .pm-violet { background: #6d3fc7; } .pm-orange { background: #c2570c; }
.pm-teal { background: #0e7c86; } .pm-pink { background: #b5306e; } .pm-gray { background: #4b5563; } .pm-amber { background: #a16207; } .pm-indigo { background: #4338ca; }
dialog.prospect-dialog { width: min(440px, 96vw); }

/* Уведомления онлайн-страницы (ADR-097) */

/* Суммы в карточке партнёра: правка на месте и окно истории при наведении (ADR-103) */
.money-box { position: relative; }
.money-label { cursor: help; text-decoration: underline dotted; align-self: flex-start; }
.money-sum { all: unset; cursor: pointer; font-weight: 600; border-bottom: 1px dashed var(--accent); }
.money-sum:hover, .money-sum:focus-visible { color: var(--accent); }
.facts .money-pop { display: none; position: absolute; top: 100%; left: 0; z-index: 900; width: min(480px, 92vw); max-height: 340px; overflow-y: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
.facts .money-box:not(.editing):hover .money-pop, .facts .money-box.open:not(.editing) .money-pop { display: block; }
.money-pop-sum { margin: 6px 0 4px; }
.facts .money-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.facts .money-fix { display: block; padding: 4px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.money-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.money-edit[hidden] { display: none; }
.money-edit input[name=amount] { width: 110px; }
.money-edit input[name=comment] { flex: 1 1 180px; min-width: 150px; }
.money-delta { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.money-delta:empty { display: none; }
.money-err { display: block; font-size: 13px; color: var(--danger); }
.money-err:empty { display: none; }

/* Четыре блока вверху карточки партнёра и окно со списком заявок (ADR-106) */
.pc-blocks { gap: 8px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-blocks .lead-box { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 900px) {
  .pc-blocks { grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1fr); }
  .pc-blocks .lead-box { grid-column: auto; }
}
/* Пять показателей в ряд: деньги, бонусы, всего внесено, взято, на заявку (ТЗ Даши #266 п. 5) */
.pc-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .pc-leads { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pc-kpi { grid-template-columns: repeat(5, auto); justify-content: start; } }
.money-val { all: unset; cursor: pointer; font-weight: 600; border-bottom: 1px dotted var(--muted); }
.money-val:hover, .money-val:focus-visible { color: var(--accent); }
.lead-open { all: unset; cursor: pointer; }
.lead-open:hover, .lead-open:focus-visible { color: var(--accent); text-decoration: underline; }
.lead-count { font-weight: 600; }
.lead-last { list-style: none; margin: 2px 0 0; padding: 0; font-size: 13px; }
.lead-last li { margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.pc-blocks .money-box.editing { z-index: 901; }
.pc-blocks .money-edit { position: absolute; top: 100%; left: 0; z-index: 901; width: min(440px, 88vw); padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
.lead-note { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.lead-freq { margin: 4px 0 8px; font-size: 13px; }
.lead-all { margin-top: 6px; }
.lead-dialog-title { margin: 0 0 8px; }
.lead-dialog .dialog-close { float: right; }
.lead-dialog td a { white-space: nowrap; }
/* Результат взятой заявки: цвет и всегда текст (ADR-108) */
.lead-status { font-weight: 600; white-space: nowrap; }
.lead-status::before { content: "●"; margin-right: 4px; }
.lead-good { color: var(--ok); }
.lead-wait { color: #9a6700; }
.lead-bad { color: var(--danger); }
.lead-none { color: var(--muted); font-weight: 400; }
.lead-none::before { content: "○"; }
@media (prefers-color-scheme: dark) { .lead-wait { color: #e3b341; } }
.lead-reason { color: var(--muted); }
.lead-status { white-space: normal; }
.lead-filter { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.lead-filter[hidden] { display: none; }
.lead-more { font-size: 12px; overflow-wrap: anywhere; }
.lead-more summary { cursor: pointer; color: var(--accent); }
.lead-more-part { margin: 4px 0; }
/* Выбор статуса в кабинете и у сотрудника: нужные поля появляются сами, сервер всё равно проверяет (ADR-109) */
.ps-form .ps-options { display: grid; gap: 4px; margin-bottom: 8px; }
.ps-form .ps-options label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.ps-form .ps-for-no-answer, .ps-form .ps-for-failed, .ps-form .ps-for-next { display: none; }
.ps-form:has(input[value=no_answer]:checked) .ps-for-no-answer, .ps-form:has(input[value=no_answer]:checked) .ps-for-next, .ps-form:has(input[value=failed]:checked) .ps-for-failed { display: block; }
.ps-history { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.lead-last li + li { margin-top: 6px; }
.lead-dialog table[data-kind=offered] .lead-col-taken { display: none; }
.lead-dialog .lead-comment summary { cursor: pointer; }
dialog.lead-dialog { width: min(1180px, 96vw); }
.lead-dialog .lead-comment { font-size: 13px; overflow-wrap: anywhere; }
@media (min-width: 900px) { .lead-dialog tbody td:last-child { min-width: 300px; } }

/* Отчёты: компактные блоки и ежедневная статистика (app/views/reports_daily.php, ADR-112). Дата закреплена при прокрутке вбок */
.report-compact h2 { margin: 0 0 6px; font-size: 16px; }
main:has(table.daily) { max-width: 1680px; }   /* в таблице 18 столбцов: иначе половина за краем */
.report-compact .facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; margin: 0; font-size: 13px; }
.report-compact .facts > div { padding: 0; margin: 0; }
.report-compact .facts dd { margin: 0; }
.daily-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 8px 0 12px; }
.daily-summary b { font-size: 18px; }
.daily-wrap { overflow: auto; max-height: 75vh; }
table.daily { border-collapse: separate; border-spacing: 0; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.daily th, table.daily td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: right; background: var(--card, var(--bg)); }
table.daily thead th { position: sticky; top: 0; z-index: 2; font-weight: 600; white-space: normal; min-width: 64px; vertical-align: bottom; }
table.daily thead tr + tr th { top: 27px; }
table.daily th.group { text-align: center; border-left: 2px solid var(--line); }
table.daily .gs { border-left: 2px solid var(--line); }
table.daily .day { position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 600; min-width: 84px; }
table.daily thead .day { z-index: 3; }
table.daily tfoot td { position: sticky; bottom: 0; z-index: 1; font-weight: 700; border-top: 2px solid var(--line); }
table.daily tfoot .day { z-index: 3; }
table.daily .nodata { color: var(--muted, #6b7280); font-size: 11px; font-weight: 400; }
table.daily tfoot .total { white-space: normal; max-width: 110px; line-height: 1.2; }
table.daily tr.daily-month td { text-align: left; font-size: 15px; font-weight: 700; padding: 10px 8px 6px; border-top: 2px solid var(--accent); color: var(--accent); }
table.daily tr.daily-month span { position: sticky; left: 8px; }
.daily-hist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0; }
.daily-hist-more { position: sticky; left: 0; display: inline-block; padding: 12px 8px; }
.daily-dist { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0; }
.rd-sub { font-size: 12px; white-space: nowrap; margin-top: 2px; }   /* почта: письма и заявки под обращениями (#988) */
.mail-funnel { margin: 8px 0 12px; padding-left: 20px; }
.mail-funnel ul { margin: 2px 0 4px; padding-left: 20px; }


/* Компактный список партнёров (app/views/partners_list.php, ADR-114). Цвет — спокойный фон и тёмный текст, в обеих темах один и тот же: отметка всегда с подписью */
main:has(.pf) { max-width: 1560px; }
.pf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.pf-top h1 { margin: 0; }
.pf-found { color: var(--muted); }
.pf-found b { color: var(--text); }
.pf-top-right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.pf-actions { position: relative; }
.pf-actions summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 14px; white-space: nowrap; }
.pf-actions summary::-webkit-details-marker { display: none; }
.pf-actions-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 290px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.pf-actions-list a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.pf-actions-list a:hover { background: var(--accent-soft); }
.pf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pf-quick a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; text-decoration: none; }
.pf-quick a:hover { border-color: var(--accent); }
.pf-quick a b { font-weight: 600; color: var(--muted); }
.pf-quick a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pf-quick a.on b { color: #fff; }
.pf-form { margin-bottom: 8px; }
.pf-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-search input[type=search] { flex: 1 1 280px; width: auto; margin: 0; min-height: 36px; padding: 4px 10px; font-size: 14px; }
.pf-search select { flex: 0 1 180px; width: auto; margin: 0; min-height: 36px; padding: 4px 8px; font-size: 14px; }
.pf-more { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.pf-more[hidden] { display: none; }
.pf-more h2 { margin: 0 0 8px; font-size: 15px; }
.pf-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 14px; }
.pf-groups fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pf-groups legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.pf-groups label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.pf-groups select, .pf-groups input { display: block; width: 100%; margin: 2px 0 0; min-height: 34px; padding: 3px 8px; font-size: 14px; color: var(--text); }
.pf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.pf-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; }
.pf-chip a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1; }
.pf-chip a:hover { background: var(--line); }
.pf-reset { font-size: 13px; margin-left: 4px; }
.pf-tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; background: #eef0f3; color: #374151; }
.pf-tag.t-new { background: #dbeafe; color: #1e3a8a; }
.pf-tag.t-pot { background: #ede9fe; color: #4c1d95; }
.pf-tag.t-check { background: #fef3c7; color: #78350f; }
.pf-tag.t-money { background: #ffedd5; color: #7c2d12; }
.pf-tag.t-blocked { background: #fee2e2; color: #7f1d1d; }
.pf-tag.t-max-on { background: #dcfce7; color: #14532d; }
.pf-tag.t-max-off { background: #eef0f3; color: #4b5563; }
/* Возможные дубли партнёров (ADR-123): отметка, номера связанных карточек, сравнение двух карточек */
.pf-tag.t-dup { background: #fef08a; color: #713f12; text-decoration: none; }
a.pf-tag.t-dup:hover { background: #fde047; }
.pf-tag.t-dupyes { background: #fecaca; color: #7f1d1d; text-decoration: none; font-weight: 600; }
a.pf-tag.t-dupyes:hover { background: #fca5a5; }
.pf-tag.t-ok { background: #dcfce7; color: #14532d; }
.dup-no { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fef08a; color: #713f12; font-weight: 600; text-decoration: none; }
.dup-no:hover { background: #fde047; text-decoration: underline; }
/* Возможное совпадение — жёлтым, подтверждённый дубль — красным, «Не дубль» — серым (ТЗ #262 п. 6) */
.dup-no.st-dup { background: #fecaca; color: #7f1d1d; }
.dup-no.st-dup:hover { background: #fca5a5; }
.dup-no.st-not_dup { background: #e5e7eb; color: #374151; }
.dup-pay-hit { color: #7f1d1d; font-weight: 600; }
.dup-list { list-style: none; padding: 0; margin: 0; }
.dup-item { padding: 8px 0; border-top: 1px solid #eef0f3; }
.dup-item:first-child { border-top: 0; }
.dup-why > summary { cursor: pointer; color: #1d4ed8; margin-top: 4px; }
.dup-cmp td, .dup-cmp th { font-size: 13px; }
.dup-sides { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0; }
.dup-side { flex: 1 1 280px; background: #f8fafc; border-radius: 6px; padding: 8px 12px; }
.dup-side h4 { margin: 0 0 4px; font-size: 14px; }
.dup-side ul { margin: 0; padding-left: 18px; font-size: 13px; }
tr.dup-open-row td { background: #fefce8; }
.pf-name { display: flex; gap: 5px; min-width: 0; font-weight: 600; }
.pf-name a { flex: none; }
.pf-name a.pf-nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; margin-top: 2px; overflow: hidden; font-size: 12px; font-weight: 400; }
.pf-line .p-marks { display: inline; margin: 0; white-space: nowrap; }
.pf-cmt { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.pf-cmt a { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); font-size: 12px; line-height: 16px; text-decoration: none; white-space: nowrap; }
.pf-cmt a:hover { border-color: var(--accent); color: var(--accent); }
.pf-sub { font-size: 12px; line-height: 1.25; }
.pf-status { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-hint { cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; }
.pf-table .lead-open.pf-taken { color: var(--accent); text-decoration: underline; }
.pf-table a.p-win { white-space: nowrap; }
.phone-box { position: relative; }
.pf .copy-note, .pf-table .copy-note { position: absolute; left: 0; top: -1px; margin: 0; padding: 0 8px; border-radius: 4px; background: #dcfce7; color: #14532d; font-size: 13px; line-height: 22px; z-index: 3; }
.pf-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: 14px; }
.pf-pages, .pf-per { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.pf-pages a, .pf-pages span, .pf-per a, .pf-per span { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; min-width: 36px; padding: 0 8px; border-radius: 6px; text-decoration: none; }
.pf-pages a:hover, .pf-per a:hover { background: var(--accent-soft); }
.pf-pages .on, .pf-per .on { background: var(--accent); color: #fff; font-weight: 600; }
.pf-who .pf-line .copy-note { display: none; }
.money-win { font-size: 14px; }
.money-win .money-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.money-win .num { text-align: right; white-space: nowrap; }
.hist-new { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist-new textarea { min-height: 56px; margin: 2px 0 6px; font-size: 14px; }
.hist-new .hist-new-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; }
.hist-new .hist-new-lead input { width: 130px; min-height: 32px; margin: 0; padding: 2px 8px; font-size: 14px; }
.hist-row details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.row-blocked .pf-who, table.pf-table tr.row-blocked td { background: color-mix(in srgb, var(--danger) 8%, var(--card)); }
@media (min-width: 760px) {
  .pf-wrap { overflow: auto; max-height: calc(100vh - 110px); border: 1px solid var(--line); border-radius: 8px; }
  table.pf-table { border-collapse: separate; border-spacing: 0; min-width: 1180px; }
  table.pf-table th, table.pf-table td { padding: 6px 8px; background: var(--card); }
  table.pf-table td { white-space: nowrap; }
  table.pf-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-size: 13px; font-weight: 600; line-height: 1.2; vertical-align: bottom; border-bottom: 1px solid var(--line); }
  table.pf-table .pf-who { position: sticky; left: 0; z-index: 1; width: 310px; min-width: 240px; max-width: 310px; border-right: 1px solid var(--line); }
  table.pf-table thead .pf-who { z-index: 3; }
  table.pf-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
  table.pf-table tbody tr.row-blocked:hover td { background: color-mix(in srgb, var(--danger) 13%, var(--card)); }
}
@media (max-width: 759px) {
  .pf-top-right { margin-left: 0; width: 100%; }
  .pf-actions-list { right: auto; left: 0; }
  .pf-line { flex-wrap: wrap; overflow: visible; }
  .pf-name { flex-wrap: wrap; }
  .pf-name a.pf-nm { white-space: normal; }
  table.pf-table { font-size: 15px; }
}

/* Результат общения и задачи менеджеров (ADR-115) */
.pw-block { font-size: 12px; line-height: 1.3; min-width: 150px; max-width: 280px; }
.pw-block a { color: inherit; text-decoration: none; }
.pw-block a:hover { color: var(--accent); }
.pw-line, .pw-next { display: block; }
/* Работа менеджера: цвет только у отметки, всегда вместе с подписью (ТЗ Даши #303) */
.pw-block a.pw-mark-today { padding: 2px 6px; border-radius: 5px; background: #cdeed8; box-shadow: inset 3px 0 0 #2e7d32; color: #1d2330; }
.pw-block a.pw-mark-note { padding: 2px 6px; border-radius: 5px; background: #dcecff; box-shadow: inset 3px 0 0 #1565c0; color: #1d2330; }
.pw-block a.pw-mark-bad { padding: 2px 6px; border-radius: 5px; background: rgba(198, 40, 40, .14); box-shadow: inset 3px 0 0 #c62828; color: #1d2330; }
.pw-block a.pw-mark-today:hover, .pw-block a.pw-mark-note:hover, .pw-block a.pw-mark-bad:hover { color: var(--accent); }
.pw-block a.pw-mark-today .pw-text, .pw-block a.pw-mark-note .pw-text, .pw-block a.pw-mark-bad .pw-text { color: #4a5262; }
.pw-history { max-height: 45vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.pw-hist-row { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.pw-hist-row:last-child { border-bottom: 0; }
.online-acts { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.pw-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pw-next { margin-top: 2px; font-weight: 600; }
.pw-next .pw-text { font-weight: 400; }
.pw-next .pmark, .pw-chip .pmark { padding: 0 5px; font-size: 11px; }
a.pw-btn { display: inline-block; flex: none; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); font-size: 12px; line-height: 16px; text-decoration: none; white-space: nowrap; }
a.pw-btn:hover { border-color: var(--accent); color: var(--accent); }
.pw-card-box { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 6px 0; }
.pw-card-box .pw-block { max-width: 520px; }
a.pw-chip { display: block; margin-bottom: 3px; padding: 3px 8px; border-radius: 6px; background: var(--warn); color: var(--text); font-size: 13px; text-decoration: none; box-shadow: inset 3px 0 0 #f9a825; }
a.pw-chip-overdue { background: rgba(198, 40, 40, .14); box-shadow: inset 3px 0 0 #c62828; }
a.pw-chip-future { background: var(--accent-soft); box-shadow: inset 3px 0 0 #8a94a6; }
a.pw-chip:hover { outline: 1px solid var(--accent); }
dialog.pw-dialog { width: min(640px, 96vw); }
.pw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding-right: 80px; }
.pw-root h3 { margin: 8px 0 4px; font-size: 14px; }
.pw-small { margin: 2px 0; font-size: 13px; }
.pw-task { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-left: 3px solid #8a94a6; border-radius: 6px; }
.pw-task p { margin: 3px 0; }
.pw-task-due { border-left-color: #f9a825; }
.pw-task-overdue { border-left-color: #c62828; }
.pw-task-on { background: var(--accent-soft); }
.pw-task-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px; margin-top: 4px; }
.pw-more > summary { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; cursor: pointer; list-style: none; }
.pw-more[open] { flex-basis: 100%; }
.pw-more form { margin-top: 5px; }
.pw-log summary { font-size: 13px; cursor: pointer; }
.pw-prev { margin: 6px 0; }
.pw-main label { display: block; }
.pw-main select, .pw-main textarea, .pw-main input[type=text], .pw-more input[type=text], .pw-more select { width: 100%; box-sizing: border-box; }
.pw-nextbox summary { cursor: pointer; font-weight: 600; }
.pw-due { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pw-due-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.pw-radio { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; cursor: pointer; }
.pw-radio.on { border-color: var(--accent); }
.pw-existing .pw-radio { display: block; margin: 2px 0; }
.pw-existing { margin: 0; padding: 4px 8px; border: 1px solid #f9a825; border-radius: 6px; }
.pw-buttons { display: flex; gap: 6px; }
.pw-err:empty { display: none; }
.pw-root [hidden] { display: none !important; }
.thread .pw-head { display: none; }   /* в окне онлайн-таблицы партнёр уже в шапке окна */
.pw-more > summary { color: var(--text); font-size: 14px; padding: 4px 10px; }
.pw-more > summary::-webkit-details-marker { display: none; }
.pw-task-actions details, .pw-task-actions form { margin: 0; }
.pw-task-actions .button, .pw-task-actions button { margin: 0; }
/* Отказы «Моя» (ADR-118): строка «Нужно обработать» открывает карточку */
table.refusals tr.refusal-todo { cursor: pointer; }
table.refusals tr.refusal-todo:hover > td { background: #f6f8fb; }
/* Очередь «Пропущенные» и перезвоны (ТЗ Даши #239) */
.mq-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.mq-time { font-size: 1.05em; }
.mq-time b { font-size: 1.35em; }
.mq-time.unknown, .client-time.unknown { color: var(--muted, #777); font-style: italic; }
.mq-row.mq-due { background: rgba(224, 160, 0, .14); padding-left: 8px; border-left: 4px solid #e0a000; }
.mq-row.mq-taken { opacity: .75; }
.mq-badge-due { background: #e0a000; color: #fff; }
.mq-badge-taken { background: #888; color: #fff; }
.mq-details summary { cursor: pointer; }
/* Часы звонков (ТЗ Даши #243): рано или поздно у клиента */
.mq-row.mq-early { opacity: .7; }
.call-early { color: #b04000; font-size: .95em; }
.history { margin: 4px 0 6px 18px; padding: 0; font-size: .92em; }
.client-time { margin-left: 10px; }
.client-time b { font-size: 1.3em; }
.callback-due { padding: 8px 10px; border-radius: 6px; background: var(--accent-soft, #eef); }
.callback-due.due { background: rgba(224, 160, 0, .14); border-left: 4px solid #e0a000; }

/* «Комментарий» со счётчиком в строке заявки и выбор заявки по номеру в тексте (ТЗ Даши #266 п. 3–4) */
.lc-cmt { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 18px; white-space: nowrap; text-decoration: none; color: var(--muted); }
.lc-cmt.has { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.lc-cmt:hover, .lc-cmt:focus-visible { color: var(--accent); }
.comment-lead-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 4px; font-size: 13px; }

/* Макет единого вида вкладок (ТЗ Даши #266 п. 1–2, app/views/mockup_ui.php): плитки, кнопки-фильтры, компактные строки с раскрытием */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.ui-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); text-decoration: none; }
.ui-tile span { font-size: 13px; color: var(--muted); }
.ui-tile b { font-size: 20px; }
.ui-tile:hover { border-color: var(--accent); }
.ui-tile-warn { background: var(--warn); }
.ui-tile small { font-size: 12px; color: var(--muted); }
/* Период показателей и расшифровка платежей (#278) */
.pf-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0; font-size: 13px; }
.pf-period > a { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); text-decoration: none; }
.pf-period > a:hover { border-color: var(--accent); }
.pf-period > a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pf-period-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.pf-period-form label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); }
.pf-period-form input[type=date] { width: auto; min-height: 32px; padding: 2px 6px; }
.pf-period-label { margin-left: auto; color: var(--muted); }
.pf-period-label b { color: var(--text); }
.pf-quick a.pf-quick-main:not(.on) { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pf-period-sum { margin: 8px 0; }
.pf-pays { margin: 8px 0 12px; }
.pf-pays summary { cursor: pointer; font-weight: 600; }
.pf-pays-list { max-height: 320px; margin-top: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pf-pays-row { display: grid; grid-template-columns: 130px minmax(0, 2fr) minmax(0, 2fr) 90px; gap: 8px; padding: 5px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pf-pays-row:first-child { border-top: 0; }
.pf-pays-row .num { text-align: right; }
@media (max-width: 720px) { .pf-period-label { margin-left: 0; width: 100%; } .pf-pays-row { grid-template-columns: 1fr auto; } }
.ui-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.ui-filters input[type=search] { flex: 1 1 200px; max-width: 280px; }
.ui-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); font-size: 13px; text-decoration: none; cursor: pointer; list-style: none; }
.ui-chip b { color: var(--muted); font-weight: 600; }
.ui-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ui-chip.on b { color: #fff; }
.ui-chip-warn { border-color: #d4a017; }
.ui-more { display: inline-block; position: relative; }
.ui-more > summary::-webkit-details-marker { display: none; }
.ui-more-box { position: absolute; z-index: 50; top: 110%; left: 0; display: flex; flex-wrap: wrap; gap: 8px; width: min(520px, 90vw); padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .15); }
.ui-list { border-top: 1px solid var(--line); font-size: 14px; }
.ui-head, .ui-row > :is(summary, .ui-sum) { display: grid; grid-template-columns: minmax(200px, 2.2fr) 1fr 1fr .6fr .9fr 1.6fr auto; gap: 10px; align-items: center; padding: 7px 6px; }
.ui-head { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.ui-row { border-bottom: 1px solid var(--line); }
.ui-row > summary { cursor: pointer; list-style: none; }
.ui-row > summary::-webkit-details-marker { display: none; }
.ui-row > summary:hover, .ui-row[open] > summary { background: var(--accent-soft); }
.ui-row small { display: block; font-size: 12px; color: var(--muted); }
.ui-who a { font-weight: 600; }
.ui-st { font-style: normal; padding: 0 6px; border-radius: 8px; background: var(--line); }
.ui-st-ok { background: #e6f4ea; color: #1b7f3b; } .ui-st-warn { background: #fdecea; color: #c62828; } .ui-st-dup { background: #fff4d6; color: #8a6100; }
.ui-detail { padding: 6px 12px 10px; background: var(--bg); }
.ui-detail p { margin: 4px 0; }
@media (max-width: 760px) {
  .ui-head { display: none; }
  .ui-row > :is(summary, .ui-sum) { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .ui-row > :is(summary, .ui-sum) .ui-who { grid-column: 1 / -1; }
  .ui-row > :is(summary, .ui-sum) [data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
}

/* Настоящая таблица «Партнёры» в согласованном виде (#275) */
.ui-row > :is(summary, .ui-sum), .ui-sec > summary, .ui-calc-pop { color: var(--text); }
.ui-row small { overflow: hidden; text-overflow: ellipsis; }
.pf-list .pf-line { flex-wrap: wrap; overflow: visible; }
.pf-list .pf-place { white-space: nowrap; }
.pf-list .pf-setup-gap { color: var(--danger); }
.pf-list .pf-taken { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; }
.pf-list .pf-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 12px; }
.pf-list .pf-status { max-width: none; }
.pf-quick a { border-radius: 16px; }
.ui-calc { position: relative; display: inline-block; }
.ui-calc-btn { all: unset; cursor: pointer; font-weight: 600; border-bottom: 1px dotted var(--muted); }
.ui-calc-btn:hover, .ui-calc-btn:focus-visible { color: var(--accent); }
.ui-calc-pop { position: absolute; z-index: 40; top: 100%; right: 0; display: flex; flex-direction: column; gap: 4px; width: 300px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .15); font-size: 13px; font-weight: 400; cursor: auto; }
.ui-calc-pop[hidden] { display: none; }
@media (min-width: 761px) {
  .pf-list .ui-head, .pf-list .ui-row > :is(summary, .ui-sum) { grid-template-columns: minmax(230px, 2.2fr) 200px .9fr .9fr .5fr .8fr .8fr 1.5fr 170px; }
  .pf-list .ui-head { position: sticky; top: 0; z-index: 5; background: var(--card); }
}
@media (max-width: 760px) {
  .ui-calc-pop { position: fixed; top: auto; left: 5vw; right: 5vw; bottom: 16px; width: auto; }
  .pf-list .pf-acts, .pf-list [data-l="Телефон"] { grid-column: 1 / -1; }
}

/* Карточка партнёра в том же виде (#275) */
.pc-top { padding: 14px 16px; }
.pc-back { margin: 0 0 4px; font-size: 13px; }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 4px; }
.pc-head h1 { margin: 0; font-size: 22px; }
.pc-phone { font-size: 16px; font-weight: 600; }
.pc-as { margin-left: auto; }
.pc-lock { position: relative; }
.pc-lock > summary { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; font-size: 14px; border-radius: 8px; background: var(--danger); color: #fff; cursor: pointer; list-style: none; }
.pc-lock > summary::-webkit-details-marker { display: none; }
/* Причина блокировки под шапкой карточки и строка отметок под именем в списках (ТЗ Даши #703 п. 5) */
.pc-block-why { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: #fee2e2; color: #7f1d1d; }
.p-ref .p-flags { display: block; margin-top: 2px; }
.p-ref .p-flags .pf-tag { font-weight: 400; }
/* Плашка подписки рядом с именем во всех списках (ТЗ Даши #837): зелёная — действует, серая — не подключена; по нажатию — подробности */
details.sub-pill { display: inline-block; vertical-align: middle; margin: 0; padding: 0; border: 0; background: none; }
details.sub-pill > summary { list-style: none; cursor: pointer; }
details.sub-pill > summary::-webkit-details-marker { display: none; }
.pf-tag.t-sub-on { background: #16a34a; color: #fff; font-weight: 600; }
.pf-tag.t-sub-off { background: #e5e7eb; color: #4b5563; }
.p-ref .p-flags .pf-tag.t-sub-on { font-weight: 600; }
details.sub-pill[open] > summary { outline: 2px solid #86efac; outline-offset: 1px; }
details.sub-pill .sub-pop { display: block; max-width: 340px; margin: 4px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 12px; font-weight: 400; line-height: 1.45; white-space: normal; text-align: left; }
details.sub-pill .sub-row { display: block; }
.pf-sub { display: block; margin-top: 2px; }
.pw-head details.sub-pill, .pc-badges details.sub-pill { margin-right: 4px; }
.pc-lock.is-blocked > summary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.pc-lock-form { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: min(320px, 80vw); padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.pc-lock-form input[type="text"] { width: 100%; box-sizing: border-box; }
/* Заблокированный партнёр (ТЗ Даши #1063): яркая надпись, красный блок с причиной и записями менеджеров, форма разблокировки с предупреждением */
.pf-tag.t-lock { background: var(--danger); color: #fff; font-weight: 700; }
.p-blocked, .p-blocked a { font-weight: 700; }
.pb-notice { margin: 8px 0; padding: 10px 14px; border: 2px solid var(--danger); border-radius: 8px; background: #fee2e2; color: #7f1d1d; text-align: left; }
.pb-notice p { margin: 2px 0; }
.pb-notice .pb-who { color: #991b1b; opacity: .85; }
.pb-notice .pb-sub { margin-top: 8px; font-weight: 600; }
.pb-notes { margin: 4px 0; padding-left: 18px; }
.pb-notes li { margin: 2px 0; }
.pb-warn { margin: 8px 0 !important; padding: 6px 10px; border-radius: 6px; background: var(--danger); color: #fff; font-weight: 600; }
.pb-links a { color: #7f1d1d; text-decoration: underline; }
.pc-unlock-form { width: min(560px, 92vw); }
.pc-unlock-form .pb-notice { margin: 0; width: 100%; box-sizing: border-box; max-height: 50vh; overflow: auto; }
.pc-unlock-form textarea { width: 100%; box-sizing: border-box; }
.pc-lock-right { left: auto; right: 0; }
.thread-block .pb-notice { margin: 6px 0; }
.pc-badges { margin: 0 0 6px; }
.pc-top .pc-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; justify-content: stretch; margin: 10px 0; }
.pc-top .pc-kpi > div { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.pc-top .pc-kpi dd { font-size: 18px; font-weight: 600; }
.pc-top .pc-kpi dd .money-err, .pc-top .pc-kpi dd .money-edit { font-size: 14px; font-weight: 400; }
.pc-top .pc-leads { margin: 0 0 10px; gap: 8px; }
.pc-top .pc-leads .lead-box { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.pc-top .pc-facts { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; margin: 0; font-size: 14px; }
.pc-manage { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.pc-manage > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.pc-manage[open] > summary { margin-bottom: 8px; }
.pc-nav { margin: 10px 0 0; }
.ui-sec { padding: 8px 14px; margin-bottom: 8px; }
.ui-sec > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.ui-sec > summary::-webkit-details-marker { display: none; }
.ui-sec > summary::before { content: "▸"; color: var(--muted); }
.ui-sec[open] > summary::before { content: "▾"; }
.ui-sec > summary h2 { margin: 0; font-size: 16px; }
.ui-sec[open] > summary { margin-bottom: 10px; }

/* Приглашение и окно «Написать в MAX» в карточке партнёра (ТЗ #297, ADR-129) */
.pc-max { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.mx-invite { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.mx-url { color: var(--danger); font-weight: 600; overflow-wrap: anywhere; }
.mx-invite .copy-note { margin-left: 0; }
dialog.mx-dialog { width: min(640px, 96vw); }
.mx-dialog h2 { margin: 0 0 8px; font-size: 18px; padding-right: 90px; }
.mx-off { margin: 8px 0 0; }

/* Незавершённая проверка в кабинете (ADR-130) */
.take-gate { border-left: 4px solid #c97a00; }
.take-gate h2 { margin-top: 0; }
.take-gate li { margin-bottom: 8px; }
.take-gate li small { display: block; color: var(--muted, #667); }
.pf-who small.muted { display: block; }

/* Единая работа с партнёром (ТЗ Даши #307) */
.pw-block .pw-contact, .pw-block a.pw-contact, .pw-block a.pw-contact:hover { color: #c62828; font-weight: 600; }
.pw-block a.pw-contact.pw-mark-today { padding: 0; background: none; box-shadow: none; }
.pw-block a.pw-contact.pw-mark-today:hover { color: #c62828; }
.pw-block a.pw-contact b { color: inherit; }
.pw-block .pw-contact .pw-text { color: var(--muted); font-weight: 400; }
.pw-tick { color: #2e7d32; font-weight: 700; }
.pw-name-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.pw-imp-box { margin: 0 !important; }
a.pw-imp { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 16px; text-decoration: none; }
a.pw-imp1 { background: #fff0d6; color: #8a5200; }
a.pw-imp2 { background: #c62828; color: #fff; }
.pw-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pw-pill { display: inline-block !important; padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; cursor: pointer; }
.pw-pill input { margin: 0 4px 0 0; }
.pw-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.pw-more-status summary { font-size: 13px; cursor: pointer; color: var(--muted); }
.pw-more-status .pw-pills { margin-top: 4px; }
.pw-callback { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; padding: 8px; border: 1px solid #f9a825; border-radius: 6px; }
.pw-callback p { grid-column: 1 / -1; }
.pw-callback input, .pw-callback select { width: 100%; box-sizing: border-box; }
.pw-done-task { font-size: 13px; }
.pw-hist-edit details summary { font-size: 12px; cursor: pointer; color: var(--muted); }
.pw-hist-row.record-hit { background: var(--warn); }
.pw-newtask { margin-top: 6px; }
.pw-newtask > summary { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; list-style: none; }
.pw-remind { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #c62828; border-left-width: 4px; border-radius: 6px; background: rgba(198, 40, 40, .08); }
.pw-remind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; font-size: 14px; }
.pw-help { margin: 4px 0; font-size: 13px; }
.pw-help summary { cursor: pointer; color: var(--muted); }
.pw-help dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0; }
.pw-help dt { font-weight: 600; }
.pw-help dd { margin: 0; }
.pw-help p { margin: 3px 0; }
.pw-call-alert { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border: 2px solid #c62828; border-radius: 8px; background: #fff3f3; color: #1d2330; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); font-size: 14px; }
.pw-call-alert > div + div { margin-top: 5px; }
.reply-tpls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.reply-tpls button { margin: 0; }
.ev-notes { margin: 0 0 6px 12px; font-size: 13px; }
.ev-note { margin: 2px 0; }
.ev-add summary { font-size: 12px; cursor: pointer; color: var(--muted); }
.thread-head .pw-block { max-width: none; margin: 2px 0; }
.mx-result { margin: 0 0 6px; }
@media (max-width: 700px) {
  .pw-help dl { grid-template-columns: 1fr; }
  .pw-pill { flex: 1 1 auto; text-align: center; }
}
.pw-block .pw-line, .pw-block .pw-text { font-weight: 400; }
.pw-block .pw-contact, .pw-block a.pw-contact { font-weight: 600; }
.pw-block a.pw-contact .pw-text { font-weight: 400; }
.pw-callback input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
/* Ответ партнёру (#325): «Отправить» и «Закрыть» рядом внизу, пометка о черновике */
.reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reply-actions button { margin: 0; }
.draft-note { font-size: 12px; }

/* «Не дозвонился» на карточке обращения (ТЗ Даши #355) */
.na-box { display: inline-block; vertical-align: top; }
.na-box > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; font-size: 14px;
  border-radius: 8px; background: var(--card); color: var(--text); border: 1px solid var(--line); }
.na-box > summary::-webkit-details-marker { display: none; }
.na-box[open] > summary { background: var(--accent-soft); }
.na-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 8px 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.na-quick { display: inline-flex; gap: 4px; }
/* Поиск над списком тем (#395 п. 5, assets/checklist-search.js) */
.checklist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 8px 0 0; }
.checklist-bar input[type=search] { flex: 1 1 240px; min-width: 0; }
.checklist-bar label.check { margin: 0; }

/* Свободные заявки за неделю и окно отправки партнёру (ТЗ Даши #482, app/views/online_free*.php) */
.free-leads .fl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.free-leads .fl-head h2 { margin: 0; font-size: 18px; }
.free-leads .fl-city { width: auto; min-width: 200px; }
.fl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fl-table th, .fl-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fl-table .fl-theme { white-space: nowrap; }
.fl-table .fl-leads { line-height: 1.5; }
.fl-table .fl-leads a { white-space: nowrap; }
.fl-table .fl-act { width: 1%; text-align: center; }
.fl-plus { min-width: 34px; font-weight: 700; }
.free-leads .fl-more-btn, .free-leads .fl-next { margin-top: 6px; }
.fl-table tr.fl-city-row th { background: var(--bg, #f6f7f9); font-size: 15px; padding-top: 8px; }
dialog.fl-dialog { width: min(640px, 96vw); }
.fl-dialog h2 { margin: 0 0 8px; font-size: 18px; padding-right: 40px; }
.fl-list { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.fl-item { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; }
.fl-q { display: block; margin-bottom: 8px; }
.fl-q-row { display: flex; gap: 6px; margin-top: 4px; }
.fl-q-row input { flex: 1; }
.fl-who { background: var(--bg, #f6f7f9); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; line-height: 1.6; }
.fl-plan { list-style: none; padding: 0; margin: 0 0 8px; }
.fl-plan li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.fl-plan li.fl-skip { color: var(--muted, #777); }
.fl-warn { display: inline-block; margin-left: 6px; color: #8a5a00; font-size: 13px; }
.fl-repeat { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; font-weight: normal; }
.fl-found { list-style: none; padding: 0; }
.fl-found li { margin: 4px 0; }
.fl-result { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.fl-foot { text-align: right; margin: 8px 0 0; }

/* Подсказки имён в карточке обращения (ТЗ Даши #494 п. 11, assets/name-suggest.js) */
.ns-wrap { position: relative; }
.name-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 2px 0; list-style: none;
  background: var(--bg, #fff); border: 1px solid #c8ccd2; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.12); max-width: 320px; }
.name-suggest li { padding: 5px 10px; cursor: pointer; }
.name-suggest li.on, .name-suggest li:hover { background: #e8f0fe; }
/* Вкладка меню «Свободные заявки» — заметная (ТЗ Даши #518) и заголовок отдельной страницы */
.top nav a.menu-accent { background: #fff3cd; color: #7a4b00; font-weight: 600; border-radius: 6px; }
.top nav a.menu-accent[aria-current="page"] { background: #ffe08a; }
.free-leads.fl-page .fl-head h1 { margin: 0; font-size: 20px; }

/* Быстрые фразы у полей ввода (ТЗ Даши #536, assets/phrases.js) */
.qp { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.qp-row .qp-own { border-style: dashed; }
.qp-more, .qp-save { opacity: .85; }
.qp-panel { border: 1px solid #d8dde3; border-radius: 6px; padding: 6px; background: #fafbfc; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.qp-panel .qp-search { width: 100%; max-width: 320px; }
.qp-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.qp-group button, .qp-own-item button { margin: 0; }
.qp-own-item { display: inline-flex; gap: 1px; }
.qp-editor { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.qp-sug { list-style: none; margin: 2px 0 0; padding: 2px; border: 1px solid #c9d1da; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 13px; max-width: 560px; }
.qp-sug li { padding: 4px 8px; cursor: pointer; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-sug li.on, .qp-sug li:hover { background: #e8f0fe; }
.qp-msg.error { color: #b3261e; }
.qp-panel[hidden], .qp-own-none[hidden], .qp-own-item[hidden], .qp-chip[hidden] { display: none; }

/* Загрузка операторов по часам (ТЗ Даши #592, app/views/reports_hourly.php) */
.pf-chips .badge[aria-current="page"] { background: var(--accent); color: #fff; }
.pf-chips .badge { font-size: 13px; padding: 4px 12px; text-decoration: none; }
.rh-fig { margin: 8px 0 12px; overflow-x: auto; }
.rh-chart { width: 100%; min-width: 620px; height: auto; display: block; }
.rh-grid { stroke: #e5e7eb; stroke-width: 1; }
.rh-axis { font-size: 10px; fill: #6b7280; }
.rh-bar { fill: #9ca3af; }
.rh-bg-short { fill: #fde2e1; }
.rh-bg-excess { fill: #fef3c7; }
.rh-bg-off, .rh-bg-off_paid { fill: #eef0f3; }
.rh-hit { fill: transparent; }
.rh-fact { fill: none; stroke: #2563eb; stroke-width: 2.5; }
.rh-rec { fill: none; stroke: #059669; stroke-width: 2.5; stroke-dasharray: 6 4; }
.rh-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: #374151; margin-top: 4px; }
.rh-legend span::before { content: ""; display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.rh-k-bar::before { background: #9ca3af; }
.rh-k-fact::before { background: #2563eb; height: 3px !important; }
.rh-k-rec::before { border-top: 3px dashed #059669; height: 0 !important; }
.rh-k-short::before { background: #fde2e1; border: 1px solid #f5a3a0; }
.rh-k-excess::before { background: #fef3c7; border: 1px solid #f2cf6b; }
.rh-k-off::before { background: #eef0f3; border: 1px solid #c9ced6; }
.rh-table .small, .rh-cmp .small { font-size: 12px; }
tr.rh-row-short td { background: #fdf0ef; }
tr.rh-row-excess td { background: #fffaeb; }
tr.rh-row-off td, tr.rh-row-off_paid td { background: #f4f5f7; color: #6b7280; }
table.rh-cmp { border-collapse: collapse; font-size: 12px; }
table.rh-cmp th, table.rh-cmp td { border: 1px solid #e5e7eb; padding: 3px 5px; text-align: center; white-space: nowrap; }
table.rh-cmp td.day, table.rh-cmp th.day { text-align: left; position: sticky; left: 0; background: var(--card, #fff); }
table.rh-cmp td a { display: block; text-decoration: none; color: inherit; }
table.rh-cmp .rh-ops { display: block; color: #6b7280; font-size: 11px; }
td.rh-c-short { background: #fbd5d3; }
td.rh-c-excess { background: #fdecb5; }
td.rh-c-off, td.rh-c-off_paid { background: #eef0f3; }

/* Контакты базы для подбора под свободные заявки (ТЗ Даши #598, assets/prospect_base.js, app/views/free_base.php) */
dialog.pb-dialog { width: min(1100px, 97vw); }
.pb-dialog h2 { margin: 0 0 6px; font-size: 18px; padding-right: 40px; }
.pb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.pb-table td { vertical-align: top; }
.pb-table .pb-act button { margin: 0 4px 4px 0; }
.pb-themes { font-size: 13px; }
.pb-form { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.pb-results { display: flex; flex-wrap: wrap; gap: 4px 14px; border: 0; padding: 0; margin: 0 0 6px; }
.pb-form textarea { width: 100%; }
.pb-link { width: 100%; font-size: 13px; }
.fl-act .pb-open { margin-top: 4px; }
tr.pb-used td { background: var(--hover, rgba(0, 0, 0, .03)); }
/* «Перезвоны и задачи» вверху «Партнёров» (ТЗ Даши #609): просроченное — красным */
.pw-tasks { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #c9a227; border-left-width: 4px; border-radius: 6px; }
.pw-tasks.pw-tasks-bad { border-color: #c62828; background: rgba(198, 40, 40, .05); }
.pw-tasks > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pw-tasks-list { margin-top: 6px; }
.pw-tasks-list tr.pw-task-overdue td:first-child { color: #c62828; font-weight: 600; }
.pw-tasks-list tr.pw-task-overdue td { background: rgba(198, 40, 40, .07); }   /* просроченные — красным (ТЗ Даши #771) */
.pw-tasks-by { margin: 6px 0 0; }
.pw-tasks-by a.on { background: var(--line); font-weight: 600; }
/* «Новые — отправить ссылку» (ТЗ Даши #656): жёлтым, просроченные перезвоны остаются красными */
.nc-block { background: #fff8d6; }
.nc-block .nc-row td { background: #fff3b8; }
.nc-actions details.nc-form { margin-top: 4px; }
.nc-actions details.nc-form > summary { cursor: pointer; color: #1f5fbf; }
.nc-ch { font-weight: 700; color: #fff; }
.nc-ch-max { background: #6a3fd8; }
.nc-ch-telegram { background: #229ed9; }
.nc-block .nc-row.nc-done td { background: #eef7e8; }
.nc-actions form { margin-top: 4px; max-width: 320px; }
@media (prefers-color-scheme: dark) { .nc-block { background: rgba(227, 179, 65, .12); } .nc-block .nc-row td { background: rgba(227, 179, 65, .18); } }
.pmark-detail { font-size: 12px; margin-top: 2px; }
/* Поиск города и темы в «Свободных заявках» (ТЗ Даши #609) */
.fl-pick { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.fl-pick input { width: 220px; }
.fl-pick .fl-clear { padding: 2px 8px; }
.fl-sug { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 260px; max-height: 320px; overflow: auto; margin: 2px 0 0; padding: 0; list-style: none;
  background: var(--card); color: var(--text); border: 1px solid #bbb; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.fl-sug li { padding: 5px 10px; cursor: pointer; }
.fl-sug li small { display: block; color: var(--muted); }
.fl-sug li.on, .fl-sug li:hover { background: var(--accent-soft); }

/* Единая ссылка подключения и шаги подключения (ТЗ Даши #753) */
.join-choice { display: flex; gap: 12px; flex-wrap: wrap; }
.join-choice .button { flex: 1 1 200px; flex-direction: column; justify-content: center; text-align: center; padding: 14px 12px; }
ol.nc-steps { list-style: none; padding: 0; }
ol.nc-steps li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ol.nc-steps li:last-child { border-bottom: 0; }
ol.nc-steps li.done::before { content: "✓ "; color: var(--ok); font-weight: 600; }
ol.nc-steps li.todo::before { content: "○ "; color: var(--muted); }
ol.nc-steps li.nc-next { background: var(--warn-bg, #fff8e1); padding-left: 8px; }
ol.nc-steps li .button, ol.nc-steps li form { margin-top: 6px; display: inline-block; }
.nc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.nc-tabs a { padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; }
.nc-tabs a.on { background: var(--line); font-weight: 600; }
/* Экран подключения новичка над перепиской (ТЗ Даши #787, app/views/nc_panel.php) */
.nc-block .nc-row[data-src] { cursor: pointer; }
.nc-block .nc-row[data-src]:hover td { background: #ffeb99; }
.nc-howto { margin: 4px 0 8px; font-size: .92em; }
.nc-panel { border: 1px solid #e3c560; background: #fff8d6; border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.nc-panel .nc-top { margin-bottom: 4px; }
.nc-panel .nc-status { font-size: 1em; }
.nc-panel .nc-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 4px 0; }
.nc-panel .nc-yes { color: #2e7d32; font-weight: 700; }
.nc-panel .nc-no { color: #c62828; font-weight: 700; }
.nc-panel .nc-q { color: #888; font-weight: 700; }
.nc-panel .nc-situation { margin: 4px 0 0; }
.nc-panel .nc-flow { margin: 6px 0 0; padding: 6px 8px; background: #f6f8fb; border-radius: 6px; }
.nc-panel .nc-flow p { margin: 2px 0; word-break: break-all; }
.nc-panel .nc-next { margin: 2px 0 6px; }
.nc-panel .nc-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nc-panel .nc-done { color: #2e7d32; }
.nc-panel .nc-instr { margin: 6px 0 0; }
.nc-panel .nc-spec { margin-top: 6px; }
.nc-panel .nc-spec > summary { cursor: pointer; color: #1f5fbf; }
.dlv-ok { color: #2e7d32; }
@media (prefers-color-scheme: dark) {
  .nc-panel { background: rgba(227, 179, 65, .12); border-color: rgba(227, 179, 65, .4); }
  .nc-block .nc-row[data-src]:hover td { background: rgba(227, 179, 65, .28); }
}
.nc-actions details.nc-more > summary { cursor: pointer; color: #1f5fbf; margin-top: 4px; }

/* Блок «Результаты и оплаты партнёров» на онлайн-экране (ТЗ Даши #812): жёлтый — хороший ход работы, красный — нужен менеджер */
.results-block { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px 8px; }
.results-block > summary { font-weight: 600; color: inherit; gap: 6px; }
.results-block table.results td { vertical-align: top; }
.results-block tr.result-yellow td { background: #fff4c2; }
.results-block tr.result-red td { background: #fde2e1; }
.results-block .inline-form { display: inline-block; margin: 4px 0 0; }
@media (prefers-color-scheme: dark) {
  .results-block tr.result-yellow td { background: #3a3220; }
  .results-block tr.result-red td { background: #4a1f1f; }
}

/* Заявка сообщения партнёра: «Заявка №… · город, направление», «Бот уточняет заявку» (ТЗ Даши #832) */
.msg-lead { font-size: .9em; }
.msg-lead-wait { color: #8a5a00; background: #fff4d6; border-radius: 4px; padding: 0 .35em; }
.bubble-lead { margin-bottom: .2em; }
td.msg > .msg-lead { display: block; margin-bottom: .15em; }

/* Темы партнёра: три состояния «Активна» / «До весны» / «Не занимается» (ТЗ Даши #868, ADR-187). Цвет всегда вместе с подписью */
.badge.th-on { background: #e3f4e8; color: #17602d; }
.badge.th-pause { background: #fff1b8; color: #6b5300; }
.th-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.th-bar .th-q { flex: 1 1 240px; min-width: 0; }
.th-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.th-filters button[aria-pressed=true] { background: var(--accent, #1a73e8); color: #fff; border-color: transparent; }
.th-filters button span { opacity: .8; }
.th-list { columns: 1; column-gap: 16px; margin: 8px 0; }   /* колонки сверху вниз: подтемы остаются под общей темой */
@media (min-width: 900px) { .th-list { columns: 2; } }
@media (min-width: 1400px) { .th-list { columns: 3; } }
.th-row { break-inside: avoid; margin-bottom: 4px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 4px 8px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; }
.th-row.th-on { border-left-color: #1b7f3b; }
.th-row.th-pause { border-left-color: #e0b100; background: #fffbe6; }
.th-row .indent { display: none; }
.th-row.th-d1 { margin-left: 14px; } .th-row.th-d2 { margin-left: 28px; } .th-row.th-d3 { margin-left: 42px; }
@media (max-width: 759px) { .th-row.th-d1 { margin-left: 8px; } .th-row.th-d2, .th-row.th-d3 { margin-left: 16px; } }
.th-name { flex: 1 1 160px; min-width: 0; }
.th-when { display: block; font-size: .85em; color: #6b5300; }
.th-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.th-s { position: relative; margin: 0; cursor: pointer; }
.th-s input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.th-s span { display: inline-block; padding: 6px 9px; font-size: .85em; white-space: nowrap; }
.th-s + .th-s span { border-left: 1px solid var(--line); }
.th-s input:focus-visible + span { outline: 2px solid var(--accent, #1a73e8); outline-offset: -2px; }
.th-s-on input:checked + span { background: #1b7f3b; color: #fff; }
.th-s-on input:checked + span::before { content: '✓ '; }
.th-s-pause input:checked + span { background: #f5c400; color: #3a2e00; }
.th-s-pause input:checked + span::before { content: '⏸ '; }
.th-s-off input:checked + span { background: var(--line); }
.th-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding: 8px 0; background: var(--card); border-top: 1px solid var(--line); }
.th-foot label { flex: 1 1 260px; margin: 0; }
@media (prefers-color-scheme: dark) {
  .badge.th-on { background: #17331f; color: #8fdca8; }
  .badge.th-pause { background: #3a3220; color: #f5d76e; }
  .th-row.th-pause { background: #2b2614; }
  .th-when { color: #f5d76e; }
}

/* Выбор городов галочками по областям (ТЗ Даши #877) */
.geo-pick { margin: 8px 0 12px; }
.geo-pick-q { width: 100%; max-width: 520px; }
.geo-pick-group { margin: 10px 0; }
.geo-pick-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.geo-pick-cities { max-height: 300px; }
.geo-pick-chosen { margin: 6px 0; }

/* Вкладка «Не получают заявки» (ТЗ Даши #986) */
.ur-sum { margin: .5em 0; padding: .5em .75em; background: #f6f8fa; border-radius: 6px; line-height: 1.6; }
.ur-howto { margin: .5em 0 1em; }
.ur-howto ol { margin: .4em 0 0 1.2em; padding: 0; }
.ur-list td .small { font-size: .85em; }

/* Подсказки оператору в карточке обращения (ТЗ Даши #1004, app/desk_guide.php) */
.guide-box { margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px; border-left: 4px solid var(--accent, #3b6fd8); background: var(--accent-soft, #eef); }
.guide-box.guide-warn { border-left-color: #e0a000; background: rgba(224, 160, 0, .12); }
.guide-box.guide-done { border-left-color: #2e9d57; background: rgba(46, 157, 87, .10); }
.guide-box .guide-next { margin: 0 0 6px; font-size: 16px; }
.guide-box .guide-facts { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }
.guide-box .guide-facts li { margin: 2px 0; }
.actions-box details.act { display: inline-block; vertical-align: top; margin: 0 4px 6px 0; }
.actions-box details.act[open] { display: block; margin-right: 0; }
.actions-box details.act > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 34px; }
.actions-box details.act > summary::-webkit-details-marker { display: none; }
.actions-box details.act[open] > summary { outline: 2px solid var(--accent, #3b6fd8); }
.actions-box .act-body { margin: 8px 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.actions-box .act-body > p, .actions-box .act-body > ul, .actions-box .act-body > .chips { flex: 1 1 100%; margin: 0; }
.actions-box .act-body input[type=text] { flex: 1 1 260px; }
.help-table td { vertical-align: top; }
.actions-box details.act > summary.button { padding: 0 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; }
.actions-box details.act > summary.button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
/* ТЗ Даши #1025: вложения писем, картинки в тексте, текст обращения рядом с формой, причины закрытия */
.att-box .att-list { list-style: none; padding: 0; margin: 6px 0; }
.att-box .att-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.att-box .att-thumb { display: inline-block; max-width: none; max-height: none; margin: 0; }
.att-box .att-thumb img { display: block; max-width: 96px; max-height: 72px; border: 1px solid var(--line); border-radius: 4px; }
.att-box .att-name { font-weight: 600; overflow-wrap: anywhere; }
.att-lost { padding: 8px 10px; border-left: 3px solid #d08a00; background: rgba(208, 138, 0, .08); border-radius: 4px; }
.mail-img img { display: inline-block; max-width: 100%; max-height: 220px; vertical-align: middle; border: 1px solid var(--line); border-radius: 4px; }
.mail-img-lost { color: #9a5b00; font-style: italic; }
.mail-html iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
/* ТЗ Даши #1029: колонка «текст рядом с формой» убрана — форма снова на всю ширину */
.close-options { display: grid; gap: 6px; flex: 1 1 100%; }
.close-opt { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.close-opt input { grid-row: span 2; margin-top: 3px; }
.close-opt:has(input:checked) { border-color: var(--accent); background: rgba(0, 0, 0, .03); }
label.need > select, label.need > input { outline: 2px dashed #d08a00; outline-offset: 1px; }
.need-tag { font-size: 12px; color: #9a5b00; font-weight: 600; }
.calls-list .call-in td.title { color: #1c5fb8; }
.calls-list audio { width: 220px; height: 30px; }

/* «Пригласить в Telegram» (ТЗ Даши #1038, app/views/tg_invite.php): окно с текстом поверх страницы */
.tg-invite { position: relative; display: inline-block; }
.tg-invite > summary { list-style: none; cursor: pointer; }
.tg-invite > summary::-webkit-details-marker { display: none; }
.tg-invite-body { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: min(560px, 92vw); padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.pf-top-right .tg-invite-body { left: auto; right: 0; }
.tg-invite-body textarea { width: 100%; font: inherit; }
.tg-invite-body p { margin: 6px 0; }
.online-tg .tg-row.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tg-invite > summary { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; }

/* Принятие оферты на телефоне (ТЗ Даши #1156): крупные галочки, весь текст — область нажатия, неотмеченная после ошибки выделена */
.accept-card .accept-item { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.accept-card .accept-item.miss { border-color: #dc2626; background: #fef2f2; }
.accept-card .accept-item label.check { align-items: flex-start; font-size: 1.05em; cursor: pointer; }
.accept-card .accept-item label.check input { width: 28px; height: 28px; flex: 0 0 28px; margin-top: 2px; }
.accept-card .accept-item .hint { margin: 6px 0 0 36px; }
.accept-card .accept-btn { width: 100%; min-height: 48px; font-size: 1.1em; }

/* Вкладка «Все заявки» и «Комментарии по заявкам» (ТЗ Даши #1316) */
.online-tabs a.active { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.al-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.al-search input { max-width: 180px; }
.al-item { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.al-item.al-free { border-left-color: #2e7d32; }
.al-item.al-taken { border-left-color: #1565c0; }
.al-item.al-closed { border-left-color: #9e9e9e; }
.al-item.al-invalid { border-left-color: #c62828; }
.al-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-bottom: 6px; }
.al-num { font-weight: 700; font-size: 1.1em; }
.al-facts { margin: 4px 0; }
.al-sub { font-weight: 600; margin: 8px 0 4px; }
.al-rec { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0; }
.al-rec audio { height: 36px; max-width: 100%; }
.al-files .att-thumb img { max-height: 60px; vertical-align: middle; }
.al-pv summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.al-pv-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.pv-msg { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; max-width: 560px; background: var(--card); }
.pv-sent { border-style: solid; }
.pv-now { border-style: dashed; }
.pv-text mark { background: #fff3b0; }
.pv-link { text-decoration: underline; color: inherit; cursor: default; }
.pv-btn-row { display: flex; gap: 6px; margin-top: 6px; }
.pv-btn { flex: 1; text-align: center; border: 1px solid var(--accent); border-radius: 6px; padding: 6px; font-size: 13px; }
.al-cmt-row { margin: 2px 0; }
.al-cmt-form textarea { width: 100%; }
.al-pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.lead-comments .lc-unread td { font-weight: 600; background: var(--accent-soft); }
.lc-read-all { margin-bottom: 8px; }
/* Вкладки «ТЗ» — задания сотрудникам (ТЗ Даши #1312) */
.pmark-ok { background: #c8e6c9; }
.tz-table td { vertical-align: top; }
.tz-table td:nth-child(2) { min-width: 260px; }
.tz-table td.tz-res { min-width: 240px; }
.tz-table tr.tz-done td { background: #f6f8f6; }
.tz-res > div { margin-bottom: 4px; }
.tz-res .tz-text { white-space: normal; }
.tz-older summary { cursor: pointer; color: var(--muted, #667); font-size: 13px; }
.tz-form .tz-outcomes { display: flex; flex-wrap: wrap; gap: 4px 16px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.tz-form .tz-outcomes label { display: inline-flex; align-items: center; gap: 4px; }
.tz-form .tz-cb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.tz-form .tz-cb[hidden] { display: none; }
.tz-form textarea { width: 100%; }
.tz-what { padding: 6px 10px; background: #f4f6f9; border-radius: 6px; }
.tz-history { padding-left: 18px; }
.tz-history li { margin-bottom: 4px; }
