/* Стили нового кабинета поверх FinLab. Шрифт и цвета — только здесь. */

/* ── 4 тона значков статуса — ЕДИНСТВЕННОЕ место цветов (бренд подставляется здесь) ──
   danger — проблема, нужно действие; warning — внимание, ждём; success — хорошо, готово; muted — нейтрально.
   Те же переменные — у строк ИП, рамок канбана и иконок уведомлений. Синий — только кнопки, ссылки, активное меню. */
:root {
  --tone-danger: #dc2626;  --tone-danger-bg: #fdecec;  --tone-danger-fg: #b91c1c;
  --tone-warning: #d99a1e; --tone-warning-bg: #fff6dc; --tone-warning-fg: #8a5a00;
  --tone-success: #16a34a; --tone-success-bg: #e7f6ec; --tone-success-fg: #15803d;
  --tone-muted: #9ca3af;   --tone-muted-bg: #eef0f3;   --tone-muted-fg: #5b6470;
}
.badge.cabinet-tone-danger { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.badge.cabinet-tone-warning { background: var(--tone-warning-bg); color: var(--tone-warning-fg); }
.badge.cabinet-tone-success { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.badge.cabinet-tone-muted { background: var(--tone-muted-bg); color: var(--tone-muted-fg); }
.cabinet-tone-text-danger { color: var(--tone-danger) !important; }
.cabinet-tone-text-warning { color: var(--tone-warning) !important; }
.cabinet-tone-text-success { color: var(--tone-success) !important; }
.cabinet-tone-text-muted { color: var(--tone-muted-fg) !important; }
/* Исключение: счётчик колокольчика — сплошной красный */
.cabinet-bell-count { background: var(--tone-danger) !important; color: #fff !important; }

/* Шрифт Inter (кириллица) вместо Poppins FinLab; файлы — static/fonts/inter (400/500/600, 700 синтезируется) */
@font-face { font-family: "Inter"; src: url("/static/fonts/inter/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter/Inter-SemiBold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
:root, body[data-typography] {
  --bs-body-font-family: "Inter", sans-serif;
  --font-family-base: "Inter", sans-serif;
  --font-family-title: "Inter", sans-serif;
}
body[data-typography], body[data-typography] .dlabnav, body[data-typography] .header,
body[data-typography] h1, body[data-typography] h2, body[data-typography] h3,
body[data-typography] h4, body[data-typography] h5, body[data-typography] h6,
.tooltip, .popover { font-family: "Inter", sans-serif; }

/* Цвета: FinLab как есть; при смене бренда менять ТОЛЬКО здесь (учитывать [data-primary]) */

/* Обложка профиля без демо-фото FinLab */
.profile .photo-content .cover-photo { background: linear-gradient(135deg, var(--primary), #6ec6ff); }
/* Обложка страницы входа без rainbow.gif FinLab */
.cabinet-login-cover { background: linear-gradient(135deg, var(--primary), #6ec6ff); }

/* Текстовый логотип вместо логотипа FinLab */
.cabinet-logo { text-decoration: none; }
.cabinet-logo-abbr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 0.5rem;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 0.95rem;
}
.cabinet-logo-title { font-weight: 700; font-size: 1.25rem; color: var(--primary); margin-left: 0.6rem; }

/* Шапка: аватар-заглушка и счётчик колокольчика */
.cabinet-avatar-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--rgba-primary-1); color: var(--primary); margin-left: 0.75rem;
}
/* Счётчик колокольчика — маленький кружок у правого верхнего угла, колокольчик виден целиком (п.2) */
.header-right .notification_dropdown .nav-link .badge.cabinet-bell-badge {
  position: absolute; top: -4px; right: -4px; left: auto; bottom: auto;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font-size: 11px; line-height: 18px; font-weight: 600; text-align: center;
  box-shadow: 0 0 0 2px var(--card, #fff);
}
/* FinLab рисует розовую точку у колокольчика (::before) — у нас вместо неё счётчик */
.nav-item.notification_dropdown a.nav-link::before { content: none; display: none; }

/* Меню: замок у неподключённого раздела */
.dlabnav .metismenu a[data-locked="1"] { opacity: 0.6; }
.cabinet-lock { font-size: 0.75em; }

.cabinet-page-title { font-weight: 600; }
.cabinet-demo-banner { font-size: 0.9rem; }

/* Кнопка, ожидающая ответа действия */
.cabinet-busy { pointer-events: none; opacity: 0.7; }
/* Поле с ошибкой из ответа действия (fields) */
.cabinet-field-error { border-color: var(--bs-danger, #fd5353) !important; }

/* Отступ между «Сообщить о проблеме» и колокольчиком */
.header-right .cabinet-report-item { margin-right: 1rem; }
@media (max-width: 575.98px) {
  .header-right .cabinet-report-item { margin-right: 0.5rem; }
}

/* Телефон: без горизонтальной прокрутки */
@media (max-width: 575.98px) {
  .content-body .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
  /* Желоб сетки FinLab (1.875rem) шире полей контейнера — .row вылезал на 3–5 px */
  .content-body .container-fluid .row:not([class*=" g-"]) { --bs-gutter-x: 1.5rem; }
  .cabinet-report-btn { padding: 0.35rem 0.6rem; }
}

/* Свёрнутый блок (data-collapsible): видна только шапка */
[data-collapsible].cabinet-collapsed > .card-body,
[data-collapsible].cabinet-collapsed > .card-footer { display: none; }
[data-collapse-toggle] { cursor: pointer; }

/* ── Постбанкротство: список и добавление ── */
.cabinet-list-search { width: 100%; max-width: 32rem; }
.cabinet-table td, .cabinet-table th { vertical-align: middle; }
.cabinet-search-input { min-width: 12rem; }
.cabinet-table-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.cabinet-table-sort:hover, .cabinet-table-sort:focus-visible { color: var(--primary); text-decoration: underline; }
.cabinet-table-sort-icon { display: inline-block; margin-left: .15rem; color: #8b929a; font-size: .82em; }
.cabinet-table-sort.is-active .cabinet-table-sort-icon { color: var(--primary); }

/* ── Карточка клиента «как ранние ВК/Facebook» ── */
.cabinet-profile-head .photo-content .cover-photo {
  min-height: 9rem;
  background: linear-gradient(120deg, var(--primary) 0%, #4f8df5 45%, #6ec6ff 100%);
}
.cabinet-photo { flex-shrink: 0; }
.cabinet-photo img, .cabinet-photo .cabinet-silhouette {
  display: block; width: 6.25rem; height: 6.25rem; object-fit: cover;
  border-radius: 50%; border: 4px solid var(--card, #fff); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  background: var(--card, #fff);
}
.cabinet-profile-name { font-weight: 600; word-break: break-word; }
.cabinet-badges .badge { font-weight: 500; }
.cabinet-photo-form .btn { cursor: pointer; }
@media (max-width: 575.98px) {
  .cabinet-photo img, .cabinet-photo .cabinet-silhouette { width: 5rem; height: 5rem; margin: 0 auto; }
  .cabinet-badges { justify-content: center; }
  .cabinet-photo-form { margin: 0 auto; text-align: center; }
  .profile-info .profile-details .cabinet-photo-form { position: static; }
}

/* Блоки слева, лента справа; на телефоне лента уходит ПОД блоки (одна разметка, порядок — CSS order) */
.cabinet-card-layout > .cabinet-card-main { order: 1; }
.cabinet-card-layout > .cabinet-card-feed { order: 2; }
.cabinet-post-navigation { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.cabinet-post-navigation a { display: flex; flex-direction: column; justify-content: center; gap: .25rem; padding: .7rem 1rem; border: 1px solid var(--border, #e6e6e6); border-radius: .5rem; background: #fff; color: inherit; text-decoration: none; font-weight: 600; }
.cabinet-post-navigation a:hover, .cabinet-post-navigation a:focus-visible { border-color: var(--primary, #009df3); }
.cabinet-post-summary { font-size: .8rem; font-weight: 400; }
.cabinet-post-files-scroll { max-height: 24rem; overflow-y: auto; }
.cabinet-bki-actions, .cabinet-bki-bottom-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: .6rem; }
.cabinet-bki-actions { margin-bottom: 1rem; }
.cabinet-bki-bottom-actions { margin-top: 1rem; }
.cabinet-bki-choice[open] { flex-basis: 100%; }
.cabinet-bki-choice > summary { display: table; margin-left: auto; }
.cabinet-post-card [data-report-buttons] { justify-content: flex-end; }
.cabinet-bki-choice-panel { margin: .75rem 0; padding: .75rem; border: 1px solid #e3e7eb; border-radius: .5rem; }
.cabinet-bki-choice-panel > label { margin: 0 1rem 0 .35rem; }
.cabinet-bki-request-panel { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.cabinet-bki-goskey, .cabinet-bki-idgos { margin-top: .75rem; }
.cabinet-bki-goskey > button, .cabinet-bki-idgos > button { display: table; margin-left: auto; }
.cabinet-bki-idgos { display: none; }
#post-bki-method-idgos:checked ~ .cabinet-bki-goskey { display: none; }
#post-bki-method-idgos:checked ~ .cabinet-bki-idgos { display: block; }
.cabinet-post-card .cabinet-card-main [data-block] { scroll-margin-top: 6.5rem; }
.cabinet-manager-card .cabinet-card-main [data-block] { scroll-margin-top: 6.5rem; }
.cabinet-post-profile-data { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, 1.2fr) minmax(7rem, 1fr) minmax(0, 1.2fr); gap: .25rem .75rem; }
.cabinet-post-profile-data > dt, .cabinet-post-profile-data > dd { width: auto; min-width: 0; margin: 0; padding: .65rem .3rem; border-bottom: 1px solid #e8edf2; }
.cabinet-post-profile-data > dt { color: #687583; }
.cabinet-post-profile-data > dd { color: #263442; }
@media (max-width: 767.98px) { .cabinet-post-profile-data { grid-template-columns: minmax(7rem, 1fr) minmax(0, 1.5fr); } }
@media (min-width: 1200px) {
  .cabinet-feed-card { position: sticky; top: 6.5rem; }
  .cabinet-feed-card .card-body { max-height: calc(100vh - 12rem); overflow-y: auto; }
}

.cabinet-dl dt { font-weight: 500; color: var(--bs-secondary-color, #6e6e6e); }
.cabinet-dl dd { margin-bottom: 0.5rem; word-break: break-word; }
.cabinet-subblock { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--border, #e6e6e6); }
.cabinet-subtitle { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.75rem; }

/* Лента событий */
.cabinet-feed-item { display: flex; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border, #eee); }
.cabinet-feed-item:last-child { border-bottom: 0; }
.cabinet-feed-icon {
  flex: 0 0 2.25rem; height: 2.25rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rgba-primary-1); color: var(--primary); font-size: 0.85rem;
}
/* Иконки ленты — один нейтральный цвет (тон — только у значков статуса) */
.cabinet-feed-icon { background: var(--tone-muted-bg) !important; color: var(--tone-muted-fg) !important; }
.cabinet-feed-body { min-width: 0; }
.cabinet-feed-text { font-size: 0.9rem; line-height: 1.35; word-break: break-word; }
.cabinet-feed-meta { font-size: 0.78rem; color: var(--bs-secondary-color, #8a8a8a); margin-top: 0.15rem; }

/* ── Блоки карточки (БКИ, ФССП, кредиты) ── */
.cabinet-block > .card-header { gap: 0.5rem; }
.cabinet-collapse-btn .fa { transition: transform 0.2s ease; }
.cabinet-collapsed .cabinet-collapse-btn .fa { transform: rotate(180deg); }
/* A (22.10.2026): строка бюро раскрывает подробности под таблицей */
.cabinet-bureau-row { cursor: pointer; }
.cabinet-bureau-chevron { transition: transform .15s ease; }
.cabinet-bureau-toggle[aria-expanded="true"] .cabinet-bureau-chevron { transform: rotate(90deg); }
.cabinet-bureau-toggle:focus-visible { outline: 2px solid var(--bs-primary, #0d6efd); outline-offset: 2px; }
.cabinet-step-box {
  height: 100%; padding: 0.85rem 1rem; border-radius: 0.6rem;
  background: var(--rgba-primary-1, #f3f6fd); border: 1px solid transparent;
}
.cabinet-step-box-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
[data-signing-channels] .btn[data-signing-channel] {
  min-width: 8.5rem; min-height: 44px;
  padding: 0.65rem 1.25rem; font-size: 16px; font-weight: 700;
  color: #123b63; background: #dbeafe; border: 2px solid #155e9b; opacity: 1;
}
[data-signing-channels] .btn[data-signing-channel]:hover:not(:disabled),
[data-signing-channels] .btn[data-signing-channel]:active:not(:disabled) {
  color: #123b63; background: #bfdbfe; border-color: #123b63;
}
[data-signing-channels] .btn[data-signing-channel]:focus-visible {
  outline: 3px solid #155e9b !important; outline-offset: 3px;
}
[data-signing-channels] .btn[data-signing-channel]:disabled {
  color: #374151; background: #e5e7eb; border-color: #9ca3af; opacity: 1;
}
.cabinet-file-name { word-break: break-all; }

/* Воронка этапов: горизонтальная лента шагов, на телефоне — вертикальный список */
.cabinet-funnel { margin-top: 1rem; }
.cabinet-funnel-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--bs-secondary-color, #6e6e6e); }
.cabinet-steps { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.cabinet-steps-item { flex: 1 1 8.5rem; min-width: 0; }
.cabinet-step {
  width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.5rem 0.6rem; border-radius: 0.5rem; border: 1px solid var(--border, #e3e3e3);
  background: var(--card, #fff); cursor: pointer; font-size: 0.8rem; line-height: 1.25;
}
.cabinet-step:hover, .cabinet-step:focus-visible { border-color: var(--primary); }
.cabinet-step-dot {
  width: 1.15rem; height: 1.15rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #c9cfda; font-size: 0.6rem; color: #fff;
}
.cabinet-step-done { border-color: var(--tone-success); background: var(--tone-success-bg); }
.cabinet-step-done .cabinet-step-dot { background: var(--tone-success); border-color: var(--tone-success); }
.cabinet-step-skipped { opacity: 0.65; }
.cabinet-step-skipped .cabinet-step-dot { background: var(--tone-muted); border-color: var(--tone-muted); }
.cabinet-step-name { font-weight: 600; }
.cabinet-step-date { color: var(--bs-secondary-color, #7a7a7a); }
.cabinet-step-note { font-style: italic; color: var(--tone-warning-fg); word-break: break-word; }
@media (max-width: 575.98px) {
  .cabinet-steps { flex-direction: column; }
  .cabinet-steps-item { flex-basis: auto; }
}

/* Производство ФССП — как на старом сайте: цвет по статусу (левая полоса + фон) */
.cabinet-ip { padding: 0.9rem 1rem; border: 1px solid var(--border, #e6e6e6); border-left-width: 4px; border-radius: 0.6rem; margin-bottom: 0.9rem; }
.cabinet-ip:last-child { margin-bottom: 0; }
.cabinet-ip-active { border-left-color: var(--tone-danger); background: var(--tone-danger-bg); }
.cabinet-ip-active .cabinet-ip-number, .cabinet-ip-active .cabinet-ip-icon { color: var(--tone-danger-fg); }
.cabinet-ip-ended_wrong { border-left-color: var(--tone-warning); background: var(--tone-warning-bg); }
.cabinet-ip-ended_wrong .cabinet-ip-number, .cabinet-ip-ended_wrong .cabinet-ip-icon { color: var(--tone-warning-fg); }
.cabinet-ip-ended_ok { border-left-color: var(--tone-success); background: var(--tone-success-bg); }
.cabinet-ip-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--bs-secondary-color, #8a8a8a); margin-bottom: 0.15rem; }
.cabinet-ip-number { white-space: nowrap; }
.cabinet-ip-after-label { white-space: normal; text-align: left; }

/* Кредитные продукты: три слота */
.cabinet-credit-slot { padding: 0.9rem 1rem; border: 1px solid var(--border, #e6e6e6); border-radius: 0.6rem; margin-bottom: 0.9rem; }
.cabinet-credit-slot:last-child { margin-bottom: 0; }
.cabinet-slot-num {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--rgba-primary-1); color: var(--primary); font-weight: 700; flex-shrink: 0;
}
.cabinet-payments th { font-size: 0.78rem; font-weight: 600; white-space: normal; }
.cabinet-payments .form-check-input { float: none; margin: 0; }

/* FinLab растягивает .card на высоту колонки (height: calc(100% - 30px)) — в карточке клиента блоки идут стопкой */
.cabinet-card .card { height: auto; }
.cabinet-company-create-card { height: auto; }
/* FinLab пишет заголовки карточек «С Большой Буквы» — по-русски так не пишут */
.cabinet-card .card-title, .cabinet-block .card-title { text-transform: none; }
/* Кнопки «скоро»: у FinLab disabled outline-secondary — белый текст на прозрачном фоне */
[data-future][disabled] { color: #6b7280 !important; background: #f3f4f6 !important; border-color: #d1d5db !important; opacity: 1; }

/* Единые действия кабинета: активное — синее, недоступное — читаемое серое. */
.btn.btn-primary:not(:disabled):not(.disabled),
.btn.btn-outline-primary:not(:disabled):not(.disabled) {
  color: #fff !important; background: #0075c9 !important; border-color: #0075c9 !important; opacity: 1;
}
.btn.btn-primary:not(:disabled):not(.disabled):hover,
.btn.btn-outline-primary:not(:disabled):not(.disabled):hover {
  color: #fff !important; background: #005eaa !important; border-color: #005eaa !important;
}
.btn.btn-primary:disabled, .btn.btn-primary.disabled,
.btn.btn-outline-primary:disabled, .btn.btn-outline-primary.disabled,
.btn[data-future][disabled] {
  color: #4b5563 !important; background: #e8edf2 !important; border-color: #cbd5e1 !important; opacity: 1;
}
@media (max-width: 575.98px) {
  .cabinet-card .table.cabinet-payments thead th, .cabinet-card .table.cabinet-payments tbody td {
    padding: 0.45rem 0.3rem; font-size: 0.78rem; }
  .cabinet-payments .badge { display: block; width: max-content; margin-top: 0.15rem; }
  .cabinet-credit-slot, .cabinet-ip { padding: 0.75rem; }
}
.cabinet-card .table.cabinet-payments thead th { white-space: normal; text-transform: none; font-size: 0.8rem; }

/* ── Колокольчик и уведомления ── */
.cabinet-bell-menu { width: min(22rem, calc(100vw - 1.5rem)); padding-top: 0.5rem; }
.cabinet-bell-list { max-height: 22rem; overflow-y: auto; }
.cabinet-bell-item { display: flex; gap: 0.6rem; align-items: flex-start; white-space: normal; padding: 0.5rem 1rem; }
.cabinet-bell-icon { margin-top: 0.2rem; width: 1rem; text-align: center; }
.cabinet-bell-body { display: flex; flex-direction: column; min-width: 0; }
.cabinet-bell-text { font-size: 0.85rem; line-height: 1.3; word-break: break-word; }
.cabinet-unread { background: var(--rgba-primary-1, #f3f6fd); }
.cabinet-unread .cabinet-bell-text, .cabinet-note.cabinet-unread .d-block { font-weight: 600; }
.cabinet-kind-filter { flex-wrap: wrap; }
.cabinet-kind-filter .nav-link { padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.cabinet-break { word-break: break-word; }
.min-w-0 { min-width: 0; }

/* ── Поддержка: плитки-счётчики (FinLab ticketing .card.ticket) ── */
.cabinet-ticket-tile { height: auto; color: #fff; }
.cabinet-ticket-tile .card-body { padding: 1rem 1.1rem; }
.cabinet-ticket-tile h3, .cabinet-ticket-tile p { color: #fff; }
.cabinet-ticket-new { background: var(--tone-warning); }
.cabinet-ticket-in_progress { background: var(--tone-warning); }
.cabinet-ticket-done { background: var(--tone-success); }
@media (max-width: 575.98px) { .cabinet-ticket-tile .card-body { padding: 0.75rem; } }

/* Скрытые подписи (visually-hidden, position:absolute) в таблицах не должны раздвигать страницу */
.table-responsive { position: relative; }

/* ── Карточка должника: события 758-П и панель подписи ── */
.cabinet-sign-panel { padding: 0.85rem 1rem; border-radius: 0.6rem; border: 1px dashed var(--primary); }

/* ── Организация ── */
.cabinet-checklist { max-height: 12rem; overflow-y: auto; padding: 0.5rem 0.75rem; border: 1px solid var(--border, #e6e6e6); border-radius: 0.5rem; }
.cabinet-checklist .form-check-label { font-size: 0.85rem; }
/* bootstrap-select FinLab в формах кабинета — на всю ширину колонки, подпись над полем */
.content-body form .bootstrap-select:not(.input-group-btn) { width: 100% !important; display: block; }
/* FinLab пишет вкладки «С Большой Буквы» — по-русски так не пишут */
.cabinet-kind-filter .nav-link, .cabinet-server-tabs .nav-link { text-transform: none; }

/* Длинные значки в таблицах списков переносятся, а не раздвигают таблицу */
.cabinet-wrap-badge { white-space: normal; text-align: left; line-height: 1.3; max-width: 11rem; display: inline-block; }

/* ── Окно «Почта» ── */
.cabinet-mail-list { max-height: 26rem; overflow-y: auto; }
.cabinet-mail-item { text-align: left; }
.cabinet-mail-item.active { background: var(--rgba-primary-1, #eef1fd); color: inherit; border-color: var(--border, #e6e6e6); }
.cabinet-mail-view { min-height: 10rem; padding: 0.75rem 1rem; border: 1px solid var(--border, #e6e6e6); border-radius: 0.6rem; }
.cabinet-mail-body { white-space: pre-wrap; word-break: break-word; font-size: 0.9rem; }
.cabinet-mail-tabs .nav-link { text-transform: none; }
.cabinet-head-actions .btn { cursor: pointer; }
@media (max-width: 575.98px) {
  .cabinet-head-actions { margin: 0 auto; justify-content: center; }
}
.cabinet-head-actions { align-self: flex-start; }
.cabinet-head-actions > * { flex: 0 0 auto; }

/* ── Заметки ── */
.cabinet-notes .cabinet-note { display: flex; gap: 0.6rem; padding: 0.6rem 0; border-top: 1px solid var(--border, #eee); }
.cabinet-note-text { white-space: normal; word-break: break-word; font-size: 0.9rem; }
.cabinet-note-done .cabinet-note-text { text-decoration: line-through; color: var(--bs-secondary-color, #8a8a8a); }
.cabinet-note-subject { word-break: break-word; }
.cabinet-note-done .cabinet-note-subject { text-decoration: line-through; color: var(--bs-secondary-color, #8a8a8a); }
/* Длинная заметка: начало + «Показать полностью»; раскрыта — полный текст и «Свернуть» */
.cabinet-note-details > summary { cursor: pointer; list-style: none; font-size: 0.9rem; word-break: break-word; }
.cabinet-note-details > summary::-webkit-details-marker { display: none; }
.cabinet-note-more, .cabinet-note-less { color: var(--primary); white-space: nowrap; }
.cabinet-note-less, .cabinet-note-details[open] .cabinet-note-preview, .cabinet-note-details[open] .cabinet-note-more { display: none; }
.cabinet-note-details[open] .cabinet-note-less { display: inline; }
.cabinet-note-details[open] > summary { margin-bottom: 0.25rem; }

/* ── Канбаны (как воронка Битрикс24): прокрутка колонок — внутри доски, у страницы её нет ── */
.cabinet-kanban-wrap { min-width: 0; }
.cabinet-kanban { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.75rem; scroll-snap-type: x proximity;
  max-width: 100%; align-items: flex-start; }
.cabinet-kanban-col { flex: 0 0 17rem; max-width: 17rem; background: var(--card, #fff); border-radius: 0.75rem;
  border-top: 3px solid var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.06); scroll-snap-align: start; }
.cabinet-kanban-col-done { border-top-color: var(--tone-success); }
.cabinet-kanban-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border, #eee); }
.cabinet-kanban-title { font-weight: 600; font-size: 0.82rem; line-height: 1.25; }
.cabinet-kanban-cards { min-height: 4rem; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.cabinet-kanban-cards.cabinet-drop-over { background: var(--rgba-primary-1, #eef1fd); border-radius: 0 0 0.75rem 0.75rem; }
.cabinet-kanban-card { padding: 0.6rem 0.65rem; border: 1px solid var(--border, #e6e6e6); border-left-width: 4px; border-radius: 0.5rem;
  background: #fff; cursor: grab; font-size: 0.85rem; }
.cabinet-kanban-card.cabinet-dragging { opacity: 0.5; }
.cabinet-kanban-active { border-left-color: var(--tone-danger); }
.cabinet-kanban-ended_wrong { border-left-color: var(--tone-warning); }
.cabinet-kanban-refused { border-left-color: var(--tone-danger); }
.cabinet-kanban-partial { border-left-color: var(--tone-warning); }
.cabinet-kanban-full { border-left-color: var(--tone-success); }
.cabinet-kanban-name { font-weight: 600; display: block; word-break: break-word; }
.cabinet-kanban-meta { display: flex; justify-content: space-between; gap: 0.5rem; }
.cabinet-kanban-empty { padding: 0.5rem; text-align: center; }
@media (max-width: 575.98px) {
  .cabinet-kanban-col { flex-basis: 82vw; max-width: 82vw; }
}

/* Серый бейдж «не проверяли» (у FinLab badge-secondary — фиолетовый) */
/* Телефон: списки должников АУ и клиентов помещаются без горизонтальной прокрутки (ФИО переносится, поля уже) */
@media (max-width: 575.98px) {
  .table.cabinet-table-compact > :not(caption) > * > * { padding: 0.55rem 0.35rem; white-space: normal; }
  .table.cabinet-table-compact .badge { font-size: 0.68rem; }
}
/* Ноутбук/1440: списки целиком в ширину карточки — поля уже, заголовки переносятся (было: «Ответственный» за краем) */
@media (min-width: 576px) and (max-width: 1599.98px) {
  .table.cabinet-table-compact > :not(caption) > * > * { padding: 0.65rem 0.5rem; white-space: normal; }
  .table.cabinet-table-compact thead th { white-space: normal; letter-spacing: 0; }
}

/* Окна отправки: строки файлов — галочка/радио и длинное имя рядом, имя переносится (телефон) */
.cabinet-check-list .form-check, .cabinet-dispatch-attachments .form-check { display: flex; align-items: flex-start; gap: 0.5rem; padding-left: 0; margin-bottom: 0.35rem; }
.cabinet-check-list .form-check .form-check-input[type], .cabinet-dispatch-attachments .form-check .form-check-input[type] { float: none; margin: 0.15rem 0 0 !important; flex: 0 0 auto; }
.cabinet-dispatch-attachments .form-check-label { min-width: 0; word-break: break-all; }
.cabinet-check-list .form-check-label { min-width: 0; }
.cabinet-dispatch-files a { word-break: break-all; }

/* Отчёт бюро в «Документах дела»: заголовок и имя файла столбиком, «Скачать» справа в той же строке */
.cabinet-file-main { flex-basis: 12rem; }
.list-group-item > .bi, .list-group-item > .fa-regular { align-self: flex-start; margin-top: 0.2rem; }

/* ── Согласие Госключ (одно на три бюро) и ход анализа ── */
.cabinet-consent { border: 1px solid var(--border, #e6e6e6); border-radius: 0.75rem; padding: 0.75rem 1rem; background: #f7fbff; }
.cabinet-analysis-run { border: 1px solid var(--border, #e6e6e6); border-radius: 0.75rem; padding: 0.6rem 1rem; }
.cabinet-progress { height: 0.6rem; }

/* ── Кредиторы по данным БКИ ── */
.cabinet-totals th { white-space: nowrap; }
.cabinet-totals td { white-space: normal; }
.cabinet-stat { border: 1px solid var(--border, #e6e6e6); border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
.cabinet-stat-label { font-size: 0.75rem; color: var(--bs-secondary-color, #8a8a8a); }
.cabinet-stat-value { font-weight: 600; }
.cabinet-creditor { border-top: 1px solid var(--border, #eee); }
.cabinet-creditor > summary { cursor: pointer; padding: 0.6rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
  align-items: baseline; list-style: none; }
.cabinet-creditor > summary::-webkit-details-marker { display: none; }
/* стрелка — отдельным элементом с aria-hidden (псевдоэлемент читалка озвучивает), раскрыта — повёрнута */
.cabinet-creditor-arrow { color: var(--primary); margin-right: -0.5rem; display: inline-block; transition: transform 0.15s; }
.cabinet-creditor[open] .cabinet-creditor-arrow { transform: rotate(90deg); }
.cabinet-creditor-name { flex: 1 1 14rem; min-width: 0; }
.cabinet-creditor-sums { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline; }
.cabinet-creditor > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Справка «Как считаются суммы» под кредиторами (28.10.2026): маркер браузера скрыт — ▸ только у строк кредиторов */
.cabinet-creditors-help > summary { cursor: pointer; list-style: none; color: var(--primary); width: fit-content; }
.cabinet-creditors-help > summary::-webkit-details-marker { display: none; }
.cabinet-creditors-help > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* договоры раскрытой группы — с отступом под стрелкой; на телефоне (360 px) без отступа и суммы — с новой строки */
.cabinet-creditor-body { padding: 0 0 0.5rem 1rem; }
@media (max-width: 575.98px) {
  .cabinet-creditor-body { padding-left: 0; }
  .cabinet-creditor-sums { flex-basis: 100%; }
  /* карточка договора на 360 px: длинные «с 02.2023 ≈ расчёт по дням просрочки», суммы и «уступлено → …» переносятся,
     а не уводят карточку вбок */
  .cabinet-creditor .cabinet-contracts td .text-nowrap { white-space: normal !important; }
  .cabinet-creditor .cabinet-contracts td > * { min-width: 0; overflow-wrap: anywhere; }
}
.cabinet-contracts th { font-size: 0.75rem; white-space: nowrap; }
.cabinet-contracts td { font-size: 0.85rem; vertical-align: top; }
.cabinet-maybe-same td { background: var(--tone-warning-bg); }
/* Цепочка уступки — одна группа: прежние кредиторы приглушены, группа отделена линией */
.cabinet-contracts tbody + tbody { border-top: 2px solid var(--border, #e6e6e6); }
.cabinet-cession-prior td { color: var(--bs-secondary-color, #8a8a8a); }
.cabinet-cession-group tr:last-child td { font-weight: 500; }
/* До 1400 px (телефон и узкая колонка карточки): договоры — карточками (подпись поля слева, значение справа) */
@media (max-width: 1399.98px) {
  .cabinet-contracts thead { display: none; }
  .cabinet-contracts, .cabinet-contracts tbody, .cabinet-contracts tr, .cabinet-contracts td { display: block; width: 100%; }
  .cabinet-contracts tr { border: 1px solid var(--border, #e6e6e6); border-radius: 0.6rem; padding: 0.4rem 0.6rem; margin-bottom: 0.5rem; }
  .cabinet-contracts td { border: 0; padding: 0.15rem 0; text-align: right !important; display: flex; justify-content: space-between; gap: 0.75rem; }
  .cabinet-contracts td::before { content: attr(data-label); color: var(--bs-secondary-color, #8a8a8a); text-align: left; font-size: 0.75rem; }
  .cabinet-contracts td > * { text-align: right; }
  /* номер и УИД — столбиком, длинный УИД переносится */
  .cabinet-contracts td.cabinet-contract-id { display: block; text-align: left !important; }
  .cabinet-contracts td.cabinet-contract-id::before { display: block; }
  .cabinet-contracts td.cabinet-contract-id > * { text-align: left; }
}
.cabinet-totals-list li { padding: 0.15rem 0; font-size: 0.85rem; }
.cabinet-na { max-width: 7rem; line-height: 1.2; }
.table.cabinet-totals > :not(caption) > * > * { padding: 0.45rem 0.5rem; }

.cabinet-credit-history > .card-body > .cabinet-block { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.cabinet-credit-history > .card-body > .cabinet-block + .cabinet-block { border-top: 1px solid #e8edf2; }
.cabinet-credit-history > .card-body > .cabinet-block > .card-header { border-bottom: 0; }

@media (max-width: 575.98px) {
  .cabinet-debtor-profile-data { grid-template-columns: minmax(0, 1fr); }
  .cabinet-debtor-profile-data .text-nowrap { white-space: normal !important; }
  .cabinet-debtor-profile-data button, .cabinet-debtor-profile-data a { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
