/* ============ Портал задач · клиентский кабинет ============ */
:root {
    /* Базовые цвета интерфейса — нейтральные синие SaaS-акценты, переопределяемые цветом тенанта */
    --blue: #2563eb;          /* primary, акценты, активное */
    --blue-dark: #1d4ed8;     /* hover/press */
    --blue-soft: #eff6ff;     /* светлый тинт (активные состояния, info-фон) */
    --mint: #dbeafe;          /* активная вкладка/чип */
    --ink: #121315;           /* заголовки */
    --text: #252B36;          /* основной текст */
    --muted: #5B6472;         /* вторичный текст, нав-пункты */
    --muted2: #9AA0AA;        /* подписи, иконки, плейсхолдеры */
    --line: #EBEDF0;          /* бордеры, разделители */
    --line2: #F0F1F3;         /* бордеры строк */
    --border: #E3E6EA;        /* бордеры контролов */
    --bg: #F7F8FA;            /* фон рабочей зоны */
    --card: #FFFFFF;
    --surface: #F2F4F6;       /* шапка таблицы, чипы, вспомогательные подложки */
    --hover: #F8FAFC;         /* наведение на строку/пункт списка */
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 1px 2px rgba(18, 19, 21, .04);
    --shadow-lg: 0 8px 30px rgba(18, 19, 21, .10);
    --shadow-btn: 0 2px 6px rgba(20, 166, 91, .28);
    /* Семантика статусов/типов (штатные шкалы ChatApp) */
    --c-info: #0958D9;   --c-info-bg: #E6F7FF;   --c-info-dot: #1677FF;   /* Открыта / Запрос / info */
    --c-amber: #AD6800;  --c-amber-bg: #FFFBE6;  --c-amber-dot: #FAAD14;  /* В работе / Средний */
    --c-red: #CF1322;    --c-red-bg: #FFF1F0;                             /* Баг / Высокий / отклонено */
    --c-green: #068B47;  --c-green-bg: #E4FFF1;  --c-green-dot: #14A65B;  /* Закрыто / одобрено */
    --c-purple: #722ED1; --c-purple-bg: #F9F0FF;                          /* Идея */
    /* ── Единые размеры кнопок ── */
    --btn-h: 38px;  --btn-pad-y: 10px;  --btn-pad-x: 16px; --btn-r: 10px; --btn-fs: 13.5px;
    --btn-h-sm: 32px; --btn-pad-y-sm: 6px; --btn-pad-x-sm: 12px; --btn-fs-sm: 12px; --btn-r-sm: 8px;
    --btn-h-lg: 46px; --btn-pad-y-lg: 13px; --btn-fs-lg: 14px;
    /* ── Единые размеры полей ── */
    --field-pad-y: 11px; --field-pad-x: 13px; --field-r: 11px; --field-fs: 13.5px;
    --field-pad-y-sm: 8px; --field-pad-x-sm: 11px; --field-fs-sm: 12.5px; --field-r-sm: 9px;
}
/* ── Тёмная тема ──────────────────────────────────────────────────────────────
   Переопределяем ТОЛЬКО токены: вся вёрстка уже ходит через переменные, поэтому
   отдельных «тёмных» правил под каждый блок не нужно. Атрибут ставит сервер по
   cookie и только на клиентских страницах — админка своей темы не имеет и остаётся
   светлой. Зелёный бренд на тёмном фоне выцветает, поэтому берём его светлее.
   Фоны статусов не инвертируем, а гасим до тёмных: цветной текст на них читается,
   а пастельные плашки на тёмном слепили бы. */
:root[data-theme="dark"] {
    --blue: #2ECC77;
    --blue-dark: #6EE7A8;
    --blue-soft: #16301F;
    --mint: #1C4530;
    --ink: #F8FAFC;
    --text: #D7DBE0;
    --muted: #9BA3AE;
    --muted2: #737C88;
    --line: #2A2F37;
    --line2: #22262D;
    --border: #333944;
    --bg: #15181C;
    --card: #1B1F24;
    --surface: #22262D;
    --hover: #242931;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
    --shadow-btn: 0 2px 6px rgba(46, 204, 119, .25);
    --c-info: #7CB4FF;   --c-info-bg: #16243A;   --c-info-dot: #4C9AFF;
    --c-amber: #F3C46B;  --c-amber-bg: #322614;  --c-amber-dot: #E0A93C;
    --c-red: #FF8A80;    --c-red-bg: #35191A;
    --c-green: #6EE7A8;  --c-green-bg: #16301F;  --c-green-dot: #2ECC77;
    --c-purple: #D6BCFA; --c-purple-bg: #2C1E45;
}
:root[data-theme="dark"] body { color-scheme: dark; }
/* Точечно — то, что зашито мимо токенов и на тёмном светилось бы белым пятном. */
:root[data-theme="dark"] .toast { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] .toggle__track, :root[data-theme="dark"] .mine-toggle__dot { background: var(--border); }
:root[data-theme="dark"] .btn--danger { border-color: #5B2626; color: #FF8A80; }
:root[data-theme="dark"] .votes--btn:hover { background: var(--blue-soft); }
:root[data-theme="dark"] .cat-tag, :root[data-theme="dark"] .cat-item { color: var(--c-purple); background: var(--c-purple-bg); border-color: #3B2A55; }
:root[data-theme="dark"] .qv__backdrop { background: rgba(0, 0, 0, .6); }
/* Фото и превью на тёмном бьют по глазам в полную яркость. */
:root[data-theme="dark"] .comment-photos img, :root[data-theme="dark"] .photo-preview img { filter: brightness(.9); }

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-y: scroll; }
body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
@keyframes authIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ============ Анимации интерфейса (светлый минимализм; reduced-motion — в конце файла) ============ */
:root { --t-fast: 130ms; --t: 200ms; --t-slow: 360ms; --ease: cubic-bezier(.4,0,.2,1); --ease-out: cubic-bezier(.16,1,.3,1); }
html { scroll-behavior: smooth; }
@keyframes animIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Появление контента — мягкий общий fade БЕЗ сдвигов и stagger, чтобы переключение
   подвкладок не «дёргалось». main — только opacity (не ломает sticky-шапку/навигацию). */
main { animation: fadeIn 160ms var(--ease) both; }

/* Плавный интерактив везде: фон/цвет/бордер/тень + тактильное нажатие.
   Анимируем только дешёвые свойства (без width/height/top/left). */
.btn, .follow, .nav a, .tabs a, .userbox, .btn--logout, .btn--unsub, .mine-toggle,
.tbl__row, .tbl__title, .tbl__key, .tbl__desc, .back-link, .cmt-link, .photo-attach, .auth a {
    transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
                color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
input, select, textarea, .search input { transition: border-color var(--t-fast) var(--ease), box-shadow var(--t) var(--ease); }
.btn:active, .follow:active, .mine-toggle:active, .photo-attach:active, .btn--unsub:active { transform: scale(.97); }
.btn--block:active { transform: scale(.99); }

/* Полировка hover */
.btn--primary:hover { box-shadow: 0 4px 14px rgba(20,166,91,.32); }
.tbl__row:hover { background: var(--hover); }
.tbl__title:hover { color: var(--blue); }

/* Видимый фокус с клавиатуры (доступность) */
a:focus-visible, .btn:focus-visible, .follow:focus-visible, .tabs a:focus-visible,
.nav a:focus-visible, .mine-toggle:focus-visible, .userbox:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Тосты-уведомления ── */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.22); opacity: 0; transform: translateY(10px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); max-width: 90vw; }
.toast.in { opacity: 1; transform: none; }
.toast--ok { background: var(--blue); }

/* ── Спиннер на кнопках при отправке формы ── */
@keyframes spin { to { transform: rotate(360deg); } }
button.is-loading { color: transparent !important; pointer-events: none; position: relative; }
button.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; }
.btn--ghost.is-loading::after, .btn--logout.is-loading::after { border-color: var(--muted); border-right-color: transparent; }

/* ── Кнопка очистки поиска ── */
.search__clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: none; background: var(--surface); color: var(--muted); border-radius: 50%; cursor: pointer; font-size: 11px; line-height: 1; display: none; align-items: center; justify-content: center; padding: 0; }
.search.has-val .search__clear { display: inline-flex; }
.search.has-val input { padding-right: 36px; }
.search__clear:hover { background: var(--line); color: var(--ink); }

/* ── Кнопка «Наверх» ── */

/* ── Подсветка нового комментария (после отправки, по якорю) ── */
@keyframes cHighlight { 0% { background: var(--blue-soft); } 100% { background: transparent; } }
.comment:target { animation: cHighlight 1.8s var(--ease) both; border-radius: 10px; }

/* ── Большие кнопки действий (детальная): Следить/Голосовать, состояние .is-on ── */
.act-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: var(--btn-h-lg); padding: var(--btn-pad-y-lg) var(--btn-pad-x); border-radius: var(--btn-r); font-size: var(--btn-fs); font-weight: 600; line-height: 1.2; font-family: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text); transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.act-btn:active { transform: scale(.985); }
.act-follow { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-btn); }
.act-follow:hover { filter: brightness(0.92); }
.act-follow.is-on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); box-shadow: none; }
.act-vote { background: var(--card); border-color: var(--border); color: var(--text); }
.act-vote:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.act-vote.is-on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

/* ── Богатое пустое состояние списка ── */
.empty--rich { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 46px 20px; }
.empty--rich .empty__ic { font-size: 32px; }

.ca-screen { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.ca-body { flex: 1; min-width: 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 32px 44px; }
.container--narrow { max-width: 680px; }
.container--wide { max-width: 1400px; }

/* ── Логотип ── */
.logo { display: flex; align-items: center; gap: 11px; }
.logo__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 8px; flex: none; }
.logo__mark i { height: 3px; border-radius: 2px; background: var(--card); display: block; }
.logo__mark i:nth-child(2) { background: rgba(255,255,255,.7); width: 68%; }
.logo__mark i:nth-child(3) { background: rgba(255,255,255,.45); width: 86%; }
.logo__name { font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: -.01em; line-height: 1.15; }
.logo__sub { font-size: 11px; color: var(--muted2); font-weight: 500; }

/* ── Верхняя навигация разделов (ChatApp — папочные card-вкладки) ── */
.ca-tabs { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.ca-tabs__inner { max-width: 1080px; margin: 0 auto; padding: 11px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.ca-tabs__inner--wide { max-width: 1400px; }
.ca-tabs__nav { display: flex; gap: 0; min-width: 0; overflow-x: auto; }
.ca-tabs__nav::-webkit-scrollbar { height: 0; }
.ca-tabs__nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; background: transparent; border-radius: 8px; border: 1px solid transparent; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.ca-tabs__nav a:hover { color: var(--ink); background: rgba(18,19,21,.04); }
.ca-tabs__nav a.is-active { color: var(--blue); font-weight: 600; background: var(--card); border-color: var(--line); box-shadow: 0 1px 2px rgba(18,19,21,.04); }
.ca-tabs__user { display: flex; align-items: center; gap: 10px; margin: 0; flex: none; }

/* ── Шапка-подкладка: серая полоса с заголовком и вкладками. Неактивные вкладки
   сливаются с подкладкой (только серый текст); активная = белый фон контента ── */
.ca-header { background: var(--surface); }
.ca-header__inner { max-width: 1080px; margin: 0 auto; padding: 14px 32px 0; }
.ca-utility { display: flex; justify-content: flex-end; align-items: center; min-height: 18px; margin-bottom: 2px; }
.ca-nav { display: flex; gap: 0; margin-top: 12px; flex-wrap: wrap; }
.ca-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; background: transparent; border-radius: 10px 10px 0 0; }
.ca-nav a:hover { color: var(--blue-dark); }
.ca-nav a.is-active { color: var(--blue); font-weight: 600; background: var(--card); }
.ca-body { background: var(--card); }
/* Строка действий страницы (счётчик/кнопки) — в белом контенте */
.content-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.nav__badge { font-size: 11px; font-weight: 600; color: var(--blue-dark); background: var(--mint); padding: 1px 7px; border-radius: 20px; }
.userbox { display: flex; align-items: center; gap: 9px; padding: 4px 8px; border-radius: 10px; cursor: pointer; }
.userbox:hover { background: var(--bg); }
.userbox__name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.avatar { border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.avatar--lg { width: 60px; height: 60px; font-size: 21px; }

main { padding: 0; }

/* ── Кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--btn-h); padding: var(--btn-pad-y) var(--btn-pad-x); border: 1px solid transparent; border-radius: var(--btn-r); font-size: var(--btn-fs); font-weight: 600; line-height: 1.2; font-family: inherit; cursor: pointer; background: var(--card); color: var(--text); white-space: nowrap; }
.btn--primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: var(--shadow-btn); }
.btn--primary:hover { filter: brightness(0.92); color: #fff; border-color: var(--blue); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn--primary:disabled:hover { background: var(--blue); border-color: var(--blue); filter: none; }

/* ── Тумблер (стилизованный checkbox; НЕ .switch — тот занят объявлениями) ── */
/* flex: 0 0 auto — во flex-строках тумблер не сжимается, иначе nowrap-подпись
   вылезала бы поверх соседних полей. */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; flex: 0 0 auto; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track { position: relative; width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1; transition: background .15s ease; flex: 0 0 auto; }
.toggle__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s ease; }
.toggle input:checked + .toggle__track { background: var(--blue); }
.toggle input:checked + .toggle__track::after { left: 21px; }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle__label { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--card); color: var(--blue); border-color: var(--blue); }
.btn--danger { border-color: #fbd5d5; color: #dc2626; }
.btn--danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; box-shadow: 0 6px 16px rgba(220,38,38,.20); }
.btn--subtle { background: none; border-color: transparent; color: var(--muted); }
.btn--subtle:hover { color: var(--ink); background: var(--hover); }
.btn--subtle.btn--accent { color: var(--blue-dark); }
.btn--subtle.btn--accent:hover { color: var(--blue-dark); background: var(--blue-soft); }
.btn--block { width: 100%; }
.btn--sm { min-height: var(--btn-h-sm); padding: var(--btn-pad-y-sm) var(--btn-pad-x-sm); font-size: var(--btn-fs-sm); border-radius: var(--btn-r-sm); }
.btn--lg { min-height: var(--btn-h-lg); padding: var(--btn-pad-y-lg) var(--btn-pad-x); font-size: var(--btn-fs-lg); }
.btn--logout { min-height: var(--btn-h-sm); padding: var(--btn-pad-y-sm) var(--btn-pad-x-sm); border: 1px solid var(--line); color: var(--muted); font-size: var(--btn-fs-sm); border-radius: var(--btn-r-sm); }
.btn--logout:hover { background: var(--hover); color: var(--ink); }

/* ── Заголовок страницы ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; min-height: 50px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.page-sub { margin: 5px 0 0; color: var(--muted2); font-size: 13.5px; }
.page-total { font-size: 13px; color: var(--muted2); font-weight: 600; white-space: nowrap; }

/* ── Тулбар: поиск + фильтры ── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1 1 300px; min-width: 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.search input { width: 100%; padding: var(--field-pad-y) var(--field-pad-x) var(--field-pad-y) 38px; border: 1px solid var(--border); border-radius: var(--field-r); font-size: var(--field-fs); font-family: inherit; color: var(--ink); background: var(--card); }
.input, .select, textarea.input { padding: var(--field-pad-y) var(--field-pad-x); border: 1px solid var(--border); border-radius: var(--field-r); font-size: var(--field-fs); font-family: inherit; color: var(--ink); background: var(--card); }
.select { cursor: pointer; padding-right: calc(var(--field-pad-x) + 16px); }
.input:disabled, .select:disabled, textarea.input:disabled { background: var(--line2); border-color: var(--line); color: var(--muted2); cursor: not-allowed; }
textarea.input { width: 100%; resize: vertical; min-height: 90px; line-height: 1.5; }
/* Компактные поля (плотные строки админки/роудмапа) */
.input--sm, .select--sm, textarea.input--sm { padding: var(--field-pad-y-sm) var(--field-pad-x-sm); font-size: var(--field-fs-sm); border-radius: var(--field-r-sm); }
.select--sm { padding-right: calc(var(--field-pad-x-sm) + 14px); }
input:focus, select:focus, textarea:focus, .search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,166,91,.22); }
.mine-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; background: var(--card); border: 1px solid var(--border); color: var(--muted); }
.mine-toggle.is-on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.mine-toggle__dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.mine-toggle.is-on .mine-toggle__dot { background: var(--blue); }

/* ── Табы-фильтры (статусы, подвкладки) — чипы, активный с белой заливкой ── */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 0 0 12px; margin-bottom: -1px; font-size: 13.5px; font-weight: 500; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--blue); }
.tabs__count { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; line-height: 1.3; }
.tabs a.is-active .tabs__count { background: var(--blue-soft); color: var(--blue); }
/* Подвкладки (в кабинете «Мои задачи») — отдельной строкой; стиль «пилюли»,
   чтобы отличались от основных вкладок-подчёркиваний (а не два underline-ряда). */
.subtabs-row { display: block; margin: 6px 0 18px; }
.tabs--sub { margin-bottom: 0; border-bottom: none; gap: 6px; }
.tabs--sub a { padding: 6px 13px; margin-bottom: 0; border-bottom: none; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tabs--sub a:hover { color: var(--ink); background: #E9ECEF; }
.tabs--sub a.is-active { color: #fff; background: var(--ink); border-color: var(--ink); border-bottom-color: var(--ink); }
.tabs--sub a.is-active .tabs__count { background: rgba(255,255,255,.22); color: #fff; }

/* ── Таблица обращений ── */
.tbl { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
/* Порядок колонок: голоса слева, номер (ключ) справа. */
.tbl__cols { display: grid; grid-template-columns: 84px 92px minmax(0,1fr) 118px minmax(0,1.7fr) 88px 76px; gap: 14px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line2); }
.tbl__cols div { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: normal; }
/* Строки многострочные (тема и описание переносятся) — содержимое равняем по верху. */
.tbl__row { display: grid; grid-template-columns: 84px 92px minmax(0,1fr) 118px minmax(0,1.7fr) 88px 76px; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line2); align-items: start; }
.tbl__row:last-child { border-bottom: none; }
.tbl__row:hover { background: var(--bg); }
/* Таблица с отдельной колонкой для временного решения (вкладка «Ошибки» в кабинете) */
.tbl--with-workaround .tbl__cols,
.tbl--with-workaround .tbl__row {
    grid-template-columns: 84px 92px minmax(0, 1fr) 118px minmax(0, 1.4fr) minmax(160px, 1.1fr) 88px 76px;
}
.tbl__wa-cell {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 1px;
}
.tbl__key { font-size: 13px; font-weight: 600; color: var(--text); padding-top: 2px; text-align: right; }
/* Название не обрезаем — в отличие от описания, оно показывается целиком. */
.tbl__title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.tbl__title:hover { color: var(--blue); }
/* Переносы из Jira в списке НЕ сохраняем: короткие строки исходника рвали абзац
   в лесенку и раздували высоту строки таблицы. Текст течёт по колонке и обрезается
   по числу строк — в списке нужен смысл, а не первая фраза; целиком читают в карточке. */
/* Базовый кламп — 3 строки (минимум и запасной вариант без JS). CSS не умеет «по
   высоте строки», поэтому app.js поднимает кламп до высоты, которую строке задали
   соседние ячейки (обычно длинный заголовок) — пустот под описанием не остаётся. */
.tbl__desc { font-size: 12.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.tbl__desc:hover { color: var(--text); }
.tbl__upd { font-size: 12.5px; color: var(--muted2); white-space: nowrap; padding-top: 2px; }
/* Заголовок «Голосов» равняем по числу под ним, иначе подпись слева, а бейдж справа. */
.tbl__cols div:last-child { text-align: right; }
.tbl__action { display: flex; justify-content: flex-start; }
.tbl__action form { margin: 0; }
/* Голосовать можно из списка: ради одного клика открывать карточку незачем. */
.votes--btn { gap: 3px; cursor: pointer; font-family: inherit; border: 1px solid var(--line2); background: var(--card); color: var(--muted); }
.votes--btn span { font-size: 11px; line-height: 1; }
.votes--btn:hover { border-color: var(--blue); color: var(--blue); background: #f5f8ff; }
.votes--btn.is-on { border-color: var(--blue); background: var(--blue); color: #fff; }
.votes--btn[data-busy] { opacity: .6; pointer-events: none; }
.tbl__row[data-preview] { cursor: pointer; }

/* Быстрый просмотр обращения со списка. Тело окна — те же блоки, что и у карточки
   (.detail__head/__body/__foot), поэтому своих правил тут минимум: только оболочка.
   Панель сама играет роль .detail__card, второй подложки внутри не заводим. */
.qv { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.qv[hidden] { display: none; }
.qv__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.qv__panel { position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(15,23,42,.24); }
.qv__x { position: absolute; top: 14px; right: 14px; z-index: 1; width: 30px; height: 30px; border: none; border-radius: 8px; background: transparent; color: var(--muted2); font-size: 15px; cursor: pointer; }
.qv__x:hover { background: var(--line2); color: var(--text); }
.qv__load { height: 180px; }
.qv__cat { font-size: 12px; color: var(--muted2); }
.qv__body .discussion__count { margin-left: 6px; }
/* В карточке действие одно и занимает всю ширину; тут их три — делим поровну,
   иначе кнопки разъезжаются по ширине текста. */
.qv__body .detail__actions > *, .detail__foot .detail__actions > * { flex: 1 1 0; }
body.is-locked { overflow: hidden; }

/* Окно-предупреждение (голос от организации уже отдан и т.п.) */
.warn-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,23,42,.45); }
.warn-modal__panel { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(15,23,42,.24); padding: 26px 28px; text-align: center; }
.warn-modal__panel h3 { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.warn-modal__panel p { margin: 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--text); }
.warn-modal__panel .btn { min-width: 140px; }
:root[data-theme="dark"] .warn-modal { background: rgba(0,0,0,.6); }

/* Модальное окно подтверждения (снятие голоса с ошибки и др.) */
.confirm-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: confirmFadeIn .15s ease-out; }
:root[data-theme="dark"] .confirm-modal { background: rgba(0,0,0,.6); }
.confirm-modal__panel { position: relative; width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(15,23,42,.24); padding: 28px 28px 24px; text-align: center; animation: confirmPopIn .15s ease-out; }
.confirm-modal__x { position: absolute; top: 14px; right: 14px; z-index: 1; width: 30px; height: 30px; border: none; border-radius: 8px; background: transparent; color: var(--muted2); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.confirm-modal__x:hover { background: var(--line2); color: var(--text); }
.confirm-modal__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--c-red-bg); color: var(--c-red); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.confirm-modal__title { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.confirm-modal__text { margin: 0 0 22px; font-size: 14px; line-height: 1.55; color: var(--text); }
.confirm-modal__actions { display: flex; gap: 12px; justify-content: center; }
.confirm-modal__actions .btn { flex: 1 1 0; min-height: 40px; }
@keyframes confirmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirmPopIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Счётчик голосов в списке: тот же счёт, что на карточке и в Jira «Кол-во клиентов». */
.votes { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 3px 9px; border-radius: 999px; background: var(--line2); color: var(--muted); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Бейджи типа (Идея/Баг/Запрос/Жалоба) — без точки, плоский фон ── */
.type-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.type--task { background: var(--c-green-bg); color: var(--c-green); }
.type--bug { background: var(--c-red-bg); color: var(--c-red); }
.type--request, .type--story { background: var(--c-info-bg); color: var(--c-info); }
.type--epic { background: var(--c-purple-bg); color: var(--c-purple); }
.type--sub, .type--default { background: var(--line2); color: var(--muted); }

/* ── Бейджи статуса (пилюля + точка), по категории ── */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.status::before { content: ""; width: 6.5px; height: 6.5px; border-radius: 50%; background: var(--muted2); }
.status--new { background: var(--c-info-bg); color: var(--c-info); }
.status--new::before { background: var(--c-info-dot); }
.status--progress { background: var(--c-amber-bg); color: var(--c-amber); }
.status--progress::before { background: var(--c-amber-dot); }
.status--done { background: var(--c-green-bg); color: var(--c-green); }
.status--done::before { background: var(--c-green-dot); }
.status--rejected { background: var(--c-red-bg); color: var(--c-red); }
.status--rejected::before { background: var(--c-red); }
.status--feedback { background: #f3e8ff; color: #6d28d9; }
.status--feedback::before { background: #8b5cf6; }
.status--review { background: #ecfeff; color: #0e7490; }
.status--review::before { background: #06b6d4; }
.status--default { background: var(--line2); color: var(--muted); }

/* ── Follow-кнопка ── */
.follow { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 112px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.follow:hover { border-color: var(--blue); color: var(--blue); }
.follow.is-sub { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.follow.is-sub:hover { background: var(--blue-soft); opacity: 0.9; }

.empty { padding: 60px 0; text-align: center; color: var(--muted2); font-size: 14px; }

/* ── Карточка задачи (detail) ── */
.detail { max-width: 820px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }
.detail__card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.detail__head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; padding: 26px 30px 0; }
.detail__key { font-size: 13px; font-weight: 600; color: var(--blue); }
.detail__body { padding: 14px 30px 26px; }
.detail__title { margin: 8px 0 22px; font-size: 24px; font-weight: 700; line-height: 1.25; color: var(--ink); letter-spacing: -.01em; text-align: center; }
.section-label { font-size: 11.5px; font-weight: 600; color: var(--muted2); margin-bottom: 8px; }
/* Степпер статуса (детальная) — крупный, по центру, подпись под кружком */
.stepper { display: flex; align-items: flex-start; justify-content: center; max-width: 640px; margin: 0 auto 26px; }
.stepper__step { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 96px; }
.stepper__c { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; background: var(--card); border: 2px solid #D7DAE0; color: #9AA0A8; }
.stepper__c.is-done { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper__c.is-current { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--blue-soft); }
.stepper__c.is-rejected { background: var(--c-red); border-color: var(--c-red); color: #fff; box-shadow: 0 0 0 5px var(--c-red-bg); }
.stepper__cap { font-size: 13px; font-weight: 600; margin-top: 11px; text-align: center; color: var(--muted2); }
.stepper__cap.is-done { color: var(--blue); }
.stepper__cap.is-rejected { color: var(--c-red); font-weight: 700; }
.stepper__l { flex: 1; height: 3px; border-radius: 2px; background: #E3E5E9; margin-top: 20.5px; }
.stepper__l.is-done { background: var(--blue); }
.stepper__l.is-rejected { background: var(--c-red); }
.detail__desc { margin: 0 0 24px; font-size: 14px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }
/* Даты отделяем воздухом, а не линейками: две черты вокруг узкой строки резали
   карточку на полосы и читались как пустой разделитель. */
/* Даты и счёт голосов по центру — и в карточке, и в быстром просмотре: блоки общие. */
.detail__dates { display: flex; gap: 40px; margin-top: 28px; justify-content: center; }
.detail__dates .k { font-size: 11.5px; font-weight: 600; color: var(--muted2); margin-bottom: 5px; }
.detail__dates .v { font-size: 13.5px; color: var(--text); font-weight: 500; }
.detail__foot { padding: 18px 26px; border-top: 1px solid var(--line2); }
.sub-count { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.sub-count b { color: var(--ink); font-weight: 700; }
.sub-count__ico { font-size: 14px; }

/* ── Обсуждение (комментарии) ── */
.discussion { margin-top: 20px; padding: 24px 26px; }
.discussion__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.discussion__head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.discussion__count { font-size: 12px; font-weight: 700; color: var(--blue-dark); background: var(--blue-soft); padding: 1px 9px; border-radius: 20px; }
.comments { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.comments__empty { font-size: 13.5px; color: var(--muted2); padding: 18px; text-align: center; background: var(--hover); border: 1px dashed var(--line2); border-radius: 12px; }
.comment { display: flex; gap: 12px; }
.comment__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.comment__main { flex: 1; min-width: 0; }
.comment__meta { display: flex; align-items: baseline; gap: 9px; margin-bottom: 3px; flex-wrap: wrap; }
.comment__author { font-size: 13.5px; font-weight: 600; color: var(--ink); }
/* Ответ сотрудника («Servicedesk Admin»): отличается от зелёных клиентских аватаров.
   Не через --ink: в тёмной теме этот токен почти белый, кружок светился белым пятном. */
.comment__avatar--staff { background: #121315; color: #fff; }
:root[data-theme="dark"] .comment__avatar--staff { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.comment__author--staff { color: var(--blue-dark); }
.comment__time { font-size: 12px; color: var(--muted2); }
.comment__replyto { font-size: 12px; color: var(--blue-dark); background: var(--blue-soft); padding: 1px 8px; border-radius: 20px; font-weight: 600; }
.comment__body { font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-wrap: break-word; }
.comment-form { border-top: 1px solid var(--line2); padding-top: 18px; }
.comment-form textarea { width: 100%; padding: var(--field-pad-y) var(--field-pad-x); border: 1px solid var(--border); border-radius: var(--field-r); font-size: var(--field-fs); font-family: inherit; color: var(--ink); background: var(--card); resize: vertical; line-height: 1.5; }
.comment-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,166,91,.22); }
.comment-form__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.photo-attach { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; user-select: none; }
.photo-attach:hover { color: var(--blue); }
.comment-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
/* Фото обращения — по центру колонки (в обсуждении они остаются слева, у аватара).
   Центрируем и ссылку-обёртку, и картинку ВНУТРИ неё: ширина <a> считается по
   естественной ширине изображения, а не по ужатой max-width, и без внутреннего
   центрирования картинка прижималась к левому краю своей же широкой ссылки. */
.detail__body .comment-photos, .qv__body .comment-photos { justify-content: center; margin: 10px 0 4px; }
.detail__body .comment-photos a, .qv__body .comment-photos a { display: flex; justify-content: center; max-width: 100%; }
.comment-photos img { max-width: min(100%, 380px); max-height: 320px; border-radius: 10px; border: 1px solid var(--line2); display: block; cursor: zoom-in; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
/* Над формой тянут файлы: lightbox.js вешает класс и зону сброса поверх формы.
   pointer-events: none — события drop/dragleave идут форме, зона не мигает. */
form.is-dragover { position: relative; }
.drop-zone { position: absolute; inset: -8px; z-index: 5; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--blue); border-radius: 12px; background: var(--blue-soft); color: var(--blue-dark); font-size: 14px; font-weight: 600; pointer-events: none; }
:root[data-theme="dark"] .drop-zone { background: rgba(20,166,91,.12); }
.photo-preview__item { position: relative; }
.photo-preview__item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); display: block; }
.photo-preview__x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: #dc2626; color: #fff; font-size: 10px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.photo-preview__x:hover { background: #b91c1c; }
/* Лайтбокс */
.lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, .88); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 30px; }
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; cursor: zoom-in; transition: transform .2s ease; }
.lightbox__img.is-zoom { transform: scale(1.9); cursor: zoom-out; }
.lightbox__close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.lightbox__close:hover { background: rgba(255, 255, 255, .3); }
.comment-form--inline { border: 1px solid var(--line2); background: var(--hover); border-radius: 11px; padding: 12px; margin-top: 10px; }
.comment-form--inline textarea { background: var(--card); }
.comment__actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; align-items: center; }
.cmt-link { background: none; border: 0; padding: 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); font-family: inherit; }
.cmt-link:hover { color: #dc2626; }
.cmt-link--muted { cursor: default; opacity: .6; }
.cmt-link--muted:hover { color: var(--muted); }
.cat-tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; padding: 3px 10px; border-radius: 6px; }
/* Пайплайн модерации (этапы) */
/* Карточки модерации */
.mod-card { margin-bottom: 14px; }
.mod-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mod-card__title { font-size: 16px; font-weight: 700; color: var(--ink); }
.mod-card__desc { font-size: 13.5px; color: var(--text); margin-top: 5px; white-space: pre-wrap; line-height: 1.55; }
.mod-card__author { font-size: 13px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line2); }
.mod-card__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
/* Существующее фото с кнопкой удаления (в редактировании) */
.att-item { position: relative; display: inline-block; }
.att-item__x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: #dc2626; color: #fff; font-size: 10px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.att-item__x:hover { background: #b91c1c; }
/* Бейдж ручного приоритета */
.prio { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; white-space: nowrap; }
.prio--1 { background: var(--line2); color: var(--muted); }
.prio--2 { background: var(--c-info-bg); color: var(--c-info); }
.prio--3 { background: var(--c-amber-bg); color: var(--c-amber); }
.prio--4 { background: var(--c-red-bg); color: var(--c-red); }
.prio--5 { background: var(--c-red); color: #fff; }
.cat-editor { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 8px 7px 14px; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 20px; font-size: 14px; font-weight: 600; color: #6d28d9; }
.cat-item__x { background: none; border: 0; cursor: pointer; color: #a78bfa; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 50%; font-family: inherit; }
.cat-item__x:hover { color: #dc2626; background: var(--card); }
.cmt-toggle { flex: 0 0 auto; }
.cmt-toggle[open] { flex: 1 1 100%; }
.cmt-toggle > summary { list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; display: inline-flex; align-items: center; gap: 4px; }
.cmt-toggle > summary::-webkit-details-marker { display: none; }
.cmt-toggle > summary::before { content: ""; }
.cmt-toggle > summary:hover { color: var(--blue); }
.cmt-toggle[open] > summary { color: var(--blue); margin-bottom: 2px; }
.comment-replies { margin: 14px 0 0 48px; padding-left: 16px; border-left: 2px solid var(--line2); display: flex; flex-direction: column; gap: 16px; }

/* Счётчики и действия на карточке обращения */
.counts { display: flex; gap: 18px; margin-bottom: 12px; flex-wrap: wrap; justify-content: center; }
.counts__item { font-size: 13px; color: var(--muted); }
.counts__item b { color: var(--ink); font-weight: 700; }
.detail__actions { display: flex; gap: 10px; }
.detail__actions form { display: flex; }
.detail__actions .btn { width: 100%; }
.btn--vote { border: 1px solid var(--border); background: var(--card); color: var(--text); }
.btn--vote:hover { border-color: #86efac; background: #f0fdf4; color: #15803d; }

/* ── Админка: карточки данных, аналитика, боты ── */
.kv { display: flex; flex-direction: column; }
.kv__row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line2); font-size: 13.5px; }
.kv__row:first-child { border-top: 0; }
.kv__row > span { color: var(--muted2); flex: 0 1 auto; max-width: 55%; min-width: 0; overflow-wrap: break-word; }
.kv__row > b { color: var(--ink); font-weight: 600; text-align: right; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; word-break: break-word; }
.kv__row[style*="align-items:flex-start"] > b { white-space: pre-line; }
.aud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line2); font-size: 13px; }
.aud-row:first-of-type { border-top: 0; }
.aud-row > :first-child { font-weight: 600; }
.aud-row > span:first-child { color: var(--ink); }
/* Строки из поля контактов Jira бывают длинными ссылками без пробелов: flex-ребёнок с
   min-width:auto не ужимается и вылезает за карточку, а подпись «голос из Jira» ломается
   на три строки. Ссылку переносим по любому символу, подпись держим целой. */
.aud-row > span, .aud-row > a { min-width: 0; overflow-wrap: anywhere; }
.aud-row__info { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; flex-wrap: wrap; }
.aud-row__info > :first-child { font-weight: 600; }
.aud-row__info > span:first-child { color: var(--ink); }
.aud-row__info > span, .aud-row__info > a { min-width: 0; overflow-wrap: anywhere; }
.aud-row__del-form { margin: 0; flex: none; display: flex; align-items: center; }
.aud-row__del {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, background-color .15s ease;
}
.aud-row__del:hover {
    color: var(--c-red);
    background-color: rgba(220, 38, 38, 0.08);
}
.aud-row__tag { flex: none; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.metric__n { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.metric__l { font-size: 12.5px; color: var(--muted2); margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; margin-top: 12px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bar__track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar__fill { width: 100%; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar__n { font-size: 12px; font-weight: 600; color: var(--ink); }
.bar__x { font-size: 11px; color: var(--muted2); }
.bot-links { display: flex; flex-wrap: wrap; gap: 10px; }
/* Графики аналитики (SVG) */
.chart-wrap { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.chart-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
/* Легенда-таблица (Grafana-style, светлая) */
.chart-legend-tbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; color: var(--text); }
.chart-legend-tbl th { text-align: right; font-weight: 600; color: var(--muted2); padding: 7px 12px; border-bottom: 1px solid var(--line2); font-size: 11.5px; }
.chart-legend-tbl th:first-child { text-align: left; }
.chart-legend-tbl td { text-align: right; padding: 7px 12px; border-bottom: 1px solid var(--line2); font-variant-numeric: tabular-nums; }
.chart-legend-tbl td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
.chart-legend-tbl tbody tr:hover { background: var(--hover); }
.chart-line { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
/* Перекрестие + тултип графика (как в Grafana) */
.chart-ix { position: relative; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16); padding: 10px 12px; min-width: 190px; font-size: 13px; }
.chart-tip__h { font-weight: 700; color: var(--ink); margin-bottom: 7px; font-size: 12.5px; }
.chart-tip__r { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 0; color: var(--text); }
.chart-tip__r span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.chart-tip__r b { color: var(--ink); font-variant-numeric: tabular-nums; }
.charts-multi { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .charts-multi { grid-template-columns: 1fr; } }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.chart-card__title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
/* Модерация комментариев — тред */
.mod-cmt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line2); }
.mod-cmt:first-child { border-top: 0; }
.mod-cmt--reply { margin-left: 44px; }
.mod-cmt .comment__main { flex: 1; min-width: 0; }
.mod-cmt__actions { display: flex; flex-direction: column; gap: 6px; flex: none; min-width: 124px; }
/* Ответ сотрудника: summary в виде обычной кнопки — без треугольника и шрифта браузера. */
.mod-cmt__reply { margin-top: 10px; }
.mod-cmt__reply > summary { list-style: none; }
.mod-cmt__reply > summary::-webkit-details-marker { display: none; }
.mod-cmt__reply[open] > summary { color: var(--blue-dark); border-color: var(--mint); background: var(--blue-soft); }
.mod-cmt__reply-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.mod-cmt__reply-form textarea { flex: 1; min-width: 0; resize: vertical; }
a.comment__author { color: var(--ink); }
a.comment__author:hover { color: var(--blue); }
/* Лента комментариев в виде цепочек обсуждений */
.cmt-feed { display: flex; flex-direction: column; gap: 14px; }
.cmt-row { padding: 14px 18px; }
.cmt-row .mod-cmt { padding: 0; border-top: 0; }
.cmt-ctx { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 12.5px; margin-bottom: 7px; }
.cmt-ctx a { font-weight: 700; color: var(--blue); text-decoration: none; }
.cmt-ctx a:hover { text-decoration: underline; }
.cmt-ctx .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--muted); }
.cmt-row--new { border-left: 3px solid var(--c-amber-dot); }

/* ── Ветка обсуждения (Thread) в ленте комментариев ── */
.cmt-thread {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cmt-thread:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}
.cmt-thread--new {
    border-left: 4px solid var(--c-amber-dot, #f59e0b);
}
.cmt-thread__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line2, #f1f5f9);
    margin-bottom: 14px;
}
.cmt-thread__head .cmt-ctx {
    margin-bottom: 0;
}

/* Сворачивание и компактный вид обсуждений */
.cmt-thread.is-collapsed {
    padding: 10px 16px;
    background: #f8fafc;
    border-color: #e2e8f0;
}
.cmt-thread.is-collapsed .cmt-thread__head {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.cmt-thread.is-collapsed .cmt-thread__body {
    display: none !important;
}
.cmt-thread .cmt-thread__collapsed-preview {
    display: none;
}
.cmt-thread.is-collapsed .cmt-thread__collapsed-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line2, #e2e8f0);
    cursor: pointer;
    font-size: 13px;
    transition: color .15s ease;
}
.cmt-thread.is-collapsed .cmt-thread__collapsed-preview:hover {
    color: var(--blue);
}
.cmt-thread__collapsed-preview .comment__avatar--sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
    flex-shrink: 0;
}
.cmt-thread__collapsed-preview .collapsed-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.cmt-thread__collapsed-preview .collapsed-author {
    font-weight: 600;
    color: var(--text);
}
.cmt-thread__collapsed-preview .collapsed-text {
    color: var(--muted);
    margin-left: 4px;
}
.cmt-thread__collapsed-preview .collapsed-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.cmt-thread__collapsed-preview .collapsed-time {
    color: var(--muted);
    font-size: 12px;
}
.cmt-thread__replies {
    margin-left: 18px;
    padding-left: 18px;
    border-left: 2px solid var(--line, #e2e8f0);
    margin-top: 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}
.cmt-thread__foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line2, #f1f5f9);
}
.mod-cmt__actions-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}
.btn--xs {
    min-height: 26px;
    padding: 2px 8px;
    font-size: 11.5px;
    border-radius: 6px;
    line-height: 1.4;
}
/* Цитата комментария, на который отвечают: кто и что писал, клик — к нему по якорю */
.cmt-quote { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; padding: 7px 11px; border-left: 3px solid var(--mint); background: var(--hover); border-radius: 0 8px 8px 0; color: var(--text); text-decoration: none; }
.cmt-quote:hover { background: var(--blue-soft); }
.cmt-quote__who { font-size: 12px; font-weight: 600; color: var(--blue-dark); }
.cmt-quote__text { font-size: 12.5px; color: var(--muted); line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mod-cmt:target { animation: cHighlight 1.8s var(--ease) both; border-radius: 10px; }
/* Тулбар фильтров админки */
.admin-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.admin-filters .search { flex: 1; min-width: 220px; }
.admin-filters .select { min-width: 130px; }
.tbl-group { padding: 12px 16px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: normal; background: var(--surface); }

/* ── Авторизация ── */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; animation: authIn .25s ease; }
.auth__logo { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth__card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth__title { margin: 0 0 5px; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.auth__hint { margin: 0 0 22px; font-size: 14px; color: var(--muted); }
.auth__foot { margin: 20px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth__tag { margin: 20px 0 0; font-size: 12px; color: #a8aebb; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.auth-divider span { font-size: 12px; color: var(--muted2); }
.auth-divider i { flex: 1; height: 1px; background: var(--line2); }
.field { display: block; margin-bottom: 20px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; } }
/* Чипы-переключатели (одиночный выбор, напр. тип обращения) */
.chip-radio { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-radio .chip { position: relative; cursor: pointer; margin: 0; }
.chip-radio .chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-radio .chip span { display: inline-block; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--card); transition: border-color .15s, background .15s, color .15s; }
.chip-radio .chip:hover span { border-color: var(--blue); }
.chip-radio .chip input:checked + span { border-color: var(--blue); background: var(--blue); color: #ffffff; font-weight: 600; }
.chip-radio .chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--blue-soft); }
.field > span { display: block; font-size: 13px; color: var(--text); font-weight: 500; margin-bottom: 8px; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .field textarea { width: 100%; padding: var(--field-pad-y) var(--field-pad-x); border: 1px solid var(--border); border-radius: var(--field-r); font-size: var(--field-fs); font-family: inherit; color: var(--ink); background: var(--card); }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.req { color: #dc2626; }
.opt { color: var(--muted2); font-weight: 400; }
.checkrow { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; line-height: 1.5; margin-bottom: 18px; }
.checkrow input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; margin-top: 2px; flex: none; }

/* ── Алерты ── */
/* overflow-wrap: причина отклонения — клиентский текст, слово без пробелов не должно
   вылезать за рамку. */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; overflow-wrap: anywhere; }
.alert--error { background: var(--c-red-bg); color: var(--c-red); border-color: #FFCCC7; }
.alert--success { background: var(--c-green-bg); color: var(--blue-dark); border-color: var(--mint); }
.alert--info { background: var(--c-info-bg); color: var(--c-info); border-color: #BAE0FF; }
.alert--warn { background: var(--c-amber-bg); color: var(--c-amber); border-color: #FFE7A3; }

@keyframes workaround-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
        border-color: #34d399;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16), 0 0 10px 1px rgba(16, 185, 129, 0.22);
        border-color: #10b981;
    }
}

/* ── Временное решение для ошибок (внутри обращения) ── */
.workaround-banner {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 18px 0;
}
.workaround-banner__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 8px;
}
.workaround-banner__icon {
    flex: none;
    color: #10b981;
}
.workaround-banner__title {
    letter-spacing: -.01em;
}
.workaround-banner__body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Баннер отклонённого обращения (внутри задачи) ── */
.rejected-banner {
    background: var(--c-red-bg);
    border: 1.5px solid #ffa39e;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 18px 0;
}
.rejected-banner__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--c-red);
    margin-bottom: 8px;
}
.rejected-banner__icon {
    flex: none;
    color: var(--c-red);
}
.rejected-banner__title {
    letter-spacing: -.01em;
}
.rejected-banner__body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Подсветка наличия временного решения в списке (изумрудная подсветка) */
@keyframes wa-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(16, 185, 129, 0.4), inset 0 0 3px rgba(16, 185, 129, 0.15);
        border-color: #34d399;
    }
    50% {
        box-shadow: 0 0 14px rgba(16, 185, 129, 0.75), inset 0 0 5px rgba(16, 185, 129, 0.25);
        border-color: #10b981;
    }
}

.tbl__wa-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}
/* Бейдж: Есть временное решение */
.tbl__wa-badge--yes {
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.tbl__wa-badge--yes:hover {
    color: #064e3b;
    background: #d1fae5;
    border-color: #6ee7b7;
}

.tbl__wa-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex: none;
}

/* Бейдж: Нет временного решения (спокойный нейтральный) */
.tbl__wa-badge--no {
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 500;
    cursor: default;
}

:root[data-theme="dark"] .tbl__wa-badge--yes {
    color: #a7f3d0;
    background: rgba(6, 78, 59, 0.45);
    border-color: #059669;
}
:root[data-theme="dark"] .tbl__wa-badge--yes:hover {
    background: rgba(6, 78, 59, 0.7);
    color: #ecfdf5;
}

:root[data-theme="dark"] .tbl__wa-badge--no {
    color: var(--muted2);
    background: var(--surface);
    border-color: var(--border);
}

:root[data-theme="dark"] .workaround-banner {
    background: rgba(6, 78, 59, 0.35);
    border-color: #059669;
}
:root[data-theme="dark"] .workaround-banner__head {
    color: #a7f3d0;
}
:root[data-theme="dark"] .workaround-banner__icon {
    color: #34d399;
}

:root[data-theme="dark"] .rejected-banner {
    background: rgba(120, 20, 20, 0.28);
    border-color: #a8071a;
}
:root[data-theme="dark"] .rejected-banner__head {
    color: #ff7875;
}
:root[data-theme="dark"] .rejected-banner__icon {
    color: #ff7875;
}
:root[data-theme="dark"] .rejected-banner__body {
    color: var(--text);
}

/* ── Кабинет ── */
.cab-grid { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 24px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card--pad { padding: 24px; }
.profile__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile__name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.tag-client { display: inline-flex; margin-top: 5px; font-size: 11px; font-weight: 600; color: var(--blue-dark); background: var(--blue-soft); padding: 2px 9px; border-radius: 6px; }
.profile__rows { border-top: 1px solid var(--line2); padding-top: 16px; display: flex; flex-direction: column; gap: 13px; }
.profile__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile__row .k { font-size: 13px; color: var(--muted2); }
.profile__row .v { font-size: 13px; color: var(--text); font-weight: 500; }
.card-title { margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink); }
.card-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted2); }
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid #f1f4f8; }
.notify-row .label { font-size: 14px; font-weight: 500; color: var(--ink); }
.notify-row .desc { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.switch { width: 42px; height: 24px; border-radius: 12px; background: #cbd5e1; position: relative; cursor: pointer; flex: none; border: none; padding: 0; }
.switch.is-on { background: var(--blue); }
.switch i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch.is-on i { left: 20px; }
.switch-input { position: absolute; width: 0; height: 0; opacity: 0; }
.switch-input:checked + .switch { background: var(--blue); }
.switch-input:checked + .switch i { left: 20px; }
.switch-label { display: inline-flex; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat__n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.stat__n--blue { color: var(--blue-dark); }
.stat__n--green { color: #047857; }
.stat__l { font-size: 12.5px; color: var(--muted2); margin-top: 2px; }
.subs-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line2); }
.btn--unsub { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--muted); }
.btn--unsub:hover { background: #fef2f2; border-color: #fbd5d5; color: #dc2626; }

@media (max-width: 880px) {
    .cab-grid { grid-template-columns: 1fr; }
    /* Прячем тип и дату, но описание и голоса оставляем — ради них список и смотрят. */
    .tbl__cols, .tbl__row { grid-template-columns: 62px minmax(0,1fr) 110px minmax(0,1.2fr) 70px; }
    .tbl__cols div:nth-child(2), .tbl__row > *:nth-child(2),
    .tbl__cols div:nth-child(6), .tbl__row > *:nth-child(6) { display: none; }

    .tbl--with-workaround .tbl__cols,
    .tbl--with-workaround .tbl__row {
        grid-template-columns: 62px minmax(0, 1fr) 110px minmax(0, 1.1fr) minmax(154px, 1fr) 70px;
    }
    .tbl--with-workaround .tbl__cols div:nth-child(2),
    .tbl--with-workaround .tbl__row > *:nth-child(2),
    .tbl--with-workaround .tbl__cols div:nth-child(7),
    .tbl--with-workaround .tbl__row > *:nth-child(7) {
        display: none;
    }
    .tbl--with-workaround .tbl__cols div:nth-child(6),
    .tbl--with-workaround .tbl__row > *:nth-child(6) {
        display: flex;
    }
}

/* ============ Админка ============ */
.add-from-jira { display: inline-flex; gap: 8px; margin: 0; }
.add-from-jira .input--sm { width: 240px; }
.admin-badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; letter-spacing: normal; text-transform: none; vertical-align: 1px; }
.admin-main h1, .admin-content h1 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); margin: 0 0 18px; }
.admin-whoami { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 6px; }
.admin-whoami__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-green-dot, #10b981); flex: none; }
.nav__badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.nav__badge--warn { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.nav__badge--soft { color: var(--blue-dark); background: var(--blue-soft); border: 1px solid var(--mint, rgba(20,166,91,.2)); }

/* ── Админка: сайдбар-раскладка ── */
.admin-layout { display: flex; align-items: stretch; min-height: 100vh; }
.admin-side { width: 234px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.admin-side__logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 6px; }
.admin-side__logo .logo__name { font-size: 15px; }
.admin-side__group { font-size: 11px; font-weight: 600; color: var(--muted2); margin: 16px 10px 5px; }
.snav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 11px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.snav:hover { background: var(--hover); color: var(--ink); }
.snav.is-active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.admin-side__spacer { flex: 1; min-height: 16px; }
.admin-content { min-width: 0; }
.admin-subtabs { margin-bottom: 22px; }
@media (max-width: 820px) {
    .admin-layout { flex-direction: column; }
    .admin-side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; align-items: center; }
    .admin-side__group, .admin-side__spacer { display: none; }
}
.admin-toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted2); }

/* Таблица админки */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table thead th { background: var(--surface); color: var(--muted); font-weight: 500; font-size: 12px; text-transform: none; letter-spacing: normal; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--hover); }
.table a { color: var(--blue); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* Бейджи (логи/предупреждения) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge--ok { background: var(--c-green-bg); color: var(--blue-dark); }
.badge--fail { background: var(--c-red-bg); color: var(--c-red); }
.badge--warn { background: var(--c-amber-bg); color: var(--c-amber); }

/* Мини-значки мессенджеров (Dialogs.pro) в карточке обращения и профиле */
.msg-badges { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; margin-left: auto; vertical-align: middle; }
.msg-badge { display: inline-flex; align-items: center; gap: 3.5px; padding: 2px 5px; border-radius: 5px; font-size: 10.5px; font-weight: 600; text-decoration: none; line-height: 1.25; white-space: nowrap; flex-shrink: 0; transition: opacity .15s ease, transform .15s ease; }
.msg-badge:hover { opacity: 0.85; transform: translateY(-1px); }
.msg-badge svg, .msg-badge img { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.msg-badge img { width: 13px; height: 13px; object-fit: contain; }
.msg-badge--tg { background: #e0f2fe; color: #0369a1; }
.msg-badge--wa { background: #dcfce7; color: #15803d; }
.msg-badge--max { background: #f3e8ff; color: #7e22ce; }
.msg-badge--phone { background: #fef3c7; color: #b45309; }
:root[data-theme="dark"] .msg-badge--tg { background: #082f49; color: #38bdf8; }
:root[data-theme="dark"] .msg-badge--wa { background: #052e16; color: #4ade80; }
:root[data-theme="dark"] .msg-badge--max { background: #3b0764; color: #c084fc; }
:root[data-theme="dark"] .msg-badge--phone { background: #451a03; color: #fcd34d; }
.phone-link { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; transition: color .15s ease; }
.phone-link:hover { color: var(--blue); text-decoration: underline; }
.phone-link svg { flex-shrink: 0; color: var(--blue); }

/* Настройки полей */
.settings-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 100%; box-shadow: var(--shadow); }
.card .settings-form { background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none; }
.settings-form__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.settings-form__row:last-of-type { border-bottom: none; }
.settings-form__row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; flex-shrink: 0; }
.settings-form__row code { margin-left: auto; font-size: 12px; color: var(--muted2); background: var(--bg); padding: 2px 7px; border-radius: 5px; }
.card .settings-form button.btn--primary { margin-top: 0; }
.settings-form > button { margin-top: 18px; }

.select--sm { max-width: 170px; }

/* Двухколоночные раскладки админки (карточка задачи/пользователя/аналитика) —
   сворачиваются в одну колонку на узких экранах, чтобы не было гориз. скролла. */
.adm-grid { display: grid; gap: 24px; align-items: start; }
.adm-grid--detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.adm-grid--user { grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); }
.adm-grid--even { grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 880px) { .adm-grid { grid-template-columns: 1fr; } }

/* ============ Доступность: уважаем системную настройку «уменьшить движение» ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Разгрузка админки: выпадашка доп.фильтров, мини-теги, компактные действия ── */
.admin-more { position: relative; }
.admin-more > summary { list-style: none; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--card); }
.admin-more > summary::-webkit-details-marker { display: none; }
.admin-more > summary::after { content: "▾"; font-size: 10px; color: var(--muted2); }
.admin-more[open] > summary { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); }
.admin-more__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.admin-more__panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 11px; }
.admin-more__row { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.admin-more__row .select { width: 100%; }

/* Тулбары списков (шапка с действиями и строка фильтров): все элементы управления одной
   высоты, радиуса и рамки — иначе поле, ghost-кнопка, селект и «Ещё фильтры» выглядят
   набором разных стилей (были 33/32/40/38 px и четыре радиуса). */
.page-head__actions .btn, .page-head__actions .input,
.admin-filters .btn, .admin-filters .search input, .admin-filters .select, .admin-more > summary {
    box-sizing: border-box; height: var(--btn-h); min-height: var(--btn-h);
    padding-top: 0; padding-bottom: 0; padding-left: 14px; padding-right: 14px;
    border: 1px solid var(--border); border-radius: var(--btn-r); background: var(--card); color: var(--text);
}
.page-head__actions .btn, .admin-filters .btn, .admin-more > summary { font-size: var(--btn-fs); font-weight: 600; }
.page-head__actions .btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.admin-filters .search input { padding-left: 38px; }
.admin-filters .select { padding-right: 32px; }
.admin-more[open] > summary { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); }

.tag-mini { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 5px; margin-left: 6px; vertical-align: middle; letter-spacing: normal; white-space: nowrap; border: 1px solid transparent; }
.tag-mini--hidden { color: var(--muted); background: var(--surface); border-color: var(--line); }
.tag-mini--pend { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.tag-mini--warn { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

.ta-c { text-align: center; }
.aud { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.aud .muted { font-weight: 400; }
.row-act { display: flex; gap: 6px; justify-content: flex-end; }


/* ── Админка: единый каркас (редизайн) ── */
.ca-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink); white-space: nowrap; flex: none; }
.h1-count { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; vertical-align: middle; margin-left: 8px; font-variant-numeric: tabular-nums; }
.page-head__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge--info { color: var(--blue-dark); background: var(--blue-soft); }
.cell-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-content .page-head { margin-top: 4px; }
.admin-content .page-head .page-title { margin-bottom: 0; }

/* Обзор (дашборд /admin) */
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .ov-grid { grid-template-columns: 1fr; } }
.ov-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
a.ov-card:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(15,23,42,.09); }
.ov-card__n { font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.ov-card--attn { border-color: #FFD8BF; }
.ov-card--attn .ov-card__n { color: var(--c-red); }
.ov-card__t { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.ov-card__d { font-size: 12.5px; color: var(--muted2); margin-top: 3px; line-height: 1.45; }
.ov-ok { display: flex; align-items: center; gap: 10px; background: var(--c-green-bg); border: 1px solid var(--mint); color: var(--blue-dark); border-radius: 14px; padding: 16px 20px; font-weight: 600; font-size: 14px; }
.ov-section { margin: 28px 0 12px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ov-help { display: flex; flex-direction: column; }
.ov-help__row { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line2); font-size: 13.5px; align-items: baseline; }
.ov-help__row:first-child { border-top: 0; }
.ov-help__row > a { flex: none; width: 150px; color: var(--blue); font-weight: 600; }
.ov-help__row > span { color: var(--muted); }

/* ── Модерация: разбор по одному ── */
.modq-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.modq-card { border-top: 3px solid var(--c-amber-dot); }
.modq-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.modq-title { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.modq-desc { font-size: 14.5px; line-height: 1.6; color: var(--text); white-space: pre-line; background: var(--bg); border: 1px solid var(--line2); border-radius: 11px; padding: 14px 16px; }
.modq-author { margin-top: 14px; font-size: 13px; color: var(--muted); }
.modq-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.modq-reject { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.modq-reject .input { flex: 1; min-width: 0; }

/* ── Оповещение о проблемах в сервисе (баннер на всех клиентских страницах) ── */
.site-note { padding: 11px 0; font-size: 13.5px; font-weight: 500; line-height: 1.45; border-bottom: 1px solid transparent; }
.site-note__text { display: block; max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.site-note--info { background: var(--blue-soft); color: var(--blue-dark); border-bottom-color: var(--mint); }
.site-note--warning { background: #FFFBE6; color: #AD6800; border-bottom-color: #FFE58F; }
.site-note--critical { background: #FFF1F0; color: #CF1322; border-bottom-color: #FFCCC7; }

/* ── Переключатель языка RU/EN ── */
.ca-utility { gap: 10px; }
/* Все элементы верхней панели — одной высоты (--btn-h-sm), иначе ряд выглядит рвано. */
.lang-switch { display: inline-flex; gap: 2px; height: var(--btn-h-sm); box-sizing: border-box; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--btn-r-sm); padding: 2px; }
.lang-switch a { display: inline-flex; align-items: center; padding: 0 9px; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 6px; letter-spacing: .03em; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active { background: var(--blue); color: #fff; }
/* Тема — одна кнопка-переключатель (иконка показывает, куда переключит). */
.theme-switch { display: inline-flex; align-items: center; justify-content: center; width: var(--btn-h-sm); height: var(--btn-h-sm); box-sizing: border-box; font-size: 13px; line-height: 1; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--btn-r-sm); }
.theme-switch:hover { color: var(--ink); background: var(--hover); }

/* Колокольчик уведомлений и его выпадашка. */
.notif { position: relative; display: inline-flex; }
.notif__bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--btn-h-sm); height: var(--btn-h-sm); box-sizing: border-box; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--btn-r-sm); }
.notif__bell:hover { color: var(--ink); background: var(--hover); }
.notif__badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notif__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; }
.notif__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line2); font-weight: 600; font-size: 13px; color: var(--ink); }
.notif__head a { font-size: 12px; font-weight: 600; }
/* В выпадашке список ограничен по высоте и скроллится; на странице «Все» — целиком. */
.notif__panel .notif__list { max-height: min(430px, 62vh); overflow-y: auto; }
.notif__item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.notif__item:last-child { border-bottom: none; }
.notif__item:hover { background: var(--hover); }
.notif__item.is-unread { background: var(--blue-soft); }
/* Цвет точки — тип события: зелёная — одобрено, красная — отклонено, синяя — статус,
   фиолетовая — новый номер. */
.notif__dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--line); flex: none; }
.notif__item--approved .notif__dot { background: var(--c-green); }
.notif__item--rejected .notif__dot { background: var(--c-red); }
.notif__item--status .notif__dot { background: var(--c-info); }
.notif__item--merged .notif__dot { background: var(--c-purple); }
.notif__item--reply .notif__dot { background: var(--c-amber-dot); }
.notif__item--workaround .notif__dot { background: #10b981; }
.notif__workaround-badge { font-weight: 700; color: #047857; }
:root[data-theme="dark"] .notif__workaround-badge { color: #34d399; }
.notif__body { min-width: 0; flex: 1; }
.notif__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.notif__title { font-weight: 600; font-size: 13px; color: var(--ink); }
.notif__key { flex: none; font-size: 11px; font-weight: 700; color: var(--muted2); letter-spacing: .02em; }
.notif__desc { display: block; font-size: 12.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
/* Длинную причину в выпадашке обрезаем — целиком читается на странице и в карточке. */
.notif__panel .notif__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.notif__state { font-weight: 600; }
.notif__state--0 { color: var(--c-info); }
.notif__state--1 { color: var(--c-amber); }
.notif__state--2 { color: var(--c-green); }
.notif__state--3 { color: var(--c-red); }
.notif__time { display: block; font-size: 11.5px; color: var(--muted2); margin-top: 3px; }
.notif__empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.notif__clear { border: none; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.notif__clear:hover { color: var(--c-red); }
/* Страница «Все уведомления» — те же строки в карточке во всю ширину. */
.notif-page { margin-top: 16px; overflow: hidden; }
.auth__top { position: absolute; top: 18px; right: 20px; }

/* ── Карточка обращения (админ): Jira-подобный вид ── */
.jira-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 6px 0 20px; }
.jira-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.jira-key { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.jira-main { display: flex; flex-direction: column; gap: 18px; }
.jira-side { display: flex; flex-direction: column; gap: 18px; }
/* Крупное «заглавие» обращения — правка на месте, как в Jira */
.field .jira-title-input { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
/* Привязка клиентов: поиск и инлайн-создание карточки в admin_clients.js */
.clients-item { margin-bottom: 10px; }
.clients-row { display: flex; gap: 8px; align-items: center; }
.clients-row .input { flex: 1; min-width: 0; }
.client-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
}
.client-status-banner[hidden] { display: none; }
.client-status-banner--ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.client-status-banner--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.client-status-banner--err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.client-status-banner__clear {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    opacity: .85;
}
.client-status-banner__clear:hover { opacity: 1; }

/* Всплывающее окно создания клиента (поверх канбана, дровера и форм) */
.client-popup-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.client-popup-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}
.client-popup-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.client-popup-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.client-popup-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px 12px;
}
.client-popup-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.client-inline-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.client-inline-field label { font-size: 12px; font-weight: 600; color: #475569; }
.client-inline-field--wide { grid-column: 1 / -1; }
.client-inline-error { padding: 8px 10px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; font-size: 12.5px; font-weight: 600; color: var(--c-red); }
.client-inline-error[hidden] { display: none; }
.kb-drawer__edit-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.kb-drawer__edit-box[hidden] { display: none; }
.kb-drawer__internal-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--text);
    white-space: pre-wrap;
}
.kb-drawer__internal-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 3px;
}
.kb-cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11.5px;
    font-weight: 600;
}
.mod-cmt--internal {
    background: #fffbeb;
    border-color: #fde68a;
}
/* Редактируемая строка панели «Детали» (приоритет) — как kv-строка, но с полем */
/* Строки с полями: подпись слева, контрол справа — одна ширина и общая
   вертикаль у всех строк, иначе селекты «пляшут» по краю. */
.kv__row--edit { display: grid; grid-template-columns: 1fr 170px; align-items: center; }
.kv__row--edit .select { width: 100%; max-width: none; min-width: 0; }

/* Баннер модерации — «workflow» вверху карточки, акцентная левая полоса */
.mod-banner { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.mod-banner--rejected { border-color: #FBD5D5; background: #FFF7F7; }
.mod-banner--done { border-color: #C7EBD8; background: #F3FCF7; }
.mod-banner__title { font-size: 15px; font-weight: 700; color: var(--ink); }
.mod-banner__hint { display: block; font-size: 12.5px; color: var(--muted2); margin-top: 3px; }
.mod-banner__actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.mod-banner__key { flex: 1; min-width: 200px; }
.mod-banner__reject { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.mod-banner__reject .input { flex: 1; min-width: 0; }


/* Поиск существующих обращений — проверка дублей перед заведением в Jira */
.mod-dup { margin-top: 4px; }
.mod-dup form { position: relative; display: flex; align-items: center; }
.mod-dup__ic { position: absolute; left: 11px; color: var(--muted2); pointer-events: none; }
.mod-dup .input { width: 100%; padding-left: 33px; }

/* Выпадающие подсказки живого поиска дублей (баннер модерации) */
.dup-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); overflow: hidden; }
.dup-pop__item { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; font-size: 13px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.dup-pop__item:last-child { border-bottom: none; }
.dup-pop__item:hover { background: var(--hover); }
.dup-pop__item b { flex: 0 0 auto; }
.dup-pop__item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-pop__item em { flex: 0 0 auto; font-style: normal; font-size: 12px; color: var(--muted); }
.dup-pop__empty { padding: 8px 12px; font-size: 12.5px; color: var(--muted); }

/* ── Поиск по имени в селекте исполнителя (user_select.js, поверх обычного select) ── */
.user-search { position: relative; width: 100%; }
.user-search__native { display: none; }
.user-search__input { width: 100%; }
.user-search__list { position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 260px; overflow-y: auto; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.kv__row--edit .user-search__list { left: auto; right: 0; min-width: 220px; }
.user-search__item { padding: 8px 12px; font-size: 13px; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--line); }
.user-search__item:last-child { border-bottom: none; }
.user-search__item:hover,
.user-search__item--active { background: var(--hover); }
.user-search__item.is-selected { font-weight: 600; }
.user-search__empty { padding: 8px 12px; font-size: 12.5px; color: var(--muted); }

/* Атрибут hidden обязан скрывать элемент: без !important его перебивает display
   у .btn/.chip и элемент остаётся видимым. */
[hidden] { display: none !important; }


/* ── Сплит-вью модерации: слева очередь, справа карточка (как в Jira) ── */
.mod-split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.mod-split__list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-y: auto; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
.mod-split__pane { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; padding: 16px; min-width: 0; }
.mod-split__item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.mod-split__item:last-child { border-bottom: none; }
.mod-split__item:hover { background: var(--hover); }
.mod-split__item.is-active { background: #f0fdf4; box-shadow: inset 3px 0 0 var(--blue); }
.mod-split__key { display: block; font-size: 12px; font-weight: 700; color: var(--blue-dark); }
.mod-split__title { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.mod-split__meta { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 900px) {
    .mod-split { grid-template-columns: 1fr; }
    .mod-split__list { position: static; max-height: 40vh; }
}

/* ============================================================
   Адаптив под мобильные (клиентский портал). Админка отзывчива
   выше (сайдбар/таблицы/adm-grid). Точки: планшет ≤640, телефон ≤400.
   ============================================================ */
@media (max-width: 640px) {
    /* Убираем «широкие» горизонтальные поля — на телефоне они съедают экран */
    .container { padding: 18px 16px 40px; }
    .ca-header__inner { padding: 12px 16px 0; }
    .ca-tabs__inner { padding: 10px 16px; }
    .site-note__text { padding: 0 16px; }

    .page-title { font-size: 21px; }
    .ca-nav a { padding: 8px 13px; font-size: 13.5px; }

    /* iOS Safari зумит страницу при фокусе на поле с font-size < 16px — поднимаем до 16 */
    .search input, .input, .select, textarea.input,
    .input--sm, .select--sm, textarea.input--sm { font-size: 16px; }

    /* Список обращений: из таблицы-сетки в карточки (ключ+статус, тема, описание, голоса) */
    .tbl__cols { display: none; }
    .tbl__row {
        grid-template-columns: 1fr auto;
        grid-template-areas: "key status" "title title" "desc desc" "votes votes";
        row-gap: 9px; column-gap: 12px; padding: 14px 16px;
    }
    .tbl__row > *:nth-child(1) { grid-area: votes; justify-self: end; }      /* голоса */
    .tbl__row > *:nth-child(2) { display: none; }                            /* тип — скрываем */
    .tbl__row > *:nth-child(3) { grid-area: title; }                         /* тема */
    .tbl__row > *:nth-child(4) { grid-area: status; justify-self: end; }     /* статус */
    .tbl__row > *:nth-child(5) { grid-area: desc; }                          /* описание */
    .tbl__row > *:nth-child(6) { display: none; }                            /* обновлено — скрываем */
    .tbl__row > *:nth-child(7) { grid-area: key; align-self: center; justify-self: start; text-align: left; }  /* номер */
    .tbl__title { -webkit-line-clamp: none; }                                /* тема целиком */
    .tbl__desc { -webkit-line-clamp: 3; }
    .tbl__action { justify-content: flex-end; }
    /* Пустое описание не должно оставлять дыру между темой и голосами. */
    .tbl__desc:empty { display: none; }

    .tbl--with-workaround .tbl__cols { display: none; }
    .tbl--with-workaround .tbl__row {
        grid-template-columns: 1fr auto;
        grid-template-areas: "key status" "title title" "desc desc" "votes votes";
        row-gap: 9px; column-gap: 12px; padding: 14px 16px;
    }
    .tbl--with-workaround .tbl__row:has(.tbl__workaround) {
        grid-template-areas: "key status" "title title" "desc desc" "workaround workaround" "votes votes";
    }
    .tbl--with-workaround .tbl__row > *:nth-child(6) {
        display: none;
    }
    .tbl--with-workaround .tbl__row > *:nth-child(6):has(.tbl__workaround) {
        grid-area: workaround;
        display: flex;
    }
    .tbl--with-workaround .tbl__row > *:nth-child(6):empty,
    .tbl--with-workaround .tbl__wa-cell:empty {
        display: none !important;
    }
    .tbl--with-workaround .tbl__row > *:nth-child(7) {
        display: none;
    }
    .tbl--with-workaround .tbl__row > *:nth-child(8) {
        grid-area: key;
        align-self: center;
        justify-self: start;
        text-align: left;
    }

    /* Быстрый просмотр на телефоне — лист снизу во весь экран, а не окошко с полями:
       на 360px «модалка по центру» оставляет от содержимого узкую полоску. */
    .qv { padding: 0; align-items: flex-end; }
    .qv__panel { width: 100%; max-height: 92vh; border: none; border-radius: 16px 16px 0 0; }
    .qv__x { top: 10px; right: 10px; }
    .confirm-modal { padding: 0; align-items: flex-end; }
    .confirm-modal__panel { width: 100%; border: none; border-radius: 16px 16px 0 0; padding: 24px 20px 20px; }
    .qv__panel .detail__head { padding: 22px 18px 0; }
    .qv__panel .detail__body { padding: 12px 18px 22px; }
    .qv__panel .detail__foot { padding: 16px 18px; }
    /* Три кнопки в ряд на телефоне не помещаются — ставим столбиком во всю ширину. */
    .qv__body .detail__actions { flex-direction: column; }
    .qv__body .detail__actions > * { flex: none; width: 100%; }
    .qv__body .detail__dates { gap: 20px; }
    .follow { width: 100%; min-width: 0; }

    /* Карточка обращения */
    .detail__head { padding: 20px 18px 0; }
    .detail__body { padding: 12px 18px 22px; }
    .detail__foot { padding: 16px 18px; }
    .detail__title { font-size: 20px; }
    .detail__dates { gap: 18px; flex-wrap: wrap; }
    .discussion { padding: 18px 16px; }

    /* Степпер модерации не должен раздвигать страницу — даём горизонтальный скролл */
    .stepper { overflow-x: auto; justify-content: flex-start; }

    /* Тулбар/строка действий: поиск и кнопка «Новая идея» на всю ширину */
    .content-bar { justify-content: space-between; }
    .content-bar .btn { flex: 1 1 auto; }

    /* Баннер модерации: кнопки и поля — в столбик во всю ширину */
    .mod-banner__actions { flex-direction: column; align-items: stretch; }
    .mod-banner__actions form { display: flex; }
    .mod-banner__actions .btn { width: 100%; }
    .mod-banner__key { min-width: 0; }
}

@media (max-width: 400px) {
    .container { padding: 16px 12px 36px; }
    .stats { grid-template-columns: 1fr 1fr; }        /* 3 метрики → 2 в ряд */
    .detail__actions { flex-direction: column; }       /* Следить/Голосовать столбиком */
    .detail__actions form { width: 100%; }
    .stepper__step { width: 74px; }
    .stepper__c { width: 38px; height: 38px; font-size: 15px; }
}

.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 9px 16px;
    background: var(--ink, #1e293b);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}
.admin-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.admin-toast--error {
    background: #dc2626;
}

/* ── Настройки: сетка полей формы и предпросмотра (не сжимаем превью из-за таблиц) ── */
.settings-fields-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
    gap: 20px;
    align-items: start;
    width: 100%;
}
@media (min-width: 1220px) {
    .settings-fields-grid {
        grid-template-columns: minmax(0, 1fr) 648px;
    }
}
.settings-fields-grid > *,
.settings-fields-grid .card {
    min-width: 0;
}
.settings-fields-table th,
.settings-fields-table td {
    padding: 10px 10px;
    font-size: 13px;
}
.settings-fields-table code {
    font-size: 11.5px;
    white-space: nowrap;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}
.settings-preview-shell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, .06), 0 2px 6px -1px rgba(15, 23, 42, .03);
    border-radius: 16px;
    padding: 16px;
}
.settings-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}
.settings-preview-shell .detail__card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
@media (max-width: 640px) {
    .settings-fields-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Настройки режимов работы (Workflow & Kanban) ── */
.wf-modes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.wf-mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 16px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.wf-mode-card:hover {
    border-color: #cbd5e1;
    background: #fafcff;
}
.wf-mode-card.is-selected {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: 0 0 0 1px var(--blue);
}
.wf-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wf-mode-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.wf-mode-card__title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
}
.wf-mode-card__tag {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted2);
    white-space: nowrap;
}
.wf-mode-card.is-selected .wf-mode-card__tag {
    color: var(--blue);
}
.wf-mode-card__desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
}
@media (max-width: 900px) {
    .wf-modes-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── 4 смысловых хаба настроек (Hub Navigation) ── */
.settings-nav-hub {
    margin: 0 0 24px;
}
/* ── Премиальная лаконичная навигация по настройкам (SaaS Nav Bar) ── */
.settings-nav-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
}
.settings-nav-bar::-webkit-scrollbar {
    display: none;
}
.settings-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all .15s ease;
}
.settings-nav-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, .8);
}
.settings-nav-btn.is-active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
.settings-nav-btn__icon {
    flex-shrink: 0;
    color: #94a3b8;
    transition: color .15s ease;
}
.settings-nav-btn:hover .settings-nav-btn__icon,
.settings-nav-btn.is-active .settings-nav-btn__icon {
    color: #2563eb;
}
.settings-nav-btn__tag {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #64748b;
    margin-left: 2px;
}

.settings-hub-grid {
    display: none;
}
.settings-hub-card {
    display: none;
}

/* ── Вложенная полоса подразделов (Subnav Pills) ── */
.settings-subnav-shell {
    display: flex;
    align-items: center;
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    min-height: 38px;
}
.settings-subnav-group {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    width: 100%;
}
.settings-subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.settings-subnav-item:hover {
    color: var(--ink);
    background: rgba(15, 23, 42, .04);
}
.settings-subnav-item.is-active {
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(18, 19, 21, .06);
    border: 1px solid var(--line2);
}
.settings-pill-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    background: var(--blue-soft);
    color: var(--blue);
}

@media (max-width: 900px) {
    .settings-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .settings-hub-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* ── Сегментированные группы вкладок настроек (отдельный паттерн под .admin-subtabs) ── */
.settings-segbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
}
.settings-seg {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.settings-seg__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.settings-seg__item:not(.is-active):hover {
    color: var(--ink);
    background: rgba(15, 23, 42, .04);
}
.settings-seg__item.is-active {
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    border: 1px solid var(--line2);
}
:root[data-theme="dark"] .settings-seg {
    background: var(--surface);
}
:root[data-theme="dark"] .settings-seg__item:not(.is-active):hover {
    background: rgba(255, 255, 255, .05);
}
:root[data-theme="dark"] .settings-seg__item.is-active {
    background: #2D333B;
    box-shadow: none;
}
.settings-seg__muted {
    font-size: 11.5px;
    color: var(--muted2);
    font-weight: 400;
}
.settings-section-head {
    margin: 0 0 12px;
}
.settings-rule-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0;
    cursor: pointer;
}
.settings-rule-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--blue);
    flex-shrink: 0;
}
.settings-rule-box__title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.settings-rule-box__desc {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.4;
}

.settings-container {
    max-width: 1080px;
}
.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.settings-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .03);
}
.settings-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.settings-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -.01em;
}
.settings-card__sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}
.settings-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.settings-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}
.settings-field-full {
    grid-column: 1 / -1;
}
.settings-card .input,
.settings-card .select,
.settings-card select.input {
    height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.35;
    box-sizing: border-box;
    min-width: 0;
}
.settings-card .field > .input,
.settings-card .field > .select {
    width: 100%;
    display: block;
}
.settings-card .select {
    padding: 0 32px 0 12px;
}
.settings-card .field > span {
    display: block;
    margin-bottom: 6px;
}
.settings-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.settings-preset-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.settings-preset-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.settings-preset-btn:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
}
.settings-card .table-wrap,
.card .table-wrap {
    border-radius: 0;
}
.settings-card .table,
.card .table {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.settings-card .table thead th,
.card .table thead th {
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding-top: 8px;
    padding-bottom: 10px;
}
.settings-card .table td {
    padding-top: 10px;
    padding-bottom: 10px;
}
.settings-switch-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 13.5px;
}
.settings-switch-row input[type="checkbox"],
.settings-switch-row input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--blue);
    flex-shrink: 0;
}
.settings-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: 13.5px;
}
.settings-status-banner--ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
.settings-status-banner--warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.settings-col-table input.input--compact {
    height: 34px;
    padding: 5px 9px;
    font-size: 13px;
    border-radius: 7px;
    border-color: var(--line);
}
.settings-col-table .select--sm {
    max-width: none;
    min-width: 148px;
    width: 100%;
    height: 34px;
    padding: 0 26px 0 10px;
    font-size: 13px;
    border-radius: 7px;
    border-color: var(--line);
}
@media (max-width: 860px) {
    .settings-segbar { gap: 8px; }
    .settings-grid-2,
    .settings-grid-3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Канбан обращений (Linear / JSM эстетика) ── */
.kb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.kb-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.kb-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--line);
}
.kb-seg {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    padding: 3px;
    border-radius: 9px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.kb-seg__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
    white-space: nowrap;
}
.kb-seg__item:hover {
    color: var(--ink);
}
.kb-seg__item.is-active {
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.kb-seg__cnt {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted2);
    font-variant-numeric: tabular-nums;
}
.kb-seg__item.is-active .kb-seg__cnt {
    color: var(--blue);
}
.kb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap !important;
    margin-bottom: 16px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.kb-toolbar__group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap !important;
    min-width: 0;
    flex-shrink: 0;
}
.kb-toolbar .select--sm {
    max-width: 145px;
    min-width: 75px;
    text-overflow: ellipsis;
}
#kbAssigneeSelect {
    max-width: 160px;
    flex-shrink: 0;
}
.kb-search {
    flex: 1 1 130px;
    min-width: 100px;
    max-width: 180px;
}
#kbResetBtn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 4px 8px;
    font-size: 11.5px;
    border-radius: 6px;
}
@media (max-width: 860px) {
    .kb-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        overflow-x: visible;
    }
    .kb-toolbar__group {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .kb-toolbar__group::-webkit-scrollbar {
        display: none;
    }
    .kb-search {
        flex: 1;
        min-width: 120px;
        max-width: none;
    }
}
.kb-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 18px;
    align-items: flex-start;
    width: 100%;
    scrollbar-width: thin;
}
.kb-col {
    flex: 0 0 288px;
    width: 288px;
    background: #f4f6fa;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 235px);
    min-height: 360px;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.kb-col.is-drag-over {
    background: #eff6ff;
    border-color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}
.kb-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px 9px;
}
.kb-col__title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.kb-col__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.kb-col__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kb-col__count {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    padding: 1px 7px;
    line-height: 1.45;
}
.kb-col__add {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--muted2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}
.kb-col:hover .kb-col__add,
.kb-col__add:focus {
    opacity: 1;
}
.kb-col__add:hover {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.kb-col__body {
    padding: 2px 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 180px;
    scrollbar-width: thin;
}
.kb-col__empty {
    text-align: center;
    color: var(--muted2);
    font-size: 12px;
    padding: 24px 10px;
    border: 1px dashed #d8e0eb;
    border-radius: 9px;
}
.kb-card {
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    padding: 11px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: box-shadow .14s ease, border-color .14s ease, transform .12s ease;
}
.kb-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.kb-card.is-selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue-soft);
}
.kb-card.is-dragging {
    opacity: 0.4;
}
.kb-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.kb-card__keys {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
.kb-card__key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
.kb-card__jira-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 1px 5px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}
.kb-card__type {
    font-size: 10.5px;
    padding: 1px 6px;
}
.kb-card__unread {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #6d28d9;
    background: #f3e8ff;
    border-radius: 999px;
    padding: 1px 7px;
    white-space: nowrap;
}
.kb-card__comments {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    color: var(--muted2);
}
.kb-card__title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.38;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.kb-card:hover .kb-card__title {
    color: var(--blue);
}
.kb-card__modtag {
    display: inline-block;
    align-self: flex-start;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 5px;
    background: #fef3c7;
    color: #92400e;
}
.kb-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}
.kb-card__client {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.kb-card__right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.kb-prio-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.kb-prio-ic--4 { color: #dc2626; background: #fef2f2; }
.kb-prio-ic--3 { color: #d97706; background: #fffbeb; }
.kb-prio-ic--2 { color: #64748b; }
.kb-prio-ic--1 { color: #94a3b8; }

.kb-avatar-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #eef2ff;
    color: #3730a3;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: border-color .12s ease, transform .1s ease, background-color .12s ease;
}
.kb-avatar-btn--empty {
    background: #f8fafc;
    color: #94a3b8;
    border-style: dashed;
}
.kb-avatar-btn:hover {
    border-color: var(--blue);
    transform: scale(1.06);
}

/* Плавающее меню смены исполнителя */
.kb-popover {
    position: fixed;
    z-index: 9500;
    width: 225px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 5px;
}
.kb-popover__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    padding: 7px 10px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
}
.kb-popover__item:hover {
    background: #f1f5f9;
}
.kb-popover__item.is-current {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 600;
}

/* Slide-over панель детальной карточки обращения */
.kb-drawer {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    justify-content: flex-end;
    background: rgba(15, 23, 42, 0.35);
}
.kb-drawer.is-open {
    display: flex;
}
.kb-drawer__panel {
    width: 560px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 30px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.kb-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
}
.kb-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.kb-drawer__props {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.kb-drawer__prop label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}
.kb-drawer__comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.kb-msg {
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
}
.kb-msg--staff {
    background: #f8fafc;
}
.kb-msg--internal {
    background: #fffbeb;
    border-color: #fde68a;
}
.kb-msg__head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 4px;
}
.kb-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.kb-modal__panel {
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 12px;
    background: var(--card);
}

/* ── Динамическая аналитика ── */
.an-root.is-loading { opacity: .6; pointer-events: none; transition: opacity .15s ease; }
.an-subhead { font-size: 13px; color: var(--muted); margin-top: 2px; }
.metrics--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1180px) { .metrics--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .metrics--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.metric__delta { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.metric__delta--up { color: var(--c-green); }
.metric__delta--down { color: var(--c-red); }
.metric__delta--flat { color: var(--muted2); }

.an-custom-dates { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.an-custom-dates .input--date { width: 138px; min-height: var(--btn-h); padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--btn-r); background: var(--card); color: var(--text); font-family: inherit; font-size: 13px; }

.chart-legend-tbl tr.is-series-toggle { cursor: pointer; user-select: none; }
.chart-legend-tbl tr.is-series-off { opacity: .42; }
