/* Дополнения к стилям макета: то, чего в макете не было, потому что там меню — кнопки, а в приложении — ссылки.
   Сами стили макета в соседних файлах не правим. */
a.logo, a.nav-item { text-decoration: none; }
a.logo { color: inherit; }
.search-off { background: var(--surface-2); cursor: not-allowed; }
.search-off input, .search-off input::placeholder { cursor: not-allowed; }
.stub .pill { margin-top: 8px; }

/* Витрина компонентов (/ui/) */
.kit { display: flex; flex-direction: column; gap: 20px; max-width: 1040px; }
.kit h2 { margin: 0; font-size: 22px; }
.kit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kit-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink-2); }
.kit-swatch { height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Карточка сотрудника в меню: ссылка на профиль и кнопка «Выйти» */
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.me-link:hover .me-name { color: var(--accent-ink); }
.me-text { min-width: 0; }
.me-name, .me-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-3); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.seg form, form.seg { margin-left: auto; }

/* Вход и смена пароля */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-logo { display: flex; align-items: center; gap: 10px; }
.auth-logo img { width: 36px; height: 36px; border-radius: 4px; }
.auth-logo b { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.auth-title { margin: 8px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.auth-lead { margin: -8px 0 0; color: var(--ink-2); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn, .auth-card > .btn { width: 100%; height: 44px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); width: 100%; }
.input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.field-error { font-size: 12px; color: var(--bad); }
.field-help { font-size: 12px; color: var(--ink-3); }
.field-help ul { margin: 4px 0 0; padding-left: 18px; }
.auth-note { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-note-error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.auth-note-success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.auth-note-warning { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-g { width: 18px; height: 18px; stroke-width: 0; }

/* Сотрудники в «Настройках» */
a.tab { text-decoration: none; }
.tab-soon { color: var(--ink-3); cursor: default; }
.tab-soon small { font-size: 11px; margin-left: 4px; }
a.chip { text-decoration: none; }
.staff-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.staff-name:hover { color: var(--accent-ink); }
.staff-actions { display: flex; flex-direction: column; gap: 12px; }
.staff-actions form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.field .sel { width: 100%; height: 42px; }
.field .input:disabled, .field .sel:disabled { background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; }
.temp-password { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.temp-password code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 22px; font-weight: 600; letter-spacing: 0.04em; user-select: all; }

.staff-toolbar { flex-wrap: wrap; }
.staff-toolbar .q-chips { flex-wrap: wrap; overflow: visible; }

a.btn { text-decoration: none; }

/* Темы в «Настройках» (задача 47) */
.topics-note { margin-bottom: 16px; }
.topics-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.topics-spacer { flex: 1; }
.topics-off { opacity: 0.7; }
.topics-tbl th:nth-child(2), .topics-tbl td:nth-child(2) { width: 130px; }
.topics-own { margin-left: 8px; vertical-align: 1px; }
/* Кнопки в списке тем — в размер плашки состояния, чтобы не перетягивали внимание (правка Максима 27.10) */
.btn-xs { height: 24px; padding: 0 10px; font-size: 12px; gap: 5px; border-radius: 999px; }
.btn-xs .icon { width: 13px; height: 13px; }
.card-h .topics-toggle { margin: 0; }
.card-h > .btn-xs + .topics-toggle, .card-h > .topics-toggle + .btn-xs { margin-left: -4px; }
.topics-desc { margin-top: 2px; max-width: 720px; }
.topics-tbl .topics-act { width: 1%; white-space: nowrap; text-align: right; }
.topics-act .btn + .topics-toggle { margin-left: 6px; }
.topics-toggle { display: inline-flex; vertical-align: middle; margin: 0; }
.topics-act > .btn { vertical-align: middle; }
.field textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }

/* Смены (задача 70): кнопка в меню, точка-индикатор, плашка «на линии никого нет» */
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.side-foot .me { margin-top: 0; }
.shift { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
.shift-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.shift-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.shift-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.shift-alert { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.shift-alert svg { flex: none; }
.shift-alert a { color: inherit; font-weight: 600; }
@media (max-width: 860px) {
  .side-foot { display: none; }
  .shift-alert { padding: 8px 16px; }
}

/* Строка «Синхронизация» в плашке тестового режима: жёлтая, если зеркало отстаёт */
.mirror .sync-stale { color: var(--warn); font-weight: 600; }

/* Экран «Заявки» (задача 19): то, чего не было в макете */
a.tk { color: inherit; text-decoration: none; }
.q-sels-lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.q-sels-lead .sel:last-of-type { grid-column: 1 / -1; }
.q-more { padding: 14px 16px; display: flex; justify-content: center; }
.work-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.work-empty .icon { width: 28px; height: 28px; }
.msg.note { align-self: flex-end; background: var(--warn-soft); border: 1px dashed var(--line-2); border-radius: 14px 14px 4px 14px; }
/* Общий класс .note (мелкая серая подпись) не должен гасить заметку в переписке: текст как у обычного сообщения */
.msg.note { font-size: inherit; color: var(--ink); }
.msg-tag { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.msg-more summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; margin-top: 6px; }
.msg a.att { text-decoration: none; }
.msg a.att:hover { color: var(--accent-ink); border-color: var(--accent); }
.ai-btns .ai-yes { grid-column: 1 / -1; }
.ai-btns .ai-yes .btn { width: 100%; height: 44px; }
.ai-btns a.btn { text-decoration: none; }
.side-actions { margin-top: 12px; }
.side-actions form .btn { width: 100%; }
.why .input { height: 38px; }

/* ---------- Доработки 25.10: узкое меню, одна строка плашек, страница без общей прокрутки ---------- */
body { margin: 0; }
.app { height: 100vh; overflow: hidden; grid-template-columns: 64px minmax(0, 1fr); transition: grid-template-columns 160ms cubic-bezier(0.4, 0, 0.2, 1); }
.side { padding: 14px 10px 12px; gap: 14px; overflow-y: auto; overflow-x: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-direction: column; }
.logo { padding: 0; }
.side-toggle { width: 32px; height: 32px; }
.side-t, .when-wide { display: none; }
.when-narrow { display: inline-flex; }
.nav-item { justify-content: center; padding: 0; height: 40px; position: relative; gap: 10px; }
.nav-item .count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 16px; padding: 0 4px; font-size: 10px; margin: 0; }
.nav-sep { margin: 6px 4px; }
.side-foot { gap: 10px; align-items: center; }
.shift { padding: 0; justify-content: center; }
.shift-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.shift-btn.btn-primary { background: var(--surface-2); border-color: var(--line-2); }
.me { flex-direction: column; padding: 10px 0 0; gap: 6px; }
.me-link { flex: none; }

html.side-wide .app { grid-template-columns: 216px minmax(0, 1fr); }
html.side-wide .side { padding: 16px 12px; }
html.side-wide .side-head { flex-direction: row; }
html.side-wide .side-t { display: initial; }
html.side-wide .when-wide { display: inline-flex; }
html.side-wide .when-narrow { display: none; }
html.side-wide .logo b { font-size: 17px; }
html.side-wide .nav-item { justify-content: flex-start; padding: 0 10px; }
html.side-wide .nav-item .soon { margin-left: auto; }
html.side-wide .nav-item .count { position: static; margin-left: auto; min-width: 22px; height: 20px; font-size: 11px; }
html.side-wide .side-foot { align-items: stretch; }
html.side-wide .shift { justify-content: space-between; padding: 0 4px; }
html.side-wide .shift-state { display: inline-flex; }
html.side-wide .shift-btn { width: auto; height: 32px; padding: 0 12px; border-radius: var(--radius-sm); }
html.side-wide .shift-btn.btn-primary { background: var(--accent); border-color: var(--accent); }
html.side-wide .me { flex-direction: row; padding: 10px 4px 0; }
html.side-wide .me-link { flex: 1; }
html.side-wide .me-text { display: block; }

.strip { padding: 6px 20px; gap: 12px; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.strip > span { overflow: hidden; text-overflow: ellipsis; }
.strip-warn { color: var(--warn); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.strip-warn:hover { text-decoration: underline; }
.top { padding: 10px 20px; }
.search { max-width: 480px; height: 38px; }

@media (max-width: 860px) {
  .app, html.side-wide .app { grid-template-columns: minmax(0, 1fr); height: 100vh; }
  .side, html.side-wide .side { flex-direction: row; overflow: visible; padding: 8px 12px; }
  .side-head { flex-direction: row; }
  .side-toggle, .side-foot { display: none; }
  .nav { flex-direction: row; }
  html.side-wide .side-t { display: none; }
  .nav-item, html.side-wide .nav-item { width: 40px; flex: none; padding: 0; justify-content: center; }
  .strip .sync { display: none; }
  .top { padding: 8px 12px; }
}
.mode-seg { margin-left: 0; }
.mode-seg button { height: 36px; padding: 0 18px; }

/* ---------- Заявки как в почте (25.10): список на всю ширину и страница заявки ---------- */
.tlist { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); }
.tl-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
/* Чипы и фильтры всегда в одной строке (правки Максима 25.10). Чипы не сжимаются, сужаются фильтры; перенос — только на телефоне */
.tl-chips { display: flex; gap: 6px; flex-wrap: nowrap; flex: none; }
.tl-chips::-webkit-scrollbar { display: none; }
.tl-chips .chip { height: 32px; padding: 0 12px; font-size: 13px; }
.tl-filters { display: flex; gap: 8px; margin-left: auto; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.tl-filters .sel { height: 34px; flex: 0 1 158px; width: auto; min-width: 92px; text-overflow: ellipsis; }
.tlist .q-found { display: flex; gap: 12px; align-items: center; }
.tl-rows { flex: 1; min-height: 0; overflow-y: auto; }
.tl-row { display: grid; grid-template-columns: 22px minmax(140px, 220px) minmax(0, 1fr) 140px 112px minmax(120px, 190px) 104px; align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.tl-row:hover { background: var(--surface-2); }
.tl-row.done { opacity: 0.65; }
.tl-ic .icon { width: 16px; height: 16px; color: var(--ink-3); }
.tl-client { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-subj { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-mark { color: var(--ink-3); font-size: 12px; }
.tl-num, .tl-ch, .tl-time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-time { text-align: left; }

.tp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tp-head { display: flex; align-items: flex-start; gap: 16px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tp-head .btn { flex: none; text-decoration: none; }
.tp-title { min-width: 0; flex: 1; }
.tp-title h2 { margin: 2px 0; font-size: 17px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tp-title .sub { color: var(--ink-2); font-size: 13px; }
.tp-head .pill { flex: none; }
.tp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.tp-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tp .thread { padding: 18px 28px; }
.tp .msg { max-width: min(880px, 92%); }
.tp .msg p { overflow-wrap: anywhere; }
.tp .panel { background: var(--bg); }
.composer-bar { flex-direction: row; align-items: center; gap: 8px; padding: 10px 28px; flex-wrap: wrap; }
.comp-open { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 13px; background: var(--surface); }
.comp-open:hover { border-color: var(--accent); color: var(--accent-ink); }
.comp-open .icon { width: 15px; height: 15px; color: var(--ink-3); }
.comp-bar-note { margin-left: auto; }
.tp .composer:not(.composer-bar) { padding: 12px 28px 16px; }
.tp .composer textarea { min-height: 0; }
.composer .tabs a.tab { text-decoration: none; }
.comp-close { margin-left: auto; font-size: 13px; }

@media (max-width: 1100px) {
  .tl-row { grid-template-columns: 22px minmax(120px, 180px) minmax(0, 1fr) 110px 96px; }
  .tl-num, .tl-ch { display: none; }
  .tp-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .tp .thread { overflow: visible; flex: none; }
  .tp .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}
@media (max-width: 860px) {
  .tl-bar { padding: 10px 12px; flex-wrap: wrap; }
  .tl-filters { margin-left: 0; width: 100%; }
  .tl-filters .sel { flex: 1; min-width: 0; }
  .tl-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client time" "subj subj" "st st"; gap: 4px 10px; padding: 12px; }
  .tl-ic { display: none; }
  .tl-client { grid-area: client; }
  .tl-time { grid-area: time; }
  .tl-subj { grid-area: subj; }
  .tl-st { grid-area: st; }
  .tp-head { padding: 10px 12px; flex-wrap: wrap; }
  .tp .thread, .tp .composer:not(.composer-bar), .composer-bar { padding-left: 12px; padding-right: 12px; }
  .comp-bar-note { display: none; }
}
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
html.side-wide .app { grid-template-columns: 232px minmax(0, 1fr); }
html.side-wide .nav-item .soon { display: none; }
.nav-item.is-soon { color: var(--ink-3); }
.logo b { white-space: nowrap; }

/* Шапка заявки: статус и «Взять себе» справа (25.10) */
.tp-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-title .sub b { font-weight: 600; color: var(--ink); }
@media (max-width: 860px) { .tp-actions { width: 100%; } }

/* Файлы (25.10): миниатюры картинок в переписке, список файлов справа, неактивная скрепка в поле ответа */
.msg .att-img { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px; margin-right: 6px; }
.msg .att-img img { display: block; max-width: 220px; max-height: 160px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.msg .att-img .att-name { display: inline-flex; align-items: center; gap: 6px; }
.msg .att-img.broken img { display: none; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.files li { display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.files a { color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.files a:hover { text-decoration: underline; }
.comp-clip { width: 32px; height: 32px; }
.comp-clip:disabled { opacity: 0.45; cursor: not-allowed; }
.tl-mention { font-style: italic; }
/* Пометки в строке списка не обрезаются вместе с длинной темой: стоят перед ней */
.tl-subj { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-subj-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-tag { flex: none; font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

/* Журнал решений (задача 22): история в карточке заявки и «Аналитика → Журнал решений» */
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.hist li { display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.hist b { font-weight: 600; }
.hist-more { margin-top: 8px; }
.hist-more summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; }
.hist-more[open] summary { margin-bottom: 8px; }
.kit.wide { max-width: 1240px; }
.jr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jr-filters .sel { height: 34px; min-width: 150px; }
.jr-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.jr-date .input { height: 34px; width: auto; }
.jr-xlsx { margin-left: auto; }
.jr-total { margin: 14px 0 8px; }
.jr td { vertical-align: top; }
.jr-when { white-space: nowrap; }
.jr-subj { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-diff { margin-top: 6px; font-size: 13px; }
.jr-diff summary { cursor: pointer; color: var(--accent-ink); }
.diff { margin-top: 8px; max-width: 520px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); line-height: 1.5; overflow-wrap: anywhere; }
.diff del { color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.diff ins { color: var(--ok); background: var(--ok-soft); text-decoration: none; }
.diff del + ins { margin-left: 4px; }
@media (max-width: 860px) { .jr-filters .sel { flex: 1; min-width: 0; } .jr-xlsx { margin-left: 0; } }

/* Письмо в переписке (задача 84): подпись мелко, цитата свёрнута, значения копируются кликом */
.msg .msg-sign { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.msg-quote { margin-top: 10px; }
.msg-quote summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
.msg-quote[open] summary { margin-bottom: 6px; }
.msg-quote p { padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); font-size: 13px; }
.msg .cp { font-family: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; background: var(--accent-soft); color: var(--accent-ink); border-radius: 4px; padding: 0 3px; cursor: copy; overflow-wrap: anywhere; }
.msg .cp:hover { box-shadow: 0 0 0 1px var(--accent); }
.msg .cp.copied { background: var(--ok-soft); color: var(--ok); }
.msg .msg-sign .cp, .msg-quote .cp { background: transparent; box-shadow: inset 0 -1px 0 var(--line-2); color: inherit; }
.msg .msg-sign .cp:hover, .msg-quote .cp:hover { color: var(--accent-ink); box-shadow: inset 0 -1px 0 var(--accent); }
.msg-link { color: var(--accent-ink); overflow-wrap: anywhere; }

/* Дочерние обращения (задача 86): блок справа в заявке и пометка в списке */
.kids { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kid-link { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.kid-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.kid-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.tl-tag-req { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }

/* Срок ожидания клиента (задача 88): под статусом в списке — «закрыть через N раб. дн.», «сегодня», «пора закрыть» */
.tl-st { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.due { font-size: 11.5px; line-height: 1.2; white-space: nowrap; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.due-warn { color: var(--warn); font-weight: 600; }
.due-bad { color: var(--bad); font-weight: 600; }

/* Включённый фильтр подсвечен, рядом «Сбросить фильтры» (правка Максима 25.10) */
.sel.is-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.tl-reset { height: 34px; gap: 4px; padding: 0 10px; white-space: nowrap; flex: none; }
.tl-reset .icon { width: 14px; height: 14px; }

/* Заголовки колонок и сортировка (задача 91). Сетка — как у строки заявки. */
.tl-head { display: grid; grid-template-columns: 22px minmax(140px, 220px) minmax(0, 1fr) 140px 112px minmax(120px, 190px) 104px; align-items: center; gap: 14px; padding: 6px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.tl-h { font-size: 12px; font-weight: 600; color: var(--ink-3); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.tl-h:hover, a.tl-h.on { color: var(--accent-ink); }
.tl-date { display: flex; justify-content: flex-start; align-items: center; gap: 2px; overflow: visible; }
.tl-date-menu { position: relative; }
.tl-date-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--ink-3); }
.tl-date-menu summary::-webkit-details-marker { display: none; }
.tl-date-menu summary:hover { background: var(--line); color: var(--ink); }
.tl-date-menu summary .icon { width: 14px; height: 14px; }
.tl-menu { position: absolute; right: 0; top: 24px; min-width: 200px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: 0 12px 28px -10px rgba(20, 21, 26, 0.3); padding: 4px; display: flex; flex-direction: column; z-index: 5; }
.tl-menu a { padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--ink); text-decoration: none; text-align: left; font-weight: 500; }
.tl-menu a:hover { background: var(--surface-2); }
.tl-menu a.on { color: var(--accent-ink); background: var(--accent-soft); }
@media (max-width: 1100px) { .tl-head { grid-template-columns: 22px minmax(120px, 180px) minmax(0, 1fr) 110px 96px; } }
@media (max-width: 860px) { .tl-head { display: none; } }
/* «Сбросить сортировку» — значок в начале строки заголовков, виден, только если сортировка не обычная */
.tl-sort-reset { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--accent-ink); }
.tl-sort-reset:hover { background: var(--accent-soft); }
.tl-sort-reset .icon { width: 14px; height: 14px; }
/* Мало места: у сброса остаётся только «×», у чипов меньше отступы — строка остаётся одна */
@media (max-width: 1560px) { .tl-reset-t { display: none; } .tl-reset { width: 34px; padding: 0; justify-content: center; } }
@media (max-width: 1320px) { .tl-chips { gap: 4px; } .tl-chips .chip { padding: 0 9px; font-size: 12.5px; } .tl-bar { gap: 8px; } }
@media (max-width: 860px) { .tl-chips { flex-wrap: wrap; flex: 1 1 100%; } }


/* «Главная» (задача 21) */
.home-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.home-day { margin: 0; color: var(--ink-2); font-size: 15px; }
.home-note { margin: -12px 0 0; }
.home-group-h { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tiles.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles.tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles.tiles-5 { grid-template-columns: minmax(0, 1fr); } }
.tile { outline: none; }
.tile:focus-visible { border-color: var(--accent); }
.tile-link { color: inherit; text-decoration: none; transition: border-color 0.14s; }
.tile-link:hover { border-color: var(--line-2); }
.home-em { font-style: normal; font-weight: 600; color: var(--warn); }
/* Подсказки в стиле PIM: тёмная плашка, Geologica 13 px, скругление 8 px, мягкая тень.
   Плашка создаётся только при наведении или фокусе (скрытая не растягивает страницу) и плавно появляется
   через 300 мс: 210 мс, замедление в конце, без отскока. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; z-index: 30; left: 16px; top: calc(100% + 8px);
  width: max-content; max-width: 280px; padding: 8px 12px; border-radius: 8px;
  background: var(--ink); color: var(--surface);
  font: 400 13px/1.4 var(--font); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  box-shadow: 0 3px 10px -2px rgba(20, 21, 26, 0.12), 0 10px 16px -3px rgba(20, 21, 26, 0.16);
  pointer-events: none;
  animation: tip-in 210ms cubic-bezier(0.2, 0, 0, 1) 300ms both;
}
@keyframes tip-in { from { opacity: 0; translate: 0 -4px; } to { opacity: 1; translate: 0 0; } }
/* У крайней правой плитки ряда плашка прижата к правому краю, чтобы не уходить за экран */
.tiles > [data-tip]:last-child:hover::after, .tiles > [data-tip]:last-child:focus-visible::after { left: auto; right: 16px; }
[data-tip-pos="top"]:hover::after, [data-tip-pos="top"]:focus-visible::after {
  top: auto; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap;
}
.home-bar:first-child:hover::after, .home-bar:first-child:focus-visible::after { left: 0; transform: none; }
.home-bar:last-child:hover::after, .home-bar:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover .row-t { color: var(--accent-ink); }
.row form { margin: 0; flex: none; }
.home-wait { font-size: 13px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.home-wait.is-long { color: var(--warn); font-weight: 600; }
.home-person { display: flex; align-items: center; gap: 8px; font-weight: 600; }
/* Столбики «по часам / по дням»: один ряд — один цвет, число видно при наведении */
.home-chart { display: flex; align-items: stretch; gap: 2px; height: 220px; }
.home-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.home-bar-col { flex: 1; width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-2); }
.home-bar-fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.home-bar:hover .home-bar-fill, .home-bar:focus .home-bar-fill { opacity: 0.8; }
.home-bar-n { font-size: 11px; font-weight: 600; color: var(--ink-2); visibility: hidden; font-variant-numeric: tabular-nums; }
.home-bar:hover .home-bar-n, .home-bar:focus .home-bar-n { visibility: visible; }
.home-bar-l { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.home-bar-l.is-skip { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { [data-tip]:hover::after, [data-tip]:focus-visible::after { animation: none; } }
.strip-view-as { display: inline-flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
/* База знаний (задача 48) */
.kb-toolbar { flex-wrap: wrap; gap: 12px; }
.kb-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; margin: 0; }
.kb-filters .input.kb-q { width: 280px; max-width: 100%; height: 34px; }
.kb-filters .sel { height: 34px; max-width: 260px; }
.kb-count { margin: 0 0 8px; }
.kb-tbl th:nth-child(n+2):not(:last-child), .kb-tbl td:nth-child(n+2):not(:last-child) { width: 1%; white-space: nowrap; }
.kb-preview { margin-top: 2px; max-width: 760px; }
.kb-tbl .topics-act { width: 1%; white-space: nowrap; text-align: right; }
.kb-pill { margin-left: 8px; vertical-align: 1px; }
.kb-topic-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kb-ph { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.kb-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kb-body { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.kb-body p { margin: 0 0 10px; }
.kb-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; max-height: 360px; overflow: auto; }
.kb-topic-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kb-topic-group legend { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 4px; }
.kb-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.kb-check input { accent-color: var(--accent); margin: 2px 0 0; flex: none; }
/* Шаблоны в поле ответа */
.kb-pick { border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kb-pick[hidden] { display: none; }
.kb-pick-head { display: flex; align-items: center; gap: 12px; }
.kb-pick-head .input { flex: 1; height: 34px; }
.kb-pick-head .link { font-size: 13px; white-space: nowrap; }
.kb-pick-list { max-height: 240px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.kb-pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.kb-pick-item[hidden] { display: none; }
.kb-pick-item:hover, .kb-pick-item:focus-visible { background: var(--accent-soft); outline: none; }
.kb-pick-t { font-weight: 600; font-size: 14px; }
.kb-pick-t .pill { margin-left: 6px; vertical-align: 1px; }
.comp-kb-empty { font-size: 13px; }
.kb-body a, .kb-preview a, .kb-side .note a { color: var(--accent-ink); overflow-wrap: anywhere; }
